Module: Google::Shopping::Merchant::Reviews
- Defined in:
- lib/google/shopping/merchant/reviews.rb,
lib/google/shopping/merchant/reviews/version.rb
Constant Summary collapse
- VERSION =
"0.2.2"
Class Method Summary collapse
-
.merchant_reviews_service(version: :v1beta, transport: :grpc, &block) ⇒ ::Object
Create a new client object for MerchantReviewsService.
-
.merchant_reviews_service_available?(version: :v1beta, transport: :grpc) ⇒ boolean
Determines whether the MerchantReviewsService service is supported by the current client.
-
.product_reviews_service(version: :v1beta, transport: :grpc, &block) ⇒ ::Object
Create a new client object for ProductReviewsService.
-
.product_reviews_service_available?(version: :v1beta, transport: :grpc) ⇒ boolean
Determines whether the ProductReviewsService service is supported by the current client.
Class Method Details
.merchant_reviews_service(version: :v1beta, transport: :grpc, &block) ⇒ ::Object
Create a new client object for MerchantReviewsService.
By default, this returns an instance of
Google::Shopping::Merchant::Reviews::V1beta::MerchantReviewsService::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 MerchantReviewsService 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 MerchantReviewsService service. You can determine whether the method will succeed by calling merchant_reviews_service_available?.
About MerchantReviewsService
Service to manage merchant reviews.
58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/google/shopping/merchant/reviews.rb', line 58 def self.merchant_reviews_service version: :v1beta, transport: :grpc, &block require "google/shopping/merchant/reviews/#{version.to_s.downcase}" package_name = Google::Shopping::Merchant::Reviews .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first service_module = Google::Shopping::Merchant::Reviews.const_get(package_name).const_get(:MerchantReviewsService) service_module = service_module.const_get(:Rest) if transport == :rest service_module.const_get(:Client).new(&block) end |
.merchant_reviews_service_available?(version: :v1beta, transport: :grpc) ⇒ boolean
Determines whether the MerchantReviewsService service is supported by the current client. If true, you can retrieve a client object by calling merchant_reviews_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 MerchantReviewsService service, or if the versioned client gem needs an update to support the MerchantReviewsService service.
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/google/shopping/merchant/reviews.rb', line 82 def self.merchant_reviews_service_available? version: :v1beta, transport: :grpc require "google/shopping/merchant/reviews/#{version.to_s.downcase}" package_name = Google::Shopping::Merchant::Reviews .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first return false unless package_name service_module = Google::Shopping::Merchant::Reviews.const_get package_name return false unless service_module.const_defined? :MerchantReviewsService service_module = service_module.const_get :MerchantReviewsService 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 |
.product_reviews_service(version: :v1beta, transport: :grpc, &block) ⇒ ::Object
Create a new client object for ProductReviewsService.
By default, this returns an instance of
Google::Shopping::Merchant::Reviews::V1beta::ProductReviewsService::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 ProductReviewsService 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 ProductReviewsService service. You can determine whether the method will succeed by calling product_reviews_service_available?.
About ProductReviewsService
Service to manage product reviews.
128 129 130 131 132 133 134 135 136 137 138 |
# File 'lib/google/shopping/merchant/reviews.rb', line 128 def self.product_reviews_service version: :v1beta, transport: :grpc, &block require "google/shopping/merchant/reviews/#{version.to_s.downcase}" package_name = Google::Shopping::Merchant::Reviews .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first service_module = Google::Shopping::Merchant::Reviews.const_get(package_name).const_get(:ProductReviewsService) service_module = service_module.const_get(:Rest) if transport == :rest service_module.const_get(:Client).new(&block) end |
.product_reviews_service_available?(version: :v1beta, transport: :grpc) ⇒ boolean
Determines whether the ProductReviewsService service is supported by the current client. If true, you can retrieve a client object by calling product_reviews_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 ProductReviewsService service, or if the versioned client gem needs an update to support the ProductReviewsService service.
152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 |
# File 'lib/google/shopping/merchant/reviews.rb', line 152 def self.product_reviews_service_available? version: :v1beta, transport: :grpc require "google/shopping/merchant/reviews/#{version.to_s.downcase}" package_name = Google::Shopping::Merchant::Reviews .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first return false unless package_name service_module = Google::Shopping::Merchant::Reviews.const_get package_name return false unless service_module.const_defined? :ProductReviewsService service_module = service_module.const_get :ProductReviewsService 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 |