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