google-shopping-css-v1 0.a → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
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,546 @@
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_product_inputs_pb"
21
+
22
+ module Google
23
+ module Shopping
24
+ module Css
25
+ module V1
26
+ module CssProductInputsService
27
+ ##
28
+ # Client for the CssProductInputsService service.
29
+ #
30
+ # Service to use CssProductInput resource.
31
+ # This service helps to insert/update/delete CSS Products.
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_product_inputs_service_stub
44
+
45
+ ##
46
+ # Configure the CssProductInputsService Client class.
47
+ #
48
+ # See {::Google::Shopping::Css::V1::CssProductInputsService::Client::Configuration}
49
+ # for a description of the configuration fields.
50
+ #
51
+ # @example
52
+ #
53
+ # # Modify the configuration for all CssProductInputsService clients
54
+ # ::Google::Shopping::Css::V1::CssProductInputsService::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.insert_css_product_input.timeout = 60.0
75
+
76
+ default_config.rpcs.delete_css_product_input.timeout = 60.0
77
+
78
+ default_config
79
+ end
80
+ yield @configure if block_given?
81
+ @configure
82
+ end
83
+
84
+ ##
85
+ # Configure the CssProductInputsService 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::CssProductInputsService::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
+ @css_product_inputs_service_stub.universe_domain
111
+ end
112
+
113
+ ##
114
+ # Create a new CssProductInputsService client object.
115
+ #
116
+ # @example
117
+ #
118
+ # # Create a client using the default configuration
119
+ # client = ::Google::Shopping::Css::V1::CssProductInputsService::Client.new
120
+ #
121
+ # # Create a client using a custom configuration
122
+ # client = ::Google::Shopping::Css::V1::CssProductInputsService::Client.new do |config|
123
+ # config.timeout = 10.0
124
+ # end
125
+ #
126
+ # @yield [config] Configure the CssProductInputsService 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/css_product_inputs_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
+ @css_product_inputs_service_stub = ::Gapic::ServiceStub.new(
158
+ ::Google::Shopping::Css::V1::CssProductInputsService::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
+ )
167
+ end
168
+
169
+ # Service calls
170
+
171
+ ##
172
+ # Uploads a CssProductInput to your CSS Center account. If an
173
+ # input with the same contentLanguage, identity, feedLabel and feedId already
174
+ # exists, this method replaces that entry.
175
+ #
176
+ # After inserting, updating, or deleting a CSS Product input, it may
177
+ # take several minutes before the processed CSS Product can be retrieved.
178
+ #
179
+ # @overload insert_css_product_input(request, options = nil)
180
+ # Pass arguments to `insert_css_product_input` via a request object, either of type
181
+ # {::Google::Shopping::Css::V1::InsertCssProductInputRequest} or an equivalent Hash.
182
+ #
183
+ # @param request [::Google::Shopping::Css::V1::InsertCssProductInputRequest, ::Hash]
184
+ # A request object representing the call parameters. Required. To specify no
185
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
186
+ # @param options [::Gapic::CallOptions, ::Hash]
187
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
188
+ #
189
+ # @overload insert_css_product_input(parent: nil, css_product_input: nil, feed_id: nil)
190
+ # Pass arguments to `insert_css_product_input` via keyword arguments. Note that at
191
+ # least one keyword argument is required. To specify no parameters, or to keep all
192
+ # the default parameter values, pass an empty Hash as a request object (see above).
193
+ #
194
+ # @param parent [::String]
195
+ # Required. The account where this CSS Product will be inserted.
196
+ # Format: accounts/\\{account}
197
+ # @param css_product_input [::Google::Shopping::Css::V1::CssProductInput, ::Hash]
198
+ # Required. The CSS Product Input to insert.
199
+ # @param feed_id [::Integer]
200
+ # Required. The primary or supplemental feed id. If CSS Product already
201
+ # exists and feed id provided is different, then the CSS Product will be
202
+ # moved to a new feed. Note: For now, CSSs do not need to provide feed ids as
203
+ # we create feeds on the fly. We do not have supplemental feed support for
204
+ # CSS Products yet.
205
+ #
206
+ # @yield [response, operation] Access the result along with the RPC operation
207
+ # @yieldparam response [::Google::Shopping::Css::V1::CssProductInput]
208
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
209
+ #
210
+ # @return [::Google::Shopping::Css::V1::CssProductInput]
211
+ #
212
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
213
+ #
214
+ # @example Basic example
215
+ # require "google/shopping/css/v1"
216
+ #
217
+ # # Create a client object. The client can be reused for multiple calls.
218
+ # client = Google::Shopping::Css::V1::CssProductInputsService::Client.new
219
+ #
220
+ # # Create a request. To set request fields, pass in keyword arguments.
221
+ # request = Google::Shopping::Css::V1::InsertCssProductInputRequest.new
222
+ #
223
+ # # Call the insert_css_product_input method.
224
+ # result = client.insert_css_product_input request
225
+ #
226
+ # # The returned object is of type Google::Shopping::Css::V1::CssProductInput.
227
+ # p result
228
+ #
229
+ def insert_css_product_input request, options = nil
230
+ raise ::ArgumentError, "request must be provided" if request.nil?
231
+
232
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Css::V1::InsertCssProductInputRequest
233
+
234
+ # Converts hash and nil to an options object
235
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
236
+
237
+ # Customize the options with defaults
238
+ metadata = @config.rpcs.insert_css_product_input.metadata.to_h
239
+
240
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
241
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
242
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
243
+ gapic_version: ::Google::Shopping::Css::V1::VERSION
244
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
245
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
246
+
247
+ header_params = {}
248
+ if request.parent
249
+ header_params["parent"] = request.parent
250
+ end
251
+
252
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
253
+ metadata[:"x-goog-request-params"] ||= request_params_header
254
+
255
+ options.apply_defaults timeout: @config.rpcs.insert_css_product_input.timeout,
256
+ metadata: metadata,
257
+ retry_policy: @config.rpcs.insert_css_product_input.retry_policy
258
+
259
+ options.apply_defaults timeout: @config.timeout,
260
+ metadata: @config.metadata,
261
+ retry_policy: @config.retry_policy
262
+
263
+ @css_product_inputs_service_stub.call_rpc :insert_css_product_input, request, options: options do |response, operation|
264
+ yield response, operation if block_given?
265
+ return response
266
+ end
267
+ rescue ::GRPC::BadStatus => e
268
+ raise ::Google::Cloud::Error.from_error(e)
269
+ end
270
+
271
+ ##
272
+ # Deletes a CSS Product input from your CSS Center account.
273
+ #
274
+ # After a delete it may take several minutes until the input is no longer
275
+ # available.
276
+ #
277
+ # @overload delete_css_product_input(request, options = nil)
278
+ # Pass arguments to `delete_css_product_input` via a request object, either of type
279
+ # {::Google::Shopping::Css::V1::DeleteCssProductInputRequest} or an equivalent Hash.
280
+ #
281
+ # @param request [::Google::Shopping::Css::V1::DeleteCssProductInputRequest, ::Hash]
282
+ # A request object representing the call parameters. Required. To specify no
283
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
284
+ # @param options [::Gapic::CallOptions, ::Hash]
285
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
286
+ #
287
+ # @overload delete_css_product_input(name: nil, supplemental_feed_id: nil)
288
+ # Pass arguments to `delete_css_product_input` via keyword arguments. Note that at
289
+ # least one keyword argument is required. To specify no parameters, or to keep all
290
+ # the default parameter values, pass an empty Hash as a request object (see above).
291
+ #
292
+ # @param name [::String]
293
+ # Required. The name of the CSS product input resource to delete.
294
+ # Format: accounts/\\{account}/cssProductInputs/\\{css_product_input}
295
+ # @param supplemental_feed_id [::Integer]
296
+ # The Content API Supplemental Feed ID.
297
+ # The field must not be set if the action applies to a primary feed.
298
+ # If the field is set, then product action applies to a supplemental feed
299
+ # instead of primary Content API feed.
300
+ #
301
+ # @yield [response, operation] Access the result along with the RPC operation
302
+ # @yieldparam response [::Google::Protobuf::Empty]
303
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
304
+ #
305
+ # @return [::Google::Protobuf::Empty]
306
+ #
307
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
308
+ #
309
+ # @example Basic example
310
+ # require "google/shopping/css/v1"
311
+ #
312
+ # # Create a client object. The client can be reused for multiple calls.
313
+ # client = Google::Shopping::Css::V1::CssProductInputsService::Client.new
314
+ #
315
+ # # Create a request. To set request fields, pass in keyword arguments.
316
+ # request = Google::Shopping::Css::V1::DeleteCssProductInputRequest.new
317
+ #
318
+ # # Call the delete_css_product_input method.
319
+ # result = client.delete_css_product_input request
320
+ #
321
+ # # The returned object is of type Google::Protobuf::Empty.
322
+ # p result
323
+ #
324
+ def delete_css_product_input request, options = nil
325
+ raise ::ArgumentError, "request must be provided" if request.nil?
326
+
327
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Css::V1::DeleteCssProductInputRequest
328
+
329
+ # Converts hash and nil to an options object
330
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
331
+
332
+ # Customize the options with defaults
333
+ metadata = @config.rpcs.delete_css_product_input.metadata.to_h
334
+
335
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
336
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
337
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
338
+ gapic_version: ::Google::Shopping::Css::V1::VERSION
339
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
340
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
341
+
342
+ header_params = {}
343
+ if request.name
344
+ header_params["name"] = request.name
345
+ end
346
+
347
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
348
+ metadata[:"x-goog-request-params"] ||= request_params_header
349
+
350
+ options.apply_defaults timeout: @config.rpcs.delete_css_product_input.timeout,
351
+ metadata: metadata,
352
+ retry_policy: @config.rpcs.delete_css_product_input.retry_policy
353
+
354
+ options.apply_defaults timeout: @config.timeout,
355
+ metadata: @config.metadata,
356
+ retry_policy: @config.retry_policy
357
+
358
+ @css_product_inputs_service_stub.call_rpc :delete_css_product_input, request, options: options do |response, operation|
359
+ yield response, operation if block_given?
360
+ return response
361
+ end
362
+ rescue ::GRPC::BadStatus => e
363
+ raise ::Google::Cloud::Error.from_error(e)
364
+ end
365
+
366
+ ##
367
+ # Configuration class for the CssProductInputsService API.
368
+ #
369
+ # This class represents the configuration for CssProductInputsService,
370
+ # providing control over timeouts, retry behavior, logging, transport
371
+ # parameters, and other low-level controls. Certain parameters can also be
372
+ # applied individually to specific RPCs. See
373
+ # {::Google::Shopping::Css::V1::CssProductInputsService::Client::Configuration::Rpcs}
374
+ # for a list of RPCs that can be configured independently.
375
+ #
376
+ # Configuration can be applied globally to all clients, or to a single client
377
+ # on construction.
378
+ #
379
+ # @example
380
+ #
381
+ # # Modify the global config, setting the timeout for
382
+ # # insert_css_product_input to 20 seconds,
383
+ # # and all remaining timeouts to 10 seconds.
384
+ # ::Google::Shopping::Css::V1::CssProductInputsService::Client.configure do |config|
385
+ # config.timeout = 10.0
386
+ # config.rpcs.insert_css_product_input.timeout = 20.0
387
+ # end
388
+ #
389
+ # # Apply the above configuration only to a new client.
390
+ # client = ::Google::Shopping::Css::V1::CssProductInputsService::Client.new do |config|
391
+ # config.timeout = 10.0
392
+ # config.rpcs.insert_css_product_input.timeout = 20.0
393
+ # end
394
+ #
395
+ # @!attribute [rw] endpoint
396
+ # A custom service endpoint, as a hostname or hostname:port. The default is
397
+ # nil, indicating to use the default endpoint in the current universe domain.
398
+ # @return [::String,nil]
399
+ # @!attribute [rw] credentials
400
+ # Credentials to send with calls. You may provide any of the following types:
401
+ # * (`String`) The path to a service account key file in JSON format
402
+ # * (`Hash`) A service account key as a Hash
403
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
404
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
405
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
406
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
407
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
408
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
409
+ # * (`nil`) indicating no credentials
410
+ # @return [::Object]
411
+ # @!attribute [rw] scope
412
+ # The OAuth scopes
413
+ # @return [::Array<::String>]
414
+ # @!attribute [rw] lib_name
415
+ # The library name as recorded in instrumentation and logging
416
+ # @return [::String]
417
+ # @!attribute [rw] lib_version
418
+ # The library version as recorded in instrumentation and logging
419
+ # @return [::String]
420
+ # @!attribute [rw] channel_args
421
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
422
+ # `GRPC::Core::Channel` object is provided as the credential.
423
+ # @return [::Hash]
424
+ # @!attribute [rw] interceptors
425
+ # An array of interceptors that are run before calls are executed.
426
+ # @return [::Array<::GRPC::ClientInterceptor>]
427
+ # @!attribute [rw] timeout
428
+ # The call timeout in seconds.
429
+ # @return [::Numeric]
430
+ # @!attribute [rw] metadata
431
+ # Additional gRPC headers to be sent with the call.
432
+ # @return [::Hash{::Symbol=>::String}]
433
+ # @!attribute [rw] retry_policy
434
+ # The retry policy. The value is a hash with the following keys:
435
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
436
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
437
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
438
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
439
+ # trigger a retry.
440
+ # @return [::Hash]
441
+ # @!attribute [rw] quota_project
442
+ # A separate project against which to charge quota.
443
+ # @return [::String]
444
+ # @!attribute [rw] universe_domain
445
+ # The universe domain within which to make requests. This determines the
446
+ # default endpoint URL. The default value of nil uses the environment
447
+ # universe (usually the default "googleapis.com" universe).
448
+ # @return [::String,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 = "css.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, ::Signet::OAuth2::Client, nil]
460
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
461
+ allowed.any? { |klass| klass === value }
462
+ end
463
+ config_attr :scope, nil, ::String, ::Array, nil
464
+ config_attr :lib_name, nil, ::String, nil
465
+ config_attr :lib_version, nil, ::String, nil
466
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
467
+ config_attr :interceptors, nil, ::Array, nil
468
+ config_attr :timeout, nil, ::Numeric, nil
469
+ config_attr :metadata, nil, ::Hash, nil
470
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
471
+ config_attr :quota_project, nil, ::String, nil
472
+ config_attr :universe_domain, nil, ::String, nil
473
+
474
+ # @private
475
+ def initialize parent_config = nil
476
+ @parent_config = parent_config unless parent_config.nil?
477
+
478
+ yield self if block_given?
479
+ end
480
+
481
+ ##
482
+ # Configurations for individual RPCs
483
+ # @return [Rpcs]
484
+ #
485
+ def rpcs
486
+ @rpcs ||= begin
487
+ parent_rpcs = nil
488
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
489
+ Rpcs.new parent_rpcs
490
+ end
491
+ end
492
+
493
+ ##
494
+ # Configuration for the channel pool
495
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
496
+ #
497
+ def channel_pool
498
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
499
+ end
500
+
501
+ ##
502
+ # Configuration RPC class for the CssProductInputsService API.
503
+ #
504
+ # Includes fields providing the configuration for each RPC in this service.
505
+ # Each configuration object is of type `Gapic::Config::Method` and includes
506
+ # the following configuration fields:
507
+ #
508
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
509
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
510
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
511
+ # include the following keys:
512
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
513
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
514
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
515
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
516
+ # trigger a retry.
517
+ #
518
+ class Rpcs
519
+ ##
520
+ # RPC-specific configuration for `insert_css_product_input`
521
+ # @return [::Gapic::Config::Method]
522
+ #
523
+ attr_reader :insert_css_product_input
524
+ ##
525
+ # RPC-specific configuration for `delete_css_product_input`
526
+ # @return [::Gapic::Config::Method]
527
+ #
528
+ attr_reader :delete_css_product_input
529
+
530
+ # @private
531
+ def initialize parent_rpcs = nil
532
+ insert_css_product_input_config = parent_rpcs.insert_css_product_input if parent_rpcs.respond_to? :insert_css_product_input
533
+ @insert_css_product_input = ::Gapic::Config::Method.new insert_css_product_input_config
534
+ delete_css_product_input_config = parent_rpcs.delete_css_product_input if parent_rpcs.respond_to? :delete_css_product_input
535
+ @delete_css_product_input = ::Gapic::Config::Method.new delete_css_product_input_config
536
+
537
+ yield self if block_given?
538
+ end
539
+ end
540
+ end
541
+ end
542
+ end
543
+ end
544
+ end
545
+ end
546
+ 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 CssProductInputsService
26
+ # Credentials for the CssProductInputsService 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 CssProductInputsService
25
+ # Path helper methods for the CssProductInputsService 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 CssProductInput resource string.
43
+ #
44
+ # The resource will be in the following format:
45
+ #
46
+ # `accounts/{account}/cssProductInputs/{css_product_input}`
47
+ #
48
+ # @param account [String]
49
+ # @param css_product_input [String]
50
+ #
51
+ # @return [::String]
52
+ def css_product_input_path account:, css_product_input:
53
+ raise ::ArgumentError, "account cannot contain /" if account.to_s.include? "/"
54
+
55
+ "accounts/#{account}/cssProductInputs/#{css_product_input}"
56
+ end
57
+
58
+ extend self
59
+ end
60
+ end
61
+ end
62
+ end
63
+ end
64
+ end