Class: Google::Apis::DoubleclickbidmanagerV2::DoubleClickBidManagerService

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

Overview

DoubleClick Bid Manager API

DoubleClick Bid Manager API allows users to manage and create campaigns and reports.

Examples:

require 'google/apis/doubleclickbidmanager_v2'

Doubleclickbidmanager = Google::Apis::DoubleclickbidmanagerV2 # Alias the module
service = Doubleclickbidmanager::DoubleClickBidManagerService.new

See Also:

Constant Summary collapse

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDoubleClickBidManagerService

Returns a new instance of DoubleClickBidManagerService.



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

def initialize
  super(DEFAULT_ENDPOINT_TEMPLATE, 'v2/',
        client_name: 'google-apis-doubleclickbidmanager_v2',
        client_version: Google::Apis::DoubleclickbidmanagerV2::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.



41
42
43
# File 'lib/google/apis/doubleclickbidmanager_v2/service.rb', line 41

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.



46
47
48
# File 'lib/google/apis/doubleclickbidmanager_v2/service.rb', line 46

def quota_user
  @quota_user
end

Instance Method Details

#create_query(query_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DoubleclickbidmanagerV2::Query

Creates a new query.

Parameters:

  • query_object (Google::Apis::DoubleclickbidmanagerV2::Query) (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



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

def create_query(query_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'queries', options)
  command.request_representation = Google::Apis::DoubleclickbidmanagerV2::Query::Representation
  command.request_object = query_object
  command.response_representation = Google::Apis::DoubleclickbidmanagerV2::Query::Representation
  command.response_class = Google::Apis::DoubleclickbidmanagerV2::Query
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_query(query_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... }

This method returns an undefined value.

Deletes an existing query as well as its generated reports.

Parameters:

  • query_id (Fixnum)

    Required. The ID of the query to delete.

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

  • 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



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

def delete_query(query_id, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'queries/{queryId}', options)
  command.params['queryId'] = query_id unless query_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_query(query_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DoubleclickbidmanagerV2::Query

Retrieves a query.

Parameters:

  • query_id (Fixnum)

    Required. The ID of the query to retrieve.

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

def get_query(query_id, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'queries/{queryId}', options)
  command.response_representation = Google::Apis::DoubleclickbidmanagerV2::Query::Representation
  command.response_class = Google::Apis::DoubleclickbidmanagerV2::Query
  command.params['queryId'] = query_id unless query_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_query_report(query_id, report_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DoubleclickbidmanagerV2::Report

Retrieves a report.

Parameters:

  • query_id (Fixnum)

    Required. The ID of the query that generated the report.

  • report_id (Fixnum)

    Required. The ID of the query to retrieve.

  • 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



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

def get_query_report(query_id, report_id, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'queries/{queryId}/reports/{reportId}', options)
  command.response_representation = Google::Apis::DoubleclickbidmanagerV2::Report::Representation
  command.response_class = Google::Apis::DoubleclickbidmanagerV2::Report
  command.params['queryId'] = query_id unless query_id.nil?
  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

#list_queries(order_by: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DoubleclickbidmanagerV2::ListQueriesResponse

Lists queries created by the current user.

Parameters:

  • order_by (String) (defaults to: nil)

    Field to sort the list by. Accepts the following values: * queryId (default)

    • metadata.title The default sorting order is ascending. To specify descending order for a field, add the suffix desc to the field name. For example, queryId desc.
  • page_size (Fixnum) (defaults to: nil)

    Maximum number of results per page. Must be between 1 and 100. Defaults to 100 if unspecified.

  • page_token (String) (defaults to: nil)

    A token identifying which page of results the server should return. Typically, this is the value of nextPageToken, returned from the previous call to the queries.list method. If unspecified, the first page of results is returned.

  • 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



173
174
175
176
177
178
179
180
181
182
183
# File 'lib/google/apis/doubleclickbidmanager_v2/service.rb', line 173

def list_queries(order_by: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'queries', options)
  command.response_representation = Google::Apis::DoubleclickbidmanagerV2::ListQueriesResponse::Representation
  command.response_class = Google::Apis::DoubleclickbidmanagerV2::ListQueriesResponse
  command.query['orderBy'] = order_by unless order_by.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_query_reports(query_id, order_by: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DoubleclickbidmanagerV2::ListReportsResponse

Lists reports generated by the provided query.

Parameters:

  • query_id (Fixnum)

    Required. The ID of the query that generated the reports.

  • order_by (String) (defaults to: nil)

    Field to sort the list by. Accepts the following values: * key.reportId ( default) The default sorting order is ascending. To specify descending order for a field, add the suffix desc to the field name. For example, key. reportId desc.

  • page_size (Fixnum) (defaults to: nil)

    Maximum number of results per page. Must be between 1 and 100. Defaults to 100 if unspecified.

  • page_token (String) (defaults to: nil)

    A token identifying which page of results the server should return. Typically, this is the value of nextPageToken returned from the previous call to the queries.reports.list method. If unspecified, the first page of results is returned.

  • 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



289
290
291
292
293
294
295
296
297
298
299
300
# File 'lib/google/apis/doubleclickbidmanager_v2/service.rb', line 289

def list_query_reports(query_id, order_by: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'queries/{queryId}/reports', options)
  command.response_representation = Google::Apis::DoubleclickbidmanagerV2::ListReportsResponse::Representation
  command.response_class = Google::Apis::DoubleclickbidmanagerV2::ListReportsResponse
  command.params['queryId'] = query_id unless query_id.nil?
  command.query['orderBy'] = order_by unless order_by.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

#run_query(query_id, run_query_request_object = nil, synchronous: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DoubleclickbidmanagerV2::Report

Runs an existing query to generate a report.

Parameters:

  • query_id (Fixnum)

    Required. The ID of the query to run.

  • run_query_request_object (Google::Apis::DoubleclickbidmanagerV2::RunQueryRequest) (defaults to: nil)
  • synchronous (Boolean) (defaults to: nil)

    Whether the query should be run synchronously. When true, the request won't return until the resulting report has finished running. This parameter is false by default. Setting this parameter to true is not recommended.

  • 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



210
211
212
213
214
215
216
217
218
219
220
221
# File 'lib/google/apis/doubleclickbidmanager_v2/service.rb', line 210

def run_query(query_id, run_query_request_object = nil, synchronous: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'queries/{queryId}:run', options)
  command.request_representation = Google::Apis::DoubleclickbidmanagerV2::RunQueryRequest::Representation
  command.request_object = run_query_request_object
  command.response_representation = Google::Apis::DoubleclickbidmanagerV2::Report::Representation
  command.response_class = Google::Apis::DoubleclickbidmanagerV2::Report
  command.params['queryId'] = query_id unless query_id.nil?
  command.query['synchronous'] = synchronous unless synchronous.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end