Module: Google::Shopping::Merchant::Lfp

Defined in:
lib/google/shopping/merchant/lfp.rb,
lib/google/shopping/merchant/lfp/version.rb

Constant Summary collapse

VERSION =
"0.3.2"

Class Method Summary collapse

Class Method Details

.lfp_inventory_service(version: :v1beta, transport: :grpc, &block) ⇒ ::Object

Create a new client object for LfpInventoryService.

By default, this returns an instance of Google::Shopping::Merchant::Lfp::V1beta::LfpInventoryService::Client for a gRPC client for version V1beta of the API. However, you can specify a different API version by passing it in the version parameter. If the LfpInventoryService service is supported by that API version, and the corresponding gem is available, the appropriate versioned client will be returned. You can also specify a different transport by passing :rest or :grpc in the transport parameter.

Raises an exception if the currently installed versioned client gem for the given API version does not support the given transport of the LfpInventoryService service. You can determine whether the method will succeed by calling lfp_inventory_service_available?.

About LfpInventoryService

Service for a LFP partner to submit local inventories for a merchant.

Parameters:

  • version (::String, ::Symbol) (defaults to: :v1beta)

    The API version to connect to. Optional. Defaults to :v1beta.

  • transport (:grpc, :rest) (defaults to: :grpc)

    The transport to use. Defaults to :grpc.

Returns:

  • (::Object)

    A client object for the specified version.



60
61
62
63
64
65
66
67
68
69
70
# File 'lib/google/shopping/merchant/lfp.rb', line 60

def self.lfp_inventory_service version: :v1beta, transport: :grpc, &block
  require "google/shopping/merchant/lfp/#{version.to_s.downcase}"

  package_name = Google::Shopping::Merchant::Lfp
                 .constants
                 .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
                 .first
  service_module = Google::Shopping::Merchant::Lfp.const_get(package_name).const_get(:LfpInventoryService)
  service_module = service_module.const_get(:Rest) if transport == :rest
  service_module.const_get(:Client).new(&block)
end

.lfp_inventory_service_available?(version: :v1beta, transport: :grpc) ⇒ boolean

Determines whether the LfpInventoryService service is supported by the current client. If true, you can retrieve a client object by calling lfp_inventory_service. If false, that method will raise an exception. This could happen if the given API version does not exist or does not support the LfpInventoryService service, or if the versioned client gem needs an update to support the LfpInventoryService service.

Parameters:

  • version (::String, ::Symbol) (defaults to: :v1beta)

    The API version to connect to. Optional. Defaults to :v1beta.

  • transport (:grpc, :rest) (defaults to: :grpc)

    The transport to use. Defaults to :grpc.

Returns:

  • (boolean)

    Whether the service is available.



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/google/shopping/merchant/lfp.rb', line 84

def self.lfp_inventory_service_available? version: :v1beta, transport: :grpc
  require "google/shopping/merchant/lfp/#{version.to_s.downcase}"
  package_name = Google::Shopping::Merchant::Lfp
                 .constants
                 .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
                 .first
  return false unless package_name
  service_module = Google::Shopping::Merchant::Lfp.const_get package_name
  return false unless service_module.const_defined? :LfpInventoryService
  service_module = service_module.const_get :LfpInventoryService
  if transport == :rest
    return false unless service_module.const_defined? :Rest
    service_module = service_module.const_get :Rest
  end
  service_module.const_defined? :Client
rescue ::LoadError
  false
end

.lfp_merchant_state_service(version: :v1beta, transport: :grpc, &block) ⇒ ::Object

Create a new client object for LfpMerchantStateService.

By default, this returns an instance of Google::Shopping::Merchant::Lfp::V1beta::LfpMerchantStateService::Client for a gRPC client for version V1beta of the API. However, you can specify a different API version by passing it in the version parameter. If the LfpMerchantStateService service is supported by that API version, and the corresponding gem is available, the appropriate versioned client will be returned. You can also specify a different transport by passing :rest or :grpc in the transport parameter.

Raises an exception if the currently installed versioned client gem for the given API version does not support the given transport of the LfpMerchantStateService service. You can determine whether the method will succeed by calling lfp_merchant_state_service_available?.

About LfpMerchantStateService

Service for a LFP partner to get the state of a merchant.

Parameters:

  • version (::String, ::Symbol) (defaults to: :v1beta)

    The API version to connect to. Optional. Defaults to :v1beta.

  • transport (:grpc, :rest) (defaults to: :grpc)

    The transport to use. Defaults to :grpc.

Returns:

  • (::Object)

    A client object for the specified version.



132
133
134
135
136
137
138
139
140
141
142
# File 'lib/google/shopping/merchant/lfp.rb', line 132

def self.lfp_merchant_state_service version: :v1beta, transport: :grpc, &block
  require "google/shopping/merchant/lfp/#{version.to_s.downcase}"

  package_name = Google::Shopping::Merchant::Lfp
                 .constants
                 .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
                 .first
  service_module = Google::Shopping::Merchant::Lfp.const_get(package_name).const_get(:LfpMerchantStateService)
  service_module = service_module.const_get(:Rest) if transport == :rest
  service_module.const_get(:Client).new(&block)
end

.lfp_merchant_state_service_available?(version: :v1beta, transport: :grpc) ⇒ boolean

Determines whether the LfpMerchantStateService service is supported by the current client. If true, you can retrieve a client object by calling lfp_merchant_state_service. If false, that method will raise an exception. This could happen if the given API version does not exist or does not support the LfpMerchantStateService service, or if the versioned client gem needs an update to support the LfpMerchantStateService service.

Parameters:

  • version (::String, ::Symbol) (defaults to: :v1beta)

    The API version to connect to. Optional. Defaults to :v1beta.

  • transport (:grpc, :rest) (defaults to: :grpc)

    The transport to use. Defaults to :grpc.

Returns:

  • (boolean)

    Whether the service is available.



156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# File 'lib/google/shopping/merchant/lfp.rb', line 156

def self.lfp_merchant_state_service_available? version: :v1beta, transport: :grpc
  require "google/shopping/merchant/lfp/#{version.to_s.downcase}"
  package_name = Google::Shopping::Merchant::Lfp
                 .constants
                 .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
                 .first
  return false unless package_name
  service_module = Google::Shopping::Merchant::Lfp.const_get package_name
  return false unless service_module.const_defined? :LfpMerchantStateService
  service_module = service_module.const_get :LfpMerchantStateService
  if transport == :rest
    return false unless service_module.const_defined? :Rest
    service_module = service_module.const_get :Rest
  end
  service_module.const_defined? :Client
rescue ::LoadError
  false
end

.lfp_sale_service(version: :v1beta, transport: :grpc, &block) ⇒ ::Object

Create a new client object for LfpSaleService.

By default, this returns an instance of Google::Shopping::Merchant::Lfp::V1beta::LfpSaleService::Client for a gRPC client for version V1beta of the API. However, you can specify a different API version by passing it in the version parameter. If the LfpSaleService service is supported by that API version, and the corresponding gem is available, the appropriate versioned client will be returned. You can also specify a different transport by passing :rest or :grpc in the transport parameter.

Raises an exception if the currently installed versioned client gem for the given API version does not support the given transport of the LfpSaleService service. You can determine whether the method will succeed by calling lfp_sale_service_available?.

About LfpSaleService

Service for a LFP partner to submit sales data for a merchant.

Parameters:

  • version (::String, ::Symbol) (defaults to: :v1beta)

    The API version to connect to. Optional. Defaults to :v1beta.

  • transport (:grpc, :rest) (defaults to: :grpc)

    The transport to use. Defaults to :grpc.

Returns:

  • (::Object)

    A client object for the specified version.



204
205
206
207
208
209
210
211
212
213
214
# File 'lib/google/shopping/merchant/lfp.rb', line 204

def self.lfp_sale_service version: :v1beta, transport: :grpc, &block
  require "google/shopping/merchant/lfp/#{version.to_s.downcase}"

  package_name = Google::Shopping::Merchant::Lfp
                 .constants
                 .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
                 .first
  service_module = Google::Shopping::Merchant::Lfp.const_get(package_name).const_get(:LfpSaleService)
  service_module = service_module.const_get(:Rest) if transport == :rest
  service_module.const_get(:Client).new(&block)
end

.lfp_sale_service_available?(version: :v1beta, transport: :grpc) ⇒ boolean

Determines whether the LfpSaleService service is supported by the current client. If true, you can retrieve a client object by calling lfp_sale_service. If false, that method will raise an exception. This could happen if the given API version does not exist or does not support the LfpSaleService service, or if the versioned client gem needs an update to support the LfpSaleService service.

Parameters:

  • version (::String, ::Symbol) (defaults to: :v1beta)

    The API version to connect to. Optional. Defaults to :v1beta.

  • transport (:grpc, :rest) (defaults to: :grpc)

    The transport to use. Defaults to :grpc.

Returns:

  • (boolean)

    Whether the service is available.



228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
# File 'lib/google/shopping/merchant/lfp.rb', line 228

def self.lfp_sale_service_available? version: :v1beta, transport: :grpc
  require "google/shopping/merchant/lfp/#{version.to_s.downcase}"
  package_name = Google::Shopping::Merchant::Lfp
                 .constants
                 .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
                 .first
  return false unless package_name
  service_module = Google::Shopping::Merchant::Lfp.const_get package_name
  return false unless service_module.const_defined? :LfpSaleService
  service_module = service_module.const_get :LfpSaleService
  if transport == :rest
    return false unless service_module.const_defined? :Rest
    service_module = service_module.const_get :Rest
  end
  service_module.const_defined? :Client
rescue ::LoadError
  false
end

.lfp_store_service(version: :v1beta, transport: :grpc, &block) ⇒ ::Object

Create a new client object for LfpStoreService.

By default, this returns an instance of Google::Shopping::Merchant::Lfp::V1beta::LfpStoreService::Client for a gRPC client for version V1beta of the API. However, you can specify a different API version by passing it in the version parameter. If the LfpStoreService service is supported by that API version, and the corresponding gem is available, the appropriate versioned client will be returned. You can also specify a different transport by passing :rest or :grpc in the transport parameter.

Raises an exception if the currently installed versioned client gem for the given API version does not support the given transport of the LfpStoreService service. You can determine whether the method will succeed by calling lfp_store_service_available?.

About LfpStoreService

Service for a LFP partner to submit local stores for a merchant.

Parameters:

  • version (::String, ::Symbol) (defaults to: :v1beta)

    The API version to connect to. Optional. Defaults to :v1beta.

  • transport (:grpc, :rest) (defaults to: :grpc)

    The transport to use. Defaults to :grpc.

Returns:

  • (::Object)

    A client object for the specified version.



276
277
278
279
280
281
282
283
284
285
286
# File 'lib/google/shopping/merchant/lfp.rb', line 276

def self.lfp_store_service version: :v1beta, transport: :grpc, &block
  require "google/shopping/merchant/lfp/#{version.to_s.downcase}"

  package_name = Google::Shopping::Merchant::Lfp
                 .constants
                 .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
                 .first
  service_module = Google::Shopping::Merchant::Lfp.const_get(package_name).const_get(:LfpStoreService)
  service_module = service_module.const_get(:Rest) if transport == :rest
  service_module.const_get(:Client).new(&block)
end

.lfp_store_service_available?(version: :v1beta, transport: :grpc) ⇒ boolean

Determines whether the LfpStoreService service is supported by the current client. If true, you can retrieve a client object by calling lfp_store_service. If false, that method will raise an exception. This could happen if the given API version does not exist or does not support the LfpStoreService service, or if the versioned client gem needs an update to support the LfpStoreService service.

Parameters:

  • version (::String, ::Symbol) (defaults to: :v1beta)

    The API version to connect to. Optional. Defaults to :v1beta.

  • transport (:grpc, :rest) (defaults to: :grpc)

    The transport to use. Defaults to :grpc.

Returns:

  • (boolean)

    Whether the service is available.



300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
# File 'lib/google/shopping/merchant/lfp.rb', line 300

def self.lfp_store_service_available? version: :v1beta, transport: :grpc
  require "google/shopping/merchant/lfp/#{version.to_s.downcase}"
  package_name = Google::Shopping::Merchant::Lfp
                 .constants
                 .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
                 .first
  return false unless package_name
  service_module = Google::Shopping::Merchant::Lfp.const_get package_name
  return false unless service_module.const_defined? :LfpStoreService
  service_module = service_module.const_get :LfpStoreService
  if transport == :rest
    return false unless service_module.const_defined? :Rest
    service_module = service_module.const_get :Rest
  end
  service_module.const_defined? :Client
rescue ::LoadError
  false
end