Class: Google::Apis::MerchantapiInventoriesV1beta::MerchantService
- Inherits:
-
Core::BaseService
- Object
- Core::BaseService
- Google::Apis::MerchantapiInventoriesV1beta::MerchantService
- Defined in:
- lib/google/apis/merchantapi_inventories_v1beta/service.rb
Overview
Merchant API
Programmatically manage your Merchant Center Accounts.
Constant Summary collapse
- DEFAULT_ENDPOINT_TEMPLATE =
"https://merchantapi.$UNIVERSE_DOMAIN$/"
Instance Attribute Summary collapse
-
#key ⇒ String
API key.
-
#quota_user ⇒ String
Available to use for quota purposes for server-side applications.
Instance Method Summary collapse
-
#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. -
#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. -
#initialize ⇒ MerchantService
constructor
A new instance of MerchantService.
-
#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. -
#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. -
#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. -
#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.
Constructor Details
#initialize ⇒ MerchantService
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
#key ⇒ String
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.
40 41 42 |
# File 'lib/google/apis/merchantapi_inventories_v1beta/service.rb', line 40 def key @key end |
#quota_user ⇒ String
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.
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.
78 79 80 81 82 83 84 85 86 |
# File 'lib/google/apis/merchantapi_inventories_v1beta/service.rb', line 78 def delete_account_product_local_inventory(name, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:delete, 'inventories/v1beta/{+name}', ) 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.
198 199 200 201 202 203 204 205 206 |
# File 'lib/google/apis/merchantapi_inventories_v1beta/service.rb', line 198 def delete_account_product_regional_inventory(name, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:delete, 'inventories/v1beta/{+name}', ) 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.
113 114 115 116 117 118 119 120 121 122 123 |
# File 'lib/google/apis/merchantapi_inventories_v1beta/service.rb', line 113 def insert_account_product_local_inventory(parent, local_inventory_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'inventories/v1beta/{+parent}/localInventories:insert', ) 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.
233 234 235 236 237 238 239 240 241 242 243 |
# File 'lib/google/apis/merchantapi_inventories_v1beta/service.rb', line 233 def insert_account_product_regional_inventory(parent, regional_inventory_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'inventories/v1beta/{+parent}/regionalInventories:insert', ) 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.
162 163 164 165 166 167 168 169 170 171 172 |
# File 'lib/google/apis/merchantapi_inventories_v1beta/service.rb', line 162 def list_account_product_local_inventories(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'inventories/v1beta/{+parent}/localInventories', ) 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.
282 283 284 285 286 287 288 289 290 291 292 |
# File 'lib/google/apis/merchantapi_inventories_v1beta/service.rb', line 282 def list_account_product_regional_inventories(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'inventories/v1beta/{+parent}/regionalInventories', ) 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 |