Class: Google::Apis::AdsenseplatformV1::AdSensePlatformService

Inherits:
Core::BaseService
  • Object
show all
Defined in:
lib/google/apis/adsenseplatform_v1/service.rb

Overview

AdSense Platform API

Examples:

require 'google/apis/adsenseplatform_v1'

Adsenseplatform = Google::Apis::AdsenseplatformV1 # Alias the module
service = Adsenseplatform::AdSensePlatformService.new

See Also:

Constant Summary collapse

DEFAULT_ENDPOINT_TEMPLATE =
"https://adsenseplatform.$UNIVERSE_DOMAIN$/"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeAdSensePlatformService

Returns a new instance of AdSensePlatformService.



47
48
49
50
51
52
# File 'lib/google/apis/adsenseplatform_v1/service.rb', line 47

def initialize
  super(DEFAULT_ENDPOINT_TEMPLATE, '',
        client_name: 'google-apis-adsenseplatform_v1',
        client_version: Google::Apis::AdsenseplatformV1::GEM_VERSION)
  @batch_path = 'batch'
end

Instance Attribute Details

#keyString

Returns API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.

Returns:

  • (String)

    API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.



40
41
42
# File 'lib/google/apis/adsenseplatform_v1/service.rb', line 40

def key
  @key
end

#quota_userString

Returns Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

Returns:

  • (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.



45
46
47
# File 'lib/google/apis/adsenseplatform_v1/service.rb', line 45

def quota_user
  @quota_user
end

Instance Method Details

#close_account(name, close_account_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AdsenseplatformV1::CloseAccountResponse

Closes a sub-account.

Parameters:

  • name (String)

    Required. Account to close. Format: platforms/platform/accounts/account_id

  • close_account_request_object (Google::Apis::AdsenseplatformV1::CloseAccountRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



75
76
77
78
79
80
81
82
83
84
85
# File 'lib/google/apis/adsenseplatform_v1/service.rb', line 75

def (name,  = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+name}:close', options)
  command.request_representation = Google::Apis::AdsenseplatformV1::CloseAccountRequest::Representation
  command.request_object = 
  command.response_representation = Google::Apis::AdsenseplatformV1::CloseAccountResponse::Representation
  command.response_class = Google::Apis::AdsenseplatformV1::CloseAccountResponse
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#create_platform_account(parent, account_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AdsenseplatformV1::Account

Creates a sub-account.

Parameters:

  • parent (String)

    Required. Platform to create an account for. Format: platforms/platform

  • account_object (Google::Apis::AdsenseplatformV1::Account) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



108
109
110
111
112
113
114
115
116
117
118
# File 'lib/google/apis/adsenseplatform_v1/service.rb', line 108

def (parent,  = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+parent}/accounts', options)
  command.request_representation = Google::Apis::AdsenseplatformV1::Account::Representation
  command.request_object = 
  command.response_representation = Google::Apis::AdsenseplatformV1::Account::Representation
  command.response_class = Google::Apis::AdsenseplatformV1::Account
  command.params['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#create_platform_account_event(parent, event_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AdsenseplatformV1::Event

Creates an account event.

Parameters:

  • parent (String)

    Required. Account to log events about. Format: platforms/platform/accounts/ account

  • event_object (Google::Apis::AdsenseplatformV1::Event) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



246
247
248
249
250
251
252
253
254
255
256
# File 'lib/google/apis/adsenseplatform_v1/service.rb', line 246

def (parent, event_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+parent}/events', options)
  command.request_representation = Google::Apis::AdsenseplatformV1::Event::Representation
  command.request_object = event_object
  command.response_representation = Google::Apis::AdsenseplatformV1::Event::Representation
  command.response_class = Google::Apis::AdsenseplatformV1::Event
  command.params['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#create_platform_account_site(parent, site_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AdsenseplatformV1::Site

Creates a site for a specified account.

Parameters:

  • parent (String)

    Required. Account to create site. Format: platforms/platform/accounts/ account_id

  • site_object (Google::Apis::AdsenseplatformV1::Site) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



280
281
282
283
284
285
286
287
288
289
290
# File 'lib/google/apis/adsenseplatform_v1/service.rb', line 280

def (parent, site_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+parent}/sites', options)
  command.request_representation = Google::Apis::AdsenseplatformV1::Site::Representation
  command.request_object = site_object
  command.response_representation = Google::Apis::AdsenseplatformV1::Site::Representation
  command.response_class = Google::Apis::AdsenseplatformV1::Site
  command.params['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_platform_account_site(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AdsenseplatformV1::Empty

Deletes a site from a specified account.

Parameters:

  • name (String)

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

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



313
314
315
316
317
318
319
320
321
# File 'lib/google/apis/adsenseplatform_v1/service.rb', line 313

def (name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'v1/{+name}', options)
  command.response_representation = Google::Apis::AdsenseplatformV1::Empty::Representation
  command.response_class = Google::Apis::AdsenseplatformV1::Empty
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_platform_account(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AdsenseplatformV1::Account

Gets information about the selected sub-account.

Parameters:

  • name (String)

    Required. Account to get information about. Format: platforms/platform/ accounts/account_id

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



141
142
143
144
145
146
147
148
149
# File 'lib/google/apis/adsenseplatform_v1/service.rb', line 141

def (name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::AdsenseplatformV1::Account::Representation
  command.response_class = Google::Apis::AdsenseplatformV1::Account
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_platform_account_site(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AdsenseplatformV1::Site

Gets a site from a specified sub-account.

Parameters:

  • name (String)

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

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



344
345
346
347
348
349
350
351
352
# File 'lib/google/apis/adsenseplatform_v1/service.rb', line 344

def (name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::AdsenseplatformV1::Site::Representation
  command.response_class = Google::Apis::AdsenseplatformV1::Site
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_platform_account_sites(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AdsenseplatformV1::ListSitesResponse

Lists sites for a specific account.

Parameters:

  • parent (String)

    Required. The account which owns the sites. Format: platforms/platform/ accounts/account

  • page_size (Fixnum) (defaults to: nil)

    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.

  • page_token (String) (defaults to: nil)

    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.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



383
384
385
386
387
388
389
390
391
392
393
# File 'lib/google/apis/adsenseplatform_v1/service.rb', line 383

def (parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+parent}/sites', options)
  command.response_representation = Google::Apis::AdsenseplatformV1::ListSitesResponse::Representation
  command.response_class = Google::Apis::AdsenseplatformV1::ListSitesResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_platform_accounts(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AdsenseplatformV1::ListAccountsResponse

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

Parameters:

  • parent (String)

    Required. Platform who parents the accounts. Format: platforms/platform

  • page_size (Fixnum) (defaults to: nil)

    Optional. 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.

  • page_token (String) (defaults to: nil)

    Optional. A page token, received from a previous ListAccounts call. Provide this to retrieve the subsequent page.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



178
179
180
181
182
183
184
185
186
187
188
# File 'lib/google/apis/adsenseplatform_v1/service.rb', line 178

def list_platform_accounts(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+parent}/accounts', options)
  command.response_representation = Google::Apis::AdsenseplatformV1::ListAccountsResponse::Representation
  command.response_class = Google::Apis::AdsenseplatformV1::ListAccountsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#lookup_platform_account(parent, creation_request_id: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AdsenseplatformV1::LookupAccountResponse

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.

Parameters:

  • parent (String)

    Required. Platform who parents the account. Format: platforms/platform

  • creation_request_id (String) (defaults to: nil)

    Optional. The creation_request_id provided when calling createAccount.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



213
214
215
216
217
218
219
220
221
222
# File 'lib/google/apis/adsenseplatform_v1/service.rb', line 213

def (parent, creation_request_id: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+parent}/accounts:lookup', options)
  command.response_representation = Google::Apis::AdsenseplatformV1::LookupAccountResponse::Representation
  command.response_class = Google::Apis::AdsenseplatformV1::LookupAccountResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['creationRequestId'] = creation_request_id unless creation_request_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#request_platform_account_site_review(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AdsenseplatformV1::RequestSiteReviewResponse

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 on your site before requesting a review.

Parameters:

  • name (String)

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

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



419
420
421
422
423
424
425
426
427
# File 'lib/google/apis/adsenseplatform_v1/service.rb', line 419

def (name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+name}:requestReview', options)
  command.response_representation = Google::Apis::AdsenseplatformV1::RequestSiteReviewResponse::Representation
  command.response_class = Google::Apis::AdsenseplatformV1::RequestSiteReviewResponse
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end