Class: Google::Apis::AdsenseV2::AdsenseService

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

Overview

AdSense Management API

The AdSense Management API allows publishers to access their inventory and run earnings and performance reports.

Examples:

require 'google/apis/adsense_v2'

Adsense = Google::Apis::AdsenseV2 # Alias the module
service = Adsense::AdsenseService.new

See Also:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeAdsenseService

Returns a new instance of AdsenseService.



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

def initialize
  super('https://adsense.googleapis.com/', '',
        client_name: 'google-apis-adsense_v2',
        client_version: Google::Apis::AdsenseV2::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.



39
40
41
# File 'lib/google/apis/adsense_v2/service.rb', line 39

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.



44
45
46
# File 'lib/google/apis/adsense_v2/service.rb', line 44

def quota_user
  @quota_user
end

Instance Method Details

#create_account_adclient_adunit(parent, ad_unit_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AdsenseV2::AdUnit

Creates an ad unit. This method can only be used by projects enabled for the AdSense for Platforms product. Note that ad units can only be created for ad clients with an "AFC" product code. For more info see the AdClient resource. For now, this method can only be used to create DISPLAY ad units. See: https://support.google.com/adsense/answer/ 9183566

Parameters:

  • parent (String)

    Required. Ad client to create an ad unit under. Format: accounts/account/ adclients/adclient

  • ad_unit_object (Google::Apis::AdsenseV2::AdUnit) (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



326
327
328
329
330
331
332
333
334
335
336
# File 'lib/google/apis/adsense_v2/service.rb', line 326

def (parent, ad_unit_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v2/{+parent}/adunits', options)
  command.request_representation = Google::Apis::AdsenseV2::AdUnit::Representation
  command.request_object = ad_unit_object
  command.response_representation = Google::Apis::AdsenseV2::AdUnit::Representation
  command.response_class = Google::Apis::AdsenseV2::AdUnit
  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_account_adclient_customchannel(parent, custom_channel_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AdsenseV2::CustomChannel

Creates a custom channel. This method can only be used by projects enabled for the AdSense for Platforms product.

Parameters:

  • parent (String)

    Required. The ad client to create a custom channel under. Format: accounts/ account/adclients/adclient

  • custom_channel_object (Google::Apis::AdsenseV2::CustomChannel) (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



550
551
552
553
554
555
556
557
558
559
560
# File 'lib/google/apis/adsense_v2/service.rb', line 550

def (parent, custom_channel_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v2/{+parent}/customchannels', options)
  command.request_representation = Google::Apis::AdsenseV2::CustomChannel::Representation
  command.request_object = custom_channel_object
  command.response_representation = Google::Apis::AdsenseV2::CustomChannel::Representation
  command.response_class = Google::Apis::AdsenseV2::CustomChannel
  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_account_adclient_customchannel(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AdsenseV2::Empty

Deletes a custom channel. This method can only be used by projects enabled for the AdSense for Platforms product.

Parameters:

  • name (String)

    Required. Name of the custom channel to delete. Format: accounts/account/ adclients/adclient/customchannels/customchannel

  • 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



585
586
587
588
589
590
591
592
593
# File 'lib/google/apis/adsense_v2/service.rb', line 585

def (name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'v2/{+name}', options)
  command.response_representation = Google::Apis::AdsenseV2::Empty::Representation
  command.response_class = Google::Apis::AdsenseV2::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

#generate_account_report(account, currency_code: nil, date_range: nil, dimensions: nil, end_date_day: nil, end_date_month: nil, end_date_year: nil, filters: nil, language_code: nil, limit: nil, metrics: nil, order_by: nil, reporting_time_zone: nil, start_date_day: nil, start_date_month: nil, start_date_year: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AdsenseV2::ReportResult

Generates an ad hoc report.

Parameters:

  • account (String)

    Required. The account which owns the collection of reports. Format: accounts/ account

  • currency_code (String) (defaults to: nil)

    The ISO-4217 currency code to use when reporting on monetary metrics. Defaults to the account's currency if not set.

  • date_range (String) (defaults to: nil)

    Date range of the report, if unset the range will be considered CUSTOM.

  • dimensions (Array<String>, String) (defaults to: nil)

    Dimensions to base the report on.

  • end_date_day (Fixnum) (defaults to: nil)

    Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.

  • end_date_month (Fixnum) (defaults to: nil)

    Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.

  • end_date_year (Fixnum) (defaults to: nil)

    Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.

  • filters (Array<String>, String) (defaults to: nil)

    A list of filters to apply to the report. All provided filters must match in order for the data to be included in the report.

  • language_code (String) (defaults to: nil)

    The language to use for translating report output. If unspecified, this defaults to English ("en"). If the given language is not supported, report output will be returned in English. The language is specified as an IETF BCP- 47 language code.

  • limit (Fixnum) (defaults to: nil)

    The maximum number of rows of report data to return. Reports producing more rows than the requested limit will be truncated. If unset, this defaults to 100,000 rows for Reports.GenerateReport and 1,000,000 rows for Reports. GenerateCsvReport, which are also the maximum values permitted here. Report truncation can be identified (for Reports.GenerateReport only) by comparing the number of rows returned to the value returned in total_matched_rows.

  • metrics (Array<String>, String) (defaults to: nil)

    Required. Reporting metrics.

  • order_by (Array<String>, String) (defaults to: nil)

    The name of a dimension or metric to sort the resulting report on, can be prefixed with "+" to sort ascending or "-" to sort descending. If no prefix is specified, the column is sorted ascending.

  • reporting_time_zone (String) (defaults to: nil)

    Timezone in which to generate the report. If unspecified, this defaults to the account timezone. For more information, see changing the time zone of your reports.

  • start_date_day (Fixnum) (defaults to: nil)

    Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.

  • start_date_month (Fixnum) (defaults to: nil)

    Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.

  • start_date_year (Fixnum) (defaults to: nil)

    Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.

  • 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



962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
# File 'lib/google/apis/adsense_v2/service.rb', line 962

def (, currency_code: nil, date_range: nil, dimensions: nil, end_date_day: nil, end_date_month: nil, end_date_year: nil, filters: nil, language_code: nil, limit: nil, metrics: nil, order_by: nil, reporting_time_zone: nil, start_date_day: nil, start_date_month: nil, start_date_year: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/{+account}/reports:generate', options)
  command.response_representation = Google::Apis::AdsenseV2::ReportResult::Representation
  command.response_class = Google::Apis::AdsenseV2::ReportResult
  command.params['account'] =  unless .nil?
  command.query['currencyCode'] = currency_code unless currency_code.nil?
  command.query['dateRange'] = date_range unless date_range.nil?
  command.query['dimensions'] = dimensions unless dimensions.nil?
  command.query['endDate.day'] = end_date_day unless end_date_day.nil?
  command.query['endDate.month'] = end_date_month unless end_date_month.nil?
  command.query['endDate.year'] = end_date_year unless end_date_year.nil?
  command.query['filters'] = filters unless filters.nil?
  command.query['languageCode'] = language_code unless language_code.nil?
  command.query['limit'] = limit unless limit.nil?
  command.query['metrics'] = metrics unless metrics.nil?
  command.query['orderBy'] = order_by unless order_by.nil?
  command.query['reportingTimeZone'] = reporting_time_zone unless reporting_time_zone.nil?
  command.query['startDate.day'] = start_date_day unless start_date_day.nil?
  command.query['startDate.month'] = start_date_month unless start_date_month.nil?
  command.query['startDate.year'] = start_date_year unless start_date_year.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#generate_account_report_csv(account, currency_code: nil, date_range: nil, dimensions: nil, end_date_day: nil, end_date_month: nil, end_date_year: nil, filters: nil, language_code: nil, limit: nil, metrics: nil, order_by: nil, reporting_time_zone: nil, start_date_day: nil, start_date_month: nil, start_date_year: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AdsenseV2::HttpBody

Generates a csv formatted ad hoc report.

Parameters:

  • account (String)

    Required. The account which owns the collection of reports. Format: accounts/ account

  • currency_code (String) (defaults to: nil)

    The ISO-4217 currency code to use when reporting on monetary metrics. Defaults to the account's currency if not set.

  • date_range (String) (defaults to: nil)

    Date range of the report, if unset the range will be considered CUSTOM.

  • dimensions (Array<String>, String) (defaults to: nil)

    Dimensions to base the report on.

  • end_date_day (Fixnum) (defaults to: nil)

    Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.

  • end_date_month (Fixnum) (defaults to: nil)

    Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.

  • end_date_year (Fixnum) (defaults to: nil)

    Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.

  • filters (Array<String>, String) (defaults to: nil)

    A list of filters to apply to the report. All provided filters must match in order for the data to be included in the report.

  • language_code (String) (defaults to: nil)

    The language to use for translating report output. If unspecified, this defaults to English ("en"). If the given language is not supported, report output will be returned in English. The language is specified as an IETF BCP- 47 language code.

  • limit (Fixnum) (defaults to: nil)

    The maximum number of rows of report data to return. Reports producing more rows than the requested limit will be truncated. If unset, this defaults to 100,000 rows for Reports.GenerateReport and 1,000,000 rows for Reports. GenerateCsvReport, which are also the maximum values permitted here. Report truncation can be identified (for Reports.GenerateReport only) by comparing the number of rows returned to the value returned in total_matched_rows.

  • metrics (Array<String>, String) (defaults to: nil)

    Required. Reporting metrics.

  • order_by (Array<String>, String) (defaults to: nil)

    The name of a dimension or metric to sort the resulting report on, can be prefixed with "+" to sort ascending or "-" to sort descending. If no prefix is specified, the column is sorted ascending.

  • reporting_time_zone (String) (defaults to: nil)

    Timezone in which to generate the report. If unspecified, this defaults to the account timezone. For more information, see changing the time zone of your reports.

  • start_date_day (Fixnum) (defaults to: nil)

    Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.

  • start_date_month (Fixnum) (defaults to: nil)

    Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.

  • start_date_year (Fixnum) (defaults to: nil)

    Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.

  • 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



1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
# File 'lib/google/apis/adsense_v2/service.rb', line 1060

def (, currency_code: nil, date_range: nil, dimensions: nil, end_date_day: nil, end_date_month: nil, end_date_year: nil, filters: nil, language_code: nil, limit: nil, metrics: nil, order_by: nil, reporting_time_zone: nil, start_date_day: nil, start_date_month: nil, start_date_year: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/{+account}/reports:generateCsv', options)
  command.response_representation = Google::Apis::AdsenseV2::HttpBody::Representation
  command.response_class = Google::Apis::AdsenseV2::HttpBody
  command.params['account'] =  unless .nil?
  command.query['currencyCode'] = currency_code unless currency_code.nil?
  command.query['dateRange'] = date_range unless date_range.nil?
  command.query['dimensions'] = dimensions unless dimensions.nil?
  command.query['endDate.day'] = end_date_day unless end_date_day.nil?
  command.query['endDate.month'] = end_date_month unless end_date_month.nil?
  command.query['endDate.year'] = end_date_year unless end_date_year.nil?
  command.query['filters'] = filters unless filters.nil?
  command.query['languageCode'] = language_code unless language_code.nil?
  command.query['limit'] = limit unless limit.nil?
  command.query['metrics'] = metrics unless metrics.nil?
  command.query['orderBy'] = order_by unless order_by.nil?
  command.query['reportingTimeZone'] = reporting_time_zone unless reporting_time_zone.nil?
  command.query['startDate.day'] = start_date_day unless start_date_day.nil?
  command.query['startDate.month'] = start_date_month unless start_date_month.nil?
  command.query['startDate.year'] = start_date_year unless start_date_year.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#generate_account_report_saved(name, currency_code: nil, date_range: nil, end_date_day: nil, end_date_month: nil, end_date_year: nil, language_code: nil, reporting_time_zone: nil, start_date_day: nil, start_date_month: nil, start_date_year: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AdsenseV2::ReportResult

Generates a saved report.

Parameters:

  • name (String)

    Required. Name of the saved report. Format: accounts/account/reports/report

  • currency_code (String) (defaults to: nil)

    The ISO-4217 currency code to use when reporting on monetary metrics. Defaults to the account's currency if not set.

  • date_range (String) (defaults to: nil)

    Date range of the report, if unset the range will be considered CUSTOM.

  • end_date_day (Fixnum) (defaults to: nil)

    Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.

  • end_date_month (Fixnum) (defaults to: nil)

    Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.

  • end_date_year (Fixnum) (defaults to: nil)

    Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.

  • language_code (String) (defaults to: nil)

    The language to use for translating report output. If unspecified, this defaults to English ("en"). If the given language is not supported, report output will be returned in English. The language is specified as an IETF BCP- 47 language code.

  • reporting_time_zone (String) (defaults to: nil)

    Timezone in which to generate the report. If unspecified, this defaults to the account timezone. For more information, see changing the time zone of your reports.

  • start_date_day (Fixnum) (defaults to: nil)

    Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.

  • start_date_month (Fixnum) (defaults to: nil)

    Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.

  • start_date_year (Fixnum) (defaults to: nil)

    Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.

  • 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



1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
# File 'lib/google/apis/adsense_v2/service.rb', line 1169

def (name, currency_code: nil, date_range: nil, end_date_day: nil, end_date_month: nil, end_date_year: nil, language_code: nil, reporting_time_zone: nil, start_date_day: nil, start_date_month: nil, start_date_year: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/{+name}/saved:generate', options)
  command.response_representation = Google::Apis::AdsenseV2::ReportResult::Representation
  command.response_class = Google::Apis::AdsenseV2::ReportResult
  command.params['name'] = name unless name.nil?
  command.query['currencyCode'] = currency_code unless currency_code.nil?
  command.query['dateRange'] = date_range unless date_range.nil?
  command.query['endDate.day'] = end_date_day unless end_date_day.nil?
  command.query['endDate.month'] = end_date_month unless end_date_month.nil?
  command.query['endDate.year'] = end_date_year unless end_date_year.nil?
  command.query['languageCode'] = language_code unless language_code.nil?
  command.query['reportingTimeZone'] = reporting_time_zone unless reporting_time_zone.nil?
  command.query['startDate.day'] = start_date_day unless start_date_day.nil?
  command.query['startDate.month'] = start_date_month unless start_date_month.nil?
  command.query['startDate.year'] = start_date_year unless start_date_year.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#generate_account_report_saved_csv(name, currency_code: nil, date_range: nil, end_date_day: nil, end_date_month: nil, end_date_year: nil, language_code: nil, reporting_time_zone: nil, start_date_day: nil, start_date_month: nil, start_date_year: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AdsenseV2::HttpBody

Generates a csv formatted saved report.

Parameters:

  • name (String)

    Required. Name of the saved report. Format: accounts/account/reports/report

  • currency_code (String) (defaults to: nil)

    The ISO-4217 currency code to use when reporting on monetary metrics. Defaults to the account's currency if not set.

  • date_range (String) (defaults to: nil)

    Date range of the report, if unset the range will be considered CUSTOM.

  • end_date_day (Fixnum) (defaults to: nil)

    Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.

  • end_date_month (Fixnum) (defaults to: nil)

    Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.

  • end_date_year (Fixnum) (defaults to: nil)

    Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.

  • language_code (String) (defaults to: nil)

    The language to use for translating report output. If unspecified, this defaults to English ("en"). If the given language is not supported, report output will be returned in English. The language is specified as an IETF BCP- 47 language code.

  • reporting_time_zone (String) (defaults to: nil)

    Timezone in which to generate the report. If unspecified, this defaults to the account timezone. For more information, see changing the time zone of your reports.

  • start_date_day (Fixnum) (defaults to: nil)

    Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.

  • start_date_month (Fixnum) (defaults to: nil)

    Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.

  • start_date_year (Fixnum) (defaults to: nil)

    Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.

  • 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



1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
# File 'lib/google/apis/adsense_v2/service.rb', line 1242

def (name, currency_code: nil, date_range: nil, end_date_day: nil, end_date_month: nil, end_date_year: nil, language_code: nil, reporting_time_zone: nil, start_date_day: nil, start_date_month: nil, start_date_year: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/{+name}/saved:generateCsv', options)
  command.response_representation = Google::Apis::AdsenseV2::HttpBody::Representation
  command.response_class = Google::Apis::AdsenseV2::HttpBody
  command.params['name'] = name unless name.nil?
  command.query['currencyCode'] = currency_code unless currency_code.nil?
  command.query['dateRange'] = date_range unless date_range.nil?
  command.query['endDate.day'] = end_date_day unless end_date_day.nil?
  command.query['endDate.month'] = end_date_month unless end_date_month.nil?
  command.query['endDate.year'] = end_date_year unless end_date_year.nil?
  command.query['languageCode'] = language_code unless language_code.nil?
  command.query['reportingTimeZone'] = reporting_time_zone unless reporting_time_zone.nil?
  command.query['startDate.day'] = start_date_day unless start_date_day.nil?
  command.query['startDate.month'] = start_date_month unless start_date_month.nil?
  command.query['startDate.year'] = start_date_year unless start_date_year.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_account(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AdsenseV2::Account

Gets information about the selected AdSense account.

Parameters:

  • name (String)

    Required. Account to get information about. Format: accounts/account

  • 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



73
74
75
76
77
78
79
80
81
# File 'lib/google/apis/adsense_v2/service.rb', line 73

def (name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/{+name}', options)
  command.response_representation = Google::Apis::AdsenseV2::Account::Representation
  command.response_class = Google::Apis::AdsenseV2::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_account_ad_blocking_recovery_tag(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AdsenseV2::AdBlockingRecoveryTag

Gets the ad blocking recovery tag of an account.

Parameters:

  • name (String)

    Required. The name of the account to get the tag for. Format: accounts/ account

  • 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



104
105
106
107
108
109
110
111
112
# File 'lib/google/apis/adsense_v2/service.rb', line 104

def (name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/{+name}/adBlockingRecoveryTag', options)
  command.response_representation = Google::Apis::AdsenseV2::AdBlockingRecoveryTag::Representation
  command.response_class = Google::Apis::AdsenseV2::AdBlockingRecoveryTag
  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_account_adclient(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AdsenseV2::AdClient

Gets the ad client from the given resource name.

Parameters:

  • name (String)

    Required. The name of the ad client to retrieve. Format: accounts/account/ adclients/adclient

  • 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
# File 'lib/google/apis/adsense_v2/service.rb', line 213

def (name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/{+name}', options)
  command.response_representation = Google::Apis::AdsenseV2::AdClient::Representation
  command.response_class = Google::Apis::AdsenseV2::AdClient
  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_account_adclient_adcode(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AdsenseV2::AdClientAdCode

Gets the AdSense code for a given ad client. This returns what was previously known as the 'auto ad code'. This is only supported for ad clients with a product_code of AFC. For more information, see About the AdSense code.

Parameters:

  • name (String)

    Required. Name of the ad client for which to get the adcode. Format: accounts/ account/adclients/adclient

  • 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



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

def (name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/{+name}/adcode', options)
  command.response_representation = Google::Apis::AdsenseV2::AdClientAdCode::Representation
  command.response_class = Google::Apis::AdsenseV2::AdClientAdCode
  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_account_adclient_adunit(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AdsenseV2::AdUnit

Gets an ad unit from a specified account and ad client.

Parameters:

  • name (String)

    Required. AdUnit to get information about. Format: accounts/account/ adclients/adclient/adunits/adunit

  • 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



359
360
361
362
363
364
365
366
367
# File 'lib/google/apis/adsense_v2/service.rb', line 359

def (name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/{+name}', options)
  command.response_representation = Google::Apis::AdsenseV2::AdUnit::Representation
  command.response_class = Google::Apis::AdsenseV2::AdUnit
  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_account_adclient_adunit_adcode(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AdsenseV2::AdUnitAdCode

Gets the ad unit code for a given ad unit. For more information, see About the AdSense code and Where to place the ad code in your HTML.

Parameters:

  • name (String)

    Required. Name of the adunit for which to get the adcode. Format: accounts/ account/adclients/adclient/adunits/adunit

  • 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



393
394
395
396
397
398
399
400
401
# File 'lib/google/apis/adsense_v2/service.rb', line 393

def (name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/{+name}/adcode', options)
  command.response_representation = Google::Apis::AdsenseV2::AdUnitAdCode::Representation
  command.response_class = Google::Apis::AdsenseV2::AdUnitAdCode
  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_account_adclient_customchannel(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AdsenseV2::CustomChannel

Gets information about the selected custom channel.

Parameters:

  • name (String)

    Required. Name of the custom channel. Format: accounts/account/adclients/ adclient/customchannels/customchannel

  • 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



616
617
618
619
620
621
622
623
624
# File 'lib/google/apis/adsense_v2/service.rb', line 616

def (name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/{+name}', options)
  command.response_representation = Google::Apis::AdsenseV2::CustomChannel::Representation
  command.response_class = Google::Apis::AdsenseV2::CustomChannel
  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_account_adclient_urlchannel(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AdsenseV2::UrlChannel

Gets information about the selected url channel.

Parameters:

  • name (String)

    Required. The name of the url channel to retrieve. Format: accounts/account/ adclients/adclient/urlchannels/urlchannel

  • 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



770
771
772
773
774
775
776
777
778
# File 'lib/google/apis/adsense_v2/service.rb', line 770

def (name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/{+name}', options)
  command.response_representation = Google::Apis::AdsenseV2::UrlChannel::Representation
  command.response_class = Google::Apis::AdsenseV2::UrlChannel
  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_account_report_saved(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AdsenseV2::SavedReport

Gets the saved report from the given resource name.

Parameters:

  • name (String)

    Required. The name of the saved report to retrieve. Format: accounts/account/ reports/report

  • 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



1106
1107
1108
1109
1110
1111
1112
1113
1114
# File 'lib/google/apis/adsense_v2/service.rb', line 1106

def (name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/{+name}/saved', options)
  command.response_representation = Google::Apis::AdsenseV2::SavedReport::Representation
  command.response_class = Google::Apis::AdsenseV2::SavedReport
  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_account_site(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AdsenseV2::Site

Gets information about the selected site.

Parameters:

  • name (String)

    Required. Name of the site. Format: 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



1323
1324
1325
1326
1327
1328
1329
1330
1331
# File 'lib/google/apis/adsense_v2/service.rb', line 1323

def (name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/{+name}', options)
  command.response_representation = Google::Apis::AdsenseV2::Site::Representation
  command.response_class = Google::Apis::AdsenseV2::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_account_adclient_adunit_linked_custom_channels(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AdsenseV2::ListLinkedCustomChannelsResponse

Lists all the custom channels available for an ad unit.

Parameters:

  • parent (String)

    Required. The ad unit which owns the collection of custom channels. Format: accounts/account/adclients/adclient/adunits/adunit

  • page_size (Fixnum) (defaults to: nil)

    The maximum number of custom channels to include in the response, used for paging. If unspecified, at most 10000 custom channels 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 ListLinkedCustomChannels call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to ListLinkedCustomChannels 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



474
475
476
477
478
479
480
481
482
483
484
# File 'lib/google/apis/adsense_v2/service.rb', line 474

def (parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/{+parent}:listLinkedCustomChannels', options)
  command.response_representation = Google::Apis::AdsenseV2::ListLinkedCustomChannelsResponse::Representation
  command.response_class = Google::Apis::AdsenseV2::ListLinkedCustomChannelsResponse
  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_account_adclient_adunits(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AdsenseV2::ListAdUnitsResponse

Lists all ad units under a specified account and ad client.

Parameters:

  • parent (String)

    Required. The ad client which owns the collection of ad units. Format: accounts/account/adclients/adclient

  • page_size (Fixnum) (defaults to: nil)

    The maximum number of ad units to include in the response, used for paging. If unspecified, at most 10000 ad units 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 ListAdUnits call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to ListAdUnits 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



432
433
434
435
436
437
438
439
440
441
442
# File 'lib/google/apis/adsense_v2/service.rb', line 432

def (parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/{+parent}/adunits', options)
  command.response_representation = Google::Apis::AdsenseV2::ListAdUnitsResponse::Representation
  command.response_class = Google::Apis::AdsenseV2::ListAdUnitsResponse
  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_account_adclient_customchannel_linked_ad_units(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AdsenseV2::ListLinkedAdUnitsResponse

Lists all the ad units available for a custom channel.

Parameters:

  • parent (String)

    Required. The custom channel which owns the collection of ad units. Format: accounts/account/adclients/adclient/customchannels/customchannel

  • page_size (Fixnum) (defaults to: nil)

    The maximum number of ad units to include in the response, used for paging. If unspecified, at most 10000 ad units 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 ListLinkedAdUnits call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to ListLinkedAdUnits 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



698
699
700
701
702
703
704
705
706
707
708
# File 'lib/google/apis/adsense_v2/service.rb', line 698

def (parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/{+parent}:listLinkedAdUnits', options)
  command.response_representation = Google::Apis::AdsenseV2::ListLinkedAdUnitsResponse::Representation
  command.response_class = Google::Apis::AdsenseV2::ListLinkedAdUnitsResponse
  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_account_adclient_customchannels(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AdsenseV2::ListCustomChannelsResponse

Lists all the custom channels available in an ad client.

Parameters:

  • parent (String)

    Required. The ad client which owns the collection of custom channels. Format: accounts/account/adclients/adclient

  • page_size (Fixnum) (defaults to: nil)

    The maximum number of custom channels to include in the response, used for paging. If unspecified, at most 10000 custom channels 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 ListCustomChannels call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to ListCustomChannels 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



656
657
658
659
660
661
662
663
664
665
666
# File 'lib/google/apis/adsense_v2/service.rb', line 656

def (parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/{+parent}/customchannels', options)
  command.response_representation = Google::Apis::AdsenseV2::ListCustomChannelsResponse::Representation
  command.response_class = Google::Apis::AdsenseV2::ListCustomChannelsResponse
  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_account_adclient_urlchannels(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AdsenseV2::ListUrlChannelsResponse

Lists active url channels.

Parameters:

  • parent (String)

    Required. The ad client which owns the collection of url channels. Format: accounts/account/adclients/adclient

  • page_size (Fixnum) (defaults to: nil)

    The maximum number of url channels to include in the response, used for paging. If unspecified, at most 10000 url channels 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 ListUrlChannels call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to ListUrlChannels 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



809
810
811
812
813
814
815
816
817
818
819
# File 'lib/google/apis/adsense_v2/service.rb', line 809

def (parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/{+parent}/urlchannels', options)
  command.response_representation = Google::Apis::AdsenseV2::ListUrlChannelsResponse::Representation
  command.response_class = Google::Apis::AdsenseV2::ListUrlChannelsResponse
  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_account_adclients(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AdsenseV2::ListAdClientsResponse

Lists all the ad clients available in an account.

Parameters:

  • parent (String)

    Required. The account which owns the collection of ad clients. Format: accounts/account

  • page_size (Fixnum) (defaults to: nil)

    The maximum number of ad clients to include in the response, used for paging. If unspecified, at most 10000 ad clients 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 ListAdClients call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to ListAdClients 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



286
287
288
289
290
291
292
293
294
295
296
# File 'lib/google/apis/adsense_v2/service.rb', line 286

def (parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/{+parent}/adclients', options)
  command.response_representation = Google::Apis::AdsenseV2::ListAdClientsResponse::Representation
  command.response_class = Google::Apis::AdsenseV2::ListAdClientsResponse
  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_account_alerts(parent, language_code: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AdsenseV2::ListAlertsResponse

Lists all the alerts available in an account.

Parameters:

  • parent (String)

    Required. The account which owns the collection of alerts. Format: accounts/ account

  • language_code (String) (defaults to: nil)

    The language to use for translating alert messages. If unspecified, this defaults to the user's display language. If the given language is not supported, alerts will be returned in English. The language is specified as an IETF BCP-47 language code.

  • 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



847
848
849
850
851
852
853
854
855
856
# File 'lib/google/apis/adsense_v2/service.rb', line 847

def (parent, language_code: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/{+parent}/alerts', options)
  command.response_representation = Google::Apis::AdsenseV2::ListAlertsResponse::Representation
  command.response_class = Google::Apis::AdsenseV2::ListAlertsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['languageCode'] = language_code unless language_code.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_account_child_accounts(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AdsenseV2::ListChildAccountsResponse

Lists all accounts directly managed by the given AdSense account.

Parameters:

  • parent (String)

    Required. The parent account, which owns the child accounts. Format: accounts/ account

  • page_size (Fixnum) (defaults to: nil)

    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)

    A page token, received from a previous ListAccounts call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to ListAccounts 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



180
181
182
183
184
185
186
187
188
189
190
# File 'lib/google/apis/adsense_v2/service.rb', line 180

def (parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/{+parent}:listChildAccounts', options)
  command.response_representation = Google::Apis::AdsenseV2::ListChildAccountsResponse::Representation
  command.response_class = Google::Apis::AdsenseV2::ListChildAccountsResponse
  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_account_payments(parent, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AdsenseV2::ListPaymentsResponse

Lists all the payments available for an account.

Parameters:

  • parent (String)

    Required. The account which owns the collection of payments. Format: accounts/ account

  • 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



879
880
881
882
883
884
885
886
887
# File 'lib/google/apis/adsense_v2/service.rb', line 879

def (parent, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/{+parent}/payments', options)
  command.response_representation = Google::Apis::AdsenseV2::ListPaymentsResponse::Representation
  command.response_class = Google::Apis::AdsenseV2::ListPaymentsResponse
  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

#list_account_report_saveds(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AdsenseV2::ListSavedReportsResponse

Lists saved reports.

Parameters:

  • parent (String)

    Required. The account which owns the collection of reports. Format: accounts/ account

  • page_size (Fixnum) (defaults to: nil)

    The maximum number of reports to include in the response, used for paging. If unspecified, at most 10000 reports 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 ListPayments call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to ListPayments 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



1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
# File 'lib/google/apis/adsense_v2/service.rb', line 1291

def (parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/{+parent}/reports/saved', options)
  command.response_representation = Google::Apis::AdsenseV2::ListSavedReportsResponse::Representation
  command.response_class = Google::Apis::AdsenseV2::ListSavedReportsResponse
  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_account_sites(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AdsenseV2::ListSitesResponse

Lists all the sites available in an account.

Parameters:

  • parent (String)

    Required. The account which owns the collection of sites. Format: 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



1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
# File 'lib/google/apis/adsense_v2/service.rb', line 1362

def (parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/{+parent}/sites', options)
  command.response_representation = Google::Apis::AdsenseV2::ListSitesResponse::Representation
  command.response_class = Google::Apis::AdsenseV2::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_accounts(page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AdsenseV2::ListAccountsResponse

Lists all accounts available to this user.

Parameters:

  • page_size (Fixnum) (defaults to: nil)

    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)

    A page token, received from a previous ListAccounts call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to ListAccounts 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



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

def list_accounts(page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/accounts', options)
  command.response_representation = Google::Apis::AdsenseV2::ListAccountsResponse::Representation
  command.response_class = Google::Apis::AdsenseV2::ListAccountsResponse
  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

#patch_account_adclient_adunit(name, ad_unit_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AdsenseV2::AdUnit

Updates an ad unit. This method can only be used by projects enabled for the AdSense for Platforms product. For now, this method can only be used to update DISPLAY ad units. See: https://support.google.com/adsense/answer/9183566

Parameters:

  • name (String)

    Output only. Resource name of the ad unit. Format: accounts/account/ adclients/adclient/adunits/adunit

  • ad_unit_object (Google::Apis::AdsenseV2::AdUnit) (defaults to: nil)
  • update_mask (String) (defaults to: nil)

    The list of fields to update. If empty, a full update is performed.

  • 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



513
514
515
516
517
518
519
520
521
522
523
524
# File 'lib/google/apis/adsense_v2/service.rb', line 513

def (name, ad_unit_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:patch, 'v2/{+name}', options)
  command.request_representation = Google::Apis::AdsenseV2::AdUnit::Representation
  command.request_object = ad_unit_object
  command.response_representation = Google::Apis::AdsenseV2::AdUnit::Representation
  command.response_class = Google::Apis::AdsenseV2::AdUnit
  command.params['name'] = name unless name.nil?
  command.query['updateMask'] = update_mask unless update_mask.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#patch_account_adclient_customchannel(name, custom_channel_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AdsenseV2::CustomChannel

Updates a custom channel. This method can only be used by projects enabled for the AdSense for Platforms product.

Parameters:

  • name (String)

    Output only. Resource name of the custom channel. Format: accounts/account/ adclients/adclient/customchannels/customchannel

  • custom_channel_object (Google::Apis::AdsenseV2::CustomChannel) (defaults to: nil)
  • update_mask (String) (defaults to: nil)

    The list of fields to update. If empty, a full update is performed.

  • 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



736
737
738
739
740
741
742
743
744
745
746
747
# File 'lib/google/apis/adsense_v2/service.rb', line 736

def (name, custom_channel_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:patch, 'v2/{+name}', options)
  command.request_representation = Google::Apis::AdsenseV2::CustomChannel::Representation
  command.request_object = custom_channel_object
  command.response_representation = Google::Apis::AdsenseV2::CustomChannel::Representation
  command.response_class = Google::Apis::AdsenseV2::CustomChannel
  command.params['name'] = name unless name.nil?
  command.query['updateMask'] = update_mask unless update_mask.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end