google-shopping-css-v1 0.a → 0.1.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 (60) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +122 -0
  4. data/README.md +144 -8
  5. data/lib/google/shopping/css/v1/account_labels_service/client.rb +736 -0
  6. data/lib/google/shopping/css/v1/account_labels_service/credentials.rb +47 -0
  7. data/lib/google/shopping/css/v1/account_labels_service/paths.rb +64 -0
  8. data/lib/google/shopping/css/v1/account_labels_service/rest/client.rb +682 -0
  9. data/lib/google/shopping/css/v1/account_labels_service/rest/service_stub.rb +307 -0
  10. data/lib/google/shopping/css/v1/account_labels_service/rest.rb +52 -0
  11. data/lib/google/shopping/css/v1/account_labels_service.rb +55 -0
  12. data/lib/google/shopping/css/v1/accounts_labels_pb.rb +54 -0
  13. data/lib/google/shopping/css/v1/accounts_labels_services_pb.rb +51 -0
  14. data/lib/google/shopping/css/v1/accounts_pb.rb +52 -0
  15. data/lib/google/shopping/css/v1/accounts_service/client.rb +659 -0
  16. data/lib/google/shopping/css/v1/accounts_service/credentials.rb +47 -0
  17. data/lib/google/shopping/css/v1/accounts_service/paths.rb +47 -0
  18. data/lib/google/shopping/css/v1/accounts_service/rest/client.rb +612 -0
  19. data/lib/google/shopping/css/v1/accounts_service/rest/service_stub.rb +247 -0
  20. data/lib/google/shopping/css/v1/accounts_service/rest.rb +52 -0
  21. data/lib/google/shopping/css/v1/accounts_service.rb +55 -0
  22. data/lib/google/shopping/css/v1/accounts_services_pb.rb +50 -0
  23. data/lib/google/shopping/css/v1/css_product_common_pb.rb +55 -0
  24. data/lib/google/shopping/css/v1/css_product_inputs_pb.rb +56 -0
  25. data/lib/google/shopping/css/v1/css_product_inputs_service/client.rb +546 -0
  26. data/lib/google/shopping/css/v1/css_product_inputs_service/credentials.rb +47 -0
  27. data/lib/google/shopping/css/v1/css_product_inputs_service/paths.rb +64 -0
  28. data/lib/google/shopping/css/v1/css_product_inputs_service/rest/client.rb +506 -0
  29. data/lib/google/shopping/css/v1/css_product_inputs_service/rest/service_stub.rb +188 -0
  30. data/lib/google/shopping/css/v1/css_product_inputs_service/rest.rb +53 -0
  31. data/lib/google/shopping/css/v1/css_product_inputs_service.rb +56 -0
  32. data/lib/google/shopping/css/v1/css_product_inputs_services_pb.rb +56 -0
  33. data/lib/google/shopping/css/v1/css_products_pb.rb +54 -0
  34. data/lib/google/shopping/css/v1/css_products_service/client.rb +554 -0
  35. data/lib/google/shopping/css/v1/css_products_service/credentials.rb +47 -0
  36. data/lib/google/shopping/css/v1/css_products_service/paths.rb +64 -0
  37. data/lib/google/shopping/css/v1/css_products_service/rest/client.rb +514 -0
  38. data/lib/google/shopping/css/v1/css_products_service/rest/service_stub.rb +187 -0
  39. data/lib/google/shopping/css/v1/css_products_service/rest.rb +53 -0
  40. data/lib/google/shopping/css/v1/css_products_service.rb +56 -0
  41. data/lib/google/shopping/css/v1/css_products_services_pb.rb +56 -0
  42. data/lib/google/shopping/css/v1/rest.rb +40 -0
  43. data/lib/google/shopping/css/v1/version.rb +8 -3
  44. data/lib/google/shopping/css/v1.rb +48 -0
  45. data/lib/google-shopping-css-v1.rb +21 -0
  46. data/proto_docs/README.md +4 -0
  47. data/proto_docs/google/api/client.rb +399 -0
  48. data/proto_docs/google/api/field_behavior.rb +85 -0
  49. data/proto_docs/google/api/launch_stage.rb +71 -0
  50. data/proto_docs/google/api/resource.rb +222 -0
  51. data/proto_docs/google/protobuf/duration.rb +98 -0
  52. data/proto_docs/google/protobuf/empty.rb +34 -0
  53. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  54. data/proto_docs/google/shopping/css/v1/accounts.rb +168 -0
  55. data/proto_docs/google/shopping/css/v1/accounts_labels.rb +131 -0
  56. data/proto_docs/google/shopping/css/v1/css_product_common.rb +352 -0
  57. data/proto_docs/google/shopping/css/v1/css_product_inputs.rb +130 -0
  58. data/proto_docs/google/shopping/css/v1/css_products.rb +109 -0
  59. data/proto_docs/google/shopping/type/types.rb +210 -0
  60. metadata +123 -13
@@ -0,0 +1,554 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2024 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/css_products_pb"
21
+
22
+ module Google
23
+ module Shopping
24
+ module Css
25
+ module V1
26
+ module CssProductsService
27
+ ##
28
+ # Client for the CssProductsService service.
29
+ #
30
+ # Service for doing get and list on Css Products(a.k.a Aggregate Offers
31
+ # internally).
32
+ #
33
+ class Client
34
+ # @private
35
+ API_VERSION = ""
36
+
37
+ # @private
38
+ DEFAULT_ENDPOINT_TEMPLATE = "css.$UNIVERSE_DOMAIN$"
39
+
40
+ include Paths
41
+
42
+ # @private
43
+ attr_reader :css_products_service_stub
44
+
45
+ ##
46
+ # Configure the CssProductsService Client class.
47
+ #
48
+ # See {::Google::Shopping::Css::V1::CssProductsService::Client::Configuration}
49
+ # for a description of the configuration fields.
50
+ #
51
+ # @example
52
+ #
53
+ # # Modify the configuration for all CssProductsService clients
54
+ # ::Google::Shopping::Css::V1::CssProductsService::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", "Css", "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.rpcs.get_css_product.timeout = 60.0
75
+ default_config.rpcs.get_css_product.retry_policy = {
76
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
77
+ }
78
+
79
+ default_config.rpcs.list_css_products.timeout = 60.0
80
+ default_config.rpcs.list_css_products.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 CssProductsService 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::Css::V1::CssProductsService::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
+ @css_products_service_stub.universe_domain
117
+ end
118
+
119
+ ##
120
+ # Create a new CssProductsService client object.
121
+ #
122
+ # @example
123
+ #
124
+ # # Create a client using the default configuration
125
+ # client = ::Google::Shopping::Css::V1::CssProductsService::Client.new
126
+ #
127
+ # # Create a client using a custom configuration
128
+ # client = ::Google::Shopping::Css::V1::CssProductsService::Client.new do |config|
129
+ # config.timeout = 10.0
130
+ # end
131
+ #
132
+ # @yield [config] Configure the CssProductsService client.
133
+ # @yieldparam config [Client::Configuration]
134
+ #
135
+ def initialize
136
+ # These require statements are intentionally placed here to initialize
137
+ # the gRPC module only when it's required.
138
+ # See https://github.com/googleapis/toolkit/issues/446
139
+ require "gapic/grpc"
140
+ require "google/shopping/css/v1/css_products_services_pb"
141
+
142
+ # Create the configuration object
143
+ @config = Configuration.new Client.configure
144
+
145
+ # Yield the configuration if needed
146
+ yield @config if block_given?
147
+
148
+ # Create credentials
149
+ credentials = @config.credentials
150
+ # Use self-signed JWT if the endpoint is unchanged from default,
151
+ # but only if the default endpoint does not have a region prefix.
152
+ enable_self_signed_jwt = @config.endpoint.nil? ||
153
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
154
+ !@config.endpoint.split(".").first.include?("-"))
155
+ credentials ||= Credentials.default scope: @config.scope,
156
+ enable_self_signed_jwt: enable_self_signed_jwt
157
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
158
+ credentials = Credentials.new credentials, scope: @config.scope
159
+ end
160
+ @quota_project_id = @config.quota_project
161
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
162
+
163
+ @css_products_service_stub = ::Gapic::ServiceStub.new(
164
+ ::Google::Shopping::Css::V1::CssProductsService::Stub,
165
+ credentials: credentials,
166
+ endpoint: @config.endpoint,
167
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
168
+ universe_domain: @config.universe_domain,
169
+ channel_args: @config.channel_args,
170
+ interceptors: @config.interceptors,
171
+ channel_pool_config: @config.channel_pool
172
+ )
173
+ end
174
+
175
+ # Service calls
176
+
177
+ ##
178
+ # Retrieves the processed CSS Product from your CSS Center account. After
179
+ # inserting, updating, or deleting a product input, it may take several
180
+ # minutes before the updated final product can be retrieved.
181
+ #
182
+ # @overload get_css_product(request, options = nil)
183
+ # Pass arguments to `get_css_product` via a request object, either of type
184
+ # {::Google::Shopping::Css::V1::GetCssProductRequest} or an equivalent Hash.
185
+ #
186
+ # @param request [::Google::Shopping::Css::V1::GetCssProductRequest, ::Hash]
187
+ # A request object representing the call parameters. Required. To specify no
188
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
189
+ # @param options [::Gapic::CallOptions, ::Hash]
190
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
191
+ #
192
+ # @overload get_css_product(name: nil)
193
+ # Pass arguments to `get_css_product` via keyword arguments. Note that at
194
+ # least one keyword argument is required. To specify no parameters, or to keep all
195
+ # the default parameter values, pass an empty Hash as a request object (see above).
196
+ #
197
+ # @param name [::String]
198
+ # Required. The name of the CSS product to retrieve.
199
+ #
200
+ # @yield [response, operation] Access the result along with the RPC operation
201
+ # @yieldparam response [::Google::Shopping::Css::V1::CssProduct]
202
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
203
+ #
204
+ # @return [::Google::Shopping::Css::V1::CssProduct]
205
+ #
206
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
207
+ #
208
+ # @example Basic example
209
+ # require "google/shopping/css/v1"
210
+ #
211
+ # # Create a client object. The client can be reused for multiple calls.
212
+ # client = Google::Shopping::Css::V1::CssProductsService::Client.new
213
+ #
214
+ # # Create a request. To set request fields, pass in keyword arguments.
215
+ # request = Google::Shopping::Css::V1::GetCssProductRequest.new
216
+ #
217
+ # # Call the get_css_product method.
218
+ # result = client.get_css_product request
219
+ #
220
+ # # The returned object is of type Google::Shopping::Css::V1::CssProduct.
221
+ # p result
222
+ #
223
+ def get_css_product request, options = nil
224
+ raise ::ArgumentError, "request must be provided" if request.nil?
225
+
226
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Css::V1::GetCssProductRequest
227
+
228
+ # Converts hash and nil to an options object
229
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
230
+
231
+ # Customize the options with defaults
232
+ metadata = @config.rpcs.get_css_product.metadata.to_h
233
+
234
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
235
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
236
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
237
+ gapic_version: ::Google::Shopping::Css::V1::VERSION
238
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
239
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
240
+
241
+ header_params = {}
242
+ if request.name
243
+ header_params["name"] = request.name
244
+ end
245
+
246
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
247
+ metadata[:"x-goog-request-params"] ||= request_params_header
248
+
249
+ options.apply_defaults timeout: @config.rpcs.get_css_product.timeout,
250
+ metadata: metadata,
251
+ retry_policy: @config.rpcs.get_css_product.retry_policy
252
+
253
+ options.apply_defaults timeout: @config.timeout,
254
+ metadata: @config.metadata,
255
+ retry_policy: @config.retry_policy
256
+
257
+ @css_products_service_stub.call_rpc :get_css_product, request, options: options do |response, operation|
258
+ yield response, operation if block_given?
259
+ return response
260
+ end
261
+ rescue ::GRPC::BadStatus => e
262
+ raise ::Google::Cloud::Error.from_error(e)
263
+ end
264
+
265
+ ##
266
+ # Lists the processed CSS Products in your CSS Center account. The response
267
+ # might contain fewer items than specified by pageSize. Rely on pageToken to
268
+ # determine if there are more items to be requested.
269
+ #
270
+ # After inserting, updating, or deleting a CSS product input, it may
271
+ # take several minutes before the updated processed CSS product can be
272
+ # retrieved.
273
+ #
274
+ # @overload list_css_products(request, options = nil)
275
+ # Pass arguments to `list_css_products` via a request object, either of type
276
+ # {::Google::Shopping::Css::V1::ListCssProductsRequest} or an equivalent Hash.
277
+ #
278
+ # @param request [::Google::Shopping::Css::V1::ListCssProductsRequest, ::Hash]
279
+ # A request object representing the call parameters. Required. To specify no
280
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
281
+ # @param options [::Gapic::CallOptions, ::Hash]
282
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
283
+ #
284
+ # @overload list_css_products(parent: nil, page_size: nil, page_token: nil)
285
+ # Pass arguments to `list_css_products` via keyword arguments. Note that at
286
+ # least one keyword argument is required. To specify no parameters, or to keep all
287
+ # the default parameter values, pass an empty Hash as a request object (see above).
288
+ #
289
+ # @param parent [::String]
290
+ # Required. The account/domain to list processed CSS Products for.
291
+ # Format: accounts/\\{account}
292
+ # @param page_size [::Integer]
293
+ # The maximum number of CSS Products to return. The service may return
294
+ # fewer than this value.
295
+ # The maximum value is 1000; values above 1000 will be coerced to 1000. If
296
+ # unspecified, the maximum number of CSS products will be returned.
297
+ # @param page_token [::String]
298
+ # A page token, received from a previous `ListCssProducts` call.
299
+ # Provide this to retrieve the subsequent page.
300
+ #
301
+ # When paginating, all other parameters provided to `ListCssProducts`
302
+ # must match the call that provided the page token.
303
+ #
304
+ # @yield [response, operation] Access the result along with the RPC operation
305
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Shopping::Css::V1::CssProduct>]
306
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
307
+ #
308
+ # @return [::Gapic::PagedEnumerable<::Google::Shopping::Css::V1::CssProduct>]
309
+ #
310
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
311
+ #
312
+ # @example Basic example
313
+ # require "google/shopping/css/v1"
314
+ #
315
+ # # Create a client object. The client can be reused for multiple calls.
316
+ # client = Google::Shopping::Css::V1::CssProductsService::Client.new
317
+ #
318
+ # # Create a request. To set request fields, pass in keyword arguments.
319
+ # request = Google::Shopping::Css::V1::ListCssProductsRequest.new
320
+ #
321
+ # # Call the list_css_products method.
322
+ # result = client.list_css_products request
323
+ #
324
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
325
+ # # over elements, and API calls will be issued to fetch pages as needed.
326
+ # result.each do |item|
327
+ # # Each element is of type ::Google::Shopping::Css::V1::CssProduct.
328
+ # p item
329
+ # end
330
+ #
331
+ def list_css_products request, options = nil
332
+ raise ::ArgumentError, "request must be provided" if request.nil?
333
+
334
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Css::V1::ListCssProductsRequest
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
+ metadata = @config.rpcs.list_css_products.metadata.to_h
341
+
342
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
343
+ 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::Css::V1::VERSION
346
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
347
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
348
+
349
+ header_params = {}
350
+ if request.parent
351
+ header_params["parent"] = request.parent
352
+ end
353
+
354
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
355
+ metadata[:"x-goog-request-params"] ||= request_params_header
356
+
357
+ options.apply_defaults timeout: @config.rpcs.list_css_products.timeout,
358
+ metadata: metadata,
359
+ retry_policy: @config.rpcs.list_css_products.retry_policy
360
+
361
+ options.apply_defaults timeout: @config.timeout,
362
+ metadata: @config.metadata,
363
+ retry_policy: @config.retry_policy
364
+
365
+ @css_products_service_stub.call_rpc :list_css_products, request, options: options do |response, operation|
366
+ response = ::Gapic::PagedEnumerable.new @css_products_service_stub, :list_css_products, request, response, operation, options
367
+ yield response, operation if block_given?
368
+ return response
369
+ end
370
+ rescue ::GRPC::BadStatus => e
371
+ raise ::Google::Cloud::Error.from_error(e)
372
+ end
373
+
374
+ ##
375
+ # Configuration class for the CssProductsService API.
376
+ #
377
+ # This class represents the configuration for CssProductsService,
378
+ # providing control over timeouts, retry behavior, logging, transport
379
+ # parameters, and other low-level controls. Certain parameters can also be
380
+ # applied individually to specific RPCs. See
381
+ # {::Google::Shopping::Css::V1::CssProductsService::Client::Configuration::Rpcs}
382
+ # for a list of RPCs that can be configured independently.
383
+ #
384
+ # Configuration can be applied globally to all clients, or to a single client
385
+ # on construction.
386
+ #
387
+ # @example
388
+ #
389
+ # # Modify the global config, setting the timeout for
390
+ # # get_css_product to 20 seconds,
391
+ # # and all remaining timeouts to 10 seconds.
392
+ # ::Google::Shopping::Css::V1::CssProductsService::Client.configure do |config|
393
+ # config.timeout = 10.0
394
+ # config.rpcs.get_css_product.timeout = 20.0
395
+ # end
396
+ #
397
+ # # Apply the above configuration only to a new client.
398
+ # client = ::Google::Shopping::Css::V1::CssProductsService::Client.new do |config|
399
+ # config.timeout = 10.0
400
+ # config.rpcs.get_css_product.timeout = 20.0
401
+ # end
402
+ #
403
+ # @!attribute [rw] endpoint
404
+ # A custom service endpoint, as a hostname or hostname:port. The default is
405
+ # nil, indicating to use the default endpoint in the current universe domain.
406
+ # @return [::String,nil]
407
+ # @!attribute [rw] credentials
408
+ # Credentials to send with calls. You may provide any of the following types:
409
+ # * (`String`) The path to a service account key file in JSON format
410
+ # * (`Hash`) A service account key as a Hash
411
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
412
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
413
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
414
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
415
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
416
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
417
+ # * (`nil`) indicating no credentials
418
+ # @return [::Object]
419
+ # @!attribute [rw] scope
420
+ # The OAuth scopes
421
+ # @return [::Array<::String>]
422
+ # @!attribute [rw] lib_name
423
+ # The library name as recorded in instrumentation and logging
424
+ # @return [::String]
425
+ # @!attribute [rw] lib_version
426
+ # The library version as recorded in instrumentation and logging
427
+ # @return [::String]
428
+ # @!attribute [rw] channel_args
429
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
430
+ # `GRPC::Core::Channel` object is provided as the credential.
431
+ # @return [::Hash]
432
+ # @!attribute [rw] interceptors
433
+ # An array of interceptors that are run before calls are executed.
434
+ # @return [::Array<::GRPC::ClientInterceptor>]
435
+ # @!attribute [rw] timeout
436
+ # The call timeout in seconds.
437
+ # @return [::Numeric]
438
+ # @!attribute [rw] metadata
439
+ # Additional gRPC headers to be sent with the call.
440
+ # @return [::Hash{::Symbol=>::String}]
441
+ # @!attribute [rw] retry_policy
442
+ # The retry policy. The value is a hash with the following keys:
443
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
444
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
445
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
446
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
447
+ # trigger a retry.
448
+ # @return [::Hash]
449
+ # @!attribute [rw] quota_project
450
+ # A separate project against which to charge quota.
451
+ # @return [::String]
452
+ # @!attribute [rw] universe_domain
453
+ # The universe domain within which to make requests. This determines the
454
+ # default endpoint URL. The default value of nil uses the environment
455
+ # universe (usually the default "googleapis.com" universe).
456
+ # @return [::String,nil]
457
+ #
458
+ class Configuration
459
+ extend ::Gapic::Config
460
+
461
+ # @private
462
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
463
+ DEFAULT_ENDPOINT = "css.googleapis.com"
464
+
465
+ config_attr :endpoint, nil, ::String, nil
466
+ config_attr :credentials, nil do |value|
467
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
468
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
469
+ allowed.any? { |klass| klass === value }
470
+ end
471
+ config_attr :scope, nil, ::String, ::Array, nil
472
+ config_attr :lib_name, nil, ::String, nil
473
+ config_attr :lib_version, nil, ::String, nil
474
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
475
+ config_attr :interceptors, nil, ::Array, nil
476
+ config_attr :timeout, nil, ::Numeric, nil
477
+ config_attr :metadata, nil, ::Hash, nil
478
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
479
+ config_attr :quota_project, nil, ::String, nil
480
+ config_attr :universe_domain, nil, ::String, nil
481
+
482
+ # @private
483
+ def initialize parent_config = nil
484
+ @parent_config = parent_config unless parent_config.nil?
485
+
486
+ yield self if block_given?
487
+ end
488
+
489
+ ##
490
+ # Configurations for individual RPCs
491
+ # @return [Rpcs]
492
+ #
493
+ def rpcs
494
+ @rpcs ||= begin
495
+ parent_rpcs = nil
496
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
497
+ Rpcs.new parent_rpcs
498
+ end
499
+ end
500
+
501
+ ##
502
+ # Configuration for the channel pool
503
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
504
+ #
505
+ def channel_pool
506
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
507
+ end
508
+
509
+ ##
510
+ # Configuration RPC class for the CssProductsService API.
511
+ #
512
+ # Includes fields providing the configuration for each RPC in this service.
513
+ # Each configuration object is of type `Gapic::Config::Method` and includes
514
+ # the following configuration fields:
515
+ #
516
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
517
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
518
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
519
+ # include the following keys:
520
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
521
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
522
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
523
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
524
+ # trigger a retry.
525
+ #
526
+ class Rpcs
527
+ ##
528
+ # RPC-specific configuration for `get_css_product`
529
+ # @return [::Gapic::Config::Method]
530
+ #
531
+ attr_reader :get_css_product
532
+ ##
533
+ # RPC-specific configuration for `list_css_products`
534
+ # @return [::Gapic::Config::Method]
535
+ #
536
+ attr_reader :list_css_products
537
+
538
+ # @private
539
+ def initialize parent_rpcs = nil
540
+ get_css_product_config = parent_rpcs.get_css_product if parent_rpcs.respond_to? :get_css_product
541
+ @get_css_product = ::Gapic::Config::Method.new get_css_product_config
542
+ list_css_products_config = parent_rpcs.list_css_products if parent_rpcs.respond_to? :list_css_products
543
+ @list_css_products = ::Gapic::Config::Method.new list_css_products_config
544
+
545
+ yield self if block_given?
546
+ end
547
+ end
548
+ end
549
+ end
550
+ end
551
+ end
552
+ end
553
+ end
554
+ end
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2024 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 Css
24
+ module V1
25
+ module CssProductsService
26
+ # Credentials for the CssProductsService API.
27
+ class Credentials < ::Google::Auth::Credentials
28
+ self.scope = [
29
+ "https://www.googleapis.com/auth/content"
30
+ ]
31
+ self.env_vars = [
32
+ "GOOGLE_CLOUD_CREDENTIALS",
33
+ "GOOGLE_CLOUD_KEYFILE",
34
+ "GCLOUD_KEYFILE",
35
+ "GOOGLE_CLOUD_CREDENTIALS_JSON",
36
+ "GOOGLE_CLOUD_KEYFILE_JSON",
37
+ "GCLOUD_KEYFILE_JSON"
38
+ ]
39
+ self.paths = [
40
+ "~/.config/google_cloud/application_default_credentials.json"
41
+ ]
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,64 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2024 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 Css
23
+ module V1
24
+ module CssProductsService
25
+ # Path helper methods for the CssProductsService API.
26
+ module Paths
27
+ ##
28
+ # Create a fully-qualified Account resource string.
29
+ #
30
+ # The resource will be in the following format:
31
+ #
32
+ # `accounts/{account}`
33
+ #
34
+ # @param account [String]
35
+ #
36
+ # @return [::String]
37
+ def account_path account:
38
+ "accounts/#{account}"
39
+ end
40
+
41
+ ##
42
+ # Create a fully-qualified CssProduct resource string.
43
+ #
44
+ # The resource will be in the following format:
45
+ #
46
+ # `accounts/{account}/cssProducts/{css_product}`
47
+ #
48
+ # @param account [String]
49
+ # @param css_product [String]
50
+ #
51
+ # @return [::String]
52
+ def css_product_path account:, css_product:
53
+ raise ::ArgumentError, "account cannot contain /" if account.to_s.include? "/"
54
+
55
+ "accounts/#{account}/cssProducts/#{css_product}"
56
+ end
57
+
58
+ extend self
59
+ end
60
+ end
61
+ end
62
+ end
63
+ end
64
+ end