Class: Google::Apis::MerchantapiLfpV1beta::MerchantService

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

Overview

Merchant API

Programmatically manage your Merchant Center Accounts.

Examples:

require 'google/apis/merchantapi_lfp_v1beta'

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

def initialize
  super(DEFAULT_ENDPOINT_TEMPLATE, '',
        client_name: 'google-apis-merchantapi_lfp_v1beta',
        client_version: Google::Apis::MerchantapiLfpV1beta::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_lfp_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_lfp_v1beta/service.rb', line 45

def quota_user
  @quota_user
end

Instance Method Details

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

Deletes a store for a target merchant.

Parameters:

  • name (String)

    Required. The name of the store to delete for the target merchant account. Format: accounts/account/lfpStores/target_merchant~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



143
144
145
146
147
148
149
150
151
# File 'lib/google/apis/merchantapi_lfp_v1beta/service.rb', line 143

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

Retrieves information about a store.

Parameters:

  • name (String)

    Required. The name of the store to retrieve. Format: accounts/account/ lfpStores/target_merchant~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



174
175
176
177
178
179
180
181
182
# File 'lib/google/apis/merchantapi_lfp_v1beta/service.rb', line 174

def (name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'lfp/v1beta/{+name}', options)
  command.response_representation = Google::Apis::MerchantapiLfpV1beta::LfpStore::Representation
  command.response_class = Google::Apis::MerchantapiLfpV1beta::LfpStore
  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_lfp_inventory(parent, lfp_inventory_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MerchantapiLfpV1beta::LfpInventory

Inserts a LfpInventory resource for the given target merchant account. If the resource already exists, it will be replaced. The inventory automatically expires after 30 days.

Parameters:

  • parent (String)

    Required. The LFP provider account. Format: accounts/account``

  • lfp_inventory_object (Google::Apis::MerchantapiLfpV1beta::LfpInventory) (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



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

def (parent, lfp_inventory_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'lfp/v1beta/{+parent}/lfpInventories:insert', options)
  command.request_representation = Google::Apis::MerchantapiLfpV1beta::LfpInventory::Representation
  command.request_object = lfp_inventory_object
  command.response_representation = Google::Apis::MerchantapiLfpV1beta::LfpInventory::Representation
  command.response_class = Google::Apis::MerchantapiLfpV1beta::LfpInventory
  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_lfp_sale(parent, lfp_sale_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MerchantapiLfpV1beta::LfpSale

Inserts a LfpSale for the given merchant.

Parameters:

  • parent (String)

    Required. The LFP provider account. Format: accounts/lfp_partner``

  • lfp_sale_object (Google::Apis::MerchantapiLfpV1beta::LfpSale) (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



110
111
112
113
114
115
116
117
118
119
120
# File 'lib/google/apis/merchantapi_lfp_v1beta/service.rb', line 110

def (parent, lfp_sale_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'lfp/v1beta/{+parent}/lfpSales:insert', options)
  command.request_representation = Google::Apis::MerchantapiLfpV1beta::LfpSale::Representation
  command.request_object = lfp_sale_object
  command.response_representation = Google::Apis::MerchantapiLfpV1beta::LfpSale::Representation
  command.response_class = Google::Apis::MerchantapiLfpV1beta::LfpSale
  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_lfp_store(parent, lfp_store_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MerchantapiLfpV1beta::LfpStore

Inserts a store for the target merchant. If the store with the same store code already exists, it will be replaced.

Parameters:

  • parent (String)

    Required. The LFP provider account Format: accounts/account``

  • lfp_store_object (Google::Apis::MerchantapiLfpV1beta::LfpStore) (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



206
207
208
209
210
211
212
213
214
215
216
# File 'lib/google/apis/merchantapi_lfp_v1beta/service.rb', line 206

def (parent, lfp_store_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'lfp/v1beta/{+parent}/lfpStores:insert', options)
  command.request_representation = Google::Apis::MerchantapiLfpV1beta::LfpStore::Representation
  command.request_object = lfp_store_object
  command.response_representation = Google::Apis::MerchantapiLfpV1beta::LfpStore::Representation
  command.response_class = Google::Apis::MerchantapiLfpV1beta::LfpStore
  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_lfp_stores(parent, page_size: nil, page_token: nil, target_account: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MerchantapiLfpV1beta::ListLfpStoresResponse

Lists the stores of the target merchant, specified by the filter in ListLfpStoresRequest.

Parameters:

  • parent (String)

    Required. The LFP partner. Format: accounts/account``

  • page_size (Fixnum) (defaults to: nil)

    Optional. The maximum number of LfpStore resources for the given account to return. The service returns fewer than this value if the number of stores for the given account is less than the pageSize. The default value is 250. The maximum value is 1000; If a value higher than the maximum is specified, then the pageSize will default to the maximum.

  • page_token (String) (defaults to: nil)

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

  • target_account (Fixnum) (defaults to: nil)

    Required. The Merchant Center id of the merchant to list stores for.

  • 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



253
254
255
256
257
258
259
260
261
262
263
264
# File 'lib/google/apis/merchantapi_lfp_v1beta/service.rb', line 253

def (parent, page_size: nil, page_token: nil, target_account: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'lfp/v1beta/{+parent}/lfpStores', options)
  command.response_representation = Google::Apis::MerchantapiLfpV1beta::ListLfpStoresResponse::Representation
  command.response_class = Google::Apis::MerchantapiLfpV1beta::ListLfpStoresResponse
  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['targetAccount'] =  unless .nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end