Class: Google::Apis::MerchantapiDatasourcesV1beta::MerchantService
- Inherits:
-
Core::BaseService
- Object
- Core::BaseService
- Google::Apis::MerchantapiDatasourcesV1beta::MerchantService
- Defined in:
- lib/google/apis/merchantapi_datasources_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
-
#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.
-
#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.
-
#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.
-
#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.
-
#get_account_data_source_file_upload(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MerchantapiDatasourcesV1beta::FileUpload
Gets the latest data source file upload.
-
#initialize ⇒ MerchantService
constructor
A new instance of MerchantService.
-
#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.
-
#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.
Constructor Details
#initialize ⇒ MerchantService
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
#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_datasources_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_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.
76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/google/apis/merchantapi_datasources_v1beta/service.rb', line 76 def create_account_data_source(parent, data_source_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'datasources/v1beta/{+parent}/dataSources', ) 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.
109 110 111 112 113 114 115 116 117 |
# File 'lib/google/apis/merchantapi_datasources_v1beta/service.rb', line 109 def delete_account_data_source(name, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:delete, 'datasources/v1beta/{+name}', ) 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.
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', ) 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.
177 178 179 180 181 182 183 184 185 |
# File 'lib/google/apis/merchantapi_datasources_v1beta/service.rb', line 177 def get_account_data_source(name, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'datasources/v1beta/{+name}', ) 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 |
#get_account_data_source_file_upload(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MerchantapiDatasourcesV1beta::FileUpload
Gets the latest data source file upload. Only the latest
alias is accepted
for a file upload.
292 293 294 295 296 297 298 299 300 |
# File 'lib/google/apis/merchantapi_datasources_v1beta/service.rb', line 292 def get_account_data_source_file_upload(name, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'datasources/v1beta/{+name}', ) command.response_representation = Google::Apis::MerchantapiDatasourcesV1beta::FileUpload::Representation command.response_class = Google::Apis::MerchantapiDatasourcesV1beta::FileUpload 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.
217 218 219 220 221 222 223 224 225 226 227 |
# File 'lib/google/apis/merchantapi_datasources_v1beta/service.rb', line 217 def list_account_data_sources(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'datasources/v1beta/{+parent}/dataSources', ) 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.
257 258 259 260 261 262 263 264 265 266 267 268 |
# File 'lib/google/apis/merchantapi_datasources_v1beta/service.rb', line 257 def patch_account_data_source(name, data_source_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:patch, 'datasources/v1beta/{+name}', ) 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 |