google-shopping-css-v1 0.5.1 → 0.6.1

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: 384d6fe8e857897c7db27aa5864910ff7e3cbc5c0504795f27d81e4177ccfc2c
4
- data.tar.gz: a120223bf8c8bf186bde6ec60f25445204699b04a03db11238637ec678bbb2af
3
+ metadata.gz: 63d79dcc26430fa20a3b5fbbb7a0863c6ab0f2c3fd8186c53d51b2fdb522f2ff
4
+ data.tar.gz: f6e41e986e5f22066f17590dac0f70d17c66ef0fc87991cabbe5194cfe299839
5
5
  SHA512:
6
- metadata.gz: f408748499f1496fff7dcd8fe054026fc6856ad7b23094d9d3a813caa3e91f5823255c8210165017ce33f9fac584b8d2c9e9d1916a1ea043dbe008d75831d846
7
- data.tar.gz: ca851260ec28be06a4a7567dc0bda20324b97afb1ac4abca6e05fcfad068f13a18778b30104a3d93312044369d8638e9ce5663880799a56cebfdbc725605cecc
6
+ metadata.gz: 22b6dab794a38c72c8659ca4c2a965e63483ca65590ba0e750bef9e27b3aa587326c9d55571cb16354a6b54ce1392ab2c615da670af2e5fd4216ea425360689e
7
+ data.tar.gz: 8fa11d7db0804523ae1ae36bf554ad202531e4ca7d3d25b74a0b7ef7905e7e6c1a8225388fe07edd3ccbcb0d458454020160a71183364d8f4c8dd11553c9c9cf
@@ -661,8 +661,8 @@ module Google
661
661
 
662
662
  config_attr :endpoint, nil, ::String, nil
663
663
  config_attr :credentials, nil do |value|
664
- allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
665
- allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
664
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
665
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
666
666
  allowed.any? { |klass| klass === value }
667
667
  end
668
668
  config_attr :scope, nil, ::String, ::Array, nil
@@ -617,7 +617,7 @@ module Google
617
617
 
618
618
  config_attr :endpoint, nil, ::String, nil
619
619
  config_attr :credentials, nil do |value|
620
- allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
620
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
621
621
  allowed.any? { |klass| klass === value }
622
622
  end
623
623
  config_attr :scope, nil, ::String, ::Array, nil
@@ -592,8 +592,8 @@ module Google
592
592
 
593
593
  config_attr :endpoint, nil, ::String, nil
594
594
  config_attr :credentials, nil do |value|
595
- allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
596
- allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
595
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
596
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
597
597
  allowed.any? { |klass| klass === value }
598
598
  end
599
599
  config_attr :scope, nil, ::String, ::Array, nil
@@ -555,7 +555,7 @@ module Google
555
555
 
556
556
  config_attr :endpoint, nil, ::String, nil
557
557
  config_attr :credentials, nil do |value|
558
- allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
558
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
559
559
  allowed.any? { |klass| klass === value }
560
560
  end
561
561
  config_attr :scope, nil, ::String, ::Array, nil
@@ -420,7 +420,10 @@ module Google
420
420
  #
421
421
  # @param name [::String]
422
422
  # Required. The name of the CSS product input resource to delete.
423
- # Format: accounts/\\{account}/cssProductInputs/\\{css_product_input}
423
+ # Format: accounts/\\{account}/cssProductInputs/\\{css_product_input}, where the
424
+ # last section `css_product_input` consists of 3 parts:
425
+ # contentLanguage~feedLabel~offerId. Example:
426
+ # accounts/123/cssProductInputs/de~DE~rawProvidedId123
424
427
  # @param supplemental_feed_id [::Integer]
425
428
  # The Content API Supplemental Feed ID.
426
429
  # The field must not be set if the action applies to a primary feed.
@@ -596,8 +599,8 @@ module Google
596
599
 
597
600
  config_attr :endpoint, nil, ::String, nil
598
601
  config_attr :credentials, nil do |value|
599
- allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
600
- allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
602
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
603
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
601
604
  allowed.any? { |klass| klass === value }
602
605
  end
603
606
  config_attr :scope, nil, ::String, ::Array, nil
@@ -399,7 +399,10 @@ module Google
399
399
  #
400
400
  # @param name [::String]
401
401
  # Required. The name of the CSS product input resource to delete.
402
- # Format: accounts/\\{account}/cssProductInputs/\\{css_product_input}
402
+ # Format: accounts/\\{account}/cssProductInputs/\\{css_product_input}, where the
403
+ # last section `css_product_input` consists of 3 parts:
404
+ # contentLanguage~feedLabel~offerId. Example:
405
+ # accounts/123/cssProductInputs/de~DE~rawProvidedId123
403
406
  # @param supplemental_feed_id [::Integer]
404
407
  # The Content API Supplemental Feed ID.
405
408
  # The field must not be set if the action applies to a primary feed.
@@ -559,7 +562,7 @@ module Google
559
562
 
560
563
  config_attr :endpoint, nil, ::String, nil
561
564
  config_attr :credentials, nil do |value|
562
- allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
565
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
563
566
  allowed.any? { |klass| klass === value }
564
567
  end
565
568
  config_attr :scope, nil, ::String, ::Array, nil
@@ -495,8 +495,8 @@ module Google
495
495
 
496
496
  config_attr :endpoint, nil, ::String, nil
497
497
  config_attr :credentials, nil do |value|
498
- allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
499
- allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
498
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
499
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
500
500
  allowed.any? { |klass| klass === value }
501
501
  end
502
502
  config_attr :scope, nil, ::String, ::Array, nil
@@ -465,7 +465,7 @@ module Google
465
465
 
466
466
  config_attr :endpoint, nil, ::String, nil
467
467
  config_attr :credentials, nil do |value|
468
- allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
468
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
469
469
  allowed.any? { |klass| klass === value }
470
470
  end
471
471
  config_attr :scope, nil, ::String, ::Array, nil
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # source: google/shopping/css/v1/quota.proto
4
+
5
+ require 'google/protobuf'
6
+
7
+ require 'google/api/annotations_pb'
8
+ require 'google/api/client_pb'
9
+ require 'google/api/field_behavior_pb'
10
+ require 'google/api/resource_pb'
11
+
12
+
13
+ descriptor_data = "\n\"google/shopping/css/v1/quota.proto\x12\x16google.shopping.css.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xa3\x02\n\nQuotaGroup\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x18\n\x0bquota_usage\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x12\x18\n\x0bquota_limit\x18\x03 \x01(\x03\x42\x03\xe0\x41\x03\x12\x1f\n\x12quota_minute_limit\x18\x05 \x01(\x03\x42\x03\xe0\x41\x03\x12\x42\n\x0emethod_details\x18\x04 \x03(\x0b\x32%.google.shopping.css.v1.MethodDetailsB\x03\xe0\x41\x03:i\xea\x41\x66\n\x1d\x63ss.googleapis.com/QuotaGroup\x12,accounts/{account}/quotaGroups/{quota_group}*\x0bquotaGroups2\nquotaGroup\"b\n\rMethodDetails\x12\x13\n\x06method\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x07version\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x13\n\x06subapi\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04path\x18\x04 \x01(\tB\x03\xe0\x41\x03\"\x80\x01\n\x16ListQuotaGroupsRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\x12\x1d\x63ss.googleapis.com/QuotaGroup\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\"l\n\x17ListQuotaGroupsResponse\x12\x38\n\x0cquota_groups\x18\x01 \x03(\x0b\x32\".google.shopping.css.v1.QuotaGroup\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t2\xf5\x01\n\x0cQuotaService\x12\xa3\x01\n\x0fListQuotaGroups\x12..google.shopping.css.v1.ListQuotaGroupsRequest\x1a/.google.shopping.css.v1.ListQuotaGroupsResponse\"/\xda\x41\x06parent\x82\xd3\xe4\x93\x02 \x12\x1e/v1/{parent=accounts/*}/quotas\x1a?\xca\x41\x12\x63ss.googleapis.com\xd2\x41\'https://www.googleapis.com/auth/contentB\xac\x01\n\x1a\x63om.google.shopping.css.v1B\nQuotaProtoP\x01Z2cloud.google.com/go/shopping/css/apiv1/csspb;csspb\xaa\x02\x16Google.Shopping.Css.V1\xca\x02\x16Google\\Shopping\\Css\\V1\xea\x02\x19Google::Shopping::Css::V1b\x06proto3"
14
+
15
+ pool = Google::Protobuf::DescriptorPool.generated_pool
16
+
17
+ begin
18
+ pool.add_serialized_file(descriptor_data)
19
+ rescue TypeError
20
+ # Compatibility code: will be removed in the next major version.
21
+ require 'google/protobuf/descriptor_pb'
22
+ parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
23
+ parsed.clear_dependency
24
+ serialized = parsed.class.encode(parsed)
25
+ file = pool.add_serialized_file(serialized)
26
+ warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
27
+ imports = [
28
+ ]
29
+ imports.each do |type_name, expected_filename|
30
+ import_file = pool.lookup(type_name).file_descriptor
31
+ if import_file.name != expected_filename
32
+ warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
33
+ end
34
+ end
35
+ warn "Each proto file must use a consistent fully-qualified name."
36
+ warn "This will become an error in the next major version."
37
+ end
38
+
39
+ module Google
40
+ module Shopping
41
+ module Css
42
+ module V1
43
+ QuotaGroup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.shopping.css.v1.QuotaGroup").msgclass
44
+ MethodDetails = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.shopping.css.v1.MethodDetails").msgclass
45
+ ListQuotaGroupsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.shopping.css.v1.ListQuotaGroupsRequest").msgclass
46
+ ListQuotaGroupsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.shopping.css.v1.ListQuotaGroupsResponse").msgclass
47
+ end
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,476 @@
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/css/v1/quota_pb"
21
+
22
+ module Google
23
+ module Shopping
24
+ module Css
25
+ module V1
26
+ module QuotaService
27
+ ##
28
+ # Client for the QuotaService service.
29
+ #
30
+ # Service to get method call quota information per CSS API method.
31
+ #
32
+ class Client
33
+ # @private
34
+ API_VERSION = ""
35
+
36
+ # @private
37
+ DEFAULT_ENDPOINT_TEMPLATE = "css.$UNIVERSE_DOMAIN$"
38
+
39
+ include Paths
40
+
41
+ # @private
42
+ attr_reader :quota_service_stub
43
+
44
+ ##
45
+ # Configure the QuotaService Client class.
46
+ #
47
+ # See {::Google::Shopping::Css::V1::QuotaService::Client::Configuration}
48
+ # for a description of the configuration fields.
49
+ #
50
+ # @example
51
+ #
52
+ # # Modify the configuration for all QuotaService clients
53
+ # ::Google::Shopping::Css::V1::QuotaService::Client.configure do |config|
54
+ # config.timeout = 10.0
55
+ # end
56
+ #
57
+ # @yield [config] Configure the Client client.
58
+ # @yieldparam config [Client::Configuration]
59
+ #
60
+ # @return [Client::Configuration]
61
+ #
62
+ def self.configure
63
+ @configure ||= begin
64
+ namespace = ["Google", "Shopping", "Css", "V1"]
65
+ parent_config = while namespace.any?
66
+ parent_name = namespace.join "::"
67
+ parent_const = const_get parent_name
68
+ break parent_const.configure if parent_const.respond_to? :configure
69
+ namespace.pop
70
+ end
71
+ default_config = Client::Configuration.new parent_config
72
+
73
+ default_config.rpcs.list_quota_groups.timeout = 60.0
74
+ default_config.rpcs.list_quota_groups.retry_policy = {
75
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
76
+ }
77
+
78
+ default_config
79
+ end
80
+ yield @configure if block_given?
81
+ @configure
82
+ end
83
+
84
+ ##
85
+ # Configure the QuotaService Client instance.
86
+ #
87
+ # The configuration is set to the derived mode, meaning that values can be changed,
88
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
89
+ # should be made on {Client.configure}.
90
+ #
91
+ # See {::Google::Shopping::Css::V1::QuotaService::Client::Configuration}
92
+ # for a description of the configuration fields.
93
+ #
94
+ # @yield [config] Configure the Client client.
95
+ # @yieldparam config [Client::Configuration]
96
+ #
97
+ # @return [Client::Configuration]
98
+ #
99
+ def configure
100
+ yield @config if block_given?
101
+ @config
102
+ end
103
+
104
+ ##
105
+ # The effective universe domain
106
+ #
107
+ # @return [String]
108
+ #
109
+ def universe_domain
110
+ @quota_service_stub.universe_domain
111
+ end
112
+
113
+ ##
114
+ # Create a new QuotaService client object.
115
+ #
116
+ # @example
117
+ #
118
+ # # Create a client using the default configuration
119
+ # client = ::Google::Shopping::Css::V1::QuotaService::Client.new
120
+ #
121
+ # # Create a client using a custom configuration
122
+ # client = ::Google::Shopping::Css::V1::QuotaService::Client.new do |config|
123
+ # config.timeout = 10.0
124
+ # end
125
+ #
126
+ # @yield [config] Configure the QuotaService client.
127
+ # @yieldparam config [Client::Configuration]
128
+ #
129
+ def initialize
130
+ # These require statements are intentionally placed here to initialize
131
+ # the gRPC module only when it's required.
132
+ # See https://github.com/googleapis/toolkit/issues/446
133
+ require "gapic/grpc"
134
+ require "google/shopping/css/v1/quota_services_pb"
135
+
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
+ @quota_project_id = @config.quota_project
155
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
156
+
157
+ @quota_service_stub = ::Gapic::ServiceStub.new(
158
+ ::Google::Shopping::Css::V1::QuotaService::Stub,
159
+ credentials: credentials,
160
+ endpoint: @config.endpoint,
161
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
162
+ universe_domain: @config.universe_domain,
163
+ channel_args: @config.channel_args,
164
+ interceptors: @config.interceptors,
165
+ channel_pool_config: @config.channel_pool,
166
+ logger: @config.logger
167
+ )
168
+
169
+ @quota_service_stub.stub_logger&.info do |entry|
170
+ entry.set_system_name
171
+ entry.set_service
172
+ entry.message = "Created client for #{entry.service}"
173
+ entry.set_credentials_fields credentials
174
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
175
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
176
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
177
+ end
178
+ end
179
+
180
+ ##
181
+ # The logger used for request/response debug logging.
182
+ #
183
+ # @return [Logger]
184
+ #
185
+ def logger
186
+ @quota_service_stub.logger
187
+ end
188
+
189
+ # Service calls
190
+
191
+ ##
192
+ # Lists the daily call quota and usage per group for your CSS Center account.
193
+ #
194
+ # @overload list_quota_groups(request, options = nil)
195
+ # Pass arguments to `list_quota_groups` via a request object, either of type
196
+ # {::Google::Shopping::Css::V1::ListQuotaGroupsRequest} or an equivalent Hash.
197
+ #
198
+ # @param request [::Google::Shopping::Css::V1::ListQuotaGroupsRequest, ::Hash]
199
+ # A request object representing the call parameters. Required. To specify no
200
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
201
+ # @param options [::Gapic::CallOptions, ::Hash]
202
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
203
+ #
204
+ # @overload list_quota_groups(parent: nil, page_size: nil, page_token: nil)
205
+ # Pass arguments to `list_quota_groups` via keyword arguments. Note that at
206
+ # least one keyword argument is required. To specify no parameters, or to keep all
207
+ # the default parameter values, pass an empty Hash as a request object (see above).
208
+ #
209
+ # @param parent [::String]
210
+ # Required. The CSS account that owns the collection of method quotas and
211
+ # resources. In most cases, this is the CSS domain. Format:
212
+ # accounts/\\{account}
213
+ # @param page_size [::Integer]
214
+ # Optional. The maximum number of quotas to return in the response, used
215
+ # for paging. Defaults to 500; values above 1000 will be coerced to 1000.
216
+ # @param page_token [::String]
217
+ # Optional. Token (if provided) to retrieve the subsequent page. All other
218
+ # parameters must match the original call that provided the page token.
219
+ #
220
+ # @yield [response, operation] Access the result along with the RPC operation
221
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Shopping::Css::V1::QuotaGroup>]
222
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
223
+ #
224
+ # @return [::Gapic::PagedEnumerable<::Google::Shopping::Css::V1::QuotaGroup>]
225
+ #
226
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
227
+ #
228
+ # @example Basic example
229
+ # require "google/shopping/css/v1"
230
+ #
231
+ # # Create a client object. The client can be reused for multiple calls.
232
+ # client = Google::Shopping::Css::V1::QuotaService::Client.new
233
+ #
234
+ # # Create a request. To set request fields, pass in keyword arguments.
235
+ # request = Google::Shopping::Css::V1::ListQuotaGroupsRequest.new
236
+ #
237
+ # # Call the list_quota_groups method.
238
+ # result = client.list_quota_groups request
239
+ #
240
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
241
+ # # over elements, and API calls will be issued to fetch pages as needed.
242
+ # result.each do |item|
243
+ # # Each element is of type ::Google::Shopping::Css::V1::QuotaGroup.
244
+ # p item
245
+ # end
246
+ #
247
+ def list_quota_groups request, options = nil
248
+ raise ::ArgumentError, "request must be provided" if request.nil?
249
+
250
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Css::V1::ListQuotaGroupsRequest
251
+
252
+ # Converts hash and nil to an options object
253
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
254
+
255
+ # Customize the options with defaults
256
+ metadata = @config.rpcs.list_quota_groups.metadata.to_h
257
+
258
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
259
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
260
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
261
+ gapic_version: ::Google::Shopping::Css::V1::VERSION
262
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
263
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
264
+
265
+ header_params = {}
266
+ if request.parent
267
+ header_params["parent"] = request.parent
268
+ end
269
+
270
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
271
+ metadata[:"x-goog-request-params"] ||= request_params_header
272
+
273
+ options.apply_defaults timeout: @config.rpcs.list_quota_groups.timeout,
274
+ metadata: metadata,
275
+ retry_policy: @config.rpcs.list_quota_groups.retry_policy
276
+
277
+ options.apply_defaults timeout: @config.timeout,
278
+ metadata: @config.metadata,
279
+ retry_policy: @config.retry_policy
280
+
281
+ @quota_service_stub.call_rpc :list_quota_groups, request, options: options do |response, operation|
282
+ response = ::Gapic::PagedEnumerable.new @quota_service_stub, :list_quota_groups, request, response, operation, options
283
+ yield response, operation if block_given?
284
+ throw :response, response
285
+ end
286
+ rescue ::GRPC::BadStatus => e
287
+ raise ::Google::Cloud::Error.from_error(e)
288
+ end
289
+
290
+ ##
291
+ # Configuration class for the QuotaService API.
292
+ #
293
+ # This class represents the configuration for QuotaService,
294
+ # providing control over timeouts, retry behavior, logging, transport
295
+ # parameters, and other low-level controls. Certain parameters can also be
296
+ # applied individually to specific RPCs. See
297
+ # {::Google::Shopping::Css::V1::QuotaService::Client::Configuration::Rpcs}
298
+ # for a list of RPCs that can be configured independently.
299
+ #
300
+ # Configuration can be applied globally to all clients, or to a single client
301
+ # on construction.
302
+ #
303
+ # @example
304
+ #
305
+ # # Modify the global config, setting the timeout for
306
+ # # list_quota_groups to 20 seconds,
307
+ # # and all remaining timeouts to 10 seconds.
308
+ # ::Google::Shopping::Css::V1::QuotaService::Client.configure do |config|
309
+ # config.timeout = 10.0
310
+ # config.rpcs.list_quota_groups.timeout = 20.0
311
+ # end
312
+ #
313
+ # # Apply the above configuration only to a new client.
314
+ # client = ::Google::Shopping::Css::V1::QuotaService::Client.new do |config|
315
+ # config.timeout = 10.0
316
+ # config.rpcs.list_quota_groups.timeout = 20.0
317
+ # end
318
+ #
319
+ # @!attribute [rw] endpoint
320
+ # A custom service endpoint, as a hostname or hostname:port. The default is
321
+ # nil, indicating to use the default endpoint in the current universe domain.
322
+ # @return [::String,nil]
323
+ # @!attribute [rw] credentials
324
+ # Credentials to send with calls. You may provide any of the following types:
325
+ # * (`String`) The path to a service account key file in JSON format
326
+ # * (`Hash`) A service account key as a Hash
327
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
328
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
329
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
330
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
331
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
332
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
333
+ # * (`nil`) indicating no credentials
334
+ #
335
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
336
+ # external source for authentication to Google Cloud, you must validate it before
337
+ # providing it to a Google API client library. Providing an unvalidated credential
338
+ # configuration to Google APIs can compromise the security of your systems and data.
339
+ # For more information, refer to [Validate credential configurations from external
340
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
341
+ # @return [::Object]
342
+ # @!attribute [rw] scope
343
+ # The OAuth scopes
344
+ # @return [::Array<::String>]
345
+ # @!attribute [rw] lib_name
346
+ # The library name as recorded in instrumentation and logging
347
+ # @return [::String]
348
+ # @!attribute [rw] lib_version
349
+ # The library version as recorded in instrumentation and logging
350
+ # @return [::String]
351
+ # @!attribute [rw] channel_args
352
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
353
+ # `GRPC::Core::Channel` object is provided as the credential.
354
+ # @return [::Hash]
355
+ # @!attribute [rw] interceptors
356
+ # An array of interceptors that are run before calls are executed.
357
+ # @return [::Array<::GRPC::ClientInterceptor>]
358
+ # @!attribute [rw] timeout
359
+ # The call timeout in seconds.
360
+ # @return [::Numeric]
361
+ # @!attribute [rw] metadata
362
+ # Additional gRPC headers to be sent with the call.
363
+ # @return [::Hash{::Symbol=>::String}]
364
+ # @!attribute [rw] retry_policy
365
+ # The retry policy. The value is a hash with the following keys:
366
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
367
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
368
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
369
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
370
+ # trigger a retry.
371
+ # @return [::Hash]
372
+ # @!attribute [rw] quota_project
373
+ # A separate project against which to charge quota.
374
+ # @return [::String]
375
+ # @!attribute [rw] universe_domain
376
+ # The universe domain within which to make requests. This determines the
377
+ # default endpoint URL. The default value of nil uses the environment
378
+ # universe (usually the default "googleapis.com" universe).
379
+ # @return [::String,nil]
380
+ # @!attribute [rw] logger
381
+ # A custom logger to use for request/response debug logging, or the value
382
+ # `:default` (the default) to construct a default logger, or `nil` to
383
+ # explicitly disable logging.
384
+ # @return [::Logger,:default,nil]
385
+ #
386
+ class Configuration
387
+ extend ::Gapic::Config
388
+
389
+ # @private
390
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
391
+ DEFAULT_ENDPOINT = "css.googleapis.com"
392
+
393
+ config_attr :endpoint, nil, ::String, nil
394
+ config_attr :credentials, nil do |value|
395
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
396
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
397
+ allowed.any? { |klass| klass === value }
398
+ end
399
+ config_attr :scope, nil, ::String, ::Array, nil
400
+ config_attr :lib_name, nil, ::String, nil
401
+ config_attr :lib_version, nil, ::String, nil
402
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
403
+ config_attr :interceptors, nil, ::Array, nil
404
+ config_attr :timeout, nil, ::Numeric, nil
405
+ config_attr :metadata, nil, ::Hash, nil
406
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
407
+ config_attr :quota_project, nil, ::String, nil
408
+ config_attr :universe_domain, nil, ::String, nil
409
+ config_attr :logger, :default, ::Logger, nil, :default
410
+
411
+ # @private
412
+ def initialize parent_config = nil
413
+ @parent_config = parent_config unless parent_config.nil?
414
+
415
+ yield self if block_given?
416
+ end
417
+
418
+ ##
419
+ # Configurations for individual RPCs
420
+ # @return [Rpcs]
421
+ #
422
+ def rpcs
423
+ @rpcs ||= begin
424
+ parent_rpcs = nil
425
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
426
+ Rpcs.new parent_rpcs
427
+ end
428
+ end
429
+
430
+ ##
431
+ # Configuration for the channel pool
432
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
433
+ #
434
+ def channel_pool
435
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
436
+ end
437
+
438
+ ##
439
+ # Configuration RPC class for the QuotaService API.
440
+ #
441
+ # Includes fields providing the configuration for each RPC in this service.
442
+ # Each configuration object is of type `Gapic::Config::Method` and includes
443
+ # the following configuration fields:
444
+ #
445
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
446
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
447
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
448
+ # include the following keys:
449
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
450
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
451
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
452
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
453
+ # trigger a retry.
454
+ #
455
+ class Rpcs
456
+ ##
457
+ # RPC-specific configuration for `list_quota_groups`
458
+ # @return [::Gapic::Config::Method]
459
+ #
460
+ attr_reader :list_quota_groups
461
+
462
+ # @private
463
+ def initialize parent_rpcs = nil
464
+ list_quota_groups_config = parent_rpcs.list_quota_groups if parent_rpcs.respond_to? :list_quota_groups
465
+ @list_quota_groups = ::Gapic::Config::Method.new list_quota_groups_config
466
+
467
+ yield self if block_given?
468
+ end
469
+ end
470
+ end
471
+ end
472
+ end
473
+ end
474
+ end
475
+ end
476
+ end