Class: Google::Apis::DoubleclicksearchV2::DoubleclicksearchService

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

Overview

Search Ads 360 API

The Search Ads 360 API allows developers to automate uploading conversions and downloading reports from Search Ads 360.

Examples:

require 'google/apis/doubleclicksearch_v2'

Doubleclicksearch = Google::Apis::DoubleclicksearchV2 # Alias the module
service = Doubleclicksearch::DoubleclicksearchService.new

See Also:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize ⇒ DoubleclicksearchService

Returns a new instance of DoubleclicksearchService.



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

def initialize
  super('https://doubleclicksearch.googleapis.com/', '',
        client_name: 'google-apis-doubleclicksearch_v2',
        client_version: Google::Apis::DoubleclicksearchV2::GEM_VERSION)
  @batch_path = 'batch'
end

Instance Attribute Details

#key ⇒ String

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/doubleclicksearch_v2/service.rb', line 39

def key
  @key
end

#quota_user ⇒ String

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/doubleclicksearch_v2/service.rb', line 44

def quota_user
  @quota_user
end

Instance Method Details

#generate_report(report_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DoubleclicksearchV2::Report

Generates and returns a report immediately.

Parameters:

  • report_request_object (Google::Apis::DoubleclicksearchV2::ReportRequest) (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



163
164
165
166
167
168
169
170
171
172
# File 'lib/google/apis/doubleclicksearch_v2/service.rb', line 163

def generate_report(report_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'doubleclicksearch/v2/reports/generate', options)
  command.request_representation = Google::Apis::DoubleclicksearchV2::ReportRequest::Representation
  command.request_object = report_request_object
  command.response_representation = Google::Apis::DoubleclicksearchV2::Report::Representation
  command.response_class = Google::Apis::DoubleclicksearchV2::Report
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_report(report_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DoubleclicksearchV2::Report

Polls for the status of a report request.

Parameters:

  • report_id (String) —

    ID of the report request being polled.

  • 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



194
195
196
197
198
199
200
201
202
# File 'lib/google/apis/doubleclicksearch_v2/service.rb', line 194

def get_report(report_id, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'doubleclicksearch/v2/reports/{reportId}', options)
  command.response_representation = Google::Apis::DoubleclicksearchV2::Report::Representation
  command.response_class = Google::Apis::DoubleclicksearchV2::Report
  command.params['reportId'] = report_id unless report_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

#get_report_file(report_id, report_fragment, fields: nil, quota_user: nil, download_dest: nil, options: nil) {|result, err| ... }

This method returns an undefined value.

Downloads a report file encoded in UTF-8.

Parameters:

  • report_id (String) —

    ID of the report.

  • report_fragment (Fixnum) —

    The index of the report fragment to download.

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

  • download_dest (IO, String) (defaults to: nil) —

    IO stream or filename to receive content download

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

    Request-specific options

Yields:

  • (result, err) —

    Result & error if block supplied

Yield Parameters:

  • result (NilClass) —

    No result returned for this method

  • err (StandardError) —

    error object if request failed

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



228
229
230
231
232
233
234
235
236
237
238
239
240
# File 'lib/google/apis/doubleclicksearch_v2/service.rb', line 228

def get_report_file(report_id, report_fragment, fields: nil, quota_user: nil, download_dest: nil, options: nil, &block)
  if download_dest.nil?
    command = make_simple_command(:get, 'doubleclicksearch/v2/reports/{reportId}/files/{reportFragment}', options)
  else
    command = make_download_command(:get, 'doubleclicksearch/v2/reports/{reportId}/files/{reportFragment}', options)
    command.download_dest = download_dest
  end
  command.params['reportId'] = report_id unless report_id.nil?
  command.params['reportFragment'] = report_fragment unless report_fragment.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_report_id_mapping_file(agency_id, advertiser_id, fields: nil, quota_user: nil, download_dest: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DoubleclicksearchV2::IdMappingFile

Downloads a csv file(encoded in UTF-8) that contains ID mappings between legacy SA360 and new SA360. The file includes all children entities of the given advertiser(e.g. engine accounts, campaigns, ad groups, etc.) that exist in both legacy SA360 and new SA360.

Parameters:

  • agency_id (Fixnum) —

    Legacy SA360 agency ID.

  • advertiser_id (Fixnum) —

    Legacy SA360 advertiser 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.

  • download_dest (IO, String) (defaults to: nil) —

    IO stream or filename to receive content download

  • 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



269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
# File 'lib/google/apis/doubleclicksearch_v2/service.rb', line 269

def get_report_id_mapping_file(agency_id, advertiser_id, fields: nil, quota_user: nil, download_dest: nil, options: nil, &block)
  if download_dest.nil?
    command = make_simple_command(:get, 'doubleclicksearch/v2/agency/{agencyId}/advertiser/{advertiserId}/idmapping', options)
  else
    command = make_download_command(:get, 'doubleclicksearch/v2/agency/{agencyId}/advertiser/{advertiserId}/idmapping', options)
    command.download_dest = download_dest
  end
  command.response_representation = Google::Apis::DoubleclicksearchV2::IdMappingFile::Representation
  command.response_class = Google::Apis::DoubleclicksearchV2::IdMappingFile
  command.params['agencyId'] = agency_id unless agency_id.nil?
  command.params['advertiserId'] = advertiser_id unless advertiser_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

#insert_conversion(conversion_list_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DoubleclicksearchV2::ConversionList

Inserts a batch of new conversions into DoubleClick Search.

Parameters:

  • conversion_list_object (Google::Apis::DoubleclicksearchV2::ConversionList) (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



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

def insert_conversion(conversion_list_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'doubleclicksearch/v2/conversion', options)
  command.request_representation = Google::Apis::DoubleclicksearchV2::ConversionList::Representation
  command.request_object = conversion_list_object
  command.response_representation = Google::Apis::DoubleclicksearchV2::ConversionList::Representation
  command.response_class = Google::Apis::DoubleclicksearchV2::ConversionList
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_saved_columns(agency_id, advertiser_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DoubleclicksearchV2::SavedColumnList

Retrieve the list of saved columns for a specified advertiser.

Parameters:

  • agency_id (Fixnum) —

    DS ID of the agency.

  • advertiser_id (Fixnum) —

    DS ID of the advertiser.

  • 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



337
338
339
340
341
342
343
344
345
346
# File 'lib/google/apis/doubleclicksearch_v2/service.rb', line 337

def list_saved_columns(agency_id, advertiser_id, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'doubleclicksearch/v2/agency/{agencyId}/advertiser/{advertiserId}/savedcolumns', options)
  command.response_representation = Google::Apis::DoubleclicksearchV2::SavedColumnList::Representation
  command.response_class = Google::Apis::DoubleclicksearchV2::SavedColumnList
  command.params['agencyId'] = agency_id unless agency_id.nil?
  command.params['advertiserId'] = advertiser_id unless advertiser_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_report(report_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DoubleclicksearchV2::Report

Inserts a report request into the reporting system.

Parameters:

  • report_request_object (Google::Apis::DoubleclicksearchV2::ReportRequest) (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



304
305
306
307
308
309
310
311
312
313
# File 'lib/google/apis/doubleclicksearch_v2/service.rb', line 304

def request_report(report_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'doubleclicksearch/v2/reports', options)
  command.request_representation = Google::Apis::DoubleclicksearchV2::ReportRequest::Representation
  command.request_object = report_request_object
  command.response_representation = Google::Apis::DoubleclicksearchV2::Report::Representation
  command.response_class = Google::Apis::DoubleclicksearchV2::Report
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#update_conversion(conversion_list_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DoubleclicksearchV2::ConversionList

Updates a batch of conversions in DoubleClick Search.

Parameters:

  • conversion_list_object (Google::Apis::DoubleclicksearchV2::ConversionList) (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



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

def update_conversion(conversion_list_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:put, 'doubleclicksearch/v2/conversion', options)
  command.request_representation = Google::Apis::DoubleclicksearchV2::ConversionList::Representation
  command.request_object = conversion_list_object
  command.response_representation = Google::Apis::DoubleclicksearchV2::ConversionList::Representation
  command.response_class = Google::Apis::DoubleclicksearchV2::ConversionList
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#update_conversion_availability(update_availability_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DoubleclicksearchV2::UpdateAvailabilityResponse

Updates the availabilities of a batch of floodlight activities in DoubleClick Search.

Parameters:

  • update_availability_request_object (Google::Apis::DoubleclicksearchV2::UpdateAvailabilityRequest) (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



133
134
135
136
137
138
139
140
141
142
# File 'lib/google/apis/doubleclicksearch_v2/service.rb', line 133

def update_conversion_availability(update_availability_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'doubleclicksearch/v2/conversion/updateAvailability', options)
  command.request_representation = Google::Apis::DoubleclicksearchV2::UpdateAvailabilityRequest::Representation
  command.request_object = update_availability_request_object
  command.response_representation = Google::Apis::DoubleclicksearchV2::UpdateAvailabilityResponse::Representation
  command.response_class = Google::Apis::DoubleclicksearchV2::UpdateAvailabilityResponse
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end