Module: Google::Shopping::Merchant::Products
- Defined in:
- lib/google/shopping/merchant/products.rb,
lib/google/shopping/merchant/products/version.rb
Constant Summary collapse
- VERSION =
"0.1.0"
Class Method Summary collapse
-
.product_inputs_service(version: :v1beta, transport: :grpc, &block) ⇒ ::Object
Create a new client object for ProductInputsService.
-
.products_service(version: :v1beta, transport: :grpc, &block) ⇒ ::Object
Create a new client object for ProductsService.
Class Method Details
.product_inputs_service(version: :v1beta, transport: :grpc, &block) ⇒ ::Object
Create a new client object for ProductInputsService.
By default, this returns an instance of
Google::Shopping::Merchant::Products::V1beta::ProductInputsService::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 ProductInputsService 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.
About ProductInputsService
Service to use ProductInput resource. This service works for products with online channel only.
54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/google/shopping/merchant/products.rb', line 54 def self.product_inputs_service version: :v1beta, transport: :grpc, &block require "google/shopping/merchant/products/#{version.to_s.downcase}" package_name = Google::Shopping::Merchant::Products .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first service_module = Google::Shopping::Merchant::Products.const_get(package_name).const_get(:ProductInputsService) service_module = service_module.const_get(:Rest) if transport == :rest service_module.const_get(:Client).new(&block) end |
.products_service(version: :v1beta, transport: :grpc, &block) ⇒ ::Object
Create a new client object for ProductsService.
By default, this returns an instance of
Google::Shopping::Merchant::Products::V1beta::ProductsService::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 ProductsService 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.
About ProductsService
Service to use Product resource. This service works for products with online channel only.
89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/google/shopping/merchant/products.rb', line 89 def self.products_service version: :v1beta, transport: :grpc, &block require "google/shopping/merchant/products/#{version.to_s.downcase}" package_name = Google::Shopping::Merchant::Products .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first service_module = Google::Shopping::Merchant::Products.const_get(package_name).const_get(:ProductsService) service_module = service_module.const_get(:Rest) if transport == :rest service_module.const_get(:Client).new(&block) end |