Class: Google::Apis::MerchantapiConversionsV1beta::MerchantService

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

Overview

Merchant API

Programmatically manage your Merchant Center Accounts.

Examples:

require 'google/apis/merchantapi_conversions_v1beta'

Merchantapi = Google::Apis::MerchantapiConversionsV1beta # Alias the module
service = Merchantapi::MerchantService.new

See Also:

Constant Summary collapse

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeMerchantService

Returns a new instance of MerchantService.



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

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

Instance Attribute Details

#keyString

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

Returns:

  • (String)

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



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

def key
  @key
end

#quota_userString

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

Returns:

  • (String)

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



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

def quota_user
  @quota_user
end

Instance Method Details

#create_account_conversion_source(parent, conversion_source_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MerchantapiConversionsV1beta::ConversionSource

Creates a new conversion source.

Parameters:

  • parent (String)

    Required. The merchant account that will own the new conversion source. Format: accounts/account

  • conversion_source_object (Google::Apis::MerchantapiConversionsV1beta::ConversionSource) (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



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

def (parent, conversion_source_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'conversions/v1beta/{+parent}/conversionSources', options)
  command.request_representation = Google::Apis::MerchantapiConversionsV1beta::ConversionSource::Representation
  command.request_object = conversion_source_object
  command.response_representation = Google::Apis::MerchantapiConversionsV1beta::ConversionSource::Representation
  command.response_class = Google::Apis::MerchantapiConversionsV1beta::ConversionSource
  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_conversion_source(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MerchantapiConversionsV1beta::Empty

Archives an existing conversion source. If the conversion source is a Merchant Center Destination, it will be recoverable for 30 days. If the conversion source is a Google Analytics Link, it will be deleted immediately and can be restored by creating a new one.

Parameters:

  • name (String)

    Required. The name of the conversion source to be deleted. Format: accounts/ account/conversionSources/conversion_source

  • 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



112
113
114
115
116
117
118
119
120
# File 'lib/google/apis/merchantapi_conversions_v1beta/service.rb', line 112

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

#get_account_conversion_source(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MerchantapiConversionsV1beta::ConversionSource

Fetches a conversion source.

Parameters:

  • name (String)

    Required. The name of the conversion source to be fetched. Format: accounts/ account/conversionsources/conversion_source

  • 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



143
144
145
146
147
148
149
150
151
# File 'lib/google/apis/merchantapi_conversions_v1beta/service.rb', line 143

def (name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'conversions/v1beta/{+name}', options)
  command.response_representation = Google::Apis::MerchantapiConversionsV1beta::ConversionSource::Representation
  command.response_class = Google::Apis::MerchantapiConversionsV1beta::ConversionSource
  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_conversion_sources(parent, page_size: nil, page_token: nil, show_deleted: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MerchantapiConversionsV1beta::ListConversionSourcesResponse

Retrieves the list of conversion sources the caller has access to.

Parameters:

  • parent (String)

    Required. The merchant account who owns the collection of conversion sources. Format: accounts/account

  • page_size (Fixnum) (defaults to: nil)

    Optional. The maximum number of conversion sources to return in a page. If no page_size is specified, 100 is used as the default value. The maximum value is 200. Values above 200 will be coerced to 200. Regardless of pagination, at most 200 conversion sources are returned in total.

  • page_token (String) (defaults to: nil)

    Optional. Page token.

  • show_deleted (Boolean) (defaults to: nil)

    Optional. Show deleted (archived) option.

  • 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



183
184
185
186
187
188
189
190
191
192
193
194
# File 'lib/google/apis/merchantapi_conversions_v1beta/service.rb', line 183

def (parent, page_size: nil, page_token: nil, show_deleted: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'conversions/v1beta/{+parent}/conversionSources', options)
  command.response_representation = Google::Apis::MerchantapiConversionsV1beta::ListConversionSourcesResponse::Representation
  command.response_class = Google::Apis::MerchantapiConversionsV1beta::ListConversionSourcesResponse
  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['showDeleted'] = show_deleted unless show_deleted.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_conversion_source(name, conversion_source_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MerchantapiConversionsV1beta::ConversionSource

Updates information of an existing conversion source. Available only for Merchant Center Destination conversion sources.

Parameters:

  • name (String)

    Output only. Identifier. Generated by the Content API upon creation of a new ConversionSource. Format: [a-z]4:.+ The four characters before the colon represent the type of conversio source. Content after the colon represents the ID of the conversion source within that type. The ID of two different conversion sources might be the same across different types. The following type prefixes are supported: - galk: For GoogleAnalyticsLink sources. - mcdn: For MerchantCenterDestination sources.

  • conversion_source_object (Google::Apis::MerchantapiConversionsV1beta::ConversionSource) (defaults to: nil)
  • update_mask (String) (defaults to: nil)

    Required. List of fields being updated.

  • 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



226
227
228
229
230
231
232
233
234
235
236
237
# File 'lib/google/apis/merchantapi_conversions_v1beta/service.rb', line 226

def (name, conversion_source_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:patch, 'conversions/v1beta/{+name}', options)
  command.request_representation = Google::Apis::MerchantapiConversionsV1beta::ConversionSource::Representation
  command.request_object = conversion_source_object
  command.response_representation = Google::Apis::MerchantapiConversionsV1beta::ConversionSource::Representation
  command.response_class = Google::Apis::MerchantapiConversionsV1beta::ConversionSource
  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

#undelete_conversion_source(name, undelete_conversion_source_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MerchantapiConversionsV1beta::ConversionSource

Re-enables an archived conversion source. Only Available for Merchant Center Destination conversion sources.

Parameters:

  • name (String)

    Required. The name of the conversion source to be undeleted. Format: accounts/ account/conversionSources/conversion_source

  • undelete_conversion_source_request_object (Google::Apis::MerchantapiConversionsV1beta::UndeleteConversionSourceRequest) (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



262
263
264
265
266
267
268
269
270
271
272
# File 'lib/google/apis/merchantapi_conversions_v1beta/service.rb', line 262

def undelete_conversion_source(name, undelete_conversion_source_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'conversions/v1beta/{+name}:undelete', options)
  command.request_representation = Google::Apis::MerchantapiConversionsV1beta::UndeleteConversionSourceRequest::Representation
  command.request_object = undelete_conversion_source_request_object
  command.response_representation = Google::Apis::MerchantapiConversionsV1beta::ConversionSource::Representation
  command.response_class = Google::Apis::MerchantapiConversionsV1beta::ConversionSource
  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