adsenseplatform

package
v0.203.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2024 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Overview

Package adsenseplatform provides access to the AdSense Platform API.

For product documentation, see: https://developers.google.com/adsense/platforms/

Library status

These client libraries are officially supported by Google. However, this library is considered complete and is in maintenance mode. This means that we will address critical bugs and security issues but will not add any new features.

When possible, we recommend using our newer [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) that are still actively being worked and iterated on.

Creating a client

Usage example:

import "google.golang.org/api/adsenseplatform/v1"
...
ctx := context.Background()
adsenseplatformService, err := adsenseplatform.NewService(ctx)

In this example, Google Application Default Credentials are used for authentication. For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.

Other authentication options

By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use google.golang.org/api/option.WithScopes:

adsenseplatformService, err := adsenseplatform.NewService(ctx, option.WithScopes(adsenseplatform.AdsenseReadonlyScope))

To use an API key for authentication (note: some APIs do not support API keys), use google.golang.org/api/option.WithAPIKey:

adsenseplatformService, err := adsenseplatform.NewService(ctx, option.WithAPIKey("AIza..."))

To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow, use google.golang.org/api/option.WithTokenSource:

config := &oauth2.Config{...}
// ...
token, err := config.Exchange(ctx, ...)
adsenseplatformService, err := adsenseplatform.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))

See google.golang.org/api/option.ClientOption for details on options.

Index

Constants

View Source
const (
	// View and manage your AdSense data
	AdsenseScope = "https://www.googleapis.com/auth/adsense"

	// View your AdSense data
	AdsenseReadonlyScope = "https://www.googleapis.com/auth/adsense.readonly"
)

OAuth2 scopes used by this API.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	// CreateTime: Output only. Creation time of the account.
	CreateTime string `json:"createTime,omitempty"`
	// CreationRequestId: Required. An opaque token that uniquely identifies the
	// account among all the platform's accounts. This string may contain at most
	// 64 non-whitespace ASCII characters, but otherwise has no predefined
	// structure. However, it is expected to be a platform-specific identifier for
	// the user creating the account, so that only a single account can be created
	// for any given user. This field must not contain any information that is
	// recognizable as personally identifiable information. e.g. it should not be
	// an email address or login name. Once an account has been created, a second
	// attempt to create an account using the same creation_request_id will result
	// in an ALREADY_EXISTS error.
	CreationRequestId string `json:"creationRequestId,omitempty"`
	// DisplayName: Display name of this account.
	DisplayName string `json:"displayName,omitempty"`
	// Name: Output only. Resource name of the account. Format:
	// platforms/pub-[0-9]+/accounts/pub-[0-9]+
	Name string `json:"name,omitempty"`
	// RegionCode: Required. Input only. CLDR region code of the country/region of
	// the address. Set this to country code of the child account if known,
	// otherwise to your own country code.
	RegionCode string `json:"regionCode,omitempty"`
	// State: Output only. Approval state of the account.
	//
	// Possible values:
	//   "STATE_UNSPECIFIED" - Unspecified.
	//   "UNCHECKED" - Unchecked.
	//   "APPROVED" - The account is ready to serve ads.
	//   "DISAPPROVED" - The account has been blocked from serving ads.
	State string `json:"state,omitempty"`
	// TimeZone: Required. The IANA TZ timezone code of this account. For more
	// information, see
	// https://en.wikipedia.org/wiki/List_of_tz_database_time_zones. This field is
	// used for reporting. It is recommended to set it to the same value for all
	// child accounts.
	TimeZone *TimeZone `json:"timeZone,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
	// ForceSendFields is a list of field names (e.g. "CreateTime") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "CreateTime") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

Account: Representation of an Account.

func (Account) MarshalJSON

func (s Account) MarshalJSON() ([]byte, error)

type Address

type Address struct {
	// Address1: First line of address. Max length 64 bytes or 30 characters.
	Address1 string `json:"address1,omitempty"`
	// Address2: Second line of address. Max length 64 bytes or 30 characters.
	Address2 string `json:"address2,omitempty"`
	// City: City. Max length 60 bytes or 30 characters.
	City string `json:"city,omitempty"`
	// Company: Name of the company. Max length 255 bytes or 34 characters.
	Company string `json:"company,omitempty"`
	// Contact: Contact name of the company. Max length 128 bytes or 34 characters.
	Contact string `json:"contact,omitempty"`
	// Fax: Fax number with international code (i.e. +441234567890).
	Fax string `json:"fax,omitempty"`
	// Phone: Phone number with international code (i.e. +441234567890).
	Phone string `json:"phone,omitempty"`
	// RegionCode: Country/Region code. The region is specified as a CLDR region
	// code (e.g. "US", "FR").
	RegionCode string `json:"regionCode,omitempty"`
	// State: State. Max length 60 bytes or 30 characters.
	State string `json:"state,omitempty"`
	// Zip: Zip/post code. Max length 10 bytes or 10 characters.
	Zip string `json:"zip,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Address1") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Address1") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

Address: Address data.

func (Address) MarshalJSON

func (s Address) MarshalJSON() ([]byte, error)

type CloseAccountRequest

type CloseAccountRequest struct {
}

CloseAccountRequest: Request definition for the account close rpc.

type CloseAccountResponse

type CloseAccountResponse struct {
	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
}

CloseAccountResponse: Response definition for the account close rpc.

type Empty

type Empty struct {
	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
}

Empty: A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }

type Event

type Event struct {
	// EventInfo: Required. Information associated with the event.
	EventInfo *EventInfo `json:"eventInfo,omitempty"`
	// EventTime: Required. Event timestamp.
	EventTime string `json:"eventTime,omitempty"`
	// EventType: Required. Event type.
	//
	// Possible values:
	//   "EVENT_TYPE_UNSPECIFIED" - Do not use. You must set an event type
	// explicitly.
	//   "LOG_IN_VIA_PLATFORM" - Log in via platform.
	//   "SIGN_UP_VIA_PLATFORM" - Sign up via platform.
	EventType string `json:"eventType,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
	// ForceSendFields is a list of field names (e.g. "EventInfo") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "EventInfo") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

Event: A platform sub-account event to record spam signals.

func (Event) MarshalJSON

func (s Event) MarshalJSON() ([]byte, error)

type EventInfo

type EventInfo struct {
	// BillingAddress: The billing address of the publisher associated with this
	// event, if available.
	BillingAddress *Address `json:"billingAddress,omitempty"`
	// Email: Required. The email address that is associated with the publisher
	// when performing the event.
	Email string `json:"email,omitempty"`
	// ForceSendFields is a list of field names (e.g. "BillingAddress") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "BillingAddress") to include in
	// API requests with the JSON null value. By default, fields with empty values
	// are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

EventInfo: Private information for partner recorded events (PII).

func (EventInfo) MarshalJSON

func (s EventInfo) MarshalJSON() ([]byte, error)

type ListAccountsResponse

type ListAccountsResponse struct {
	// Accounts: The Accounts returned in the list response. Represented by a
	// partial view of the Account resource, populating `name` and
	// `creation_request_id`.
	Accounts []*Account `json:"accounts,omitempty"`
	// NextPageToken: Continuation token used to page through accounts. To retrieve
	// the next page of the results, set the next request's "page_token" value to
	// this.
	NextPageToken string `json:"nextPageToken,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
	// ForceSendFields is a list of field names (e.g. "Accounts") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Accounts") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

ListAccountsResponse: Response definition for the list accounts rpc.

func (ListAccountsResponse) MarshalJSON

func (s ListAccountsResponse) MarshalJSON() ([]byte, error)

type ListSitesResponse

type ListSitesResponse struct {
	// NextPageToken: Continuation token used to page through sites. To retrieve
	// the next page of the results, set the next request's "page_token" value to
	// this.
	NextPageToken string `json:"nextPageToken,omitempty"`
	// Sites: The sites returned in this list response.
	Sites []*Site `json:"sites,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

ListSitesResponse: Response definition for the site list rpc.

func (ListSitesResponse) MarshalJSON

func (s ListSitesResponse) MarshalJSON() ([]byte, error)

type LookupAccountResponse

type LookupAccountResponse struct {
	// Name: The name of the Account Format:
	// platforms/{platform}/accounts/{account_id}
	Name string `json:"name,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
	// ForceSendFields is a list of field names (e.g. "Name") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Name") to include in API requests
	// with the JSON null value. By default, fields with empty values are omitted
	// from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

LookupAccountResponse: Response definition for the lookup account rpc.

func (LookupAccountResponse) MarshalJSON

func (s LookupAccountResponse) MarshalJSON() ([]byte, error)

type PlatformsAccountsCloseCall

type PlatformsAccountsCloseCall struct {
	// contains filtered or unexported fields
}

func (*PlatformsAccountsCloseCall) Context

Context sets the context to be used in this call's Do method.

func (*PlatformsAccountsCloseCall) Do

Do executes the "adsenseplatform.platforms.accounts.close" call. Any non-2xx status code is an error. Response headers are in either *CloseAccountResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*PlatformsAccountsCloseCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.

func (*PlatformsAccountsCloseCall) Header

Header returns a http.Header that can be modified by the caller to add headers to the request.

type PlatformsAccountsCreateCall

type PlatformsAccountsCreateCall struct {
	// contains filtered or unexported fields
}

func (*PlatformsAccountsCreateCall) Context

Context sets the context to be used in this call's Do method.

func (*PlatformsAccountsCreateCall) Do

Do executes the "adsenseplatform.platforms.accounts.create" call. Any non-2xx status code is an error. Response headers are in either *Account.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*PlatformsAccountsCreateCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.

func (*PlatformsAccountsCreateCall) Header

Header returns a http.Header that can be modified by the caller to add headers to the request.

type PlatformsAccountsEventsCreateCall

type PlatformsAccountsEventsCreateCall struct {
	// contains filtered or unexported fields
}

func (*PlatformsAccountsEventsCreateCall) Context

Context sets the context to be used in this call's Do method.

func (*PlatformsAccountsEventsCreateCall) Do

Do executes the "adsenseplatform.platforms.accounts.events.create" call. Any non-2xx status code is an error. Response headers are in either *Event.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*PlatformsAccountsEventsCreateCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.

func (*PlatformsAccountsEventsCreateCall) Header

Header returns a http.Header that can be modified by the caller to add headers to the request.

type PlatformsAccountsEventsService

type PlatformsAccountsEventsService struct {
	// contains filtered or unexported fields
}

func NewPlatformsAccountsEventsService

func NewPlatformsAccountsEventsService(s *Service) *PlatformsAccountsEventsService

func (*PlatformsAccountsEventsService) Create

Create: Creates an account event.

  • parent: Account to log events about. Format: platforms/{platform}/accounts/{account}.

type PlatformsAccountsGetCall

type PlatformsAccountsGetCall struct {
	// contains filtered or unexported fields
}

func (*PlatformsAccountsGetCall) Context

Context sets the context to be used in this call's Do method.

func (*PlatformsAccountsGetCall) Do

Do executes the "adsenseplatform.platforms.accounts.get" call. Any non-2xx status code is an error. Response headers are in either *Account.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*PlatformsAccountsGetCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.

func (*PlatformsAccountsGetCall) Header

func (c *PlatformsAccountsGetCall) Header() http.Header

Header returns a http.Header that can be modified by the caller to add headers to the request.

func (*PlatformsAccountsGetCall) IfNoneMatch

func (c *PlatformsAccountsGetCall) IfNoneMatch(entityTag string) *PlatformsAccountsGetCall

IfNoneMatch sets an optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request.

type PlatformsAccountsListCall

type PlatformsAccountsListCall struct {
	// contains filtered or unexported fields
}

func (*PlatformsAccountsListCall) Context

Context sets the context to be used in this call's Do method.

func (*PlatformsAccountsListCall) Do

Do executes the "adsenseplatform.platforms.accounts.list" call. Any non-2xx status code is an error. Response headers are in either *ListAccountsResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*PlatformsAccountsListCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.

func (*PlatformsAccountsListCall) Header

Header returns a http.Header that can be modified by the caller to add headers to the request.

func (*PlatformsAccountsListCall) IfNoneMatch

func (c *PlatformsAccountsListCall) IfNoneMatch(entityTag string) *PlatformsAccountsListCall

IfNoneMatch sets an optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request.

func (*PlatformsAccountsListCall) PageSize

PageSize sets the optional parameter "pageSize": The maximum number of accounts to include in the response, used for paging. If unspecified, at most 10000 accounts will be returned. The maximum value is 10000; values above 10000 will be coerced to 10000.

func (*PlatformsAccountsListCall) PageToken

PageToken sets the optional parameter "pageToken": A page token, received from a previous `ListAccounts` call. Provide this to retrieve the subsequent page.

func (*PlatformsAccountsListCall) Pages

Pages invokes f for each page of results. A non-nil error returned from f will halt the iteration. The provided context supersedes any context provided to the Context method.

type PlatformsAccountsLookupCall

type PlatformsAccountsLookupCall struct {
	// contains filtered or unexported fields
}

func (*PlatformsAccountsLookupCall) Context

Context sets the context to be used in this call's Do method.

func (*PlatformsAccountsLookupCall) CreationRequestId

func (c *PlatformsAccountsLookupCall) CreationRequestId(creationRequestId string) *PlatformsAccountsLookupCall

CreationRequestId sets the optional parameter "creationRequestId": The creation_request_id provided when calling createAccount.

func (*PlatformsAccountsLookupCall) Do

Do executes the "adsenseplatform.platforms.accounts.lookup" call. Any non-2xx status code is an error. Response headers are in either *LookupAccountResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*PlatformsAccountsLookupCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.

func (*PlatformsAccountsLookupCall) Header

Header returns a http.Header that can be modified by the caller to add headers to the request.

func (*PlatformsAccountsLookupCall) IfNoneMatch

IfNoneMatch sets an optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request.

type PlatformsAccountsService

type PlatformsAccountsService struct {
	Events *PlatformsAccountsEventsService

	Sites *PlatformsAccountsSitesService
	// contains filtered or unexported fields
}

func NewPlatformsAccountsService

func NewPlatformsAccountsService(s *Service) *PlatformsAccountsService

func (*PlatformsAccountsService) Close

func (r *PlatformsAccountsService) Close(name string, closeaccountrequest *CloseAccountRequest) *PlatformsAccountsCloseCall

Close: Closes a sub-account.

- name: Account to close. Format: platforms/{platform}/accounts/{account_id}.

func (*PlatformsAccountsService) Create

Create: Creates a sub-account.

- parent: Platform to create an account for. Format: platforms/{platform}.

func (*PlatformsAccountsService) Get

Get: Gets information about the selected sub-account.

  • name: Account to get information about. Format: platforms/{platform}/accounts/{account_id}.

func (*PlatformsAccountsService) List

List: Lists a partial view of sub-accounts for a specific parent account.

- parent: Platform who parents the accounts. Format: platforms/{platform}.

func (*PlatformsAccountsService) Lookup

Lookup: Looks up information about a sub-account for a specified creation_request_id. If no account exists for the given creation_request_id, returns 404.

- parent: Platform who parents the account. Format: platforms/{platform}.

type PlatformsAccountsSitesCreateCall

type PlatformsAccountsSitesCreateCall struct {
	// contains filtered or unexported fields
}

func (*PlatformsAccountsSitesCreateCall) Context

Context sets the context to be used in this call's Do method.

func (*PlatformsAccountsSitesCreateCall) Do

Do executes the "adsenseplatform.platforms.accounts.sites.create" call. Any non-2xx status code is an error. Response headers are in either *Site.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*PlatformsAccountsSitesCreateCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.

func (*PlatformsAccountsSitesCreateCall) Header

Header returns a http.Header that can be modified by the caller to add headers to the request.

type PlatformsAccountsSitesDeleteCall

type PlatformsAccountsSitesDeleteCall struct {
	// contains filtered or unexported fields
}

func (*PlatformsAccountsSitesDeleteCall) Context

Context sets the context to be used in this call's Do method.

func (*PlatformsAccountsSitesDeleteCall) Do

Do executes the "adsenseplatform.platforms.accounts.sites.delete" call. Any non-2xx status code is an error. Response headers are in either *Empty.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*PlatformsAccountsSitesDeleteCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.

func (*PlatformsAccountsSitesDeleteCall) Header

Header returns a http.Header that can be modified by the caller to add headers to the request.

type PlatformsAccountsSitesGetCall

type PlatformsAccountsSitesGetCall struct {
	// contains filtered or unexported fields
}

func (*PlatformsAccountsSitesGetCall) Context

Context sets the context to be used in this call's Do method.

func (*PlatformsAccountsSitesGetCall) Do

Do executes the "adsenseplatform.platforms.accounts.sites.get" call. Any non-2xx status code is an error. Response headers are in either *Site.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*PlatformsAccountsSitesGetCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.

func (*PlatformsAccountsSitesGetCall) Header

Header returns a http.Header that can be modified by the caller to add headers to the request.

func (*PlatformsAccountsSitesGetCall) IfNoneMatch

IfNoneMatch sets an optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request.

type PlatformsAccountsSitesListCall

type PlatformsAccountsSitesListCall struct {
	// contains filtered or unexported fields
}

func (*PlatformsAccountsSitesListCall) Context

Context sets the context to be used in this call's Do method.

func (*PlatformsAccountsSitesListCall) Do

Do executes the "adsenseplatform.platforms.accounts.sites.list" call. Any non-2xx status code is an error. Response headers are in either *ListSitesResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*PlatformsAccountsSitesListCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.

func (*PlatformsAccountsSitesListCall) Header

Header returns a http.Header that can be modified by the caller to add headers to the request.

func (*PlatformsAccountsSitesListCall) IfNoneMatch

IfNoneMatch sets an optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request.

func (*PlatformsAccountsSitesListCall) PageSize

PageSize sets the optional parameter "pageSize": The maximum number of sites to include in the response, used for paging. If unspecified, at most 10000 sites will be returned. The maximum value is 10000; values above 10000 will be coerced to 10000.

func (*PlatformsAccountsSitesListCall) PageToken

PageToken sets the optional parameter "pageToken": A page token, received from a previous `ListSites` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListSites` must match the call that provided the page token.

func (*PlatformsAccountsSitesListCall) Pages

Pages invokes f for each page of results. A non-nil error returned from f will halt the iteration. The provided context supersedes any context provided to the Context method.

type PlatformsAccountsSitesRequestReviewCall

type PlatformsAccountsSitesRequestReviewCall struct {
	// contains filtered or unexported fields
}

func (*PlatformsAccountsSitesRequestReviewCall) Context

Context sets the context to be used in this call's Do method.

func (*PlatformsAccountsSitesRequestReviewCall) Do

Do executes the "adsenseplatform.platforms.accounts.sites.requestReview" call. Any non-2xx status code is an error. Response headers are in either *RequestSiteReviewResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*PlatformsAccountsSitesRequestReviewCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.

func (*PlatformsAccountsSitesRequestReviewCall) Header

Header returns a http.Header that can be modified by the caller to add headers to the request.

type PlatformsAccountsSitesService

type PlatformsAccountsSitesService struct {
	// contains filtered or unexported fields
}

func NewPlatformsAccountsSitesService

func NewPlatformsAccountsSitesService(s *Service) *PlatformsAccountsSitesService

func (*PlatformsAccountsSitesService) Create

Create: Creates a site for a specified account.

  • parent: Account to create site. Format: platforms/{platform}/accounts/{account_id}.

func (*PlatformsAccountsSitesService) Delete

Delete: Deletes a site from a specified account.

  • name: The name of the site to delete. Format: platforms/{platform}/accounts/{account}/sites/{site}.

func (*PlatformsAccountsSitesService) Get

Get: Gets a site from a specified sub-account.

  • name: The name of the site to retrieve. Format: platforms/{platform}/accounts/{account}/sites/{site}.

func (*PlatformsAccountsSitesService) List

List: Lists sites for a specific account.

  • parent: The account which owns the sites. Format: platforms/{platform}/accounts/{account}.

func (*PlatformsAccountsSitesService) RequestReview

RequestReview: Requests the review of a site. The site should be in REQUIRES_REVIEW or NEEDS_ATTENTION state. Note: Make sure you place an ad tag (https://developers.google.com/adsense/platforms/direct/ad-tags) on your site before requesting a review.

  • name: The name of the site to submit for review. Format: platforms/{platform}/accounts/{account}/sites/{site}.

type PlatformsService

type PlatformsService struct {
	Accounts *PlatformsAccountsService
	// contains filtered or unexported fields
}

func NewPlatformsService

func NewPlatformsService(s *Service) *PlatformsService

type RequestSiteReviewResponse

type RequestSiteReviewResponse struct {
	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
}

RequestSiteReviewResponse: Response definition for the site request review rpc.

type Service

type Service struct {
	BasePath  string // API endpoint base URL
	UserAgent string // optional additional User-Agent fragment

	Platforms *PlatformsService
	// contains filtered or unexported fields
}

func New deprecated

func New(client *http.Client) (*Service, error)

New creates a new Service. It uses the provided http.Client for requests.

Deprecated: please use NewService instead. To provide a custom HTTP client, use option.WithHTTPClient. If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.

func NewService

func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error)

NewService creates a new Service.

type Site

type Site struct {
	// Domain: Domain/sub-domain of the site. Must be a valid domain complying with
	// RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt) and formatted as punycode
	// RFC 3492 (https://www.ietf.org/rfc/rfc3492.txt) in case the domain contains
	// unicode characters.
	Domain string `json:"domain,omitempty"`
	// Name: Output only. Resource name of a site. Format:
	// platforms/{platform}/accounts/{account}/sites/{site}
	Name string `json:"name,omitempty"`
	// State: Output only. State of a site.
	//
	// Possible values:
	//   "STATE_UNSPECIFIED" - State unspecified.
	//   "REQUIRES_REVIEW" - Either: - The site hasn't been checked yet. - The site
	// is inactive and needs another review before it can show ads again. Learn how
	// to [request a review for an inactive
	// site](https://support.google.com/adsense/answer/9393996).
	//   "GETTING_READY" - Google is running some checks on the site. This usually
	// takes a few days, but in some cases it can take two to four weeks.
	//   "READY" - The site is ready to show ads. Learn how to [set up ads on the
	// site](https://support.google.com/adsense/answer/7037624).
	//   "NEEDS_ATTENTION" - Publisher needs to fix some issues before the site is
	// ready to show ads. Learn what to do [if a new site isn't
	// ready](https://support.google.com/adsense/answer/9061852).
	State string `json:"state,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
	// ForceSendFields is a list of field names (e.g. "Domain") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Domain") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

Site: Representation of a Site.

func (Site) MarshalJSON

func (s Site) MarshalJSON() ([]byte, error)

type TimeZone

type TimeZone struct {
	// Id: IANA Time Zone Database time zone, e.g. "America/New_York".
	Id string `json:"id,omitempty"`
	// Version: Optional. IANA Time Zone Database version number, e.g. "2019a".
	Version string `json:"version,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Id") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Id") to include in API requests
	// with the JSON null value. By default, fields with empty values are omitted
	// from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

TimeZone: Represents a time zone from the IANA Time Zone Database (https://www.iana.org/time-zones).

func (TimeZone) MarshalJSON

func (s TimeZone) MarshalJSON() ([]byte, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL