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,682 @@
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/accounts_labels_pb"
21
+ require "google/shopping/css/v1/account_labels_service/rest/service_stub"
22
+
23
+ module Google
24
+ module Shopping
25
+ module Css
26
+ module V1
27
+ module AccountLabelsService
28
+ module Rest
29
+ ##
30
+ # REST client for the AccountLabelsService service.
31
+ #
32
+ # Manages Merchant Center and CSS accounts labels.
33
+ #
34
+ class Client
35
+ # @private
36
+ API_VERSION = ""
37
+
38
+ # @private
39
+ DEFAULT_ENDPOINT_TEMPLATE = "css.$UNIVERSE_DOMAIN$"
40
+
41
+ include Paths
42
+
43
+ # @private
44
+ attr_reader :account_labels_service_stub
45
+
46
+ ##
47
+ # Configure the AccountLabelsService Client class.
48
+ #
49
+ # See {::Google::Shopping::Css::V1::AccountLabelsService::Rest::Client::Configuration}
50
+ # for a description of the configuration fields.
51
+ #
52
+ # @example
53
+ #
54
+ # # Modify the configuration for all AccountLabelsService clients
55
+ # ::Google::Shopping::Css::V1::AccountLabelsService::Rest::Client.configure do |config|
56
+ # config.timeout = 10.0
57
+ # end
58
+ #
59
+ # @yield [config] Configure the Client client.
60
+ # @yieldparam config [Client::Configuration]
61
+ #
62
+ # @return [Client::Configuration]
63
+ #
64
+ def self.configure
65
+ @configure ||= begin
66
+ namespace = ["Google", "Shopping", "Css", "V1"]
67
+ parent_config = while namespace.any?
68
+ parent_name = namespace.join "::"
69
+ parent_const = const_get parent_name
70
+ break parent_const.configure if parent_const.respond_to? :configure
71
+ namespace.pop
72
+ end
73
+ default_config = Client::Configuration.new parent_config
74
+
75
+ default_config.rpcs.list_account_labels.timeout = 60.0
76
+ default_config.rpcs.list_account_labels.retry_policy = {
77
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
78
+ }
79
+
80
+ default_config.rpcs.create_account_label.timeout = 60.0
81
+
82
+ default_config.rpcs.update_account_label.timeout = 60.0
83
+
84
+ default_config.rpcs.delete_account_label.timeout = 60.0
85
+
86
+ default_config
87
+ end
88
+ yield @configure if block_given?
89
+ @configure
90
+ end
91
+
92
+ ##
93
+ # Configure the AccountLabelsService Client instance.
94
+ #
95
+ # The configuration is set to the derived mode, meaning that values can be changed,
96
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
97
+ # should be made on {Client.configure}.
98
+ #
99
+ # See {::Google::Shopping::Css::V1::AccountLabelsService::Rest::Client::Configuration}
100
+ # for a description of the configuration fields.
101
+ #
102
+ # @yield [config] Configure the Client client.
103
+ # @yieldparam config [Client::Configuration]
104
+ #
105
+ # @return [Client::Configuration]
106
+ #
107
+ def configure
108
+ yield @config if block_given?
109
+ @config
110
+ end
111
+
112
+ ##
113
+ # The effective universe domain
114
+ #
115
+ # @return [String]
116
+ #
117
+ def universe_domain
118
+ @account_labels_service_stub.universe_domain
119
+ end
120
+
121
+ ##
122
+ # Create a new AccountLabelsService REST client object.
123
+ #
124
+ # @example
125
+ #
126
+ # # Create a client using the default configuration
127
+ # client = ::Google::Shopping::Css::V1::AccountLabelsService::Rest::Client.new
128
+ #
129
+ # # Create a client using a custom configuration
130
+ # client = ::Google::Shopping::Css::V1::AccountLabelsService::Rest::Client.new do |config|
131
+ # config.timeout = 10.0
132
+ # end
133
+ #
134
+ # @yield [config] Configure the AccountLabelsService client.
135
+ # @yieldparam config [Client::Configuration]
136
+ #
137
+ def initialize
138
+ # Create the configuration object
139
+ @config = Configuration.new Client.configure
140
+
141
+ # Yield the configuration if needed
142
+ yield @config if block_given?
143
+
144
+ # Create credentials
145
+ credentials = @config.credentials
146
+ # Use self-signed JWT if the endpoint is unchanged from default,
147
+ # but only if the default endpoint does not have a region prefix.
148
+ enable_self_signed_jwt = @config.endpoint.nil? ||
149
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
150
+ !@config.endpoint.split(".").first.include?("-"))
151
+ credentials ||= Credentials.default scope: @config.scope,
152
+ enable_self_signed_jwt: enable_self_signed_jwt
153
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
154
+ credentials = Credentials.new credentials, scope: @config.scope
155
+ end
156
+
157
+ @quota_project_id = @config.quota_project
158
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
159
+
160
+ @account_labels_service_stub = ::Google::Shopping::Css::V1::AccountLabelsService::Rest::ServiceStub.new(
161
+ endpoint: @config.endpoint,
162
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
163
+ universe_domain: @config.universe_domain,
164
+ credentials: credentials
165
+ )
166
+ end
167
+
168
+ # Service calls
169
+
170
+ ##
171
+ # Lists the labels assigned to an account.
172
+ #
173
+ # @overload list_account_labels(request, options = nil)
174
+ # Pass arguments to `list_account_labels` via a request object, either of type
175
+ # {::Google::Shopping::Css::V1::ListAccountLabelsRequest} or an equivalent Hash.
176
+ #
177
+ # @param request [::Google::Shopping::Css::V1::ListAccountLabelsRequest, ::Hash]
178
+ # A request object representing the call parameters. Required. To specify no
179
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
180
+ # @param options [::Gapic::CallOptions, ::Hash]
181
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
182
+ #
183
+ # @overload list_account_labels(parent: nil, page_size: nil, page_token: nil)
184
+ # Pass arguments to `list_account_labels` via keyword arguments. Note that at
185
+ # least one keyword argument is required. To specify no parameters, or to keep all
186
+ # the default parameter values, pass an empty Hash as a request object (see above).
187
+ #
188
+ # @param parent [::String]
189
+ # Required. The parent account.
190
+ # Format: accounts/\\{account}
191
+ # @param page_size [::Integer]
192
+ # The maximum number of labels to return. The service may return fewer than
193
+ # this value.
194
+ # If unspecified, at most 50 labels will be returned.
195
+ # The maximum value is 1000; values above 1000 will be coerced to 1000.
196
+ # @param page_token [::String]
197
+ # A page token, received from a previous `ListAccountLabels` call.
198
+ # Provide this to retrieve the subsequent page.
199
+ #
200
+ # When paginating, all other parameters provided to `ListAccountLabels` must
201
+ # match the call that provided the page token.
202
+ # @yield [result, operation] Access the result along with the TransportOperation object
203
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Shopping::Css::V1::AccountLabel>]
204
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
205
+ #
206
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Shopping::Css::V1::AccountLabel>]
207
+ #
208
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
209
+ #
210
+ # @example Basic example
211
+ # require "google/shopping/css/v1"
212
+ #
213
+ # # Create a client object. The client can be reused for multiple calls.
214
+ # client = Google::Shopping::Css::V1::AccountLabelsService::Rest::Client.new
215
+ #
216
+ # # Create a request. To set request fields, pass in keyword arguments.
217
+ # request = Google::Shopping::Css::V1::ListAccountLabelsRequest.new
218
+ #
219
+ # # Call the list_account_labels method.
220
+ # result = client.list_account_labels request
221
+ #
222
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
223
+ # # over elements, and API calls will be issued to fetch pages as needed.
224
+ # result.each do |item|
225
+ # # Each element is of type ::Google::Shopping::Css::V1::AccountLabel.
226
+ # p item
227
+ # end
228
+ #
229
+ def list_account_labels 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::ListAccountLabelsRequest
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
+ call_metadata = @config.rpcs.list_account_labels.metadata.to_h
239
+
240
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
241
+ call_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
+ transports_version_send: [:rest]
245
+
246
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
247
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
248
+
249
+ options.apply_defaults timeout: @config.rpcs.list_account_labels.timeout,
250
+ metadata: call_metadata,
251
+ retry_policy: @config.rpcs.list_account_labels.retry_policy
252
+
253
+ options.apply_defaults timeout: @config.timeout,
254
+ metadata: @config.metadata,
255
+ retry_policy: @config.retry_policy
256
+
257
+ @account_labels_service_stub.list_account_labels request, options do |result, operation|
258
+ result = ::Gapic::Rest::PagedEnumerable.new @account_labels_service_stub, :list_account_labels, "account_labels", request, result, options
259
+ yield result, operation if block_given?
260
+ return result
261
+ end
262
+ rescue ::Gapic::Rest::Error => e
263
+ raise ::Google::Cloud::Error.from_error(e)
264
+ end
265
+
266
+ ##
267
+ # Creates a new label, not assigned to any account.
268
+ #
269
+ # @overload create_account_label(request, options = nil)
270
+ # Pass arguments to `create_account_label` via a request object, either of type
271
+ # {::Google::Shopping::Css::V1::CreateAccountLabelRequest} or an equivalent Hash.
272
+ #
273
+ # @param request [::Google::Shopping::Css::V1::CreateAccountLabelRequest, ::Hash]
274
+ # A request object representing the call parameters. Required. To specify no
275
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
276
+ # @param options [::Gapic::CallOptions, ::Hash]
277
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
278
+ #
279
+ # @overload create_account_label(parent: nil, account_label: nil)
280
+ # Pass arguments to `create_account_label` via keyword arguments. Note that at
281
+ # least one keyword argument is required. To specify no parameters, or to keep all
282
+ # the default parameter values, pass an empty Hash as a request object (see above).
283
+ #
284
+ # @param parent [::String]
285
+ # Required. The parent account.
286
+ # Format: accounts/\\{account}
287
+ # @param account_label [::Google::Shopping::Css::V1::AccountLabel, ::Hash]
288
+ # Required. The label to create.
289
+ # @yield [result, operation] Access the result along with the TransportOperation object
290
+ # @yieldparam result [::Google::Shopping::Css::V1::AccountLabel]
291
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
292
+ #
293
+ # @return [::Google::Shopping::Css::V1::AccountLabel]
294
+ #
295
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
296
+ #
297
+ # @example Basic example
298
+ # require "google/shopping/css/v1"
299
+ #
300
+ # # Create a client object. The client can be reused for multiple calls.
301
+ # client = Google::Shopping::Css::V1::AccountLabelsService::Rest::Client.new
302
+ #
303
+ # # Create a request. To set request fields, pass in keyword arguments.
304
+ # request = Google::Shopping::Css::V1::CreateAccountLabelRequest.new
305
+ #
306
+ # # Call the create_account_label method.
307
+ # result = client.create_account_label request
308
+ #
309
+ # # The returned object is of type Google::Shopping::Css::V1::AccountLabel.
310
+ # p result
311
+ #
312
+ def create_account_label request, options = nil
313
+ raise ::ArgumentError, "request must be provided" if request.nil?
314
+
315
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Css::V1::CreateAccountLabelRequest
316
+
317
+ # Converts hash and nil to an options object
318
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
319
+
320
+ # Customize the options with defaults
321
+ call_metadata = @config.rpcs.create_account_label.metadata.to_h
322
+
323
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
324
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
325
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
326
+ gapic_version: ::Google::Shopping::Css::V1::VERSION,
327
+ transports_version_send: [:rest]
328
+
329
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
330
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
331
+
332
+ options.apply_defaults timeout: @config.rpcs.create_account_label.timeout,
333
+ metadata: call_metadata,
334
+ retry_policy: @config.rpcs.create_account_label.retry_policy
335
+
336
+ options.apply_defaults timeout: @config.timeout,
337
+ metadata: @config.metadata,
338
+ retry_policy: @config.retry_policy
339
+
340
+ @account_labels_service_stub.create_account_label request, options do |result, operation|
341
+ yield result, operation if block_given?
342
+ return result
343
+ end
344
+ rescue ::Gapic::Rest::Error => e
345
+ raise ::Google::Cloud::Error.from_error(e)
346
+ end
347
+
348
+ ##
349
+ # Updates a label.
350
+ #
351
+ # @overload update_account_label(request, options = nil)
352
+ # Pass arguments to `update_account_label` via a request object, either of type
353
+ # {::Google::Shopping::Css::V1::UpdateAccountLabelRequest} or an equivalent Hash.
354
+ #
355
+ # @param request [::Google::Shopping::Css::V1::UpdateAccountLabelRequest, ::Hash]
356
+ # A request object representing the call parameters. Required. To specify no
357
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
358
+ # @param options [::Gapic::CallOptions, ::Hash]
359
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
360
+ #
361
+ # @overload update_account_label(account_label: nil)
362
+ # Pass arguments to `update_account_label` via keyword arguments. Note that at
363
+ # least one keyword argument is required. To specify no parameters, or to keep all
364
+ # the default parameter values, pass an empty Hash as a request object (see above).
365
+ #
366
+ # @param account_label [::Google::Shopping::Css::V1::AccountLabel, ::Hash]
367
+ # Required. The updated label. All fields must be provided.
368
+ # @yield [result, operation] Access the result along with the TransportOperation object
369
+ # @yieldparam result [::Google::Shopping::Css::V1::AccountLabel]
370
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
371
+ #
372
+ # @return [::Google::Shopping::Css::V1::AccountLabel]
373
+ #
374
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
375
+ #
376
+ # @example Basic example
377
+ # require "google/shopping/css/v1"
378
+ #
379
+ # # Create a client object. The client can be reused for multiple calls.
380
+ # client = Google::Shopping::Css::V1::AccountLabelsService::Rest::Client.new
381
+ #
382
+ # # Create a request. To set request fields, pass in keyword arguments.
383
+ # request = Google::Shopping::Css::V1::UpdateAccountLabelRequest.new
384
+ #
385
+ # # Call the update_account_label method.
386
+ # result = client.update_account_label request
387
+ #
388
+ # # The returned object is of type Google::Shopping::Css::V1::AccountLabel.
389
+ # p result
390
+ #
391
+ def update_account_label request, options = nil
392
+ raise ::ArgumentError, "request must be provided" if request.nil?
393
+
394
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Css::V1::UpdateAccountLabelRequest
395
+
396
+ # Converts hash and nil to an options object
397
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
398
+
399
+ # Customize the options with defaults
400
+ call_metadata = @config.rpcs.update_account_label.metadata.to_h
401
+
402
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
403
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
404
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
405
+ gapic_version: ::Google::Shopping::Css::V1::VERSION,
406
+ transports_version_send: [:rest]
407
+
408
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
409
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
410
+
411
+ options.apply_defaults timeout: @config.rpcs.update_account_label.timeout,
412
+ metadata: call_metadata,
413
+ retry_policy: @config.rpcs.update_account_label.retry_policy
414
+
415
+ options.apply_defaults timeout: @config.timeout,
416
+ metadata: @config.metadata,
417
+ retry_policy: @config.retry_policy
418
+
419
+ @account_labels_service_stub.update_account_label request, options do |result, operation|
420
+ yield result, operation if block_given?
421
+ return result
422
+ end
423
+ rescue ::Gapic::Rest::Error => e
424
+ raise ::Google::Cloud::Error.from_error(e)
425
+ end
426
+
427
+ ##
428
+ # Deletes a label and removes it from all accounts to which it was assigned.
429
+ #
430
+ # @overload delete_account_label(request, options = nil)
431
+ # Pass arguments to `delete_account_label` via a request object, either of type
432
+ # {::Google::Shopping::Css::V1::DeleteAccountLabelRequest} or an equivalent Hash.
433
+ #
434
+ # @param request [::Google::Shopping::Css::V1::DeleteAccountLabelRequest, ::Hash]
435
+ # A request object representing the call parameters. Required. To specify no
436
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
437
+ # @param options [::Gapic::CallOptions, ::Hash]
438
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
439
+ #
440
+ # @overload delete_account_label(name: nil)
441
+ # Pass arguments to `delete_account_label` via keyword arguments. Note that at
442
+ # least one keyword argument is required. To specify no parameters, or to keep all
443
+ # the default parameter values, pass an empty Hash as a request object (see above).
444
+ #
445
+ # @param name [::String]
446
+ # Required. The name of the label to delete.
447
+ # Format: accounts/\\{account}/labels/\\{label}
448
+ # @yield [result, operation] Access the result along with the TransportOperation object
449
+ # @yieldparam result [::Google::Protobuf::Empty]
450
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
451
+ #
452
+ # @return [::Google::Protobuf::Empty]
453
+ #
454
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
455
+ #
456
+ # @example Basic example
457
+ # require "google/shopping/css/v1"
458
+ #
459
+ # # Create a client object. The client can be reused for multiple calls.
460
+ # client = Google::Shopping::Css::V1::AccountLabelsService::Rest::Client.new
461
+ #
462
+ # # Create a request. To set request fields, pass in keyword arguments.
463
+ # request = Google::Shopping::Css::V1::DeleteAccountLabelRequest.new
464
+ #
465
+ # # Call the delete_account_label method.
466
+ # result = client.delete_account_label request
467
+ #
468
+ # # The returned object is of type Google::Protobuf::Empty.
469
+ # p result
470
+ #
471
+ def delete_account_label request, options = nil
472
+ raise ::ArgumentError, "request must be provided" if request.nil?
473
+
474
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Css::V1::DeleteAccountLabelRequest
475
+
476
+ # Converts hash and nil to an options object
477
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
478
+
479
+ # Customize the options with defaults
480
+ call_metadata = @config.rpcs.delete_account_label.metadata.to_h
481
+
482
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
483
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
484
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
485
+ gapic_version: ::Google::Shopping::Css::V1::VERSION,
486
+ transports_version_send: [:rest]
487
+
488
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
489
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
490
+
491
+ options.apply_defaults timeout: @config.rpcs.delete_account_label.timeout,
492
+ metadata: call_metadata,
493
+ retry_policy: @config.rpcs.delete_account_label.retry_policy
494
+
495
+ options.apply_defaults timeout: @config.timeout,
496
+ metadata: @config.metadata,
497
+ retry_policy: @config.retry_policy
498
+
499
+ @account_labels_service_stub.delete_account_label request, options do |result, operation|
500
+ yield result, operation if block_given?
501
+ return result
502
+ end
503
+ rescue ::Gapic::Rest::Error => e
504
+ raise ::Google::Cloud::Error.from_error(e)
505
+ end
506
+
507
+ ##
508
+ # Configuration class for the AccountLabelsService REST API.
509
+ #
510
+ # This class represents the configuration for AccountLabelsService REST,
511
+ # providing control over timeouts, retry behavior, logging, transport
512
+ # parameters, and other low-level controls. Certain parameters can also be
513
+ # applied individually to specific RPCs. See
514
+ # {::Google::Shopping::Css::V1::AccountLabelsService::Rest::Client::Configuration::Rpcs}
515
+ # for a list of RPCs that can be configured independently.
516
+ #
517
+ # Configuration can be applied globally to all clients, or to a single client
518
+ # on construction.
519
+ #
520
+ # @example
521
+ #
522
+ # # Modify the global config, setting the timeout for
523
+ # # list_account_labels to 20 seconds,
524
+ # # and all remaining timeouts to 10 seconds.
525
+ # ::Google::Shopping::Css::V1::AccountLabelsService::Rest::Client.configure do |config|
526
+ # config.timeout = 10.0
527
+ # config.rpcs.list_account_labels.timeout = 20.0
528
+ # end
529
+ #
530
+ # # Apply the above configuration only to a new client.
531
+ # client = ::Google::Shopping::Css::V1::AccountLabelsService::Rest::Client.new do |config|
532
+ # config.timeout = 10.0
533
+ # config.rpcs.list_account_labels.timeout = 20.0
534
+ # end
535
+ #
536
+ # @!attribute [rw] endpoint
537
+ # A custom service endpoint, as a hostname or hostname:port. The default is
538
+ # nil, indicating to use the default endpoint in the current universe domain.
539
+ # @return [::String,nil]
540
+ # @!attribute [rw] credentials
541
+ # Credentials to send with calls. You may provide any of the following types:
542
+ # * (`String`) The path to a service account key file in JSON format
543
+ # * (`Hash`) A service account key as a Hash
544
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
545
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
546
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
547
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
548
+ # * (`nil`) indicating no credentials
549
+ # @return [::Object]
550
+ # @!attribute [rw] scope
551
+ # The OAuth scopes
552
+ # @return [::Array<::String>]
553
+ # @!attribute [rw] lib_name
554
+ # The library name as recorded in instrumentation and logging
555
+ # @return [::String]
556
+ # @!attribute [rw] lib_version
557
+ # The library version as recorded in instrumentation and logging
558
+ # @return [::String]
559
+ # @!attribute [rw] timeout
560
+ # The call timeout in seconds.
561
+ # @return [::Numeric]
562
+ # @!attribute [rw] metadata
563
+ # Additional headers to be sent with the call.
564
+ # @return [::Hash{::Symbol=>::String}]
565
+ # @!attribute [rw] retry_policy
566
+ # The retry policy. The value is a hash with the following keys:
567
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
568
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
569
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
570
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
571
+ # trigger a retry.
572
+ # @return [::Hash]
573
+ # @!attribute [rw] quota_project
574
+ # A separate project against which to charge quota.
575
+ # @return [::String]
576
+ # @!attribute [rw] universe_domain
577
+ # The universe domain within which to make requests. This determines the
578
+ # default endpoint URL. The default value of nil uses the environment
579
+ # universe (usually the default "googleapis.com" universe).
580
+ # @return [::String,nil]
581
+ #
582
+ class Configuration
583
+ extend ::Gapic::Config
584
+
585
+ # @private
586
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
587
+ DEFAULT_ENDPOINT = "css.googleapis.com"
588
+
589
+ config_attr :endpoint, nil, ::String, nil
590
+ config_attr :credentials, nil do |value|
591
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
592
+ allowed.any? { |klass| klass === value }
593
+ end
594
+ config_attr :scope, nil, ::String, ::Array, nil
595
+ config_attr :lib_name, nil, ::String, nil
596
+ config_attr :lib_version, nil, ::String, nil
597
+ config_attr :timeout, nil, ::Numeric, nil
598
+ config_attr :metadata, nil, ::Hash, nil
599
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
600
+ config_attr :quota_project, nil, ::String, nil
601
+ config_attr :universe_domain, nil, ::String, nil
602
+
603
+ # @private
604
+ def initialize parent_config = nil
605
+ @parent_config = parent_config unless parent_config.nil?
606
+
607
+ yield self if block_given?
608
+ end
609
+
610
+ ##
611
+ # Configurations for individual RPCs
612
+ # @return [Rpcs]
613
+ #
614
+ def rpcs
615
+ @rpcs ||= begin
616
+ parent_rpcs = nil
617
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
618
+ Rpcs.new parent_rpcs
619
+ end
620
+ end
621
+
622
+ ##
623
+ # Configuration RPC class for the AccountLabelsService API.
624
+ #
625
+ # Includes fields providing the configuration for each RPC in this service.
626
+ # Each configuration object is of type `Gapic::Config::Method` and includes
627
+ # the following configuration fields:
628
+ #
629
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
630
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
631
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
632
+ # include the following keys:
633
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
634
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
635
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
636
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
637
+ # trigger a retry.
638
+ #
639
+ class Rpcs
640
+ ##
641
+ # RPC-specific configuration for `list_account_labels`
642
+ # @return [::Gapic::Config::Method]
643
+ #
644
+ attr_reader :list_account_labels
645
+ ##
646
+ # RPC-specific configuration for `create_account_label`
647
+ # @return [::Gapic::Config::Method]
648
+ #
649
+ attr_reader :create_account_label
650
+ ##
651
+ # RPC-specific configuration for `update_account_label`
652
+ # @return [::Gapic::Config::Method]
653
+ #
654
+ attr_reader :update_account_label
655
+ ##
656
+ # RPC-specific configuration for `delete_account_label`
657
+ # @return [::Gapic::Config::Method]
658
+ #
659
+ attr_reader :delete_account_label
660
+
661
+ # @private
662
+ def initialize parent_rpcs = nil
663
+ list_account_labels_config = parent_rpcs.list_account_labels if parent_rpcs.respond_to? :list_account_labels
664
+ @list_account_labels = ::Gapic::Config::Method.new list_account_labels_config
665
+ create_account_label_config = parent_rpcs.create_account_label if parent_rpcs.respond_to? :create_account_label
666
+ @create_account_label = ::Gapic::Config::Method.new create_account_label_config
667
+ update_account_label_config = parent_rpcs.update_account_label if parent_rpcs.respond_to? :update_account_label
668
+ @update_account_label = ::Gapic::Config::Method.new update_account_label_config
669
+ delete_account_label_config = parent_rpcs.delete_account_label if parent_rpcs.respond_to? :delete_account_label
670
+ @delete_account_label = ::Gapic::Config::Method.new delete_account_label_config
671
+
672
+ yield self if block_given?
673
+ end
674
+ end
675
+ end
676
+ end
677
+ end
678
+ end
679
+ end
680
+ end
681
+ end
682
+ end