Class: Google::Apis::MerchantapiDatasourcesV1beta::MerchantService

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

Overview

Merchant API

Programmatically manage your Merchant Center Accounts.

Examples:

require 'google/apis/merchantapi_datasources_v1beta'

Merchantapi = Google::Apis::MerchantapiDatasourcesV1beta # 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_datasources_v1beta/service.rb', line 47

def initialize
  super(DEFAULT_ENDPOINT_TEMPLATE, '',
        client_name: 'google-apis-merchantapi_datasources_v1beta',
        client_version: Google::Apis::MerchantapiDatasourcesV1beta::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_datasources_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_datasources_v1beta/service.rb', line 45

def quota_user
  @quota_user
end

Instance Method Details

#create_account_data_source(parent, data_source_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MerchantapiDatasourcesV1beta::DataSource

Creates the new data source configuration for the given account.

Parameters:

  • parent (String)

    Required. The account where this data source will be created. Format: accounts/account``

  • data_source_object (Google::Apis::MerchantapiDatasourcesV1beta::DataSource) (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_datasources_v1beta/service.rb', line 76

def (parent, data_source_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'datasources/v1beta/{+parent}/dataSources', options)
  command.request_representation = Google::Apis::MerchantapiDatasourcesV1beta::DataSource::Representation
  command.request_object = data_source_object
  command.response_representation = Google::Apis::MerchantapiDatasourcesV1beta::DataSource::Representation
  command.response_class = Google::Apis::MerchantapiDatasourcesV1beta::DataSource
  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_data_source(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MerchantapiDatasourcesV1beta::Empty

Deletes a data source from your Merchant Center account.

Parameters:

  • name (String)

    Required. The name of the data source to delete. Format: accounts/account/ dataSources/datasource``

  • 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



109
110
111
112
113
114
115
116
117
# File 'lib/google/apis/merchantapi_datasources_v1beta/service.rb', line 109

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

#fetch_data_source(name, fetch_data_source_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MerchantapiDatasourcesV1beta::Empty

Performs the data fetch immediately (even outside fetch schedule) on a data source from your Merchant Center Account. If you need to call this method more than once per day, you should use the Products service to update your product data instead. This method only works on data sources with a file input set.

Parameters:

  • name (String)

    Required. The name of the data source resource to fetch. Format: accounts/ account/dataSources/datasource``

  • fetch_data_source_request_object (Google::Apis::MerchantapiDatasourcesV1beta::FetchDataSourceRequest) (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



144
145
146
147
148
149
150
151
152
153
154
# File 'lib/google/apis/merchantapi_datasources_v1beta/service.rb', line 144

def fetch_data_source(name, fetch_data_source_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'datasources/v1beta/{+name}:fetch', options)
  command.request_representation = Google::Apis::MerchantapiDatasourcesV1beta::FetchDataSourceRequest::Representation
  command.request_object = fetch_data_source_request_object
  command.response_representation = Google::Apis::MerchantapiDatasourcesV1beta::Empty::Representation
  command.response_class = Google::Apis::MerchantapiDatasourcesV1beta::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_data_source(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MerchantapiDatasourcesV1beta::DataSource

Retrieves the data source configuration for the given account.

Parameters:

  • name (String)

    Required. The name of the data source to retrieve. Format: accounts/account/ dataSources/datasource``

  • 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



177
178
179
180
181
182
183
184
185
# File 'lib/google/apis/merchantapi_datasources_v1beta/service.rb', line 177

def (name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'datasources/v1beta/{+name}', options)
  command.response_representation = Google::Apis::MerchantapiDatasourcesV1beta::DataSource::Representation
  command.response_class = Google::Apis::MerchantapiDatasourcesV1beta::DataSource
  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_data_sources(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MerchantapiDatasourcesV1beta::ListDataSourcesResponse

Lists the configurations for data sources for the given account.

Parameters:

  • parent (String)

    Required. The account to list data sources for. Format: accounts/account``

  • page_size (Fixnum) (defaults to: nil)

    Optional. The maximum number of data sources to return. The service may return fewer than this value. The maximum value is 1000; values above 1000 will be coerced to 1000. If unspecified, the maximum number of data sources will be returned.

  • page_token (String) (defaults to: nil)

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



217
218
219
220
221
222
223
224
225
226
227
# File 'lib/google/apis/merchantapi_datasources_v1beta/service.rb', line 217

def (parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'datasources/v1beta/{+parent}/dataSources', options)
  command.response_representation = Google::Apis::MerchantapiDatasourcesV1beta::ListDataSourcesResponse::Representation
  command.response_class = Google::Apis::MerchantapiDatasourcesV1beta::ListDataSourcesResponse
  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

#patch_account_data_source(name, data_source_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MerchantapiDatasourcesV1beta::DataSource

Updates the existing data source configuration. The fields that are set in the update mask but not provided in the resource will be deleted.

Parameters:

  • name (String)

    Identifier. The name of the data source. Format: datasource.name=accounts/` account`/dataSources/`datasource`

  • data_source_object (Google::Apis::MerchantapiDatasourcesV1beta::DataSource) (defaults to: nil)
  • update_mask (String) (defaults to: nil)

    Required. The list of data source fields to be updated. Fields specified in the update mask without a value specified in the body will be deleted from the data source. Providing special "*" value for full data source replacement is not supported.

  • 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



257
258
259
260
261
262
263
264
265
266
267
268
# File 'lib/google/apis/merchantapi_datasources_v1beta/service.rb', line 257

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