Class: Google::Apis::MerchantapiProductsV1beta::MerchantService
- Inherits:
-
Core::BaseService
- Object
- Core::BaseService
- Google::Apis::MerchantapiProductsV1beta::MerchantService
- Defined in:
- lib/google/apis/merchantapi_products_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_input(name, data_source: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MerchantapiProductsV1beta::Empty
Deletes a product input from your Merchant Center account.
-
#get_account_product(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MerchantapiProductsV1beta::Product
Retrieves the processed product from your Merchant Center account.
-
#initialize ⇒ MerchantService
constructor
A new instance of MerchantService.
-
#insert_account_product_input(parent, product_input_object = nil, data_source: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MerchantapiProductsV1beta::ProductInput
Uploads a product input to your Merchant Center account.
-
#list_account_products(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MerchantapiProductsV1beta::ListProductsResponse
Lists the processed products in your Merchant Center account.
Constructor Details
#initialize ⇒ MerchantService
Returns a new instance of MerchantService.
47 48 49 50 51 52 |
# File 'lib/google/apis/merchantapi_products_v1beta/service.rb', line 47 def initialize super(DEFAULT_ENDPOINT_TEMPLATE, '', client_name: 'google-apis-merchantapi_products_v1beta', client_version: Google::Apis::MerchantapiProductsV1beta::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_products_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_products_v1beta/service.rb', line 45 def quota_user @quota_user end |
Instance Method Details
#delete_account_product_input(name, data_source: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MerchantapiProductsV1beta::Empty
Deletes a product input from your Merchant Center account. After inserting, updating, or deleting a product input, it may take several minutes before the processed product can be retrieved.
80 81 82 83 84 85 86 87 88 89 |
# File 'lib/google/apis/merchantapi_products_v1beta/service.rb', line 80 def delete_account_product_input(name, data_source: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:delete, 'products/v1beta/{+name}', ) command.response_representation = Google::Apis::MerchantapiProductsV1beta::Empty::Representation command.response_class = Google::Apis::MerchantapiProductsV1beta::Empty command.params['name'] = name unless name.nil? command.query['dataSource'] = data_source unless data_source.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_product(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MerchantapiProductsV1beta::Product
Retrieves the processed product from your Merchant Center account. After inserting, updating, or deleting a product input, it may take several minutes before the updated final product can be retrieved.
157 158 159 160 161 162 163 164 165 |
# File 'lib/google/apis/merchantapi_products_v1beta/service.rb', line 157 def get_account_product(name, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'products/v1beta/{+name}', ) command.response_representation = Google::Apis::MerchantapiProductsV1beta::Product::Representation command.response_class = Google::Apis::MerchantapiProductsV1beta::Product 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_input(parent, product_input_object = nil, data_source: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MerchantapiProductsV1beta::ProductInput
Uploads a product input to your Merchant Center account. If an input with the same contentLanguage, offerId, and dataSource already exists, this method replaces that entry. After inserting, updating, or deleting a product input, it may take several minutes before the processed product can be retrieved.
121 122 123 124 125 126 127 128 129 130 131 132 |
# File 'lib/google/apis/merchantapi_products_v1beta/service.rb', line 121 def insert_account_product_input(parent, product_input_object = nil, data_source: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'products/v1beta/{+parent}/productInputs:insert', ) command.request_representation = Google::Apis::MerchantapiProductsV1beta::ProductInput::Representation command.request_object = product_input_object command.response_representation = Google::Apis::MerchantapiProductsV1beta::ProductInput::Representation command.response_class = Google::Apis::MerchantapiProductsV1beta::ProductInput command.params['parent'] = parent unless parent.nil? command.query['dataSource'] = data_source unless data_source.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_products(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MerchantapiProductsV1beta::ListProductsResponse
Lists the processed products in your Merchant Center account. The response might contain fewer items than specified by pageSize. Rely on pageToken to determine if there are more items to be requested. After inserting, updating, or deleting a product input, it may take several minutes before the updated processed product can be retrieved.
200 201 202 203 204 205 206 207 208 209 210 |
# File 'lib/google/apis/merchantapi_products_v1beta/service.rb', line 200 def list_account_products(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'products/v1beta/{+parent}/products', ) command.response_representation = Google::Apis::MerchantapiProductsV1beta::ListProductsResponse::Representation command.response_class = Google::Apis::MerchantapiProductsV1beta::ListProductsResponse 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 |