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