Class: Google::Apis::MerchantapiInventoriesV1beta::MerchantService

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

Overview

Merchant API

Programmatically manage your Merchant Center Accounts.

Examples:

require 'google/apis/merchantapi_inventories_v1beta'

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

def initialize
  super(DEFAULT_ENDPOINT_TEMPLATE, '',
        client_name: 'google-apis-merchantapi_inventories_v1beta',
        client_version: Google::Apis::MerchantapiInventoriesV1beta::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_inventories_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_inventories_v1beta/service.rb', line 45

def quota_user
  @quota_user
end

Instance Method Details

#delete_account_product_local_inventory(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MerchantapiInventoriesV1beta::Empty

Deletes the specified LocalInventory from the given product in your merchant account. It might take a up to an hour for the LocalInventory to be deleted from the specific product. Once you have received a successful delete response, wait for that period before attempting a delete again.

Parameters:

  • name (String)

    Required. The name of the local inventory for the given product to delete. Format: accounts/account/products/product/localInventories/store_code``

  • 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



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

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

#delete_account_product_regional_inventory(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MerchantapiInventoriesV1beta::Empty

Deletes the specified RegionalInventory resource from the given product in your merchant account. It might take up to an hour for the RegionalInventory to be deleted from the specific product. Once you have received a successful delete response, wait for that period before attempting a delete again.

Parameters:

  • name (String)

    Required. The name of the RegionalInventory resource to delete. Format: accounts/account/products/product/regionalInventories/region``

  • 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



198
199
200
201
202
203
204
205
206
# File 'lib/google/apis/merchantapi_inventories_v1beta/service.rb', line 198

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

#insert_account_product_local_inventory(parent, local_inventory_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MerchantapiInventoriesV1beta::LocalInventory

Inserts a LocalInventory resource to a product in your merchant account. Replaces the full LocalInventory resource if an entry with the same storeCode already exists for the product. It might take up to 30 minutes for the new or updated LocalInventory resource to appear in products.

Parameters:

  • parent (String)

    Required. The account and product where this inventory will be inserted. Format: accounts/account/products/product``

  • local_inventory_object (Google::Apis::MerchantapiInventoriesV1beta::LocalInventory) (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



113
114
115
116
117
118
119
120
121
122
123
# File 'lib/google/apis/merchantapi_inventories_v1beta/service.rb', line 113

def (parent, local_inventory_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'inventories/v1beta/{+parent}/localInventories:insert', options)
  command.request_representation = Google::Apis::MerchantapiInventoriesV1beta::LocalInventory::Representation
  command.request_object = local_inventory_object
  command.response_representation = Google::Apis::MerchantapiInventoriesV1beta::LocalInventory::Representation
  command.response_class = Google::Apis::MerchantapiInventoriesV1beta::LocalInventory
  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

#insert_account_product_regional_inventory(parent, regional_inventory_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MerchantapiInventoriesV1beta::RegionalInventory

Inserts a RegionalInventory to a given product in your merchant account. Replaces the full RegionalInventory resource if an entry with the same region already exists for the product. It might take up to 30 minutes for the new or updated RegionalInventory resource to appear in products.

Parameters:

  • parent (String)

    Required. The account and product where this inventory will be inserted. Format: accounts/account/products/product``

  • regional_inventory_object (Google::Apis::MerchantapiInventoriesV1beta::RegionalInventory) (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



233
234
235
236
237
238
239
240
241
242
243
# File 'lib/google/apis/merchantapi_inventories_v1beta/service.rb', line 233

def (parent, regional_inventory_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'inventories/v1beta/{+parent}/regionalInventories:insert', options)
  command.request_representation = Google::Apis::MerchantapiInventoriesV1beta::RegionalInventory::Representation
  command.request_object = regional_inventory_object
  command.response_representation = Google::Apis::MerchantapiInventoriesV1beta::RegionalInventory::Representation
  command.response_class = Google::Apis::MerchantapiInventoriesV1beta::RegionalInventory
  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

#list_account_product_local_inventories(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MerchantapiInventoriesV1beta::ListLocalInventoriesResponse

Lists the LocalInventory resources for the given product in your merchant account. The response might contain fewer items than specified by pageSize. If pageToken was returned in previous request, it can be used to obtain additional results. LocalInventory resources are listed per product for a given account.

Parameters:

  • parent (String)

    Required. The name of the parent product to list local inventories for. Format: accounts/account/products/product``

  • page_size (Fixnum) (defaults to: nil)

    The maximum number of LocalInventory resources for the given product to return. The service returns fewer than this value if the number of inventories for the given product is less that than the pageSize. The default value is

    1. The maximum value is 25000; If a value higher than the maximum is specified, then the pageSize will default to the maximum
  • page_token (String) (defaults to: nil)

    A page token, received from a previous ListLocalInventories call. Provide the page token to retrieve the subsequent page. When paginating, all other parameters provided to ListLocalInventories must match the call that provided the page token. The token returned as nextPageToken in the response to the previous request.

  • 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



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

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

#list_account_product_regional_inventories(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MerchantapiInventoriesV1beta::ListRegionalInventoriesResponse

Lists the RegionalInventory resources for the given product in your merchant account. The response might contain fewer items than specified by pageSize. If pageToken was returned in previous request, it can be used to obtain additional results. RegionalInventory resources are listed per product for a given account.

Parameters:

  • parent (String)

    Required. The name of the parent product to list RegionalInventory resources for. Format: accounts/account/products/product``

  • page_size (Fixnum) (defaults to: nil)

    The maximum number of RegionalInventory resources for the given product to return. The service returns fewer than this value if the number of inventories for the given product is less that than the pageSize. The default value is

    1. The maximum value is 100000; If a value higher than the maximum is specified, then the pageSize will default to the maximum.
  • page_token (String) (defaults to: nil)

    A page token, received from a previous ListRegionalInventories call. Provide the page token to retrieve the subsequent page. When paginating, all other parameters provided to ListRegionalInventories must match the call that provided the page token. The token returned as nextPageToken in the response to the previous request.

  • 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



282
283
284
285
286
287
288
289
290
291
292
# File 'lib/google/apis/merchantapi_inventories_v1beta/service.rb', line 282

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