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