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/v1alpha" ... 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
- type Account
- type Address
- type CloseAccountRequest
- type CloseAccountResponse
- type Empty
- type Event
- type EventInfo
- type ListAccountsResponse
- type ListSitesResponse
- type LookupAccountResponse
- type PlatformsAccountsCloseCall
- func (c *PlatformsAccountsCloseCall) Context(ctx context.Context) *PlatformsAccountsCloseCall
- func (c *PlatformsAccountsCloseCall) Do(opts ...googleapi.CallOption) (*CloseAccountResponse, error)
- func (c *PlatformsAccountsCloseCall) Fields(s ...googleapi.Field) *PlatformsAccountsCloseCall
- func (c *PlatformsAccountsCloseCall) Header() http.Header
- type PlatformsAccountsCreateCall
- func (c *PlatformsAccountsCreateCall) Context(ctx context.Context) *PlatformsAccountsCreateCall
- func (c *PlatformsAccountsCreateCall) Do(opts ...googleapi.CallOption) (*Account, error)
- func (c *PlatformsAccountsCreateCall) Fields(s ...googleapi.Field) *PlatformsAccountsCreateCall
- func (c *PlatformsAccountsCreateCall) Header() http.Header
- type PlatformsAccountsEventsCreateCall
- func (c *PlatformsAccountsEventsCreateCall) Context(ctx context.Context) *PlatformsAccountsEventsCreateCall
- func (c *PlatformsAccountsEventsCreateCall) Do(opts ...googleapi.CallOption) (*Event, error)
- func (c *PlatformsAccountsEventsCreateCall) Fields(s ...googleapi.Field) *PlatformsAccountsEventsCreateCall
- func (c *PlatformsAccountsEventsCreateCall) Header() http.Header
- type PlatformsAccountsEventsService
- type PlatformsAccountsGetCall
- func (c *PlatformsAccountsGetCall) Context(ctx context.Context) *PlatformsAccountsGetCall
- func (c *PlatformsAccountsGetCall) Do(opts ...googleapi.CallOption) (*Account, error)
- func (c *PlatformsAccountsGetCall) Fields(s ...googleapi.Field) *PlatformsAccountsGetCall
- func (c *PlatformsAccountsGetCall) Header() http.Header
- func (c *PlatformsAccountsGetCall) IfNoneMatch(entityTag string) *PlatformsAccountsGetCall
- type PlatformsAccountsListCall
- func (c *PlatformsAccountsListCall) Context(ctx context.Context) *PlatformsAccountsListCall
- func (c *PlatformsAccountsListCall) Do(opts ...googleapi.CallOption) (*ListAccountsResponse, error)
- func (c *PlatformsAccountsListCall) Fields(s ...googleapi.Field) *PlatformsAccountsListCall
- func (c *PlatformsAccountsListCall) Header() http.Header
- func (c *PlatformsAccountsListCall) IfNoneMatch(entityTag string) *PlatformsAccountsListCall
- func (c *PlatformsAccountsListCall) PageSize(pageSize int64) *PlatformsAccountsListCall
- func (c *PlatformsAccountsListCall) PageToken(pageToken string) *PlatformsAccountsListCall
- func (c *PlatformsAccountsListCall) Pages(ctx context.Context, f func(*ListAccountsResponse) error) error
- type PlatformsAccountsLookupCall
- func (c *PlatformsAccountsLookupCall) Context(ctx context.Context) *PlatformsAccountsLookupCall
- func (c *PlatformsAccountsLookupCall) CreationRequestId(creationRequestId string) *PlatformsAccountsLookupCall
- func (c *PlatformsAccountsLookupCall) Do(opts ...googleapi.CallOption) (*LookupAccountResponse, error)
- func (c *PlatformsAccountsLookupCall) Fields(s ...googleapi.Field) *PlatformsAccountsLookupCall
- func (c *PlatformsAccountsLookupCall) Header() http.Header
- func (c *PlatformsAccountsLookupCall) IfNoneMatch(entityTag string) *PlatformsAccountsLookupCall
- type PlatformsAccountsService
- func (r *PlatformsAccountsService) Close(name string, closeaccountrequest *CloseAccountRequest) *PlatformsAccountsCloseCall
- func (r *PlatformsAccountsService) Create(parent string, account *Account) *PlatformsAccountsCreateCall
- func (r *PlatformsAccountsService) Get(name string) *PlatformsAccountsGetCall
- func (r *PlatformsAccountsService) List(parent string) *PlatformsAccountsListCall
- func (r *PlatformsAccountsService) Lookup(parent string) *PlatformsAccountsLookupCall
- type PlatformsAccountsSitesCreateCall
- func (c *PlatformsAccountsSitesCreateCall) Context(ctx context.Context) *PlatformsAccountsSitesCreateCall
- func (c *PlatformsAccountsSitesCreateCall) Do(opts ...googleapi.CallOption) (*Site, error)
- func (c *PlatformsAccountsSitesCreateCall) Fields(s ...googleapi.Field) *PlatformsAccountsSitesCreateCall
- func (c *PlatformsAccountsSitesCreateCall) Header() http.Header
- type PlatformsAccountsSitesDeleteCall
- func (c *PlatformsAccountsSitesDeleteCall) Context(ctx context.Context) *PlatformsAccountsSitesDeleteCall
- func (c *PlatformsAccountsSitesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error)
- func (c *PlatformsAccountsSitesDeleteCall) Fields(s ...googleapi.Field) *PlatformsAccountsSitesDeleteCall
- func (c *PlatformsAccountsSitesDeleteCall) Header() http.Header
- type PlatformsAccountsSitesGetCall
- func (c *PlatformsAccountsSitesGetCall) Context(ctx context.Context) *PlatformsAccountsSitesGetCall
- func (c *PlatformsAccountsSitesGetCall) Do(opts ...googleapi.CallOption) (*Site, error)
- func (c *PlatformsAccountsSitesGetCall) Fields(s ...googleapi.Field) *PlatformsAccountsSitesGetCall
- func (c *PlatformsAccountsSitesGetCall) Header() http.Header
- func (c *PlatformsAccountsSitesGetCall) IfNoneMatch(entityTag string) *PlatformsAccountsSitesGetCall
- type PlatformsAccountsSitesListCall
- func (c *PlatformsAccountsSitesListCall) Context(ctx context.Context) *PlatformsAccountsSitesListCall
- func (c *PlatformsAccountsSitesListCall) Do(opts ...googleapi.CallOption) (*ListSitesResponse, error)
- func (c *PlatformsAccountsSitesListCall) Fields(s ...googleapi.Field) *PlatformsAccountsSitesListCall
- func (c *PlatformsAccountsSitesListCall) Header() http.Header
- func (c *PlatformsAccountsSitesListCall) IfNoneMatch(entityTag string) *PlatformsAccountsSitesListCall
- func (c *PlatformsAccountsSitesListCall) PageSize(pageSize int64) *PlatformsAccountsSitesListCall
- func (c *PlatformsAccountsSitesListCall) PageToken(pageToken string) *PlatformsAccountsSitesListCall
- func (c *PlatformsAccountsSitesListCall) Pages(ctx context.Context, f func(*ListSitesResponse) error) error
- type PlatformsAccountsSitesRequestReviewCall
- func (c *PlatformsAccountsSitesRequestReviewCall) Context(ctx context.Context) *PlatformsAccountsSitesRequestReviewCall
- func (c *PlatformsAccountsSitesRequestReviewCall) Do(opts ...googleapi.CallOption) (*RequestSiteReviewResponse, error)
- func (c *PlatformsAccountsSitesRequestReviewCall) Fields(s ...googleapi.Field) *PlatformsAccountsSitesRequestReviewCall
- func (c *PlatformsAccountsSitesRequestReviewCall) Header() http.Header
- type PlatformsAccountsSitesService
- func (r *PlatformsAccountsSitesService) Create(parent string, site *Site) *PlatformsAccountsSitesCreateCall
- func (r *PlatformsAccountsSitesService) Delete(name string) *PlatformsAccountsSitesDeleteCall
- func (r *PlatformsAccountsSitesService) Get(name string) *PlatformsAccountsSitesGetCall
- func (r *PlatformsAccountsSitesService) List(parent string) *PlatformsAccountsSitesListCall
- func (r *PlatformsAccountsSitesService) RequestReview(name string) *PlatformsAccountsSitesRequestReviewCall
- type PlatformsService
- type RequestSiteReviewResponse
- type Service
- type Site
- type TimeZone
Constants ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
func (c *PlatformsAccountsCloseCall) Context(ctx context.Context) *PlatformsAccountsCloseCall
Context sets the context to be used in this call's Do method.
func (*PlatformsAccountsCloseCall) Do ¶
func (c *PlatformsAccountsCloseCall) Do(opts ...googleapi.CallOption) (*CloseAccountResponse, error)
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 ¶
func (c *PlatformsAccountsCloseCall) Fields(s ...googleapi.Field) *PlatformsAccountsCloseCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*PlatformsAccountsCloseCall) Header ¶
func (c *PlatformsAccountsCloseCall) Header() http.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 ¶
func (c *PlatformsAccountsCreateCall) Context(ctx context.Context) *PlatformsAccountsCreateCall
Context sets the context to be used in this call's Do method.
func (*PlatformsAccountsCreateCall) Do ¶
func (c *PlatformsAccountsCreateCall) Do(opts ...googleapi.CallOption) (*Account, error)
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 ¶
func (c *PlatformsAccountsCreateCall) Fields(s ...googleapi.Field) *PlatformsAccountsCreateCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*PlatformsAccountsCreateCall) Header ¶
func (c *PlatformsAccountsCreateCall) Header() http.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 ¶
func (c *PlatformsAccountsEventsCreateCall) Context(ctx context.Context) *PlatformsAccountsEventsCreateCall
Context sets the context to be used in this call's Do method.
func (*PlatformsAccountsEventsCreateCall) Do ¶
func (c *PlatformsAccountsEventsCreateCall) Do(opts ...googleapi.CallOption) (*Event, error)
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 ¶
func (c *PlatformsAccountsEventsCreateCall) Fields(s ...googleapi.Field) *PlatformsAccountsEventsCreateCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*PlatformsAccountsEventsCreateCall) Header ¶
func (c *PlatformsAccountsEventsCreateCall) Header() http.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 ¶
func (r *PlatformsAccountsEventsService) Create(parent string, event *Event) *PlatformsAccountsEventsCreateCall
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 ¶
func (c *PlatformsAccountsGetCall) Context(ctx context.Context) *PlatformsAccountsGetCall
Context sets the context to be used in this call's Do method.
func (*PlatformsAccountsGetCall) Do ¶
func (c *PlatformsAccountsGetCall) Do(opts ...googleapi.CallOption) (*Account, error)
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 ¶
func (c *PlatformsAccountsGetCall) Fields(s ...googleapi.Field) *PlatformsAccountsGetCall
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 ¶
func (c *PlatformsAccountsListCall) Context(ctx context.Context) *PlatformsAccountsListCall
Context sets the context to be used in this call's Do method.
func (*PlatformsAccountsListCall) Do ¶
func (c *PlatformsAccountsListCall) Do(opts ...googleapi.CallOption) (*ListAccountsResponse, error)
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 ¶
func (c *PlatformsAccountsListCall) Fields(s ...googleapi.Field) *PlatformsAccountsListCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*PlatformsAccountsListCall) Header ¶
func (c *PlatformsAccountsListCall) Header() http.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 ¶
func (c *PlatformsAccountsListCall) PageSize(pageSize int64) *PlatformsAccountsListCall
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 ¶
func (c *PlatformsAccountsListCall) PageToken(pageToken string) *PlatformsAccountsListCall
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 ¶
func (c *PlatformsAccountsListCall) Pages(ctx context.Context, f func(*ListAccountsResponse) error) error
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 ¶
func (c *PlatformsAccountsLookupCall) Context(ctx context.Context) *PlatformsAccountsLookupCall
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 ¶
func (c *PlatformsAccountsLookupCall) Do(opts ...googleapi.CallOption) (*LookupAccountResponse, error)
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 ¶
func (c *PlatformsAccountsLookupCall) Fields(s ...googleapi.Field) *PlatformsAccountsLookupCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*PlatformsAccountsLookupCall) Header ¶
func (c *PlatformsAccountsLookupCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
func (*PlatformsAccountsLookupCall) IfNoneMatch ¶
func (c *PlatformsAccountsLookupCall) IfNoneMatch(entityTag string) *PlatformsAccountsLookupCall
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 ¶
func (r *PlatformsAccountsService) Create(parent string, account *Account) *PlatformsAccountsCreateCall
Create: Creates a sub-account.
- parent: Platform to create an account for. Format: platforms/{platform}.
func (*PlatformsAccountsService) Get ¶
func (r *PlatformsAccountsService) Get(name string) *PlatformsAccountsGetCall
Get: Gets information about the selected sub-account.
- name: Account to get information about. Format: platforms/{platform}/accounts/{account_id}.
func (*PlatformsAccountsService) List ¶
func (r *PlatformsAccountsService) List(parent string) *PlatformsAccountsListCall
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 ¶
func (r *PlatformsAccountsService) Lookup(parent string) *PlatformsAccountsLookupCall
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 ¶
func (c *PlatformsAccountsSitesCreateCall) Context(ctx context.Context) *PlatformsAccountsSitesCreateCall
Context sets the context to be used in this call's Do method.
func (*PlatformsAccountsSitesCreateCall) Do ¶
func (c *PlatformsAccountsSitesCreateCall) Do(opts ...googleapi.CallOption) (*Site, error)
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 ¶
func (c *PlatformsAccountsSitesCreateCall) Fields(s ...googleapi.Field) *PlatformsAccountsSitesCreateCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*PlatformsAccountsSitesCreateCall) Header ¶
func (c *PlatformsAccountsSitesCreateCall) Header() http.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 ¶
func (c *PlatformsAccountsSitesDeleteCall) Context(ctx context.Context) *PlatformsAccountsSitesDeleteCall
Context sets the context to be used in this call's Do method.
func (*PlatformsAccountsSitesDeleteCall) Do ¶
func (c *PlatformsAccountsSitesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error)
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 ¶
func (c *PlatformsAccountsSitesDeleteCall) Fields(s ...googleapi.Field) *PlatformsAccountsSitesDeleteCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*PlatformsAccountsSitesDeleteCall) Header ¶
func (c *PlatformsAccountsSitesDeleteCall) Header() http.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 ¶
func (c *PlatformsAccountsSitesGetCall) Context(ctx context.Context) *PlatformsAccountsSitesGetCall
Context sets the context to be used in this call's Do method.
func (*PlatformsAccountsSitesGetCall) Do ¶
func (c *PlatformsAccountsSitesGetCall) Do(opts ...googleapi.CallOption) (*Site, error)
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 ¶
func (c *PlatformsAccountsSitesGetCall) Fields(s ...googleapi.Field) *PlatformsAccountsSitesGetCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*PlatformsAccountsSitesGetCall) Header ¶
func (c *PlatformsAccountsSitesGetCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
func (*PlatformsAccountsSitesGetCall) IfNoneMatch ¶
func (c *PlatformsAccountsSitesGetCall) IfNoneMatch(entityTag string) *PlatformsAccountsSitesGetCall
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 ¶
func (c *PlatformsAccountsSitesListCall) Context(ctx context.Context) *PlatformsAccountsSitesListCall
Context sets the context to be used in this call's Do method.
func (*PlatformsAccountsSitesListCall) Do ¶
func (c *PlatformsAccountsSitesListCall) Do(opts ...googleapi.CallOption) (*ListSitesResponse, error)
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 ¶
func (c *PlatformsAccountsSitesListCall) Fields(s ...googleapi.Field) *PlatformsAccountsSitesListCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*PlatformsAccountsSitesListCall) Header ¶
func (c *PlatformsAccountsSitesListCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
func (*PlatformsAccountsSitesListCall) IfNoneMatch ¶
func (c *PlatformsAccountsSitesListCall) IfNoneMatch(entityTag string) *PlatformsAccountsSitesListCall
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 ¶
func (c *PlatformsAccountsSitesListCall) PageSize(pageSize int64) *PlatformsAccountsSitesListCall
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 ¶
func (c *PlatformsAccountsSitesListCall) PageToken(pageToken string) *PlatformsAccountsSitesListCall
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 ¶
func (c *PlatformsAccountsSitesListCall) Pages(ctx context.Context, f func(*ListSitesResponse) error) error
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 ¶
func (c *PlatformsAccountsSitesRequestReviewCall) Context(ctx context.Context) *PlatformsAccountsSitesRequestReviewCall
Context sets the context to be used in this call's Do method.
func (*PlatformsAccountsSitesRequestReviewCall) Do ¶
func (c *PlatformsAccountsSitesRequestReviewCall) Do(opts ...googleapi.CallOption) (*RequestSiteReviewResponse, error)
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 ¶
func (c *PlatformsAccountsSitesRequestReviewCall) Fields(s ...googleapi.Field) *PlatformsAccountsSitesRequestReviewCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*PlatformsAccountsSitesRequestReviewCall) Header ¶
func (c *PlatformsAccountsSitesRequestReviewCall) Header() http.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 ¶
func (r *PlatformsAccountsSitesService) Create(parent string, site *Site) *PlatformsAccountsSitesCreateCall
Create: Creates a site for a specified account.
- parent: Account to create site. Format: platforms/{platform}/accounts/{account_id}.
func (*PlatformsAccountsSitesService) Delete ¶
func (r *PlatformsAccountsSitesService) Delete(name string) *PlatformsAccountsSitesDeleteCall
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 ¶
func (r *PlatformsAccountsSitesService) Get(name string) *PlatformsAccountsSitesGetCall
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 ¶
func (r *PlatformsAccountsSitesService) List(parent string) *PlatformsAccountsSitesListCall
List: Lists sites for a specific account.
- parent: The account which owns the sites. Format: platforms/{platform}/accounts/{account}.
func (*PlatformsAccountsSitesService) RequestReview ¶
func (r *PlatformsAccountsSitesService) RequestReview(name string) *PlatformsAccountsSitesRequestReviewCall
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
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 ¶
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 ¶
type TimeZone ¶
type TimeZone struct { // Id: IANA Time Zone Database time zone. For example "America/New_York". Id string `json:"id,omitempty"` // Version: Optional. IANA Time Zone Database version number. For example // "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).