google-shopping-merchant-reviews 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2871b0cf052cdb0f1644102163a02caf81f096844e795d18c03734158b3a4e6b
4
- data.tar.gz: a2ebd7df1241829b62ed5ebfe425cbf8b570081709bfeb616dc4d56340d0b740
3
+ metadata.gz: 5c0dcff04fbfb29b272ac3ab19c046ac3fd66cf513a811b8a77733368791d1e7
4
+ data.tar.gz: 1336d67f72d50f22a52ec6e06a7163c834a270b1a9235b56d09d47098d5b5141
5
5
  SHA512:
6
- metadata.gz: 513ffb1e67e88092e10b139d9cf4cf3756c59e25bdb69b171f460d90b8f1818c0ec7a99f4f339dbc0b4f7730f3f5c11ad398a0dae48bbccc70830af485be02ec
7
- data.tar.gz: a623b050fe059c52f288c8b3164fec9972e4e19da4ca7fadb8c8998c2fdba505004d5ed1a6e509bfde3b326cb99d56c377a51982b7b704f32f3f726f4f86aa89
6
+ metadata.gz: 05d1a4f4e0539652ddd771307bb7482fe9fb8835afbc54013a6ea207d0735c6134c8a9308a6a248445b97c2697e2f23b177c4e3b1a210574d6640ec045d10ee0
7
+ data.tar.gz: 6b212c0f081cb4c55c8f06eeee370eb186d6be37a5796424517f56e3041626af7a9f597523c0688c2149b22be44b21a8f62acd7268be1358c0a7411d4e82e70e
data/README.md CHANGED
@@ -59,9 +59,14 @@ service such as [Google Cloud Run](https://cloud.google.com/run), this generally
59
59
  results in logs appearing alongside your application logs in the
60
60
  [Google Cloud Logging](https://cloud.google.com/logging/) service.
61
61
 
62
+ Debug logging also requires that the versioned clients for this service be
63
+ sufficiently recent, released after about Dec 10, 2024. If logging is not
64
+ working, try updating the versioned clients in your bundle or installed gems:
65
+ [google-shopping-merchant-reviews-v1beta](https://rubydoc.info/gems/google-shopping-merchant-reviews-v1beta).
66
+
62
67
  ## Supported Ruby Versions
63
68
 
64
- This library is supported on Ruby 2.7+.
69
+ This library is supported on Ruby 3.0+.
65
70
 
66
71
  Google provides official support for Ruby versions that are actively supported
67
72
  by Ruby Core—that is, Ruby versions that are either in normal maintenance or
@@ -21,7 +21,7 @@ module Google
21
21
  module Shopping
22
22
  module Merchant
23
23
  module Reviews
24
- VERSION = "0.1.0"
24
+ VERSION = "0.2.0"
25
25
  end
26
26
  end
27
27
  end
@@ -41,6 +41,11 @@ module Google
41
41
  # You can also specify a different transport by passing `:rest` or `:grpc` in
42
42
  # the `transport` parameter.
43
43
  #
44
+ # Raises an exception if the currently installed versioned client gem for the
45
+ # given API version does not support the given transport of the MerchantReviewsService service.
46
+ # You can determine whether the method will succeed by calling
47
+ # {Google::Shopping::Merchant::Reviews.merchant_reviews_service_available?}.
48
+ #
44
49
  # ## About MerchantReviewsService
45
50
  #
46
51
  # Service to manage merchant reviews.
@@ -62,6 +67,37 @@ module Google
62
67
  service_module.const_get(:Client).new(&block)
63
68
  end
64
69
 
70
+ ##
71
+ # Determines whether the MerchantReviewsService service is supported by the current client.
72
+ # If true, you can retrieve a client object by calling {Google::Shopping::Merchant::Reviews.merchant_reviews_service}.
73
+ # If false, that method will raise an exception. This could happen if the given
74
+ # API version does not exist or does not support the MerchantReviewsService service,
75
+ # or if the versioned client gem needs an update to support the MerchantReviewsService service.
76
+ #
77
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
78
+ # Defaults to `:v1beta`.
79
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
80
+ # @return [boolean] Whether the service is available.
81
+ #
82
+ def self.merchant_reviews_service_available? version: :v1beta, transport: :grpc
83
+ require "google/shopping/merchant/reviews/#{version.to_s.downcase}"
84
+ package_name = Google::Shopping::Merchant::Reviews
85
+ .constants
86
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
87
+ .first
88
+ return false unless package_name
89
+ service_module = Google::Shopping::Merchant::Reviews.const_get package_name
90
+ return false unless service_module.const_defined? :MerchantReviewsService
91
+ service_module = service_module.const_get :MerchantReviewsService
92
+ if transport == :rest
93
+ return false unless service_module.const_defined? :Rest
94
+ service_module = service_module.const_get :Rest
95
+ end
96
+ service_module.const_defined? :Client
97
+ rescue ::LoadError
98
+ false
99
+ end
100
+
65
101
  ##
66
102
  # Create a new client object for ProductReviewsService.
67
103
  #
@@ -75,6 +111,11 @@ module Google
75
111
  # You can also specify a different transport by passing `:rest` or `:grpc` in
76
112
  # the `transport` parameter.
77
113
  #
114
+ # Raises an exception if the currently installed versioned client gem for the
115
+ # given API version does not support the given transport of the ProductReviewsService service.
116
+ # You can determine whether the method will succeed by calling
117
+ # {Google::Shopping::Merchant::Reviews.product_reviews_service_available?}.
118
+ #
78
119
  # ## About ProductReviewsService
79
120
  #
80
121
  # Service to manage product reviews.
@@ -95,6 +136,37 @@ module Google
95
136
  service_module = service_module.const_get(:Rest) if transport == :rest
96
137
  service_module.const_get(:Client).new(&block)
97
138
  end
139
+
140
+ ##
141
+ # Determines whether the ProductReviewsService service is supported by the current client.
142
+ # If true, you can retrieve a client object by calling {Google::Shopping::Merchant::Reviews.product_reviews_service}.
143
+ # If false, that method will raise an exception. This could happen if the given
144
+ # API version does not exist or does not support the ProductReviewsService service,
145
+ # or if the versioned client gem needs an update to support the ProductReviewsService service.
146
+ #
147
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
148
+ # Defaults to `:v1beta`.
149
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
150
+ # @return [boolean] Whether the service is available.
151
+ #
152
+ def self.product_reviews_service_available? version: :v1beta, transport: :grpc
153
+ require "google/shopping/merchant/reviews/#{version.to_s.downcase}"
154
+ package_name = Google::Shopping::Merchant::Reviews
155
+ .constants
156
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
157
+ .first
158
+ return false unless package_name
159
+ service_module = Google::Shopping::Merchant::Reviews.const_get package_name
160
+ return false unless service_module.const_defined? :ProductReviewsService
161
+ service_module = service_module.const_get :ProductReviewsService
162
+ if transport == :rest
163
+ return false unless service_module.const_defined? :Rest
164
+ service_module = service_module.const_get :Rest
165
+ end
166
+ service_module.const_defined? :Client
167
+ rescue ::LoadError
168
+ false
169
+ end
98
170
  end
99
171
  end
100
172
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-shopping-merchant-reviews
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2025-01-08 00:00:00.000000000 Z
10
+ date: 2025-01-29 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: google-cloud-core
@@ -73,7 +72,6 @@ homepage: https://github.com/googleapis/google-cloud-ruby
73
72
  licenses:
74
73
  - Apache-2.0
75
74
  metadata: {}
76
- post_install_message:
77
75
  rdoc_options: []
78
76
  require_paths:
79
77
  - lib
@@ -81,15 +79,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
81
79
  requirements:
82
80
  - - ">="
83
81
  - !ruby/object:Gem::Version
84
- version: '2.7'
82
+ version: '3.0'
85
83
  required_rubygems_version: !ruby/object:Gem::Requirement
86
84
  requirements:
87
85
  - - ">="
88
86
  - !ruby/object:Gem::Version
89
87
  version: '0'
90
88
  requirements: []
91
- rubygems_version: 3.5.23
92
- signing_key:
89
+ rubygems_version: 3.6.2
93
90
  specification_version: 4
94
91
  summary: Programmatically manage your Merchant Center Accounts.
95
92
  test_files: []