google-cloud-service_management-v1 0.4.1 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,1347 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 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/api/servicemanagement/v1/servicemanager_pb"
21
+ require "google/cloud/service_management/v1/service_manager/rest/service_stub"
22
+
23
+ module Google
24
+ module Cloud
25
+ module ServiceManagement
26
+ module V1
27
+ module ServiceManager
28
+ module Rest
29
+ ##
30
+ # REST client for the ServiceManager service.
31
+ #
32
+ # [Google Service Management
33
+ # API](https://cloud.google.com/service-infrastructure/docs/overview)
34
+ #
35
+ class Client
36
+ # @private
37
+ attr_reader :service_manager_stub
38
+
39
+ ##
40
+ # Configure the ServiceManager Client class.
41
+ #
42
+ # See {::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client::Configuration}
43
+ # for a description of the configuration fields.
44
+ #
45
+ # @example
46
+ #
47
+ # # Modify the configuration for all ServiceManager clients
48
+ # ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.configure do |config|
49
+ # config.timeout = 10.0
50
+ # end
51
+ #
52
+ # @yield [config] Configure the Client client.
53
+ # @yieldparam config [Client::Configuration]
54
+ #
55
+ # @return [Client::Configuration]
56
+ #
57
+ def self.configure
58
+ @configure ||= begin
59
+ namespace = ["Google", "Cloud", "ServiceManagement", "V1"]
60
+ parent_config = while namespace.any?
61
+ parent_name = namespace.join "::"
62
+ parent_const = const_get parent_name
63
+ break parent_const.configure if parent_const.respond_to? :configure
64
+ namespace.pop
65
+ end
66
+ default_config = Client::Configuration.new parent_config
67
+
68
+ default_config.timeout = 10.0
69
+
70
+ default_config
71
+ end
72
+ yield @configure if block_given?
73
+ @configure
74
+ end
75
+
76
+ ##
77
+ # Configure the ServiceManager Client instance.
78
+ #
79
+ # The configuration is set to the derived mode, meaning that values can be changed,
80
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
81
+ # should be made on {Client.configure}.
82
+ #
83
+ # See {::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client::Configuration}
84
+ # for a description of the configuration fields.
85
+ #
86
+ # @yield [config] Configure the Client client.
87
+ # @yieldparam config [Client::Configuration]
88
+ #
89
+ # @return [Client::Configuration]
90
+ #
91
+ def configure
92
+ yield @config if block_given?
93
+ @config
94
+ end
95
+
96
+ ##
97
+ # Create a new ServiceManager REST client object.
98
+ #
99
+ # @example
100
+ #
101
+ # # Create a client using the default configuration
102
+ # client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new
103
+ #
104
+ # # Create a client using a custom configuration
105
+ # client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new do |config|
106
+ # config.timeout = 10.0
107
+ # end
108
+ #
109
+ # @yield [config] Configure the ServiceManager client.
110
+ # @yieldparam config [Client::Configuration]
111
+ #
112
+ def initialize
113
+ # Create the configuration object
114
+ @config = Configuration.new Client.configure
115
+
116
+ # Yield the configuration if needed
117
+ yield @config if block_given?
118
+
119
+ # Create credentials
120
+ credentials = @config.credentials
121
+ # Use self-signed JWT if the endpoint is unchanged from default,
122
+ # but only if the default endpoint does not have a region prefix.
123
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
124
+ !@config.endpoint.split(".").first.include?("-")
125
+ credentials ||= Credentials.default scope: @config.scope,
126
+ enable_self_signed_jwt: enable_self_signed_jwt
127
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
128
+ credentials = Credentials.new credentials, scope: @config.scope
129
+ end
130
+
131
+ @quota_project_id = @config.quota_project
132
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
133
+
134
+ @operations_client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Operations.new do |config|
135
+ config.credentials = credentials
136
+ config.quota_project = @quota_project_id
137
+ config.endpoint = @config.endpoint
138
+ end
139
+
140
+ @service_manager_stub = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
141
+ end
142
+
143
+ ##
144
+ # Get the associated client for long-running operations.
145
+ #
146
+ # @return [::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Operations]
147
+ #
148
+ attr_reader :operations_client
149
+
150
+ # Service calls
151
+
152
+ ##
153
+ # Lists managed services.
154
+ #
155
+ # Returns all public services. For authenticated users, also returns all
156
+ # services the calling user has "servicemanagement.services.get" permission
157
+ # for.
158
+ #
159
+ # @overload list_services(request, options = nil)
160
+ # Pass arguments to `list_services` via a request object, either of type
161
+ # {::Google::Cloud::ServiceManagement::V1::ListServicesRequest} or an equivalent Hash.
162
+ #
163
+ # @param request [::Google::Cloud::ServiceManagement::V1::ListServicesRequest, ::Hash]
164
+ # A request object representing the call parameters. Required. To specify no
165
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
166
+ # @param options [::Gapic::CallOptions, ::Hash]
167
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
168
+ #
169
+ # @overload list_services(producer_project_id: nil, page_size: nil, page_token: nil, consumer_id: nil)
170
+ # Pass arguments to `list_services` via keyword arguments. Note that at
171
+ # least one keyword argument is required. To specify no parameters, or to keep all
172
+ # the default parameter values, pass an empty Hash as a request object (see above).
173
+ #
174
+ # @param producer_project_id [::String]
175
+ # Include services produced by the specified project.
176
+ # @param page_size [::Integer]
177
+ # The max number of items to include in the response list. Page size is 50
178
+ # if not specified. Maximum value is 100.
179
+ # @param page_token [::String]
180
+ # Token identifying which result to start with; returned by a previous list
181
+ # call.
182
+ # @param consumer_id [::String]
183
+ # Include services consumed by the specified consumer.
184
+ #
185
+ # The Google Service Management implementation accepts the following
186
+ # forms:
187
+ # - project:<project_id>
188
+ # @yield [result, operation] Access the result along with the TransportOperation object
189
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceManagement::V1::ManagedService>]
190
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
191
+ #
192
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceManagement::V1::ManagedService>]
193
+ #
194
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
195
+ def list_services request, options = nil
196
+ raise ::ArgumentError, "request must be provided" if request.nil?
197
+
198
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::ListServicesRequest
199
+
200
+ # Converts hash and nil to an options object
201
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
202
+
203
+ # Customize the options with defaults
204
+ call_metadata = @config.rpcs.list_services.metadata.to_h
205
+
206
+ # Set x-goog-api-client and x-goog-user-project headers
207
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
208
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
209
+ gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION,
210
+ transports_version_send: [:rest]
211
+
212
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
213
+
214
+ options.apply_defaults timeout: @config.rpcs.list_services.timeout,
215
+ metadata: call_metadata,
216
+ retry_policy: @config.rpcs.list_services.retry_policy
217
+
218
+ options.apply_defaults timeout: @config.timeout,
219
+ metadata: @config.metadata,
220
+ retry_policy: @config.retry_policy
221
+
222
+ @service_manager_stub.list_services request, options do |result, operation|
223
+ result = ::Gapic::Rest::PagedEnumerable.new @service_manager_stub, :list_services, "services", request, result, options
224
+ yield result, operation if block_given?
225
+ return result
226
+ end
227
+ rescue ::Gapic::Rest::Error => e
228
+ raise ::Google::Cloud::Error.from_error(e)
229
+ end
230
+
231
+ ##
232
+ # Gets a managed service. Authentication is required unless the service is
233
+ # public.
234
+ #
235
+ # @overload get_service(request, options = nil)
236
+ # Pass arguments to `get_service` via a request object, either of type
237
+ # {::Google::Cloud::ServiceManagement::V1::GetServiceRequest} or an equivalent Hash.
238
+ #
239
+ # @param request [::Google::Cloud::ServiceManagement::V1::GetServiceRequest, ::Hash]
240
+ # A request object representing the call parameters. Required. To specify no
241
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
242
+ # @param options [::Gapic::CallOptions, ::Hash]
243
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
244
+ #
245
+ # @overload get_service(service_name: nil)
246
+ # Pass arguments to `get_service` via keyword arguments. Note that at
247
+ # least one keyword argument is required. To specify no parameters, or to keep all
248
+ # the default parameter values, pass an empty Hash as a request object (see above).
249
+ #
250
+ # @param service_name [::String]
251
+ # Required. The name of the service. See the `ServiceManager` overview for
252
+ # naming requirements. For example: `example.googleapis.com`.
253
+ # @yield [result, operation] Access the result along with the TransportOperation object
254
+ # @yieldparam result [::Google::Cloud::ServiceManagement::V1::ManagedService]
255
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
256
+ #
257
+ # @return [::Google::Cloud::ServiceManagement::V1::ManagedService]
258
+ #
259
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
260
+ def get_service request, options = nil
261
+ raise ::ArgumentError, "request must be provided" if request.nil?
262
+
263
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::GetServiceRequest
264
+
265
+ # Converts hash and nil to an options object
266
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
267
+
268
+ # Customize the options with defaults
269
+ call_metadata = @config.rpcs.get_service.metadata.to_h
270
+
271
+ # Set x-goog-api-client and x-goog-user-project headers
272
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
273
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
274
+ gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION,
275
+ transports_version_send: [:rest]
276
+
277
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
278
+
279
+ options.apply_defaults timeout: @config.rpcs.get_service.timeout,
280
+ metadata: call_metadata,
281
+ retry_policy: @config.rpcs.get_service.retry_policy
282
+
283
+ options.apply_defaults timeout: @config.timeout,
284
+ metadata: @config.metadata,
285
+ retry_policy: @config.retry_policy
286
+
287
+ @service_manager_stub.get_service request, options do |result, operation|
288
+ yield result, operation if block_given?
289
+ return result
290
+ end
291
+ rescue ::Gapic::Rest::Error => e
292
+ raise ::Google::Cloud::Error.from_error(e)
293
+ end
294
+
295
+ ##
296
+ # Creates a new managed service.
297
+ #
298
+ # A managed service is immutable, and is subject to mandatory 30-day
299
+ # data retention. You cannot move a service or recreate it within 30 days
300
+ # after deletion.
301
+ #
302
+ # One producer project can own no more than 500 services. For security and
303
+ # reliability purposes, a production service should be hosted in a
304
+ # dedicated producer project.
305
+ #
306
+ # Operation<response: ManagedService>
307
+ #
308
+ # @overload create_service(request, options = nil)
309
+ # Pass arguments to `create_service` via a request object, either of type
310
+ # {::Google::Cloud::ServiceManagement::V1::CreateServiceRequest} or an equivalent Hash.
311
+ #
312
+ # @param request [::Google::Cloud::ServiceManagement::V1::CreateServiceRequest, ::Hash]
313
+ # A request object representing the call parameters. Required. To specify no
314
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
315
+ # @param options [::Gapic::CallOptions, ::Hash]
316
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
317
+ #
318
+ # @overload create_service(service: nil)
319
+ # Pass arguments to `create_service` via keyword arguments. Note that at
320
+ # least one keyword argument is required. To specify no parameters, or to keep all
321
+ # the default parameter values, pass an empty Hash as a request object (see above).
322
+ #
323
+ # @param service [::Google::Cloud::ServiceManagement::V1::ManagedService, ::Hash]
324
+ # Required. Initial values for the service resource.
325
+ # @yield [result, operation] Access the result along with the TransportOperation object
326
+ # @yieldparam result [::Gapic::Operation]
327
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
328
+ #
329
+ # @return [::Gapic::Operation]
330
+ #
331
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
332
+ def create_service request, options = nil
333
+ raise ::ArgumentError, "request must be provided" if request.nil?
334
+
335
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::CreateServiceRequest
336
+
337
+ # Converts hash and nil to an options object
338
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
339
+
340
+ # Customize the options with defaults
341
+ call_metadata = @config.rpcs.create_service.metadata.to_h
342
+
343
+ # Set x-goog-api-client and x-goog-user-project headers
344
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
345
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
346
+ gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION,
347
+ transports_version_send: [:rest]
348
+
349
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
350
+
351
+ options.apply_defaults timeout: @config.rpcs.create_service.timeout,
352
+ metadata: call_metadata,
353
+ retry_policy: @config.rpcs.create_service.retry_policy
354
+
355
+ options.apply_defaults timeout: @config.timeout,
356
+ metadata: @config.metadata,
357
+ retry_policy: @config.retry_policy
358
+
359
+ @service_manager_stub.create_service request, options do |result, operation|
360
+ result = ::Gapic::Operation.new result, @operations_client, options: options
361
+ yield result, operation if block_given?
362
+ return result
363
+ end
364
+ rescue ::Gapic::Rest::Error => e
365
+ raise ::Google::Cloud::Error.from_error(e)
366
+ end
367
+
368
+ ##
369
+ # Deletes a managed service. This method will change the service to the
370
+ # `Soft-Delete` state for 30 days. Within this period, service producers may
371
+ # call
372
+ # {::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client#undelete_service UndeleteService}
373
+ # to restore the service. After 30 days, the service will be permanently
374
+ # deleted.
375
+ #
376
+ # Operation<response: google.protobuf.Empty>
377
+ #
378
+ # @overload delete_service(request, options = nil)
379
+ # Pass arguments to `delete_service` via a request object, either of type
380
+ # {::Google::Cloud::ServiceManagement::V1::DeleteServiceRequest} or an equivalent Hash.
381
+ #
382
+ # @param request [::Google::Cloud::ServiceManagement::V1::DeleteServiceRequest, ::Hash]
383
+ # A request object representing the call parameters. Required. To specify no
384
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
385
+ # @param options [::Gapic::CallOptions, ::Hash]
386
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
387
+ #
388
+ # @overload delete_service(service_name: nil)
389
+ # Pass arguments to `delete_service` via keyword arguments. Note that at
390
+ # least one keyword argument is required. To specify no parameters, or to keep all
391
+ # the default parameter values, pass an empty Hash as a request object (see above).
392
+ #
393
+ # @param service_name [::String]
394
+ # Required. The name of the service. See the
395
+ # [overview](https://cloud.google.com/service-infrastructure/docs/overview) for naming requirements. For
396
+ # example: `example.googleapis.com`.
397
+ # @yield [result, operation] Access the result along with the TransportOperation object
398
+ # @yieldparam result [::Gapic::Operation]
399
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
400
+ #
401
+ # @return [::Gapic::Operation]
402
+ #
403
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
404
+ def delete_service request, options = nil
405
+ raise ::ArgumentError, "request must be provided" if request.nil?
406
+
407
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::DeleteServiceRequest
408
+
409
+ # Converts hash and nil to an options object
410
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
411
+
412
+ # Customize the options with defaults
413
+ call_metadata = @config.rpcs.delete_service.metadata.to_h
414
+
415
+ # Set x-goog-api-client and x-goog-user-project headers
416
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
417
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
418
+ gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION,
419
+ transports_version_send: [:rest]
420
+
421
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
422
+
423
+ options.apply_defaults timeout: @config.rpcs.delete_service.timeout,
424
+ metadata: call_metadata,
425
+ retry_policy: @config.rpcs.delete_service.retry_policy
426
+
427
+ options.apply_defaults timeout: @config.timeout,
428
+ metadata: @config.metadata,
429
+ retry_policy: @config.retry_policy
430
+
431
+ @service_manager_stub.delete_service request, options do |result, operation|
432
+ result = ::Gapic::Operation.new result, @operations_client, options: options
433
+ yield result, operation if block_given?
434
+ return result
435
+ end
436
+ rescue ::Gapic::Rest::Error => e
437
+ raise ::Google::Cloud::Error.from_error(e)
438
+ end
439
+
440
+ ##
441
+ # Revives a previously deleted managed service. The method restores the
442
+ # service using the configuration at the time the service was deleted.
443
+ # The target service must exist and must have been deleted within the
444
+ # last 30 days.
445
+ #
446
+ # Operation<response: UndeleteServiceResponse>
447
+ #
448
+ # @overload undelete_service(request, options = nil)
449
+ # Pass arguments to `undelete_service` via a request object, either of type
450
+ # {::Google::Cloud::ServiceManagement::V1::UndeleteServiceRequest} or an equivalent Hash.
451
+ #
452
+ # @param request [::Google::Cloud::ServiceManagement::V1::UndeleteServiceRequest, ::Hash]
453
+ # A request object representing the call parameters. Required. To specify no
454
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
455
+ # @param options [::Gapic::CallOptions, ::Hash]
456
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
457
+ #
458
+ # @overload undelete_service(service_name: nil)
459
+ # Pass arguments to `undelete_service` via keyword arguments. Note that at
460
+ # least one keyword argument is required. To specify no parameters, or to keep all
461
+ # the default parameter values, pass an empty Hash as a request object (see above).
462
+ #
463
+ # @param service_name [::String]
464
+ # Required. The name of the service. See the
465
+ # [overview](https://cloud.google.com/service-infrastructure/docs/overview) for naming requirements. For
466
+ # example: `example.googleapis.com`.
467
+ # @yield [result, operation] Access the result along with the TransportOperation object
468
+ # @yieldparam result [::Gapic::Operation]
469
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
470
+ #
471
+ # @return [::Gapic::Operation]
472
+ #
473
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
474
+ def undelete_service request, options = nil
475
+ raise ::ArgumentError, "request must be provided" if request.nil?
476
+
477
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::UndeleteServiceRequest
478
+
479
+ # Converts hash and nil to an options object
480
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
481
+
482
+ # Customize the options with defaults
483
+ call_metadata = @config.rpcs.undelete_service.metadata.to_h
484
+
485
+ # Set x-goog-api-client and x-goog-user-project headers
486
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
487
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
488
+ gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION,
489
+ transports_version_send: [:rest]
490
+
491
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
492
+
493
+ options.apply_defaults timeout: @config.rpcs.undelete_service.timeout,
494
+ metadata: call_metadata,
495
+ retry_policy: @config.rpcs.undelete_service.retry_policy
496
+
497
+ options.apply_defaults timeout: @config.timeout,
498
+ metadata: @config.metadata,
499
+ retry_policy: @config.retry_policy
500
+
501
+ @service_manager_stub.undelete_service request, options do |result, operation|
502
+ result = ::Gapic::Operation.new result, @operations_client, options: options
503
+ yield result, operation if block_given?
504
+ return result
505
+ end
506
+ rescue ::Gapic::Rest::Error => e
507
+ raise ::Google::Cloud::Error.from_error(e)
508
+ end
509
+
510
+ ##
511
+ # Lists the history of the service configuration for a managed service,
512
+ # from the newest to the oldest.
513
+ #
514
+ # @overload list_service_configs(request, options = nil)
515
+ # Pass arguments to `list_service_configs` via a request object, either of type
516
+ # {::Google::Cloud::ServiceManagement::V1::ListServiceConfigsRequest} or an equivalent Hash.
517
+ #
518
+ # @param request [::Google::Cloud::ServiceManagement::V1::ListServiceConfigsRequest, ::Hash]
519
+ # A request object representing the call parameters. Required. To specify no
520
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
521
+ # @param options [::Gapic::CallOptions, ::Hash]
522
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
523
+ #
524
+ # @overload list_service_configs(service_name: nil, page_token: nil, page_size: nil)
525
+ # Pass arguments to `list_service_configs` via keyword arguments. Note that at
526
+ # least one keyword argument is required. To specify no parameters, or to keep all
527
+ # the default parameter values, pass an empty Hash as a request object (see above).
528
+ #
529
+ # @param service_name [::String]
530
+ # Required. The name of the service. See the
531
+ # [overview](https://cloud.google.com/service-infrastructure/docs/overview) for naming requirements. For
532
+ # example: `example.googleapis.com`.
533
+ # @param page_token [::String]
534
+ # The token of the page to retrieve.
535
+ # @param page_size [::Integer]
536
+ # The max number of items to include in the response list. Page size is 50
537
+ # if not specified. Maximum value is 100.
538
+ # @yield [result, operation] Access the result along with the TransportOperation object
539
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Api::Service>]
540
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
541
+ #
542
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Api::Service>]
543
+ #
544
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
545
+ def list_service_configs request, options = nil
546
+ raise ::ArgumentError, "request must be provided" if request.nil?
547
+
548
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::ListServiceConfigsRequest
549
+
550
+ # Converts hash and nil to an options object
551
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
552
+
553
+ # Customize the options with defaults
554
+ call_metadata = @config.rpcs.list_service_configs.metadata.to_h
555
+
556
+ # Set x-goog-api-client and x-goog-user-project headers
557
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
558
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
559
+ gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION,
560
+ transports_version_send: [:rest]
561
+
562
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
563
+
564
+ options.apply_defaults timeout: @config.rpcs.list_service_configs.timeout,
565
+ metadata: call_metadata,
566
+ retry_policy: @config.rpcs.list_service_configs.retry_policy
567
+
568
+ options.apply_defaults timeout: @config.timeout,
569
+ metadata: @config.metadata,
570
+ retry_policy: @config.retry_policy
571
+
572
+ @service_manager_stub.list_service_configs request, options do |result, operation|
573
+ result = ::Gapic::Rest::PagedEnumerable.new @service_manager_stub, :list_service_configs, "service_configs", request, result, options
574
+ yield result, operation if block_given?
575
+ return result
576
+ end
577
+ rescue ::Gapic::Rest::Error => e
578
+ raise ::Google::Cloud::Error.from_error(e)
579
+ end
580
+
581
+ ##
582
+ # Gets a service configuration (version) for a managed service.
583
+ #
584
+ # @overload get_service_config(request, options = nil)
585
+ # Pass arguments to `get_service_config` via a request object, either of type
586
+ # {::Google::Cloud::ServiceManagement::V1::GetServiceConfigRequest} or an equivalent Hash.
587
+ #
588
+ # @param request [::Google::Cloud::ServiceManagement::V1::GetServiceConfigRequest, ::Hash]
589
+ # A request object representing the call parameters. Required. To specify no
590
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
591
+ # @param options [::Gapic::CallOptions, ::Hash]
592
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
593
+ #
594
+ # @overload get_service_config(service_name: nil, config_id: nil, view: nil)
595
+ # Pass arguments to `get_service_config` via keyword arguments. Note that at
596
+ # least one keyword argument is required. To specify no parameters, or to keep all
597
+ # the default parameter values, pass an empty Hash as a request object (see above).
598
+ #
599
+ # @param service_name [::String]
600
+ # Required. The name of the service. See the
601
+ # [overview](https://cloud.google.com/service-infrastructure/docs/overview) for naming requirements. For
602
+ # example: `example.googleapis.com`.
603
+ # @param config_id [::String]
604
+ # Required. The id of the service configuration resource.
605
+ #
606
+ # This field must be specified for the server to return all fields, including
607
+ # `SourceInfo`.
608
+ # @param view [::Google::Cloud::ServiceManagement::V1::GetServiceConfigRequest::ConfigView]
609
+ # Specifies which parts of the Service Config should be returned in the
610
+ # response.
611
+ # @yield [result, operation] Access the result along with the TransportOperation object
612
+ # @yieldparam result [::Google::Api::Service]
613
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
614
+ #
615
+ # @return [::Google::Api::Service]
616
+ #
617
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
618
+ def get_service_config request, options = nil
619
+ raise ::ArgumentError, "request must be provided" if request.nil?
620
+
621
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::GetServiceConfigRequest
622
+
623
+ # Converts hash and nil to an options object
624
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
625
+
626
+ # Customize the options with defaults
627
+ call_metadata = @config.rpcs.get_service_config.metadata.to_h
628
+
629
+ # Set x-goog-api-client and x-goog-user-project headers
630
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
631
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
632
+ gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION,
633
+ transports_version_send: [:rest]
634
+
635
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
636
+
637
+ options.apply_defaults timeout: @config.rpcs.get_service_config.timeout,
638
+ metadata: call_metadata,
639
+ retry_policy: @config.rpcs.get_service_config.retry_policy
640
+
641
+ options.apply_defaults timeout: @config.timeout,
642
+ metadata: @config.metadata,
643
+ retry_policy: @config.retry_policy
644
+
645
+ @service_manager_stub.get_service_config request, options do |result, operation|
646
+ yield result, operation if block_given?
647
+ return result
648
+ end
649
+ rescue ::Gapic::Rest::Error => e
650
+ raise ::Google::Cloud::Error.from_error(e)
651
+ end
652
+
653
+ ##
654
+ # Creates a new service configuration (version) for a managed service.
655
+ # This method only stores the service configuration. To roll out the service
656
+ # configuration to backend systems please call
657
+ # {::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client#create_service_rollout CreateServiceRollout}.
658
+ #
659
+ # Only the 100 most recent service configurations and ones referenced by
660
+ # existing rollouts are kept for each service. The rest will be deleted
661
+ # eventually.
662
+ #
663
+ # @overload create_service_config(request, options = nil)
664
+ # Pass arguments to `create_service_config` via a request object, either of type
665
+ # {::Google::Cloud::ServiceManagement::V1::CreateServiceConfigRequest} or an equivalent Hash.
666
+ #
667
+ # @param request [::Google::Cloud::ServiceManagement::V1::CreateServiceConfigRequest, ::Hash]
668
+ # A request object representing the call parameters. Required. To specify no
669
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
670
+ # @param options [::Gapic::CallOptions, ::Hash]
671
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
672
+ #
673
+ # @overload create_service_config(service_name: nil, service_config: nil)
674
+ # Pass arguments to `create_service_config` via keyword arguments. Note that at
675
+ # least one keyword argument is required. To specify no parameters, or to keep all
676
+ # the default parameter values, pass an empty Hash as a request object (see above).
677
+ #
678
+ # @param service_name [::String]
679
+ # Required. The name of the service. See the
680
+ # [overview](https://cloud.google.com/service-infrastructure/docs/overview) for naming requirements. For
681
+ # example: `example.googleapis.com`.
682
+ # @param service_config [::Google::Api::Service, ::Hash]
683
+ # Required. The service configuration resource.
684
+ # @yield [result, operation] Access the result along with the TransportOperation object
685
+ # @yieldparam result [::Google::Api::Service]
686
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
687
+ #
688
+ # @return [::Google::Api::Service]
689
+ #
690
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
691
+ def create_service_config request, options = nil
692
+ raise ::ArgumentError, "request must be provided" if request.nil?
693
+
694
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::CreateServiceConfigRequest
695
+
696
+ # Converts hash and nil to an options object
697
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
698
+
699
+ # Customize the options with defaults
700
+ call_metadata = @config.rpcs.create_service_config.metadata.to_h
701
+
702
+ # Set x-goog-api-client and x-goog-user-project headers
703
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
704
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
705
+ gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION,
706
+ transports_version_send: [:rest]
707
+
708
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
709
+
710
+ options.apply_defaults timeout: @config.rpcs.create_service_config.timeout,
711
+ metadata: call_metadata,
712
+ retry_policy: @config.rpcs.create_service_config.retry_policy
713
+
714
+ options.apply_defaults timeout: @config.timeout,
715
+ metadata: @config.metadata,
716
+ retry_policy: @config.retry_policy
717
+
718
+ @service_manager_stub.create_service_config request, options do |result, operation|
719
+ yield result, operation if block_given?
720
+ return result
721
+ end
722
+ rescue ::Gapic::Rest::Error => e
723
+ raise ::Google::Cloud::Error.from_error(e)
724
+ end
725
+
726
+ ##
727
+ # Creates a new service configuration (version) for a managed service based
728
+ # on
729
+ # user-supplied configuration source files (for example: OpenAPI
730
+ # Specification). This method stores the source configurations as well as the
731
+ # generated service configuration. To rollout the service configuration to
732
+ # other services,
733
+ # please call
734
+ # {::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client#create_service_rollout CreateServiceRollout}.
735
+ #
736
+ # Only the 100 most recent configuration sources and ones referenced by
737
+ # existing service configurtions are kept for each service. The rest will be
738
+ # deleted eventually.
739
+ #
740
+ # Operation<response: SubmitConfigSourceResponse>
741
+ #
742
+ # @overload submit_config_source(request, options = nil)
743
+ # Pass arguments to `submit_config_source` via a request object, either of type
744
+ # {::Google::Cloud::ServiceManagement::V1::SubmitConfigSourceRequest} or an equivalent Hash.
745
+ #
746
+ # @param request [::Google::Cloud::ServiceManagement::V1::SubmitConfigSourceRequest, ::Hash]
747
+ # A request object representing the call parameters. Required. To specify no
748
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
749
+ # @param options [::Gapic::CallOptions, ::Hash]
750
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
751
+ #
752
+ # @overload submit_config_source(service_name: nil, config_source: nil, validate_only: nil)
753
+ # Pass arguments to `submit_config_source` via keyword arguments. Note that at
754
+ # least one keyword argument is required. To specify no parameters, or to keep all
755
+ # the default parameter values, pass an empty Hash as a request object (see above).
756
+ #
757
+ # @param service_name [::String]
758
+ # Required. The name of the service. See the
759
+ # [overview](https://cloud.google.com/service-infrastructure/docs/overview) for naming requirements. For
760
+ # example: `example.googleapis.com`.
761
+ # @param config_source [::Google::Cloud::ServiceManagement::V1::ConfigSource, ::Hash]
762
+ # Required. The source configuration for the service.
763
+ # @param validate_only [::Boolean]
764
+ # Optional. If set, this will result in the generation of a
765
+ # `google.api.Service` configuration based on the `ConfigSource` provided,
766
+ # but the generated config and the sources will NOT be persisted.
767
+ # @yield [result, operation] Access the result along with the TransportOperation object
768
+ # @yieldparam result [::Gapic::Operation]
769
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
770
+ #
771
+ # @return [::Gapic::Operation]
772
+ #
773
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
774
+ def submit_config_source request, options = nil
775
+ raise ::ArgumentError, "request must be provided" if request.nil?
776
+
777
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::SubmitConfigSourceRequest
778
+
779
+ # Converts hash and nil to an options object
780
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
781
+
782
+ # Customize the options with defaults
783
+ call_metadata = @config.rpcs.submit_config_source.metadata.to_h
784
+
785
+ # Set x-goog-api-client and x-goog-user-project headers
786
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
787
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
788
+ gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION,
789
+ transports_version_send: [:rest]
790
+
791
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
792
+
793
+ options.apply_defaults timeout: @config.rpcs.submit_config_source.timeout,
794
+ metadata: call_metadata,
795
+ retry_policy: @config.rpcs.submit_config_source.retry_policy
796
+
797
+ options.apply_defaults timeout: @config.timeout,
798
+ metadata: @config.metadata,
799
+ retry_policy: @config.retry_policy
800
+
801
+ @service_manager_stub.submit_config_source request, options do |result, operation|
802
+ result = ::Gapic::Operation.new result, @operations_client, options: options
803
+ yield result, operation if block_given?
804
+ return result
805
+ end
806
+ rescue ::Gapic::Rest::Error => e
807
+ raise ::Google::Cloud::Error.from_error(e)
808
+ end
809
+
810
+ ##
811
+ # Lists the history of the service configuration rollouts for a managed
812
+ # service, from the newest to the oldest.
813
+ #
814
+ # @overload list_service_rollouts(request, options = nil)
815
+ # Pass arguments to `list_service_rollouts` via a request object, either of type
816
+ # {::Google::Cloud::ServiceManagement::V1::ListServiceRolloutsRequest} or an equivalent Hash.
817
+ #
818
+ # @param request [::Google::Cloud::ServiceManagement::V1::ListServiceRolloutsRequest, ::Hash]
819
+ # A request object representing the call parameters. Required. To specify no
820
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
821
+ # @param options [::Gapic::CallOptions, ::Hash]
822
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
823
+ #
824
+ # @overload list_service_rollouts(service_name: nil, page_token: nil, page_size: nil, filter: nil)
825
+ # Pass arguments to `list_service_rollouts` via keyword arguments. Note that at
826
+ # least one keyword argument is required. To specify no parameters, or to keep all
827
+ # the default parameter values, pass an empty Hash as a request object (see above).
828
+ #
829
+ # @param service_name [::String]
830
+ # Required. The name of the service. See the
831
+ # [overview](https://cloud.google.com/service-infrastructure/docs/overview) for naming requirements. For
832
+ # example: `example.googleapis.com`.
833
+ # @param page_token [::String]
834
+ # The token of the page to retrieve.
835
+ # @param page_size [::Integer]
836
+ # The max number of items to include in the response list. Page size is 50
837
+ # if not specified. Maximum value is 100.
838
+ # @param filter [::String]
839
+ # Required. Use `filter` to return subset of rollouts.
840
+ # The following filters are supported:
841
+ # -- To limit the results to only those in
842
+ # status (google.api.servicemanagement.v1.RolloutStatus) 'SUCCESS',
843
+ # use filter='status=SUCCESS'
844
+ # -- To limit the results to those in
845
+ # status (google.api.servicemanagement.v1.RolloutStatus) 'CANCELLED'
846
+ # or 'FAILED', use filter='status=CANCELLED OR status=FAILED'
847
+ # @yield [result, operation] Access the result along with the TransportOperation object
848
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceManagement::V1::Rollout>]
849
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
850
+ #
851
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceManagement::V1::Rollout>]
852
+ #
853
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
854
+ def list_service_rollouts request, options = nil
855
+ raise ::ArgumentError, "request must be provided" if request.nil?
856
+
857
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::ListServiceRolloutsRequest
858
+
859
+ # Converts hash and nil to an options object
860
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
861
+
862
+ # Customize the options with defaults
863
+ call_metadata = @config.rpcs.list_service_rollouts.metadata.to_h
864
+
865
+ # Set x-goog-api-client and x-goog-user-project headers
866
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
867
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
868
+ gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION,
869
+ transports_version_send: [:rest]
870
+
871
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
872
+
873
+ options.apply_defaults timeout: @config.rpcs.list_service_rollouts.timeout,
874
+ metadata: call_metadata,
875
+ retry_policy: @config.rpcs.list_service_rollouts.retry_policy
876
+
877
+ options.apply_defaults timeout: @config.timeout,
878
+ metadata: @config.metadata,
879
+ retry_policy: @config.retry_policy
880
+
881
+ @service_manager_stub.list_service_rollouts request, options do |result, operation|
882
+ result = ::Gapic::Rest::PagedEnumerable.new @service_manager_stub, :list_service_rollouts, "rollouts", request, result, options
883
+ yield result, operation if block_given?
884
+ return result
885
+ end
886
+ rescue ::Gapic::Rest::Error => e
887
+ raise ::Google::Cloud::Error.from_error(e)
888
+ end
889
+
890
+ ##
891
+ # Gets a service configuration
892
+ # {::Google::Cloud::ServiceManagement::V1::Rollout rollout}.
893
+ #
894
+ # @overload get_service_rollout(request, options = nil)
895
+ # Pass arguments to `get_service_rollout` via a request object, either of type
896
+ # {::Google::Cloud::ServiceManagement::V1::GetServiceRolloutRequest} or an equivalent Hash.
897
+ #
898
+ # @param request [::Google::Cloud::ServiceManagement::V1::GetServiceRolloutRequest, ::Hash]
899
+ # A request object representing the call parameters. Required. To specify no
900
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
901
+ # @param options [::Gapic::CallOptions, ::Hash]
902
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
903
+ #
904
+ # @overload get_service_rollout(service_name: nil, rollout_id: nil)
905
+ # Pass arguments to `get_service_rollout` via keyword arguments. Note that at
906
+ # least one keyword argument is required. To specify no parameters, or to keep all
907
+ # the default parameter values, pass an empty Hash as a request object (see above).
908
+ #
909
+ # @param service_name [::String]
910
+ # Required. The name of the service. See the
911
+ # [overview](https://cloud.google.com/service-infrastructure/docs/overview) for naming requirements. For
912
+ # example: `example.googleapis.com`.
913
+ # @param rollout_id [::String]
914
+ # Required. The id of the rollout resource.
915
+ # @yield [result, operation] Access the result along with the TransportOperation object
916
+ # @yieldparam result [::Google::Cloud::ServiceManagement::V1::Rollout]
917
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
918
+ #
919
+ # @return [::Google::Cloud::ServiceManagement::V1::Rollout]
920
+ #
921
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
922
+ def get_service_rollout request, options = nil
923
+ raise ::ArgumentError, "request must be provided" if request.nil?
924
+
925
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::GetServiceRolloutRequest
926
+
927
+ # Converts hash and nil to an options object
928
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
929
+
930
+ # Customize the options with defaults
931
+ call_metadata = @config.rpcs.get_service_rollout.metadata.to_h
932
+
933
+ # Set x-goog-api-client and x-goog-user-project headers
934
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
935
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
936
+ gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION,
937
+ transports_version_send: [:rest]
938
+
939
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
940
+
941
+ options.apply_defaults timeout: @config.rpcs.get_service_rollout.timeout,
942
+ metadata: call_metadata,
943
+ retry_policy: @config.rpcs.get_service_rollout.retry_policy
944
+
945
+ options.apply_defaults timeout: @config.timeout,
946
+ metadata: @config.metadata,
947
+ retry_policy: @config.retry_policy
948
+
949
+ @service_manager_stub.get_service_rollout request, options do |result, operation|
950
+ yield result, operation if block_given?
951
+ return result
952
+ end
953
+ rescue ::Gapic::Rest::Error => e
954
+ raise ::Google::Cloud::Error.from_error(e)
955
+ end
956
+
957
+ ##
958
+ # Creates a new service configuration rollout. Based on rollout, the
959
+ # Google Service Management will roll out the service configurations to
960
+ # different backend services. For example, the logging configuration will be
961
+ # pushed to Google Cloud Logging.
962
+ #
963
+ # Please note that any previous pending and running Rollouts and associated
964
+ # Operations will be automatically cancelled so that the latest Rollout will
965
+ # not be blocked by previous Rollouts.
966
+ #
967
+ # Only the 100 most recent (in any state) and the last 10 successful (if not
968
+ # already part of the set of 100 most recent) rollouts are kept for each
969
+ # service. The rest will be deleted eventually.
970
+ #
971
+ # Operation<response: Rollout>
972
+ #
973
+ # @overload create_service_rollout(request, options = nil)
974
+ # Pass arguments to `create_service_rollout` via a request object, either of type
975
+ # {::Google::Cloud::ServiceManagement::V1::CreateServiceRolloutRequest} or an equivalent Hash.
976
+ #
977
+ # @param request [::Google::Cloud::ServiceManagement::V1::CreateServiceRolloutRequest, ::Hash]
978
+ # A request object representing the call parameters. Required. To specify no
979
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
980
+ # @param options [::Gapic::CallOptions, ::Hash]
981
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
982
+ #
983
+ # @overload create_service_rollout(service_name: nil, rollout: nil)
984
+ # Pass arguments to `create_service_rollout` via keyword arguments. Note that at
985
+ # least one keyword argument is required. To specify no parameters, or to keep all
986
+ # the default parameter values, pass an empty Hash as a request object (see above).
987
+ #
988
+ # @param service_name [::String]
989
+ # Required. The name of the service. See the
990
+ # [overview](https://cloud.google.com/service-infrastructure/docs/overview) for naming requirements. For
991
+ # example: `example.googleapis.com`.
992
+ # @param rollout [::Google::Cloud::ServiceManagement::V1::Rollout, ::Hash]
993
+ # Required. The rollout resource. The `service_name` field is output only.
994
+ # @yield [result, operation] Access the result along with the TransportOperation object
995
+ # @yieldparam result [::Gapic::Operation]
996
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
997
+ #
998
+ # @return [::Gapic::Operation]
999
+ #
1000
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1001
+ def create_service_rollout request, options = nil
1002
+ raise ::ArgumentError, "request must be provided" if request.nil?
1003
+
1004
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::CreateServiceRolloutRequest
1005
+
1006
+ # Converts hash and nil to an options object
1007
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1008
+
1009
+ # Customize the options with defaults
1010
+ call_metadata = @config.rpcs.create_service_rollout.metadata.to_h
1011
+
1012
+ # Set x-goog-api-client and x-goog-user-project headers
1013
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1014
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1015
+ gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION,
1016
+ transports_version_send: [:rest]
1017
+
1018
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1019
+
1020
+ options.apply_defaults timeout: @config.rpcs.create_service_rollout.timeout,
1021
+ metadata: call_metadata,
1022
+ retry_policy: @config.rpcs.create_service_rollout.retry_policy
1023
+
1024
+ options.apply_defaults timeout: @config.timeout,
1025
+ metadata: @config.metadata,
1026
+ retry_policy: @config.retry_policy
1027
+
1028
+ @service_manager_stub.create_service_rollout request, options do |result, operation|
1029
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1030
+ yield result, operation if block_given?
1031
+ return result
1032
+ end
1033
+ rescue ::Gapic::Rest::Error => e
1034
+ raise ::Google::Cloud::Error.from_error(e)
1035
+ end
1036
+
1037
+ ##
1038
+ # Generates and returns a report (errors, warnings and changes from
1039
+ # existing configurations) associated with
1040
+ # GenerateConfigReportRequest.new_value
1041
+ #
1042
+ # If GenerateConfigReportRequest.old_value is specified,
1043
+ # GenerateConfigReportRequest will contain a single ChangeReport based on the
1044
+ # comparison between GenerateConfigReportRequest.new_value and
1045
+ # GenerateConfigReportRequest.old_value.
1046
+ # If GenerateConfigReportRequest.old_value is not specified, this method
1047
+ # will compare GenerateConfigReportRequest.new_value with the last pushed
1048
+ # service configuration.
1049
+ #
1050
+ # @overload generate_config_report(request, options = nil)
1051
+ # Pass arguments to `generate_config_report` via a request object, either of type
1052
+ # {::Google::Cloud::ServiceManagement::V1::GenerateConfigReportRequest} or an equivalent Hash.
1053
+ #
1054
+ # @param request [::Google::Cloud::ServiceManagement::V1::GenerateConfigReportRequest, ::Hash]
1055
+ # A request object representing the call parameters. Required. To specify no
1056
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1057
+ # @param options [::Gapic::CallOptions, ::Hash]
1058
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1059
+ #
1060
+ # @overload generate_config_report(new_config: nil, old_config: nil)
1061
+ # Pass arguments to `generate_config_report` via keyword arguments. Note that at
1062
+ # least one keyword argument is required. To specify no parameters, or to keep all
1063
+ # the default parameter values, pass an empty Hash as a request object (see above).
1064
+ #
1065
+ # @param new_config [::Google::Protobuf::Any, ::Hash]
1066
+ # Required. Service configuration for which we want to generate the report.
1067
+ # For this version of API, the supported types are
1068
+ # {::Google::Cloud::ServiceManagement::V1::ConfigRef google.api.servicemanagement.v1.ConfigRef},
1069
+ # {::Google::Cloud::ServiceManagement::V1::ConfigSource google.api.servicemanagement.v1.ConfigSource},
1070
+ # and {::Google::Api::Service google.api.Service}
1071
+ # @param old_config [::Google::Protobuf::Any, ::Hash]
1072
+ # Optional. Service configuration against which the comparison will be done.
1073
+ # For this version of API, the supported types are
1074
+ # {::Google::Cloud::ServiceManagement::V1::ConfigRef google.api.servicemanagement.v1.ConfigRef},
1075
+ # {::Google::Cloud::ServiceManagement::V1::ConfigSource google.api.servicemanagement.v1.ConfigSource},
1076
+ # and {::Google::Api::Service google.api.Service}
1077
+ # @yield [result, operation] Access the result along with the TransportOperation object
1078
+ # @yieldparam result [::Google::Cloud::ServiceManagement::V1::GenerateConfigReportResponse]
1079
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1080
+ #
1081
+ # @return [::Google::Cloud::ServiceManagement::V1::GenerateConfigReportResponse]
1082
+ #
1083
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1084
+ def generate_config_report request, options = nil
1085
+ raise ::ArgumentError, "request must be provided" if request.nil?
1086
+
1087
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::GenerateConfigReportRequest
1088
+
1089
+ # Converts hash and nil to an options object
1090
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1091
+
1092
+ # Customize the options with defaults
1093
+ call_metadata = @config.rpcs.generate_config_report.metadata.to_h
1094
+
1095
+ # Set x-goog-api-client and x-goog-user-project headers
1096
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1097
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1098
+ gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION,
1099
+ transports_version_send: [:rest]
1100
+
1101
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1102
+
1103
+ options.apply_defaults timeout: @config.rpcs.generate_config_report.timeout,
1104
+ metadata: call_metadata,
1105
+ retry_policy: @config.rpcs.generate_config_report.retry_policy
1106
+
1107
+ options.apply_defaults timeout: @config.timeout,
1108
+ metadata: @config.metadata,
1109
+ retry_policy: @config.retry_policy
1110
+
1111
+ @service_manager_stub.generate_config_report request, options do |result, operation|
1112
+ yield result, operation if block_given?
1113
+ return result
1114
+ end
1115
+ rescue ::Gapic::Rest::Error => e
1116
+ raise ::Google::Cloud::Error.from_error(e)
1117
+ end
1118
+
1119
+ ##
1120
+ # Configuration class for the ServiceManager REST API.
1121
+ #
1122
+ # This class represents the configuration for ServiceManager REST,
1123
+ # providing control over timeouts, retry behavior, logging, transport
1124
+ # parameters, and other low-level controls. Certain parameters can also be
1125
+ # applied individually to specific RPCs. See
1126
+ # {::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client::Configuration::Rpcs}
1127
+ # for a list of RPCs that can be configured independently.
1128
+ #
1129
+ # Configuration can be applied globally to all clients, or to a single client
1130
+ # on construction.
1131
+ #
1132
+ # @example
1133
+ #
1134
+ # # Modify the global config, setting the timeout for
1135
+ # # list_services to 20 seconds,
1136
+ # # and all remaining timeouts to 10 seconds.
1137
+ # ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.configure do |config|
1138
+ # config.timeout = 10.0
1139
+ # config.rpcs.list_services.timeout = 20.0
1140
+ # end
1141
+ #
1142
+ # # Apply the above configuration only to a new client.
1143
+ # client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new do |config|
1144
+ # config.timeout = 10.0
1145
+ # config.rpcs.list_services.timeout = 20.0
1146
+ # end
1147
+ #
1148
+ # @!attribute [rw] endpoint
1149
+ # The hostname or hostname:port of the service endpoint.
1150
+ # Defaults to `"servicemanagement.googleapis.com"`.
1151
+ # @return [::String]
1152
+ # @!attribute [rw] credentials
1153
+ # Credentials to send with calls. You may provide any of the following types:
1154
+ # * (`String`) The path to a service account key file in JSON format
1155
+ # * (`Hash`) A service account key as a Hash
1156
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1157
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
1158
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1159
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
1160
+ # * (`nil`) indicating no credentials
1161
+ # @return [::Object]
1162
+ # @!attribute [rw] scope
1163
+ # The OAuth scopes
1164
+ # @return [::Array<::String>]
1165
+ # @!attribute [rw] lib_name
1166
+ # The library name as recorded in instrumentation and logging
1167
+ # @return [::String]
1168
+ # @!attribute [rw] lib_version
1169
+ # The library version as recorded in instrumentation and logging
1170
+ # @return [::String]
1171
+ # @!attribute [rw] timeout
1172
+ # The call timeout in seconds.
1173
+ # @return [::Numeric]
1174
+ # @!attribute [rw] metadata
1175
+ # Additional headers to be sent with the call.
1176
+ # @return [::Hash{::Symbol=>::String}]
1177
+ # @!attribute [rw] retry_policy
1178
+ # The retry policy. The value is a hash with the following keys:
1179
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1180
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1181
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1182
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1183
+ # trigger a retry.
1184
+ # @return [::Hash]
1185
+ # @!attribute [rw] quota_project
1186
+ # A separate project against which to charge quota.
1187
+ # @return [::String]
1188
+ #
1189
+ class Configuration
1190
+ extend ::Gapic::Config
1191
+
1192
+ config_attr :endpoint, "servicemanagement.googleapis.com", ::String
1193
+ config_attr :credentials, nil do |value|
1194
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1195
+ allowed.any? { |klass| klass === value }
1196
+ end
1197
+ config_attr :scope, nil, ::String, ::Array, nil
1198
+ config_attr :lib_name, nil, ::String, nil
1199
+ config_attr :lib_version, nil, ::String, nil
1200
+ config_attr :timeout, nil, ::Numeric, nil
1201
+ config_attr :metadata, nil, ::Hash, nil
1202
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1203
+ config_attr :quota_project, nil, ::String, nil
1204
+
1205
+ # @private
1206
+ def initialize parent_config = nil
1207
+ @parent_config = parent_config unless parent_config.nil?
1208
+
1209
+ yield self if block_given?
1210
+ end
1211
+
1212
+ ##
1213
+ # Configurations for individual RPCs
1214
+ # @return [Rpcs]
1215
+ #
1216
+ def rpcs
1217
+ @rpcs ||= begin
1218
+ parent_rpcs = nil
1219
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1220
+ Rpcs.new parent_rpcs
1221
+ end
1222
+ end
1223
+
1224
+ ##
1225
+ # Configuration RPC class for the ServiceManager API.
1226
+ #
1227
+ # Includes fields providing the configuration for each RPC in this service.
1228
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1229
+ # the following configuration fields:
1230
+ #
1231
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1232
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
1233
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1234
+ # include the following keys:
1235
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1236
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1237
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1238
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1239
+ # trigger a retry.
1240
+ #
1241
+ class Rpcs
1242
+ ##
1243
+ # RPC-specific configuration for `list_services`
1244
+ # @return [::Gapic::Config::Method]
1245
+ #
1246
+ attr_reader :list_services
1247
+ ##
1248
+ # RPC-specific configuration for `get_service`
1249
+ # @return [::Gapic::Config::Method]
1250
+ #
1251
+ attr_reader :get_service
1252
+ ##
1253
+ # RPC-specific configuration for `create_service`
1254
+ # @return [::Gapic::Config::Method]
1255
+ #
1256
+ attr_reader :create_service
1257
+ ##
1258
+ # RPC-specific configuration for `delete_service`
1259
+ # @return [::Gapic::Config::Method]
1260
+ #
1261
+ attr_reader :delete_service
1262
+ ##
1263
+ # RPC-specific configuration for `undelete_service`
1264
+ # @return [::Gapic::Config::Method]
1265
+ #
1266
+ attr_reader :undelete_service
1267
+ ##
1268
+ # RPC-specific configuration for `list_service_configs`
1269
+ # @return [::Gapic::Config::Method]
1270
+ #
1271
+ attr_reader :list_service_configs
1272
+ ##
1273
+ # RPC-specific configuration for `get_service_config`
1274
+ # @return [::Gapic::Config::Method]
1275
+ #
1276
+ attr_reader :get_service_config
1277
+ ##
1278
+ # RPC-specific configuration for `create_service_config`
1279
+ # @return [::Gapic::Config::Method]
1280
+ #
1281
+ attr_reader :create_service_config
1282
+ ##
1283
+ # RPC-specific configuration for `submit_config_source`
1284
+ # @return [::Gapic::Config::Method]
1285
+ #
1286
+ attr_reader :submit_config_source
1287
+ ##
1288
+ # RPC-specific configuration for `list_service_rollouts`
1289
+ # @return [::Gapic::Config::Method]
1290
+ #
1291
+ attr_reader :list_service_rollouts
1292
+ ##
1293
+ # RPC-specific configuration for `get_service_rollout`
1294
+ # @return [::Gapic::Config::Method]
1295
+ #
1296
+ attr_reader :get_service_rollout
1297
+ ##
1298
+ # RPC-specific configuration for `create_service_rollout`
1299
+ # @return [::Gapic::Config::Method]
1300
+ #
1301
+ attr_reader :create_service_rollout
1302
+ ##
1303
+ # RPC-specific configuration for `generate_config_report`
1304
+ # @return [::Gapic::Config::Method]
1305
+ #
1306
+ attr_reader :generate_config_report
1307
+
1308
+ # @private
1309
+ def initialize parent_rpcs = nil
1310
+ list_services_config = parent_rpcs.list_services if parent_rpcs.respond_to? :list_services
1311
+ @list_services = ::Gapic::Config::Method.new list_services_config
1312
+ get_service_config = parent_rpcs.get_service if parent_rpcs.respond_to? :get_service
1313
+ @get_service = ::Gapic::Config::Method.new get_service_config
1314
+ create_service_config = parent_rpcs.create_service if parent_rpcs.respond_to? :create_service
1315
+ @create_service = ::Gapic::Config::Method.new create_service_config
1316
+ delete_service_config = parent_rpcs.delete_service if parent_rpcs.respond_to? :delete_service
1317
+ @delete_service = ::Gapic::Config::Method.new delete_service_config
1318
+ undelete_service_config = parent_rpcs.undelete_service if parent_rpcs.respond_to? :undelete_service
1319
+ @undelete_service = ::Gapic::Config::Method.new undelete_service_config
1320
+ list_service_configs_config = parent_rpcs.list_service_configs if parent_rpcs.respond_to? :list_service_configs
1321
+ @list_service_configs = ::Gapic::Config::Method.new list_service_configs_config
1322
+ get_service_config_config = parent_rpcs.get_service_config if parent_rpcs.respond_to? :get_service_config
1323
+ @get_service_config = ::Gapic::Config::Method.new get_service_config_config
1324
+ create_service_config_config = parent_rpcs.create_service_config if parent_rpcs.respond_to? :create_service_config
1325
+ @create_service_config = ::Gapic::Config::Method.new create_service_config_config
1326
+ submit_config_source_config = parent_rpcs.submit_config_source if parent_rpcs.respond_to? :submit_config_source
1327
+ @submit_config_source = ::Gapic::Config::Method.new submit_config_source_config
1328
+ list_service_rollouts_config = parent_rpcs.list_service_rollouts if parent_rpcs.respond_to? :list_service_rollouts
1329
+ @list_service_rollouts = ::Gapic::Config::Method.new list_service_rollouts_config
1330
+ get_service_rollout_config = parent_rpcs.get_service_rollout if parent_rpcs.respond_to? :get_service_rollout
1331
+ @get_service_rollout = ::Gapic::Config::Method.new get_service_rollout_config
1332
+ create_service_rollout_config = parent_rpcs.create_service_rollout if parent_rpcs.respond_to? :create_service_rollout
1333
+ @create_service_rollout = ::Gapic::Config::Method.new create_service_rollout_config
1334
+ generate_config_report_config = parent_rpcs.generate_config_report if parent_rpcs.respond_to? :generate_config_report
1335
+ @generate_config_report = ::Gapic::Config::Method.new generate_config_report_config
1336
+
1337
+ yield self if block_given?
1338
+ end
1339
+ end
1340
+ end
1341
+ end
1342
+ end
1343
+ end
1344
+ end
1345
+ end
1346
+ end
1347
+ end