Class: Google::Apis::PartnersV2::PartnersService

Inherits:
Core::BaseService show all
Defined in:
generated/google/apis/partners_v2/service.rb

Overview

Google Partners API

Lets advertisers search certified companies and create contact leads with them, and also audits the usage of clients.

Examples:

require 'google/apis/partners_v2'

Partners = Google::Apis::PartnersV2 # Alias the module
service = Partners::PartnersService.new

See Also:

Instance Attribute Summary collapse

Attributes inherited from Core::BaseService

#authorization, #base_path, #batch_path, #client, #client_options, #request_options, #root_url, #upload_path

Instance Method Summary collapse

Methods inherited from Core::BaseService

#batch, #batch_upload, #fetch_all, #http

Constructor Details

#initializePartnersService

Returns a new instance of PartnersService



46
47
48
# File 'generated/google/apis/partners_v2/service.rb', line 46

def initialize
  super('https://partners.googleapis.com/', '')
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 'generated/google/apis/partners_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 'generated/google/apis/partners_v2/service.rb', line 44

def quota_user
  @quota_user
end

Instance Method Details

#create_lead(company_id, create_lead_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PartnersV2::CreateLeadResponse

Creates an advertiser lead for the given company ID.

Parameters:

  • company_id (String)

    The ID of the company to contact.

  • create_lead_request_object (Google::Apis::PartnersV2::CreateLeadRequest) (defaults to: nil)
  • fields (String)

    Selector specifying which fields to include in a partial response.

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



379
380
381
382
383
384
385
386
387
388
389
# File 'generated/google/apis/partners_v2/service.rb', line 379

def create_lead(company_id, create_lead_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:post, 'v2/companies/{companyId}/leads', options)
  command.request_representation = Google::Apis::PartnersV2::CreateLeadRequest::Representation
  command.request_object = create_lead_request_object
  command.response_representation = Google::Apis::PartnersV2::CreateLeadResponse::Representation
  command.response_class = Google::Apis::PartnersV2::CreateLeadResponse
  command.params['companyId'] = company_id unless company_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_company(company_id, request_metadata_user_overrides_ip_address: nil, request_metadata_user_overrides_user_id: nil, request_metadata_locale: nil, request_metadata_partners_session_id: nil, request_metadata_experiment_ids: nil, request_metadata_traffic_source_traffic_source_id: nil, request_metadata_traffic_source_traffic_sub_id: nil, view: nil, order_by: nil, currency_code: nil, address: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PartnersV2::GetCompanyResponse

Gets a company.

Parameters:

  • company_id (String)

    The ID of the company to retrieve.

  • request_metadata_user_overrides_ip_address (String)

    IP address to use instead of the user's geo-located IP address.

  • request_metadata_user_overrides_user_id (String)

    Logged-in user ID to impersonate instead of the user's ID.

  • request_metadata_locale (String)

    Locale to use for the current request.

  • request_metadata_partners_session_id (String)

    Google Partners session ID.

  • request_metadata_experiment_ids (Array<String>, String)

    Experiment IDs the current request belongs to.

  • request_metadata_traffic_source_traffic_source_id (String)

    Identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us.

  • request_metadata_traffic_source_traffic_sub_id (String)

    Second level identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us.

  • view (String)

    The view of Company resource to be returned. This must not be COMPANY_VIEW_UNSPECIFIED.

  • order_by (String)

    How to order addresses within the returned company. Currently, only address and address desc is supported which will sorted by closest to farthest in distance from given address and farthest to closest distance from given address respectively.

  • currency_code (String)

    If the company's budget is in a different currency code than this one, then the converted budget is converted to this currency code.

  • address (String)

    The address to use for sorting the company's addresses by proximity. If not given, the geo-located address of the request is used. Used when order_by is set.

  • fields (String)

    Selector specifying which fields to include in a partial response.

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
# File 'generated/google/apis/partners_v2/service.rb', line 215

def get_company(company_id, request_metadata_user_overrides_ip_address: nil, request_metadata_user_overrides_user_id: nil, request_metadata_locale: nil, request_metadata_partners_session_id: nil, request_metadata_experiment_ids: nil, request_metadata_traffic_source_traffic_source_id: nil, request_metadata_traffic_source_traffic_sub_id: nil, view: nil, order_by: nil, currency_code: nil, address: nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:get, 'v2/companies/{companyId}', options)
  command.response_representation = Google::Apis::PartnersV2::GetCompanyResponse::Representation
  command.response_class = Google::Apis::PartnersV2::GetCompanyResponse
  command.params['companyId'] = company_id unless company_id.nil?
  command.query['requestMetadata.userOverrides.ipAddress'] =  unless .nil?
  command.query['requestMetadata.userOverrides.userId'] =  unless .nil?
  command.query['requestMetadata.locale'] =  unless .nil?
  command.query['requestMetadata.partnersSessionId'] =  unless .nil?
  command.query['requestMetadata.experimentIds'] =  unless .nil?
  command.query['requestMetadata.trafficSource.trafficSourceId'] =  unless .nil?
  command.query['requestMetadata.trafficSource.trafficSubId'] =  unless .nil?
  command.query['view'] = view unless view.nil?
  command.query['orderBy'] = order_by unless order_by.nil?
  command.query['currencyCode'] = currency_code unless currency_code.nil?
  command.query['address'] = address unless address.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_companies(request_metadata_user_overrides_ip_address: nil, request_metadata_user_overrides_user_id: nil, request_metadata_locale: nil, request_metadata_partners_session_id: nil, request_metadata_experiment_ids: nil, request_metadata_traffic_source_traffic_source_id: nil, request_metadata_traffic_source_traffic_sub_id: nil, page_size: nil, page_token: nil, company_name: nil, view: nil, min_monthly_budget_currency_code: nil, min_monthly_budget_units: nil, min_monthly_budget_nanos: nil, max_monthly_budget_currency_code: nil, max_monthly_budget_units: nil, max_monthly_budget_nanos: nil, industries: nil, services: nil, language_codes: nil, address: nil, order_by: nil, gps_motivations: nil, website_url: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PartnersV2::ListCompaniesResponse

Lists companies.

Parameters:

  • request_metadata_user_overrides_ip_address (String)

    IP address to use instead of the user's geo-located IP address.

  • request_metadata_user_overrides_user_id (String)

    Logged-in user ID to impersonate instead of the user's ID.

  • request_metadata_locale (String)

    Locale to use for the current request.

  • request_metadata_partners_session_id (String)

    Google Partners session ID.

  • request_metadata_experiment_ids (Array<String>, String)

    Experiment IDs the current request belongs to.

  • request_metadata_traffic_source_traffic_source_id (String)

    Identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us.

  • request_metadata_traffic_source_traffic_sub_id (String)

    Second level identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us.

  • page_size (Fixnum)

    Requested page size. Server may return fewer companies than requested. If unspecified, server picks an appropriate default.

  • page_token (String)

    A token identifying a page of results that the server returns. Typically, this is the value of ListCompaniesResponse.next_page_token returned from the previous call to ListCompanies.

  • company_name (String)

    Company name to search for.

  • view (String)

    The view of the Company resource to be returned. This must not be COMPANY_VIEW_UNSPECIFIED.

  • min_monthly_budget_currency_code (String)

    The 3-letter currency code defined in ISO 4217.

  • min_monthly_budget_units (String)

    The whole units of the amount. For example if currencyCode is "USD", then 1 unit is one US dollar.

  • min_monthly_budget_nanos (Fixnum)

    Number of nano (10^-9) units of the amount. The value must be between -999,999, 999 and +999,999,999 inclusive. If units is positive, nanos must be positive or zero. If units is zero, nanos can be positive, zero, or negative. If units is negative, nanos must be negative or zero. For example $-1.75 is represented as units=-1 and nanos=-750,000,000.

  • max_monthly_budget_currency_code (String)

    The 3-letter currency code defined in ISO 4217.

  • max_monthly_budget_units (String)

    The whole units of the amount. For example if currencyCode is "USD", then 1 unit is one US dollar.

  • max_monthly_budget_nanos (Fixnum)

    Number of nano (10^-9) units of the amount. The value must be between -999,999, 999 and +999,999,999 inclusive. If units is positive, nanos must be positive or zero. If units is zero, nanos can be positive, zero, or negative. If units is negative, nanos must be negative or zero. For example $-1.75 is represented as units=-1 and nanos=-750,000,000.

  • industries (Array<String>, String)

    List of industries the company can help with.

  • services (Array<String>, String)

    List of services the company can help with.

  • language_codes (Array<String>, String)

    List of language codes that company can support. Only primary language subtags are accepted as defined by BCP 47 (IETF BCP 47, "Tags for Identifying Languages").

  • address (String)

    The address to use when searching for companies. If not given, the geo-located address of the request is used.

  • order_by (String)

    How to order addresses within the returned companies. Currently, only address and address desc is supported which will sorted by closest to farthest in distance from given address and farthest to closest distance from given address respectively.

  • gps_motivations (Array<String>, String)

    List of reasons for using Google Partner Search to get companies.

  • website_url (String)

    Website URL that will help to find a better matched company. .

  • fields (String)

    Selector specifying which fields to include in a partial response.

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
# File 'generated/google/apis/partners_v2/service.rb', line 325

def list_companies(request_metadata_user_overrides_ip_address: nil, request_metadata_user_overrides_user_id: nil, request_metadata_locale: nil, request_metadata_partners_session_id: nil, request_metadata_experiment_ids: nil, request_metadata_traffic_source_traffic_source_id: nil, request_metadata_traffic_source_traffic_sub_id: nil, page_size: nil, page_token: nil, company_name: nil, view: nil, min_monthly_budget_currency_code: nil, min_monthly_budget_units: nil, min_monthly_budget_nanos: nil, max_monthly_budget_currency_code: nil, max_monthly_budget_units: nil, max_monthly_budget_nanos: nil, industries: nil, services: nil, language_codes: nil, address: nil, order_by: nil, gps_motivations: nil, website_url: nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:get, 'v2/companies', options)
  command.response_representation = Google::Apis::PartnersV2::ListCompaniesResponse::Representation
  command.response_class = Google::Apis::PartnersV2::ListCompaniesResponse
  command.query['requestMetadata.userOverrides.ipAddress'] =  unless .nil?
  command.query['requestMetadata.userOverrides.userId'] =  unless .nil?
  command.query['requestMetadata.locale'] =  unless .nil?
  command.query['requestMetadata.partnersSessionId'] =  unless .nil?
  command.query['requestMetadata.experimentIds'] =  unless .nil?
  command.query['requestMetadata.trafficSource.trafficSourceId'] =  unless .nil?
  command.query['requestMetadata.trafficSource.trafficSubId'] =  unless .nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['companyName'] = company_name unless company_name.nil?
  command.query['view'] = view unless view.nil?
  command.query['minMonthlyBudget.currencyCode'] = min_monthly_budget_currency_code unless min_monthly_budget_currency_code.nil?
  command.query['minMonthlyBudget.units'] = min_monthly_budget_units unless min_monthly_budget_units.nil?
  command.query['minMonthlyBudget.nanos'] = min_monthly_budget_nanos unless min_monthly_budget_nanos.nil?
  command.query['maxMonthlyBudget.currencyCode'] = max_monthly_budget_currency_code unless max_monthly_budget_currency_code.nil?
  command.query['maxMonthlyBudget.units'] = max_monthly_budget_units unless max_monthly_budget_units.nil?
  command.query['maxMonthlyBudget.nanos'] = max_monthly_budget_nanos unless max_monthly_budget_nanos.nil?
  command.query['industries'] = industries unless industries.nil?
  command.query['services'] = services unless services.nil?
  command.query['languageCodes'] = language_codes unless language_codes.nil?
  command.query['address'] = address unless address.nil?
  command.query['orderBy'] = order_by unless order_by.nil?
  command.query['gpsMotivations'] = gps_motivations unless gps_motivations.nil?
  command.query['websiteUrl'] = website_url unless website_url.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_user_states(request_metadata_user_overrides_ip_address: nil, request_metadata_user_overrides_user_id: nil, request_metadata_locale: nil, request_metadata_partners_session_id: nil, request_metadata_experiment_ids: nil, request_metadata_traffic_source_traffic_source_id: nil, request_metadata_traffic_source_traffic_sub_id: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PartnersV2::ListUserStatesResponse

Lists states for current user.

Parameters:

  • request_metadata_user_overrides_ip_address (String)

    IP address to use instead of the user's geo-located IP address.

  • request_metadata_user_overrides_user_id (String)

    Logged-in user ID to impersonate instead of the user's ID.

  • request_metadata_locale (String)

    Locale to use for the current request.

  • request_metadata_partners_session_id (String)

    Google Partners session ID.

  • request_metadata_experiment_ids (Array<String>, String)

    Experiment IDs the current request belongs to.

  • request_metadata_traffic_source_traffic_source_id (String)

    Identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us.

  • request_metadata_traffic_source_traffic_sub_id (String)

    Second level identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us.

  • fields (String)

    Selector specifying which fields to include in a partial response.

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# File 'generated/google/apis/partners_v2/service.rb', line 147

def list_user_states(request_metadata_user_overrides_ip_address: nil, request_metadata_user_overrides_user_id: nil, request_metadata_locale: nil, request_metadata_partners_session_id: nil, request_metadata_experiment_ids: nil, request_metadata_traffic_source_traffic_source_id: nil, request_metadata_traffic_source_traffic_sub_id: nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:get, 'v2/userStates', options)
  command.response_representation = Google::Apis::PartnersV2::ListUserStatesResponse::Representation
  command.response_class = Google::Apis::PartnersV2::ListUserStatesResponse
  command.query['requestMetadata.userOverrides.ipAddress'] =  unless .nil?
  command.query['requestMetadata.userOverrides.userId'] =  unless .nil?
  command.query['requestMetadata.locale'] =  unless .nil?
  command.query['requestMetadata.partnersSessionId'] =  unless .nil?
  command.query['requestMetadata.experimentIds'] =  unless .nil?
  command.query['requestMetadata.trafficSource.trafficSourceId'] =  unless .nil?
  command.query['requestMetadata.trafficSource.trafficSubId'] =  unless .nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#log_client_message_message(log_message_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PartnersV2::LogMessageResponse

Logs a generic message from the client, such as Failed to render component, Profile page is running slow, More than 500 users have accessed this result. , etc.

Parameters:

  • log_message_request_object (Google::Apis::PartnersV2::LogMessageRequest) (defaults to: nil)
  • fields (String)

    Selector specifying which fields to include in a partial response.

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



101
102
103
104
105
106
107
108
109
110
# File 'generated/google/apis/partners_v2/service.rb', line 101

def log_client_message_message(log_message_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:post, 'v2/clientMessages:log', options)
  command.request_representation = Google::Apis::PartnersV2::LogMessageRequest::Representation
  command.request_object = log_message_request_object
  command.response_representation = Google::Apis::PartnersV2::LogMessageResponse::Representation
  command.response_class = Google::Apis::PartnersV2::LogMessageResponse
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#log_user_event(log_user_event_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PartnersV2::LogUserEventResponse

Logs a user event.

Parameters:

  • log_user_event_request_object (Google::Apis::PartnersV2::LogUserEventRequest) (defaults to: nil)
  • fields (String)

    Selector specifying which fields to include in a partial response.

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

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



69
70
71
72
73
74
75
76
77
78
# File 'generated/google/apis/partners_v2/service.rb', line 69

def log_user_event(log_user_event_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:post, 'v2/userEvents:log', options)
  command.request_representation = Google::Apis::PartnersV2::LogUserEventRequest::Representation
  command.request_object = log_user_event_request_object
  command.response_representation = Google::Apis::PartnersV2::LogUserEventResponse::Representation
  command.response_class = Google::Apis::PartnersV2::LogUserEventResponse
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end