google-shopping-merchant-accounts-v1beta 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/shopping/merchant/accounts/v1beta/gbp_accounts_service/client.rb +581 -0
  3. data/lib/google/shopping/merchant/accounts/v1beta/gbp_accounts_service/credentials.rb +49 -0
  4. data/lib/google/shopping/merchant/accounts/v1beta/gbp_accounts_service/paths.rb +49 -0
  5. data/lib/google/shopping/merchant/accounts/v1beta/gbp_accounts_service/rest/client.rb +541 -0
  6. data/lib/google/shopping/merchant/accounts/v1beta/gbp_accounts_service/rest/service_stub.rb +206 -0
  7. data/lib/google/shopping/merchant/accounts/v1beta/gbp_accounts_service/rest.rb +57 -0
  8. data/lib/google/shopping/merchant/accounts/v1beta/gbp_accounts_service.rb +60 -0
  9. data/lib/google/shopping/merchant/accounts/v1beta/gbpaccounts_pb.rb +56 -0
  10. data/lib/google/shopping/merchant/accounts/v1beta/gbpaccounts_services_pb.rb +52 -0
  11. data/lib/google/shopping/merchant/accounts/v1beta/lfp_providers_service/client.rb +584 -0
  12. data/lib/google/shopping/merchant/accounts/v1beta/lfp_providers_service/credentials.rb +49 -0
  13. data/lib/google/shopping/merchant/accounts/v1beta/lfp_providers_service/paths.rb +71 -0
  14. data/lib/google/shopping/merchant/accounts/v1beta/lfp_providers_service/rest/client.rb +544 -0
  15. data/lib/google/shopping/merchant/accounts/v1beta/lfp_providers_service/rest/service_stub.rb +206 -0
  16. data/lib/google/shopping/merchant/accounts/v1beta/lfp_providers_service/rest.rb +56 -0
  17. data/lib/google/shopping/merchant/accounts/v1beta/lfp_providers_service.rb +59 -0
  18. data/lib/google/shopping/merchant/accounts/v1beta/lfpproviders_pb.rb +55 -0
  19. data/lib/google/shopping/merchant/accounts/v1beta/lfpproviders_services_pb.rb +51 -0
  20. data/lib/google/shopping/merchant/accounts/v1beta/omnichannel_settings_service/client.rb +875 -0
  21. data/lib/google/shopping/merchant/accounts/v1beta/omnichannel_settings_service/credentials.rb +49 -0
  22. data/lib/google/shopping/merchant/accounts/v1beta/omnichannel_settings_service/paths.rb +66 -0
  23. data/lib/google/shopping/merchant/accounts/v1beta/omnichannel_settings_service/rest/client.rb +814 -0
  24. data/lib/google/shopping/merchant/accounts/v1beta/omnichannel_settings_service/rest/service_stub.rb +391 -0
  25. data/lib/google/shopping/merchant/accounts/v1beta/omnichannel_settings_service/rest.rb +57 -0
  26. data/lib/google/shopping/merchant/accounts/v1beta/omnichannel_settings_service.rb +60 -0
  27. data/lib/google/shopping/merchant/accounts/v1beta/omnichannelsettings_pb.rb +68 -0
  28. data/lib/google/shopping/merchant/accounts/v1beta/omnichannelsettings_services_pb.rb +58 -0
  29. data/lib/google/shopping/merchant/accounts/v1beta/online_return_policy_pb.rb +8 -1
  30. data/lib/google/shopping/merchant/accounts/v1beta/online_return_policy_service/client.rb +285 -4
  31. data/lib/google/shopping/merchant/accounts/v1beta/online_return_policy_service/rest/client.rb +264 -4
  32. data/lib/google/shopping/merchant/accounts/v1beta/online_return_policy_service/rest/service_stub.rb +185 -0
  33. data/lib/google/shopping/merchant/accounts/v1beta/online_return_policy_service/rest.rb +1 -1
  34. data/lib/google/shopping/merchant/accounts/v1beta/online_return_policy_service.rb +1 -1
  35. data/lib/google/shopping/merchant/accounts/v1beta/online_return_policy_services_pb.rb +9 -3
  36. data/lib/google/shopping/merchant/accounts/v1beta/rest.rb +3 -0
  37. data/lib/google/shopping/merchant/accounts/v1beta/version.rb +1 -1
  38. data/lib/google/shopping/merchant/accounts/v1beta.rb +3 -0
  39. data/proto_docs/google/shopping/merchant/accounts/v1beta/gbpaccounts.rb +123 -0
  40. data/proto_docs/google/shopping/merchant/accounts/v1beta/lfpproviders.rb +108 -0
  41. data/proto_docs/google/shopping/merchant/accounts/v1beta/omnichannelsettings.rb +336 -0
  42. data/proto_docs/google/shopping/merchant/accounts/v1beta/online_return_policy.rb +64 -10
  43. metadata +31 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c9a0f7c5c2f75136049b8d6c0f0c0efd7af40a91b68d5d90c5eedadf19310c93
4
- data.tar.gz: 40f98c0050ad756c38f76e981094c51f14b84cfc94f96b04b4ef10e80e466259
3
+ metadata.gz: cf1322c4663ac1cb59fe22f35f7590d7c760a74b7c38642194bca926c4126166
4
+ data.tar.gz: ccb159202e4d757af87019e26b5d7f2d8101fe8efaa59ce04c853a35778e3148
5
5
  SHA512:
6
- metadata.gz: '08473a62606a3cf9518185052a0b39c2b85f38f44fffaf41b12030076686266bbad1a46be75dc2f16e628f8ffaa9187580f10040740ea240d2ee2abdd76e08fe'
7
- data.tar.gz: 3b5b4581f07c192c15da582fbb4756fe22f8cee496d180d1a0cc7647963ea77a04778b19ece7ba5dcad5c6dddb34f5ad18e0b2cb7081b577e349b77500d337ad
6
+ metadata.gz: 5dade4d85ddabcb51e34c57ac8a0c10656b4c610624adca1d674e0b3323d0650b1be9efe81223838385b589560dd12e34881292f2dec86b94c05d86fe607d5b4
7
+ data.tar.gz: 46118f6cfcda18cb42d397ca17aedeea2bd41ab2ae7ae3a175465a17bcf4d26e4b2e38b17ca53c14d6cb4f44df8c52d4e82e1e8cff2215244159d3ce3988210a
@@ -0,0 +1,581 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2025 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/shopping/merchant/accounts/v1beta/gbpaccounts_pb"
21
+
22
+ module Google
23
+ module Shopping
24
+ module Merchant
25
+ module Accounts
26
+ module V1beta
27
+ module GbpAccountsService
28
+ ##
29
+ # Client for the GbpAccountsService service.
30
+ #
31
+ # The service facilitates the management of a merchant's Google Business
32
+ # Profile (GBP) account settings. This API defines the following resource
33
+ # model:
34
+ # - [GbpAccount][google.shopping.merchant.accounts.v1.GbpAccount]
35
+ #
36
+ class Client
37
+ # @private
38
+ API_VERSION = ""
39
+
40
+ # @private
41
+ DEFAULT_ENDPOINT_TEMPLATE = "merchantapi.$UNIVERSE_DOMAIN$"
42
+
43
+ include Paths
44
+
45
+ # @private
46
+ attr_reader :gbp_accounts_service_stub
47
+
48
+ ##
49
+ # Configure the GbpAccountsService Client class.
50
+ #
51
+ # See {::Google::Shopping::Merchant::Accounts::V1beta::GbpAccountsService::Client::Configuration}
52
+ # for a description of the configuration fields.
53
+ #
54
+ # @example
55
+ #
56
+ # # Modify the configuration for all GbpAccountsService clients
57
+ # ::Google::Shopping::Merchant::Accounts::V1beta::GbpAccountsService::Client.configure do |config|
58
+ # config.timeout = 10.0
59
+ # end
60
+ #
61
+ # @yield [config] Configure the Client client.
62
+ # @yieldparam config [Client::Configuration]
63
+ #
64
+ # @return [Client::Configuration]
65
+ #
66
+ def self.configure
67
+ @configure ||= begin
68
+ namespace = ["Google", "Shopping", "Merchant", "Accounts", "V1beta"]
69
+ parent_config = while namespace.any?
70
+ parent_name = namespace.join "::"
71
+ parent_const = const_get parent_name
72
+ break parent_const.configure if parent_const.respond_to? :configure
73
+ namespace.pop
74
+ end
75
+ default_config = Client::Configuration.new parent_config
76
+
77
+ default_config.timeout = 60.0
78
+ default_config.retry_policy = {
79
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
80
+ }
81
+
82
+ default_config
83
+ end
84
+ yield @configure if block_given?
85
+ @configure
86
+ end
87
+
88
+ ##
89
+ # Configure the GbpAccountsService Client instance.
90
+ #
91
+ # The configuration is set to the derived mode, meaning that values can be changed,
92
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
93
+ # should be made on {Client.configure}.
94
+ #
95
+ # See {::Google::Shopping::Merchant::Accounts::V1beta::GbpAccountsService::Client::Configuration}
96
+ # for a description of the configuration fields.
97
+ #
98
+ # @yield [config] Configure the Client client.
99
+ # @yieldparam config [Client::Configuration]
100
+ #
101
+ # @return [Client::Configuration]
102
+ #
103
+ def configure
104
+ yield @config if block_given?
105
+ @config
106
+ end
107
+
108
+ ##
109
+ # The effective universe domain
110
+ #
111
+ # @return [String]
112
+ #
113
+ def universe_domain
114
+ @gbp_accounts_service_stub.universe_domain
115
+ end
116
+
117
+ ##
118
+ # Create a new GbpAccountsService client object.
119
+ #
120
+ # @example
121
+ #
122
+ # # Create a client using the default configuration
123
+ # client = ::Google::Shopping::Merchant::Accounts::V1beta::GbpAccountsService::Client.new
124
+ #
125
+ # # Create a client using a custom configuration
126
+ # client = ::Google::Shopping::Merchant::Accounts::V1beta::GbpAccountsService::Client.new do |config|
127
+ # config.timeout = 10.0
128
+ # end
129
+ #
130
+ # @yield [config] Configure the GbpAccountsService client.
131
+ # @yieldparam config [Client::Configuration]
132
+ #
133
+ def initialize
134
+ # These require statements are intentionally placed here to initialize
135
+ # the gRPC module only when it's required.
136
+ # See https://github.com/googleapis/toolkit/issues/446
137
+ require "gapic/grpc"
138
+ require "google/shopping/merchant/accounts/v1beta/gbpaccounts_services_pb"
139
+
140
+ # Create the configuration object
141
+ @config = Configuration.new Client.configure
142
+
143
+ # Yield the configuration if needed
144
+ yield @config if block_given?
145
+
146
+ # Create credentials
147
+ credentials = @config.credentials
148
+ # Use self-signed JWT if the endpoint is unchanged from default,
149
+ # but only if the default endpoint does not have a region prefix.
150
+ enable_self_signed_jwt = @config.endpoint.nil? ||
151
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
152
+ !@config.endpoint.split(".").first.include?("-"))
153
+ credentials ||= Credentials.default scope: @config.scope,
154
+ enable_self_signed_jwt: enable_self_signed_jwt
155
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
156
+ credentials = Credentials.new credentials, scope: @config.scope
157
+ end
158
+ @quota_project_id = @config.quota_project
159
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
160
+
161
+ @gbp_accounts_service_stub = ::Gapic::ServiceStub.new(
162
+ ::Google::Shopping::Merchant::Accounts::V1beta::GbpAccountsService::Stub,
163
+ credentials: credentials,
164
+ endpoint: @config.endpoint,
165
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
166
+ universe_domain: @config.universe_domain,
167
+ channel_args: @config.channel_args,
168
+ interceptors: @config.interceptors,
169
+ channel_pool_config: @config.channel_pool,
170
+ logger: @config.logger
171
+ )
172
+
173
+ @gbp_accounts_service_stub.stub_logger&.info do |entry|
174
+ entry.set_system_name
175
+ entry.set_service
176
+ entry.message = "Created client for #{entry.service}"
177
+ entry.set_credentials_fields credentials
178
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
179
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
180
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
181
+ end
182
+ end
183
+
184
+ ##
185
+ # The logger used for request/response debug logging.
186
+ #
187
+ # @return [Logger]
188
+ #
189
+ def logger
190
+ @gbp_accounts_service_stub.logger
191
+ end
192
+
193
+ # Service calls
194
+
195
+ ##
196
+ # List the GBP accounts for a given merchant.
197
+ #
198
+ # @overload list_gbp_accounts(request, options = nil)
199
+ # Pass arguments to `list_gbp_accounts` via a request object, either of type
200
+ # {::Google::Shopping::Merchant::Accounts::V1beta::ListGbpAccountsRequest} or an equivalent Hash.
201
+ #
202
+ # @param request [::Google::Shopping::Merchant::Accounts::V1beta::ListGbpAccountsRequest, ::Hash]
203
+ # A request object representing the call parameters. Required. To specify no
204
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
205
+ # @param options [::Gapic::CallOptions, ::Hash]
206
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
207
+ #
208
+ # @overload list_gbp_accounts(parent: nil, page_size: nil, page_token: nil)
209
+ # Pass arguments to `list_gbp_accounts` via keyword arguments. Note that at
210
+ # least one keyword argument is required. To specify no parameters, or to keep all
211
+ # the default parameter values, pass an empty Hash as a request object (see above).
212
+ #
213
+ # @param parent [::String]
214
+ # Required. The name of the parent resource under which the GBP accounts are
215
+ # listed. Format: `accounts/{account}`.
216
+ # @param page_size [::Integer]
217
+ # Optional. The maximum number of `GbpAccount` resources to return. The
218
+ # service returns fewer than this value if the number of gbp accounts is less
219
+ # that than the `pageSize`. The default value is 50. The maximum value is
220
+ # 1000; If a value higher than the maximum is specified, then the `pageSize`
221
+ # will default to the maximum.
222
+ # @param page_token [::String]
223
+ # Optional. A page token, received from a previous `ListGbpAccounts` call.
224
+ # Provide the page token to retrieve the subsequent page.
225
+ #
226
+ # When paginating, all other parameters provided to `ListGbpAccounts` must
227
+ # match the call that provided the page token.
228
+ #
229
+ # @yield [response, operation] Access the result along with the RPC operation
230
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Shopping::Merchant::Accounts::V1beta::GbpAccount>]
231
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
232
+ #
233
+ # @return [::Gapic::PagedEnumerable<::Google::Shopping::Merchant::Accounts::V1beta::GbpAccount>]
234
+ #
235
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
236
+ #
237
+ # @example Basic example
238
+ # require "google/shopping/merchant/accounts/v1beta"
239
+ #
240
+ # # Create a client object. The client can be reused for multiple calls.
241
+ # client = Google::Shopping::Merchant::Accounts::V1beta::GbpAccountsService::Client.new
242
+ #
243
+ # # Create a request. To set request fields, pass in keyword arguments.
244
+ # request = Google::Shopping::Merchant::Accounts::V1beta::ListGbpAccountsRequest.new
245
+ #
246
+ # # Call the list_gbp_accounts method.
247
+ # result = client.list_gbp_accounts request
248
+ #
249
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
250
+ # # over elements, and API calls will be issued to fetch pages as needed.
251
+ # result.each do |item|
252
+ # # Each element is of type ::Google::Shopping::Merchant::Accounts::V1beta::GbpAccount.
253
+ # p item
254
+ # end
255
+ #
256
+ def list_gbp_accounts request, options = nil
257
+ raise ::ArgumentError, "request must be provided" if request.nil?
258
+
259
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::Accounts::V1beta::ListGbpAccountsRequest
260
+
261
+ # Converts hash and nil to an options object
262
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
263
+
264
+ # Customize the options with defaults
265
+ metadata = @config.rpcs.list_gbp_accounts.metadata.to_h
266
+
267
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
268
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
269
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
270
+ gapic_version: ::Google::Shopping::Merchant::Accounts::V1beta::VERSION
271
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
272
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
273
+
274
+ header_params = {}
275
+ if request.parent
276
+ header_params["parent"] = request.parent
277
+ end
278
+
279
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
280
+ metadata[:"x-goog-request-params"] ||= request_params_header
281
+
282
+ options.apply_defaults timeout: @config.rpcs.list_gbp_accounts.timeout,
283
+ metadata: metadata,
284
+ retry_policy: @config.rpcs.list_gbp_accounts.retry_policy
285
+
286
+ options.apply_defaults timeout: @config.timeout,
287
+ metadata: @config.metadata,
288
+ retry_policy: @config.retry_policy
289
+
290
+ @gbp_accounts_service_stub.call_rpc :list_gbp_accounts, request, options: options do |response, operation|
291
+ response = ::Gapic::PagedEnumerable.new @gbp_accounts_service_stub, :list_gbp_accounts, request, response, operation, options
292
+ yield response, operation if block_given?
293
+ throw :response, response
294
+ end
295
+ rescue ::GRPC::BadStatus => e
296
+ raise ::Google::Cloud::Error.from_error(e)
297
+ end
298
+
299
+ ##
300
+ # Link the specified merchant to a GBP account for all countries.
301
+ #
302
+ # @overload link_gbp_account(request, options = nil)
303
+ # Pass arguments to `link_gbp_account` via a request object, either of type
304
+ # {::Google::Shopping::Merchant::Accounts::V1beta::LinkGbpAccountRequest} or an equivalent Hash.
305
+ #
306
+ # @param request [::Google::Shopping::Merchant::Accounts::V1beta::LinkGbpAccountRequest, ::Hash]
307
+ # A request object representing the call parameters. Required. To specify no
308
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
309
+ # @param options [::Gapic::CallOptions, ::Hash]
310
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
311
+ #
312
+ # @overload link_gbp_account(parent: nil, gbp_email: nil)
313
+ # Pass arguments to `link_gbp_account` via keyword arguments. Note that at
314
+ # least one keyword argument is required. To specify no parameters, or to keep all
315
+ # the default parameter values, pass an empty Hash as a request object (see above).
316
+ #
317
+ # @param parent [::String]
318
+ # Required. The name of the parent resource to which the GBP account is
319
+ # linked. Format: `accounts/{account}`.
320
+ # @param gbp_email [::String]
321
+ # Required. The email address of the Business Profile account.
322
+ #
323
+ # @yield [response, operation] Access the result along with the RPC operation
324
+ # @yieldparam response [::Google::Shopping::Merchant::Accounts::V1beta::LinkGbpAccountResponse]
325
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
326
+ #
327
+ # @return [::Google::Shopping::Merchant::Accounts::V1beta::LinkGbpAccountResponse]
328
+ #
329
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
330
+ #
331
+ # @example Basic example
332
+ # require "google/shopping/merchant/accounts/v1beta"
333
+ #
334
+ # # Create a client object. The client can be reused for multiple calls.
335
+ # client = Google::Shopping::Merchant::Accounts::V1beta::GbpAccountsService::Client.new
336
+ #
337
+ # # Create a request. To set request fields, pass in keyword arguments.
338
+ # request = Google::Shopping::Merchant::Accounts::V1beta::LinkGbpAccountRequest.new
339
+ #
340
+ # # Call the link_gbp_account method.
341
+ # result = client.link_gbp_account request
342
+ #
343
+ # # The returned object is of type Google::Shopping::Merchant::Accounts::V1beta::LinkGbpAccountResponse.
344
+ # p result
345
+ #
346
+ def link_gbp_account request, options = nil
347
+ raise ::ArgumentError, "request must be provided" if request.nil?
348
+
349
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::Accounts::V1beta::LinkGbpAccountRequest
350
+
351
+ # Converts hash and nil to an options object
352
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
353
+
354
+ # Customize the options with defaults
355
+ metadata = @config.rpcs.link_gbp_account.metadata.to_h
356
+
357
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
358
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
359
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
360
+ gapic_version: ::Google::Shopping::Merchant::Accounts::V1beta::VERSION
361
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
362
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
363
+
364
+ header_params = {}
365
+ if request.parent
366
+ header_params["parent"] = request.parent
367
+ end
368
+
369
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
370
+ metadata[:"x-goog-request-params"] ||= request_params_header
371
+
372
+ options.apply_defaults timeout: @config.rpcs.link_gbp_account.timeout,
373
+ metadata: metadata,
374
+ retry_policy: @config.rpcs.link_gbp_account.retry_policy
375
+
376
+ options.apply_defaults timeout: @config.timeout,
377
+ metadata: @config.metadata,
378
+ retry_policy: @config.retry_policy
379
+
380
+ @gbp_accounts_service_stub.call_rpc :link_gbp_account, request, options: options do |response, operation|
381
+ yield response, operation if block_given?
382
+ end
383
+ rescue ::GRPC::BadStatus => e
384
+ raise ::Google::Cloud::Error.from_error(e)
385
+ end
386
+
387
+ ##
388
+ # Configuration class for the GbpAccountsService API.
389
+ #
390
+ # This class represents the configuration for GbpAccountsService,
391
+ # providing control over timeouts, retry behavior, logging, transport
392
+ # parameters, and other low-level controls. Certain parameters can also be
393
+ # applied individually to specific RPCs. See
394
+ # {::Google::Shopping::Merchant::Accounts::V1beta::GbpAccountsService::Client::Configuration::Rpcs}
395
+ # for a list of RPCs that can be configured independently.
396
+ #
397
+ # Configuration can be applied globally to all clients, or to a single client
398
+ # on construction.
399
+ #
400
+ # @example
401
+ #
402
+ # # Modify the global config, setting the timeout for
403
+ # # list_gbp_accounts to 20 seconds,
404
+ # # and all remaining timeouts to 10 seconds.
405
+ # ::Google::Shopping::Merchant::Accounts::V1beta::GbpAccountsService::Client.configure do |config|
406
+ # config.timeout = 10.0
407
+ # config.rpcs.list_gbp_accounts.timeout = 20.0
408
+ # end
409
+ #
410
+ # # Apply the above configuration only to a new client.
411
+ # client = ::Google::Shopping::Merchant::Accounts::V1beta::GbpAccountsService::Client.new do |config|
412
+ # config.timeout = 10.0
413
+ # config.rpcs.list_gbp_accounts.timeout = 20.0
414
+ # end
415
+ #
416
+ # @!attribute [rw] endpoint
417
+ # A custom service endpoint, as a hostname or hostname:port. The default is
418
+ # nil, indicating to use the default endpoint in the current universe domain.
419
+ # @return [::String,nil]
420
+ # @!attribute [rw] credentials
421
+ # Credentials to send with calls. You may provide any of the following types:
422
+ # * (`String`) The path to a service account key file in JSON format
423
+ # * (`Hash`) A service account key as a Hash
424
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
425
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
426
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
427
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
428
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
429
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
430
+ # * (`nil`) indicating no credentials
431
+ #
432
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
433
+ # external source for authentication to Google Cloud, you must validate it before
434
+ # providing it to a Google API client library. Providing an unvalidated credential
435
+ # configuration to Google APIs can compromise the security of your systems and data.
436
+ # For more information, refer to [Validate credential configurations from external
437
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
438
+ # @return [::Object]
439
+ # @!attribute [rw] scope
440
+ # The OAuth scopes
441
+ # @return [::Array<::String>]
442
+ # @!attribute [rw] lib_name
443
+ # The library name as recorded in instrumentation and logging
444
+ # @return [::String]
445
+ # @!attribute [rw] lib_version
446
+ # The library version as recorded in instrumentation and logging
447
+ # @return [::String]
448
+ # @!attribute [rw] channel_args
449
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
450
+ # `GRPC::Core::Channel` object is provided as the credential.
451
+ # @return [::Hash]
452
+ # @!attribute [rw] interceptors
453
+ # An array of interceptors that are run before calls are executed.
454
+ # @return [::Array<::GRPC::ClientInterceptor>]
455
+ # @!attribute [rw] timeout
456
+ # The call timeout in seconds.
457
+ # @return [::Numeric]
458
+ # @!attribute [rw] metadata
459
+ # Additional gRPC headers to be sent with the call.
460
+ # @return [::Hash{::Symbol=>::String}]
461
+ # @!attribute [rw] retry_policy
462
+ # The retry policy. The value is a hash with the following keys:
463
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
464
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
465
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
466
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
467
+ # trigger a retry.
468
+ # @return [::Hash]
469
+ # @!attribute [rw] quota_project
470
+ # A separate project against which to charge quota.
471
+ # @return [::String]
472
+ # @!attribute [rw] universe_domain
473
+ # The universe domain within which to make requests. This determines the
474
+ # default endpoint URL. The default value of nil uses the environment
475
+ # universe (usually the default "googleapis.com" universe).
476
+ # @return [::String,nil]
477
+ # @!attribute [rw] logger
478
+ # A custom logger to use for request/response debug logging, or the value
479
+ # `:default` (the default) to construct a default logger, or `nil` to
480
+ # explicitly disable logging.
481
+ # @return [::Logger,:default,nil]
482
+ #
483
+ class Configuration
484
+ extend ::Gapic::Config
485
+
486
+ # @private
487
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
488
+ DEFAULT_ENDPOINT = "merchantapi.googleapis.com"
489
+
490
+ config_attr :endpoint, nil, ::String, nil
491
+ config_attr :credentials, nil do |value|
492
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
493
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
494
+ allowed.any? { |klass| klass === value }
495
+ end
496
+ config_attr :scope, nil, ::String, ::Array, nil
497
+ config_attr :lib_name, nil, ::String, nil
498
+ config_attr :lib_version, nil, ::String, nil
499
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
500
+ config_attr :interceptors, nil, ::Array, nil
501
+ config_attr :timeout, nil, ::Numeric, nil
502
+ config_attr :metadata, nil, ::Hash, nil
503
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
504
+ config_attr :quota_project, nil, ::String, nil
505
+ config_attr :universe_domain, nil, ::String, nil
506
+ config_attr :logger, :default, ::Logger, nil, :default
507
+
508
+ # @private
509
+ def initialize parent_config = nil
510
+ @parent_config = parent_config unless parent_config.nil?
511
+
512
+ yield self if block_given?
513
+ end
514
+
515
+ ##
516
+ # Configurations for individual RPCs
517
+ # @return [Rpcs]
518
+ #
519
+ def rpcs
520
+ @rpcs ||= begin
521
+ parent_rpcs = nil
522
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
523
+ Rpcs.new parent_rpcs
524
+ end
525
+ end
526
+
527
+ ##
528
+ # Configuration for the channel pool
529
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
530
+ #
531
+ def channel_pool
532
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
533
+ end
534
+
535
+ ##
536
+ # Configuration RPC class for the GbpAccountsService API.
537
+ #
538
+ # Includes fields providing the configuration for each RPC in this service.
539
+ # Each configuration object is of type `Gapic::Config::Method` and includes
540
+ # the following configuration fields:
541
+ #
542
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
543
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
544
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
545
+ # include the following keys:
546
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
547
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
548
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
549
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
550
+ # trigger a retry.
551
+ #
552
+ class Rpcs
553
+ ##
554
+ # RPC-specific configuration for `list_gbp_accounts`
555
+ # @return [::Gapic::Config::Method]
556
+ #
557
+ attr_reader :list_gbp_accounts
558
+ ##
559
+ # RPC-specific configuration for `link_gbp_account`
560
+ # @return [::Gapic::Config::Method]
561
+ #
562
+ attr_reader :link_gbp_account
563
+
564
+ # @private
565
+ def initialize parent_rpcs = nil
566
+ list_gbp_accounts_config = parent_rpcs.list_gbp_accounts if parent_rpcs.respond_to? :list_gbp_accounts
567
+ @list_gbp_accounts = ::Gapic::Config::Method.new list_gbp_accounts_config
568
+ link_gbp_account_config = parent_rpcs.link_gbp_account if parent_rpcs.respond_to? :link_gbp_account
569
+ @link_gbp_account = ::Gapic::Config::Method.new link_gbp_account_config
570
+
571
+ yield self if block_given?
572
+ end
573
+ end
574
+ end
575
+ end
576
+ end
577
+ end
578
+ end
579
+ end
580
+ end
581
+ end
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2025 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "googleauth"
20
+
21
+ module Google
22
+ module Shopping
23
+ module Merchant
24
+ module Accounts
25
+ module V1beta
26
+ module GbpAccountsService
27
+ # Credentials for the GbpAccountsService API.
28
+ class Credentials < ::Google::Auth::Credentials
29
+ self.scope = [
30
+ "https://www.googleapis.com/auth/content"
31
+ ]
32
+ self.env_vars = [
33
+ "GOOGLE_CLOUD_CREDENTIALS",
34
+ "GOOGLE_CLOUD_KEYFILE",
35
+ "GCLOUD_KEYFILE",
36
+ "GOOGLE_CLOUD_CREDENTIALS_JSON",
37
+ "GOOGLE_CLOUD_KEYFILE_JSON",
38
+ "GCLOUD_KEYFILE_JSON"
39
+ ]
40
+ self.paths = [
41
+ "~/.config/google_cloud/application_default_credentials.json"
42
+ ]
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end