google-cloud-security-private_ca-v1beta1 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,1958 @@
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/cloud/security/privateca/v1beta1/service_pb"
21
+ require "google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/service_stub"
22
+
23
+ module Google
24
+ module Cloud
25
+ module Security
26
+ module PrivateCA
27
+ module V1beta1
28
+ module CertificateAuthorityService
29
+ module Rest
30
+ ##
31
+ # REST client for the CertificateAuthorityService service.
32
+ #
33
+ # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client Certificate Authority Service} manages private
34
+ # certificate authorities and issued certificates.
35
+ #
36
+ class Client
37
+ include Paths
38
+
39
+ # @private
40
+ attr_reader :certificate_authority_service_stub
41
+
42
+ ##
43
+ # Configure the CertificateAuthorityService Client class.
44
+ #
45
+ # See {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client::Configuration}
46
+ # for a description of the configuration fields.
47
+ #
48
+ # @example
49
+ #
50
+ # # Modify the configuration for all CertificateAuthorityService clients
51
+ # ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.configure do |config|
52
+ # config.timeout = 10.0
53
+ # end
54
+ #
55
+ # @yield [config] Configure the Client client.
56
+ # @yieldparam config [Client::Configuration]
57
+ #
58
+ # @return [Client::Configuration]
59
+ #
60
+ def self.configure
61
+ @configure ||= begin
62
+ namespace = ["Google", "Cloud", "Security", "PrivateCA", "V1beta1"]
63
+ parent_config = while namespace.any?
64
+ parent_name = namespace.join "::"
65
+ parent_const = const_get parent_name
66
+ break parent_const.configure if parent_const.respond_to? :configure
67
+ namespace.pop
68
+ end
69
+ default_config = Client::Configuration.new parent_config
70
+
71
+ default_config.timeout = 60.0
72
+ default_config.retry_policy = {
73
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [2, 14, 4]
74
+ }
75
+
76
+ default_config
77
+ end
78
+ yield @configure if block_given?
79
+ @configure
80
+ end
81
+
82
+ ##
83
+ # Configure the CertificateAuthorityService Client instance.
84
+ #
85
+ # The configuration is set to the derived mode, meaning that values can be changed,
86
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
87
+ # should be made on {Client.configure}.
88
+ #
89
+ # See {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client::Configuration}
90
+ # for a description of the configuration fields.
91
+ #
92
+ # @yield [config] Configure the Client client.
93
+ # @yieldparam config [Client::Configuration]
94
+ #
95
+ # @return [Client::Configuration]
96
+ #
97
+ def configure
98
+ yield @config if block_given?
99
+ @config
100
+ end
101
+
102
+ ##
103
+ # Create a new CertificateAuthorityService REST client object.
104
+ #
105
+ # @example
106
+ #
107
+ # # Create a client using the default configuration
108
+ # client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new
109
+ #
110
+ # # Create a client using a custom configuration
111
+ # client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new do |config|
112
+ # config.timeout = 10.0
113
+ # end
114
+ #
115
+ # @yield [config] Configure the CertificateAuthorityService client.
116
+ # @yieldparam config [Client::Configuration]
117
+ #
118
+ def initialize
119
+ # Create the configuration object
120
+ @config = Configuration.new Client.configure
121
+
122
+ # Yield the configuration if needed
123
+ yield @config if block_given?
124
+
125
+ # Create credentials
126
+ credentials = @config.credentials
127
+ # Use self-signed JWT if the endpoint is unchanged from default,
128
+ # but only if the default endpoint does not have a region prefix.
129
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
130
+ !@config.endpoint.split(".").first.include?("-")
131
+ credentials ||= Credentials.default scope: @config.scope,
132
+ enable_self_signed_jwt: enable_self_signed_jwt
133
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
134
+ credentials = Credentials.new credentials, scope: @config.scope
135
+ end
136
+
137
+ @quota_project_id = @config.quota_project
138
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
139
+
140
+ @operations_client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Operations.new do |config|
141
+ config.credentials = credentials
142
+ config.quota_project = @quota_project_id
143
+ config.endpoint = @config.endpoint
144
+ end
145
+
146
+ @certificate_authority_service_stub = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
147
+ end
148
+
149
+ ##
150
+ # Get the associated client for long-running operations.
151
+ #
152
+ # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Operations]
153
+ #
154
+ attr_reader :operations_client
155
+
156
+ # Service calls
157
+
158
+ ##
159
+ # Create a new {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} in a given Project, Location from a particular
160
+ # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}.
161
+ #
162
+ # @overload create_certificate(request, options = nil)
163
+ # Pass arguments to `create_certificate` via a request object, either of type
164
+ # {::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateRequest} or an equivalent Hash.
165
+ #
166
+ # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateRequest, ::Hash]
167
+ # A request object representing the call parameters. Required. To specify no
168
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
169
+ # @param options [::Gapic::CallOptions, ::Hash]
170
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
171
+ #
172
+ # @overload create_certificate(parent: nil, certificate_id: nil, certificate: nil, request_id: nil)
173
+ # Pass arguments to `create_certificate` via keyword arguments. Note that at
174
+ # least one keyword argument is required. To specify no parameters, or to keep all
175
+ # the default parameter values, pass an empty Hash as a request object (see above).
176
+ #
177
+ # @param parent [::String]
178
+ # Required. The resource name of the location and {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}
179
+ # associated with the {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate}, in the format
180
+ # `projects/*/locations/*/certificateAuthorities/*`.
181
+ # @param certificate_id [::String]
182
+ # Optional. It must be unique within a location and match the regular
183
+ # expression `[a-zA-Z0-9_-]{1,63}`. This field is required when using a
184
+ # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in the Enterprise {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::Tier CertificateAuthority.Tier},
185
+ # but is optional and its value is ignored otherwise.
186
+ # @param certificate [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate, ::Hash]
187
+ # Required. A {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} with initial field values.
188
+ # @param request_id [::String]
189
+ # Optional. An ID to identify requests. Specify a unique request ID so that if you must
190
+ # retry your request, the server will know to ignore the request if it has
191
+ # already been completed. The server will guarantee that for at least 60
192
+ # minutes since the first request.
193
+ #
194
+ # For example, consider a situation where you make an initial request and t
195
+ # he request times out. If you make the request again with the same request
196
+ # ID, the server can check if original operation with the same request ID
197
+ # was received, and if so, will ignore the second request. This prevents
198
+ # clients from accidentally creating duplicate commitments.
199
+ #
200
+ # The request ID must be a valid UUID with the exception that zero UUID is
201
+ # not supported (00000000-0000-0000-0000-000000000000).
202
+ # @yield [result, operation] Access the result along with the TransportOperation object
203
+ # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate]
204
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
205
+ #
206
+ # @return [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate]
207
+ #
208
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
209
+ def create_certificate request, options = nil
210
+ raise ::ArgumentError, "request must be provided" if request.nil?
211
+
212
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateRequest
213
+
214
+ # Converts hash and nil to an options object
215
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
216
+
217
+ # Customize the options with defaults
218
+ call_metadata = @config.rpcs.create_certificate.metadata.to_h
219
+
220
+ # Set x-goog-api-client and x-goog-user-project headers
221
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
222
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
223
+ gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION,
224
+ transports_version_send: [:rest]
225
+
226
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
227
+
228
+ options.apply_defaults timeout: @config.rpcs.create_certificate.timeout,
229
+ metadata: call_metadata,
230
+ retry_policy: @config.rpcs.create_certificate.retry_policy
231
+
232
+ options.apply_defaults timeout: @config.timeout,
233
+ metadata: @config.metadata,
234
+ retry_policy: @config.retry_policy
235
+
236
+ @certificate_authority_service_stub.create_certificate request, options do |result, operation|
237
+ yield result, operation if block_given?
238
+ return result
239
+ end
240
+ rescue ::Gapic::Rest::Error => e
241
+ raise ::Google::Cloud::Error.from_error(e)
242
+ end
243
+
244
+ ##
245
+ # Returns a {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate}.
246
+ #
247
+ # @overload get_certificate(request, options = nil)
248
+ # Pass arguments to `get_certificate` via a request object, either of type
249
+ # {::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRequest} or an equivalent Hash.
250
+ #
251
+ # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRequest, ::Hash]
252
+ # A request object representing the call parameters. Required. To specify no
253
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
254
+ # @param options [::Gapic::CallOptions, ::Hash]
255
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
256
+ #
257
+ # @overload get_certificate(name: nil)
258
+ # Pass arguments to `get_certificate` via keyword arguments. Note that at
259
+ # least one keyword argument is required. To specify no parameters, or to keep all
260
+ # the default parameter values, pass an empty Hash as a request object (see above).
261
+ #
262
+ # @param name [::String]
263
+ # Required. The {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate#name name} of the {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} to get.
264
+ # @yield [result, operation] Access the result along with the TransportOperation object
265
+ # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate]
266
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
267
+ #
268
+ # @return [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate]
269
+ #
270
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
271
+ def get_certificate request, options = nil
272
+ raise ::ArgumentError, "request must be provided" if request.nil?
273
+
274
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRequest
275
+
276
+ # Converts hash and nil to an options object
277
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
278
+
279
+ # Customize the options with defaults
280
+ call_metadata = @config.rpcs.get_certificate.metadata.to_h
281
+
282
+ # Set x-goog-api-client and x-goog-user-project headers
283
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
284
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
285
+ gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION,
286
+ transports_version_send: [:rest]
287
+
288
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
289
+
290
+ options.apply_defaults timeout: @config.rpcs.get_certificate.timeout,
291
+ metadata: call_metadata,
292
+ retry_policy: @config.rpcs.get_certificate.retry_policy
293
+
294
+ options.apply_defaults timeout: @config.timeout,
295
+ metadata: @config.metadata,
296
+ retry_policy: @config.retry_policy
297
+
298
+ @certificate_authority_service_stub.get_certificate request, options do |result, operation|
299
+ yield result, operation if block_given?
300
+ return result
301
+ end
302
+ rescue ::Gapic::Rest::Error => e
303
+ raise ::Google::Cloud::Error.from_error(e)
304
+ end
305
+
306
+ ##
307
+ # Lists {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates}.
308
+ #
309
+ # @overload list_certificates(request, options = nil)
310
+ # Pass arguments to `list_certificates` via a request object, either of type
311
+ # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesRequest} or an equivalent Hash.
312
+ #
313
+ # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesRequest, ::Hash]
314
+ # A request object representing the call parameters. Required. To specify no
315
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
316
+ # @param options [::Gapic::CallOptions, ::Hash]
317
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
318
+ #
319
+ # @overload list_certificates(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
320
+ # Pass arguments to `list_certificates` via keyword arguments. Note that at
321
+ # least one keyword argument is required. To specify no parameters, or to keep all
322
+ # the default parameter values, pass an empty Hash as a request object (see above).
323
+ #
324
+ # @param parent [::String]
325
+ # Required. The resource name of the location associated with the
326
+ # {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates}, in the format
327
+ # `projects/*/locations/*/certificateauthorities/*`.
328
+ # @param page_size [::Integer]
329
+ # Optional. Limit on the number of
330
+ # {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates} to include in the
331
+ # response. Further {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificates} can subsequently be obtained
332
+ # by including the
333
+ # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesResponse#next_page_token ListCertificatesResponse.next_page_token} in a subsequent
334
+ # request. If unspecified, the server will pick an appropriate default.
335
+ # @param page_token [::String]
336
+ # Optional. Pagination token, returned earlier via
337
+ # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesResponse#next_page_token ListCertificatesResponse.next_page_token}.
338
+ # @param filter [::String]
339
+ # Optional. Only include resources that match the filter in the response. For details
340
+ # on supported filters and syntax, see [Certificates Filtering
341
+ # documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#filtering_support).
342
+ # @param order_by [::String]
343
+ # Optional. Specify how the results should be sorted. For details on supported fields
344
+ # and syntax, see [Certificates Sorting
345
+ # documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#sorting_support).
346
+ # @yield [result, operation] Access the result along with the TransportOperation object
347
+ # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesResponse]
348
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
349
+ #
350
+ # @return [::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesResponse]
351
+ #
352
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
353
+ def list_certificates request, options = nil
354
+ raise ::ArgumentError, "request must be provided" if request.nil?
355
+
356
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesRequest
357
+
358
+ # Converts hash and nil to an options object
359
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
360
+
361
+ # Customize the options with defaults
362
+ call_metadata = @config.rpcs.list_certificates.metadata.to_h
363
+
364
+ # Set x-goog-api-client and x-goog-user-project headers
365
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
366
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
367
+ gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION,
368
+ transports_version_send: [:rest]
369
+
370
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
371
+
372
+ options.apply_defaults timeout: @config.rpcs.list_certificates.timeout,
373
+ metadata: call_metadata,
374
+ retry_policy: @config.rpcs.list_certificates.retry_policy
375
+
376
+ options.apply_defaults timeout: @config.timeout,
377
+ metadata: @config.metadata,
378
+ retry_policy: @config.retry_policy
379
+
380
+ @certificate_authority_service_stub.list_certificates request, options do |result, operation|
381
+ yield result, operation if block_given?
382
+ return result
383
+ end
384
+ rescue ::Gapic::Rest::Error => e
385
+ raise ::Google::Cloud::Error.from_error(e)
386
+ end
387
+
388
+ ##
389
+ # Revoke a {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate}.
390
+ #
391
+ # @overload revoke_certificate(request, options = nil)
392
+ # Pass arguments to `revoke_certificate` via a request object, either of type
393
+ # {::Google::Cloud::Security::PrivateCA::V1beta1::RevokeCertificateRequest} or an equivalent Hash.
394
+ #
395
+ # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::RevokeCertificateRequest, ::Hash]
396
+ # A request object representing the call parameters. Required. To specify no
397
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
398
+ # @param options [::Gapic::CallOptions, ::Hash]
399
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
400
+ #
401
+ # @overload revoke_certificate(name: nil, reason: nil, request_id: nil)
402
+ # Pass arguments to `revoke_certificate` via keyword arguments. Note that at
403
+ # least one keyword argument is required. To specify no parameters, or to keep all
404
+ # the default parameter values, pass an empty Hash as a request object (see above).
405
+ #
406
+ # @param name [::String]
407
+ # Required. The resource name for this {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} in the
408
+ # format `projects/*/locations/*/certificateAuthorities/*/certificates/*`.
409
+ # @param reason [::Google::Cloud::Security::PrivateCA::V1beta1::RevocationReason]
410
+ # Required. The {::Google::Cloud::Security::PrivateCA::V1beta1::RevocationReason RevocationReason} for revoking this certificate.
411
+ # @param request_id [::String]
412
+ # Optional. An ID to identify requests. Specify a unique request ID so that if you must
413
+ # retry your request, the server will know to ignore the request if it has
414
+ # already been completed. The server will guarantee that for at least 60
415
+ # minutes since the first request.
416
+ #
417
+ # For example, consider a situation where you make an initial request and t
418
+ # he request times out. If you make the request again with the same request
419
+ # ID, the server can check if original operation with the same request ID
420
+ # was received, and if so, will ignore the second request. This prevents
421
+ # clients from accidentally creating duplicate commitments.
422
+ #
423
+ # The request ID must be a valid UUID with the exception that zero UUID is
424
+ # not supported (00000000-0000-0000-0000-000000000000).
425
+ # @yield [result, operation] Access the result along with the TransportOperation object
426
+ # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate]
427
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
428
+ #
429
+ # @return [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate]
430
+ #
431
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
432
+ def revoke_certificate request, options = nil
433
+ raise ::ArgumentError, "request must be provided" if request.nil?
434
+
435
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::RevokeCertificateRequest
436
+
437
+ # Converts hash and nil to an options object
438
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
439
+
440
+ # Customize the options with defaults
441
+ call_metadata = @config.rpcs.revoke_certificate.metadata.to_h
442
+
443
+ # Set x-goog-api-client and x-goog-user-project headers
444
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
445
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
446
+ gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION,
447
+ transports_version_send: [:rest]
448
+
449
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
450
+
451
+ options.apply_defaults timeout: @config.rpcs.revoke_certificate.timeout,
452
+ metadata: call_metadata,
453
+ retry_policy: @config.rpcs.revoke_certificate.retry_policy
454
+
455
+ options.apply_defaults timeout: @config.timeout,
456
+ metadata: @config.metadata,
457
+ retry_policy: @config.retry_policy
458
+
459
+ @certificate_authority_service_stub.revoke_certificate request, options do |result, operation|
460
+ yield result, operation if block_given?
461
+ return result
462
+ end
463
+ rescue ::Gapic::Rest::Error => e
464
+ raise ::Google::Cloud::Error.from_error(e)
465
+ end
466
+
467
+ ##
468
+ # Update a {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate}. Currently, the only field you can update is the
469
+ # {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate#labels labels} field.
470
+ #
471
+ # @overload update_certificate(request, options = nil)
472
+ # Pass arguments to `update_certificate` via a request object, either of type
473
+ # {::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRequest} or an equivalent Hash.
474
+ #
475
+ # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRequest, ::Hash]
476
+ # A request object representing the call parameters. Required. To specify no
477
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
478
+ # @param options [::Gapic::CallOptions, ::Hash]
479
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
480
+ #
481
+ # @overload update_certificate(certificate: nil, update_mask: nil, request_id: nil)
482
+ # Pass arguments to `update_certificate` via keyword arguments. Note that at
483
+ # least one keyword argument is required. To specify no parameters, or to keep all
484
+ # the default parameter values, pass an empty Hash as a request object (see above).
485
+ #
486
+ # @param certificate [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate, ::Hash]
487
+ # Required. {::Google::Cloud::Security::PrivateCA::V1beta1::Certificate Certificate} with updated values.
488
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
489
+ # Required. A list of fields to be updated in this request.
490
+ # @param request_id [::String]
491
+ # Optional. An ID to identify requests. Specify a unique request ID so that if you must
492
+ # retry your request, the server will know to ignore the request if it has
493
+ # already been completed. The server will guarantee that for at least 60
494
+ # minutes since the first request.
495
+ #
496
+ # For example, consider a situation where you make an initial request and t
497
+ # he request times out. If you make the request again with the same request
498
+ # ID, the server can check if original operation with the same request ID
499
+ # was received, and if so, will ignore the second request. This prevents
500
+ # clients from accidentally creating duplicate commitments.
501
+ #
502
+ # The request ID must be a valid UUID with the exception that zero UUID is
503
+ # not supported (00000000-0000-0000-0000-000000000000).
504
+ # @yield [result, operation] Access the result along with the TransportOperation object
505
+ # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate]
506
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
507
+ #
508
+ # @return [::Google::Cloud::Security::PrivateCA::V1beta1::Certificate]
509
+ #
510
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
511
+ def update_certificate request, options = nil
512
+ raise ::ArgumentError, "request must be provided" if request.nil?
513
+
514
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRequest
515
+
516
+ # Converts hash and nil to an options object
517
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
518
+
519
+ # Customize the options with defaults
520
+ call_metadata = @config.rpcs.update_certificate.metadata.to_h
521
+
522
+ # Set x-goog-api-client and x-goog-user-project headers
523
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
524
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
525
+ gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION,
526
+ transports_version_send: [:rest]
527
+
528
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
529
+
530
+ options.apply_defaults timeout: @config.rpcs.update_certificate.timeout,
531
+ metadata: call_metadata,
532
+ retry_policy: @config.rpcs.update_certificate.retry_policy
533
+
534
+ options.apply_defaults timeout: @config.timeout,
535
+ metadata: @config.metadata,
536
+ retry_policy: @config.retry_policy
537
+
538
+ @certificate_authority_service_stub.update_certificate request, options do |result, operation|
539
+ yield result, operation if block_given?
540
+ return result
541
+ end
542
+ rescue ::Gapic::Rest::Error => e
543
+ raise ::Google::Cloud::Error.from_error(e)
544
+ end
545
+
546
+ ##
547
+ # Activate a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} that is in state
548
+ # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::State::PENDING_ACTIVATION PENDING_ACTIVATION} and is
549
+ # of type {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::Type::SUBORDINATE SUBORDINATE}. After the
550
+ # parent Certificate Authority signs a certificate signing request from
551
+ # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client#fetch_certificate_authority_csr FetchCertificateAuthorityCsr}, this method can complete the activation
552
+ # process.
553
+ #
554
+ # @overload activate_certificate_authority(request, options = nil)
555
+ # Pass arguments to `activate_certificate_authority` via a request object, either of type
556
+ # {::Google::Cloud::Security::PrivateCA::V1beta1::ActivateCertificateAuthorityRequest} or an equivalent Hash.
557
+ #
558
+ # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::ActivateCertificateAuthorityRequest, ::Hash]
559
+ # A request object representing the call parameters. Required. To specify no
560
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
561
+ # @param options [::Gapic::CallOptions, ::Hash]
562
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
563
+ #
564
+ # @overload activate_certificate_authority(name: nil, pem_ca_certificate: nil, subordinate_config: nil, request_id: nil)
565
+ # Pass arguments to `activate_certificate_authority` via keyword arguments. Note that at
566
+ # least one keyword argument is required. To specify no parameters, or to keep all
567
+ # the default parameter values, pass an empty Hash as a request object (see above).
568
+ #
569
+ # @param name [::String]
570
+ # Required. The resource name for this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in the
571
+ # format `projects/*/locations/*/certificateAuthorities/*`.
572
+ # @param pem_ca_certificate [::String]
573
+ # Required. The signed CA certificate issued from
574
+ # {::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrResponse#pem_csr FetchCertificateAuthorityCsrResponse.pem_csr}.
575
+ # @param subordinate_config [::Google::Cloud::Security::PrivateCA::V1beta1::SubordinateConfig, ::Hash]
576
+ # Required. Must include information about the issuer of 'pem_ca_certificate', and any
577
+ # further issuers until the self-signed CA.
578
+ # @param request_id [::String]
579
+ # Optional. An ID to identify requests. Specify a unique request ID so that if you must
580
+ # retry your request, the server will know to ignore the request if it has
581
+ # already been completed. The server will guarantee that for at least 60
582
+ # minutes since the first request.
583
+ #
584
+ # For example, consider a situation where you make an initial request and t
585
+ # he request times out. If you make the request again with the same request
586
+ # ID, the server can check if original operation with the same request ID
587
+ # was received, and if so, will ignore the second request. This prevents
588
+ # clients from accidentally creating duplicate commitments.
589
+ #
590
+ # The request ID must be a valid UUID with the exception that zero UUID is
591
+ # not supported (00000000-0000-0000-0000-000000000000).
592
+ # @yield [result, operation] Access the result along with the TransportOperation object
593
+ # @yieldparam result [::Gapic::Operation]
594
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
595
+ #
596
+ # @return [::Gapic::Operation]
597
+ #
598
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
599
+ def activate_certificate_authority request, options = nil
600
+ raise ::ArgumentError, "request must be provided" if request.nil?
601
+
602
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::ActivateCertificateAuthorityRequest
603
+
604
+ # Converts hash and nil to an options object
605
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
606
+
607
+ # Customize the options with defaults
608
+ call_metadata = @config.rpcs.activate_certificate_authority.metadata.to_h
609
+
610
+ # Set x-goog-api-client and x-goog-user-project headers
611
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
612
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
613
+ gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION,
614
+ transports_version_send: [:rest]
615
+
616
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
617
+
618
+ options.apply_defaults timeout: @config.rpcs.activate_certificate_authority.timeout,
619
+ metadata: call_metadata,
620
+ retry_policy: @config.rpcs.activate_certificate_authority.retry_policy
621
+
622
+ options.apply_defaults timeout: @config.timeout,
623
+ metadata: @config.metadata,
624
+ retry_policy: @config.retry_policy
625
+
626
+ @certificate_authority_service_stub.activate_certificate_authority request, options do |result, operation|
627
+ result = ::Gapic::Operation.new result, @operations_client, options: options
628
+ yield result, operation if block_given?
629
+ return result
630
+ end
631
+ rescue ::Gapic::Rest::Error => e
632
+ raise ::Google::Cloud::Error.from_error(e)
633
+ end
634
+
635
+ ##
636
+ # Create a new {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in a given Project and Location.
637
+ #
638
+ # @overload create_certificate_authority(request, options = nil)
639
+ # Pass arguments to `create_certificate_authority` via a request object, either of type
640
+ # {::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateAuthorityRequest} or an equivalent Hash.
641
+ #
642
+ # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateAuthorityRequest, ::Hash]
643
+ # A request object representing the call parameters. Required. To specify no
644
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
645
+ # @param options [::Gapic::CallOptions, ::Hash]
646
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
647
+ #
648
+ # @overload create_certificate_authority(parent: nil, certificate_authority_id: nil, certificate_authority: nil, request_id: nil)
649
+ # Pass arguments to `create_certificate_authority` via keyword arguments. Note that at
650
+ # least one keyword argument is required. To specify no parameters, or to keep all
651
+ # the default parameter values, pass an empty Hash as a request object (see above).
652
+ #
653
+ # @param parent [::String]
654
+ # Required. The resource name of the location associated with the
655
+ # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthorities}, in the format
656
+ # `projects/*/locations/*`.
657
+ # @param certificate_authority_id [::String]
658
+ # Required. It must be unique within a location and match the regular
659
+ # expression `[a-zA-Z0-9_-]{1,63}`
660
+ # @param certificate_authority [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority, ::Hash]
661
+ # Required. A {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} with initial field values.
662
+ # @param request_id [::String]
663
+ # Optional. An ID to identify requests. Specify a unique request ID so that if you must
664
+ # retry your request, the server will know to ignore the request if it has
665
+ # already been completed. The server will guarantee that for at least 60
666
+ # minutes since the first request.
667
+ #
668
+ # For example, consider a situation where you make an initial request and t
669
+ # he request times out. If you make the request again with the same request
670
+ # ID, the server can check if original operation with the same request ID
671
+ # was received, and if so, will ignore the second request. This prevents
672
+ # clients from accidentally creating duplicate commitments.
673
+ #
674
+ # The request ID must be a valid UUID with the exception that zero UUID is
675
+ # not supported (00000000-0000-0000-0000-000000000000).
676
+ # @yield [result, operation] Access the result along with the TransportOperation object
677
+ # @yieldparam result [::Gapic::Operation]
678
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
679
+ #
680
+ # @return [::Gapic::Operation]
681
+ #
682
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
683
+ def create_certificate_authority request, options = nil
684
+ raise ::ArgumentError, "request must be provided" if request.nil?
685
+
686
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateAuthorityRequest
687
+
688
+ # Converts hash and nil to an options object
689
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
690
+
691
+ # Customize the options with defaults
692
+ call_metadata = @config.rpcs.create_certificate_authority.metadata.to_h
693
+
694
+ # Set x-goog-api-client and x-goog-user-project headers
695
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
696
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
697
+ gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION,
698
+ transports_version_send: [:rest]
699
+
700
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
701
+
702
+ options.apply_defaults timeout: @config.rpcs.create_certificate_authority.timeout,
703
+ metadata: call_metadata,
704
+ retry_policy: @config.rpcs.create_certificate_authority.retry_policy
705
+
706
+ options.apply_defaults timeout: @config.timeout,
707
+ metadata: @config.metadata,
708
+ retry_policy: @config.retry_policy
709
+
710
+ @certificate_authority_service_stub.create_certificate_authority request, options do |result, operation|
711
+ result = ::Gapic::Operation.new result, @operations_client, options: options
712
+ yield result, operation if block_given?
713
+ return result
714
+ end
715
+ rescue ::Gapic::Rest::Error => e
716
+ raise ::Google::Cloud::Error.from_error(e)
717
+ end
718
+
719
+ ##
720
+ # Disable a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}.
721
+ #
722
+ # @overload disable_certificate_authority(request, options = nil)
723
+ # Pass arguments to `disable_certificate_authority` via a request object, either of type
724
+ # {::Google::Cloud::Security::PrivateCA::V1beta1::DisableCertificateAuthorityRequest} or an equivalent Hash.
725
+ #
726
+ # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::DisableCertificateAuthorityRequest, ::Hash]
727
+ # A request object representing the call parameters. Required. To specify no
728
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
729
+ # @param options [::Gapic::CallOptions, ::Hash]
730
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
731
+ #
732
+ # @overload disable_certificate_authority(name: nil, request_id: nil)
733
+ # Pass arguments to `disable_certificate_authority` via keyword arguments. Note that at
734
+ # least one keyword argument is required. To specify no parameters, or to keep all
735
+ # the default parameter values, pass an empty Hash as a request object (see above).
736
+ #
737
+ # @param name [::String]
738
+ # Required. The resource name for this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in the
739
+ # format `projects/*/locations/*/certificateAuthorities/*`.
740
+ # @param request_id [::String]
741
+ # Optional. An ID to identify requests. Specify a unique request ID so that if you must
742
+ # retry your request, the server will know to ignore the request if it has
743
+ # already been completed. The server will guarantee that for at least 60
744
+ # minutes since the first request.
745
+ #
746
+ # For example, consider a situation where you make an initial request and t
747
+ # he request times out. If you make the request again with the same request
748
+ # ID, the server can check if original operation with the same request ID
749
+ # was received, and if so, will ignore the second request. This prevents
750
+ # clients from accidentally creating duplicate commitments.
751
+ #
752
+ # The request ID must be a valid UUID with the exception that zero UUID is
753
+ # not supported (00000000-0000-0000-0000-000000000000).
754
+ # @yield [result, operation] Access the result along with the TransportOperation object
755
+ # @yieldparam result [::Gapic::Operation]
756
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
757
+ #
758
+ # @return [::Gapic::Operation]
759
+ #
760
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
761
+ def disable_certificate_authority request, options = nil
762
+ raise ::ArgumentError, "request must be provided" if request.nil?
763
+
764
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::DisableCertificateAuthorityRequest
765
+
766
+ # Converts hash and nil to an options object
767
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
768
+
769
+ # Customize the options with defaults
770
+ call_metadata = @config.rpcs.disable_certificate_authority.metadata.to_h
771
+
772
+ # Set x-goog-api-client and x-goog-user-project headers
773
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
774
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
775
+ gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION,
776
+ transports_version_send: [:rest]
777
+
778
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
779
+
780
+ options.apply_defaults timeout: @config.rpcs.disable_certificate_authority.timeout,
781
+ metadata: call_metadata,
782
+ retry_policy: @config.rpcs.disable_certificate_authority.retry_policy
783
+
784
+ options.apply_defaults timeout: @config.timeout,
785
+ metadata: @config.metadata,
786
+ retry_policy: @config.retry_policy
787
+
788
+ @certificate_authority_service_stub.disable_certificate_authority request, options do |result, operation|
789
+ result = ::Gapic::Operation.new result, @operations_client, options: options
790
+ yield result, operation if block_given?
791
+ return result
792
+ end
793
+ rescue ::Gapic::Rest::Error => e
794
+ raise ::Google::Cloud::Error.from_error(e)
795
+ end
796
+
797
+ ##
798
+ # Enable a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}.
799
+ #
800
+ # @overload enable_certificate_authority(request, options = nil)
801
+ # Pass arguments to `enable_certificate_authority` via a request object, either of type
802
+ # {::Google::Cloud::Security::PrivateCA::V1beta1::EnableCertificateAuthorityRequest} or an equivalent Hash.
803
+ #
804
+ # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::EnableCertificateAuthorityRequest, ::Hash]
805
+ # A request object representing the call parameters. Required. To specify no
806
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
807
+ # @param options [::Gapic::CallOptions, ::Hash]
808
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
809
+ #
810
+ # @overload enable_certificate_authority(name: nil, request_id: nil)
811
+ # Pass arguments to `enable_certificate_authority` via keyword arguments. Note that at
812
+ # least one keyword argument is required. To specify no parameters, or to keep all
813
+ # the default parameter values, pass an empty Hash as a request object (see above).
814
+ #
815
+ # @param name [::String]
816
+ # Required. The resource name for this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in the
817
+ # format `projects/*/locations/*/certificateAuthorities/*`.
818
+ # @param request_id [::String]
819
+ # Optional. An ID to identify requests. Specify a unique request ID so that if you must
820
+ # retry your request, the server will know to ignore the request if it has
821
+ # already been completed. The server will guarantee that for at least 60
822
+ # minutes since the first request.
823
+ #
824
+ # For example, consider a situation where you make an initial request and t
825
+ # he request times out. If you make the request again with the same request
826
+ # ID, the server can check if original operation with the same request ID
827
+ # was received, and if so, will ignore the second request. This prevents
828
+ # clients from accidentally creating duplicate commitments.
829
+ #
830
+ # The request ID must be a valid UUID with the exception that zero UUID is
831
+ # not supported (00000000-0000-0000-0000-000000000000).
832
+ # @yield [result, operation] Access the result along with the TransportOperation object
833
+ # @yieldparam result [::Gapic::Operation]
834
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
835
+ #
836
+ # @return [::Gapic::Operation]
837
+ #
838
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
839
+ def enable_certificate_authority request, options = nil
840
+ raise ::ArgumentError, "request must be provided" if request.nil?
841
+
842
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::EnableCertificateAuthorityRequest
843
+
844
+ # Converts hash and nil to an options object
845
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
846
+
847
+ # Customize the options with defaults
848
+ call_metadata = @config.rpcs.enable_certificate_authority.metadata.to_h
849
+
850
+ # Set x-goog-api-client and x-goog-user-project headers
851
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
852
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
853
+ gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION,
854
+ transports_version_send: [:rest]
855
+
856
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
857
+
858
+ options.apply_defaults timeout: @config.rpcs.enable_certificate_authority.timeout,
859
+ metadata: call_metadata,
860
+ retry_policy: @config.rpcs.enable_certificate_authority.retry_policy
861
+
862
+ options.apply_defaults timeout: @config.timeout,
863
+ metadata: @config.metadata,
864
+ retry_policy: @config.retry_policy
865
+
866
+ @certificate_authority_service_stub.enable_certificate_authority request, options do |result, operation|
867
+ result = ::Gapic::Operation.new result, @operations_client, options: options
868
+ yield result, operation if block_given?
869
+ return result
870
+ end
871
+ rescue ::Gapic::Rest::Error => e
872
+ raise ::Google::Cloud::Error.from_error(e)
873
+ end
874
+
875
+ ##
876
+ # Fetch a certificate signing request (CSR) from a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}
877
+ # that is in state
878
+ # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::State::PENDING_ACTIVATION PENDING_ACTIVATION} and is
879
+ # of type {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority::Type::SUBORDINATE SUBORDINATE}. The CSR must
880
+ # then be signed by the desired parent Certificate Authority, which could be
881
+ # another {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} resource, or could be an on-prem
882
+ # certificate authority. See also {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client#activate_certificate_authority ActivateCertificateAuthority}.
883
+ #
884
+ # @overload fetch_certificate_authority_csr(request, options = nil)
885
+ # Pass arguments to `fetch_certificate_authority_csr` via a request object, either of type
886
+ # {::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrRequest} or an equivalent Hash.
887
+ #
888
+ # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrRequest, ::Hash]
889
+ # A request object representing the call parameters. Required. To specify no
890
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
891
+ # @param options [::Gapic::CallOptions, ::Hash]
892
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
893
+ #
894
+ # @overload fetch_certificate_authority_csr(name: nil)
895
+ # Pass arguments to `fetch_certificate_authority_csr` via keyword arguments. Note that at
896
+ # least one keyword argument is required. To specify no parameters, or to keep all
897
+ # the default parameter values, pass an empty Hash as a request object (see above).
898
+ #
899
+ # @param name [::String]
900
+ # Required. The resource name for this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in the
901
+ # format `projects/*/locations/*/certificateAuthorities/*`.
902
+ # @yield [result, operation] Access the result along with the TransportOperation object
903
+ # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrResponse]
904
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
905
+ #
906
+ # @return [::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrResponse]
907
+ #
908
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
909
+ def fetch_certificate_authority_csr request, options = nil
910
+ raise ::ArgumentError, "request must be provided" if request.nil?
911
+
912
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrRequest
913
+
914
+ # Converts hash and nil to an options object
915
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
916
+
917
+ # Customize the options with defaults
918
+ call_metadata = @config.rpcs.fetch_certificate_authority_csr.metadata.to_h
919
+
920
+ # Set x-goog-api-client and x-goog-user-project headers
921
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
922
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
923
+ gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION,
924
+ transports_version_send: [:rest]
925
+
926
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
927
+
928
+ options.apply_defaults timeout: @config.rpcs.fetch_certificate_authority_csr.timeout,
929
+ metadata: call_metadata,
930
+ retry_policy: @config.rpcs.fetch_certificate_authority_csr.retry_policy
931
+
932
+ options.apply_defaults timeout: @config.timeout,
933
+ metadata: @config.metadata,
934
+ retry_policy: @config.retry_policy
935
+
936
+ @certificate_authority_service_stub.fetch_certificate_authority_csr request, options do |result, operation|
937
+ yield result, operation if block_given?
938
+ return result
939
+ end
940
+ rescue ::Gapic::Rest::Error => e
941
+ raise ::Google::Cloud::Error.from_error(e)
942
+ end
943
+
944
+ ##
945
+ # Returns a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}.
946
+ #
947
+ # @overload get_certificate_authority(request, options = nil)
948
+ # Pass arguments to `get_certificate_authority` via a request object, either of type
949
+ # {::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateAuthorityRequest} or an equivalent Hash.
950
+ #
951
+ # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateAuthorityRequest, ::Hash]
952
+ # A request object representing the call parameters. Required. To specify no
953
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
954
+ # @param options [::Gapic::CallOptions, ::Hash]
955
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
956
+ #
957
+ # @overload get_certificate_authority(name: nil)
958
+ # Pass arguments to `get_certificate_authority` via keyword arguments. Note that at
959
+ # least one keyword argument is required. To specify no parameters, or to keep all
960
+ # the default parameter values, pass an empty Hash as a request object (see above).
961
+ #
962
+ # @param name [::String]
963
+ # Required. The {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority#name name} of the {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} to
964
+ # get.
965
+ # @yield [result, operation] Access the result along with the TransportOperation object
966
+ # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority]
967
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
968
+ #
969
+ # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority]
970
+ #
971
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
972
+ def get_certificate_authority request, options = nil
973
+ raise ::ArgumentError, "request must be provided" if request.nil?
974
+
975
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateAuthorityRequest
976
+
977
+ # Converts hash and nil to an options object
978
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
979
+
980
+ # Customize the options with defaults
981
+ call_metadata = @config.rpcs.get_certificate_authority.metadata.to_h
982
+
983
+ # Set x-goog-api-client and x-goog-user-project headers
984
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
985
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
986
+ gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION,
987
+ transports_version_send: [:rest]
988
+
989
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
990
+
991
+ options.apply_defaults timeout: @config.rpcs.get_certificate_authority.timeout,
992
+ metadata: call_metadata,
993
+ retry_policy: @config.rpcs.get_certificate_authority.retry_policy
994
+
995
+ options.apply_defaults timeout: @config.timeout,
996
+ metadata: @config.metadata,
997
+ retry_policy: @config.retry_policy
998
+
999
+ @certificate_authority_service_stub.get_certificate_authority request, options do |result, operation|
1000
+ yield result, operation if block_given?
1001
+ return result
1002
+ end
1003
+ rescue ::Gapic::Rest::Error => e
1004
+ raise ::Google::Cloud::Error.from_error(e)
1005
+ end
1006
+
1007
+ ##
1008
+ # Lists {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthorities}.
1009
+ #
1010
+ # @overload list_certificate_authorities(request, options = nil)
1011
+ # Pass arguments to `list_certificate_authorities` via a request object, either of type
1012
+ # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesRequest} or an equivalent Hash.
1013
+ #
1014
+ # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesRequest, ::Hash]
1015
+ # A request object representing the call parameters. Required. To specify no
1016
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1017
+ # @param options [::Gapic::CallOptions, ::Hash]
1018
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1019
+ #
1020
+ # @overload list_certificate_authorities(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
1021
+ # Pass arguments to `list_certificate_authorities` via keyword arguments. Note that at
1022
+ # least one keyword argument is required. To specify no parameters, or to keep all
1023
+ # the default parameter values, pass an empty Hash as a request object (see above).
1024
+ #
1025
+ # @param parent [::String]
1026
+ # Required. The resource name of the location associated with the
1027
+ # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthorities}, in the format
1028
+ # `projects/*/locations/*`.
1029
+ # @param page_size [::Integer]
1030
+ # Optional. Limit on the number of {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthorities} to
1031
+ # include in the response.
1032
+ # Further {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthorities} can subsequently be
1033
+ # obtained by including the
1034
+ # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesResponse#next_page_token ListCertificateAuthoritiesResponse.next_page_token} in a subsequent
1035
+ # request. If unspecified, the server will pick an appropriate default.
1036
+ # @param page_token [::String]
1037
+ # Optional. Pagination token, returned earlier via
1038
+ # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesResponse#next_page_token ListCertificateAuthoritiesResponse.next_page_token}.
1039
+ # @param filter [::String]
1040
+ # Optional. Only include resources that match the filter in the response.
1041
+ # @param order_by [::String]
1042
+ # Optional. Specify how the results should be sorted.
1043
+ # @yield [result, operation] Access the result along with the TransportOperation object
1044
+ # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesResponse]
1045
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1046
+ #
1047
+ # @return [::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesResponse]
1048
+ #
1049
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1050
+ def list_certificate_authorities request, options = nil
1051
+ raise ::ArgumentError, "request must be provided" if request.nil?
1052
+
1053
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesRequest
1054
+
1055
+ # Converts hash and nil to an options object
1056
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1057
+
1058
+ # Customize the options with defaults
1059
+ call_metadata = @config.rpcs.list_certificate_authorities.metadata.to_h
1060
+
1061
+ # Set x-goog-api-client and x-goog-user-project headers
1062
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1063
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1064
+ gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION,
1065
+ transports_version_send: [:rest]
1066
+
1067
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1068
+
1069
+ options.apply_defaults timeout: @config.rpcs.list_certificate_authorities.timeout,
1070
+ metadata: call_metadata,
1071
+ retry_policy: @config.rpcs.list_certificate_authorities.retry_policy
1072
+
1073
+ options.apply_defaults timeout: @config.timeout,
1074
+ metadata: @config.metadata,
1075
+ retry_policy: @config.retry_policy
1076
+
1077
+ @certificate_authority_service_stub.list_certificate_authorities request, options do |result, operation|
1078
+ yield result, operation if block_given?
1079
+ return result
1080
+ end
1081
+ rescue ::Gapic::Rest::Error => e
1082
+ raise ::Google::Cloud::Error.from_error(e)
1083
+ end
1084
+
1085
+ ##
1086
+ # Restore a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} that is scheduled for deletion.
1087
+ #
1088
+ # @overload restore_certificate_authority(request, options = nil)
1089
+ # Pass arguments to `restore_certificate_authority` via a request object, either of type
1090
+ # {::Google::Cloud::Security::PrivateCA::V1beta1::RestoreCertificateAuthorityRequest} or an equivalent Hash.
1091
+ #
1092
+ # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::RestoreCertificateAuthorityRequest, ::Hash]
1093
+ # A request object representing the call parameters. Required. To specify no
1094
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1095
+ # @param options [::Gapic::CallOptions, ::Hash]
1096
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1097
+ #
1098
+ # @overload restore_certificate_authority(name: nil, request_id: nil)
1099
+ # Pass arguments to `restore_certificate_authority` via keyword arguments. Note that at
1100
+ # least one keyword argument is required. To specify no parameters, or to keep all
1101
+ # the default parameter values, pass an empty Hash as a request object (see above).
1102
+ #
1103
+ # @param name [::String]
1104
+ # Required. The resource name for this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in the
1105
+ # format `projects/*/locations/*/certificateAuthorities/*`.
1106
+ # @param request_id [::String]
1107
+ # Optional. An ID to identify requests. Specify a unique request ID so that if you must
1108
+ # retry your request, the server will know to ignore the request if it has
1109
+ # already been completed. The server will guarantee that for at least 60
1110
+ # minutes since the first request.
1111
+ #
1112
+ # For example, consider a situation where you make an initial request and t
1113
+ # he request times out. If you make the request again with the same request
1114
+ # ID, the server can check if original operation with the same request ID
1115
+ # was received, and if so, will ignore the second request. This prevents
1116
+ # clients from accidentally creating duplicate commitments.
1117
+ #
1118
+ # The request ID must be a valid UUID with the exception that zero UUID is
1119
+ # not supported (00000000-0000-0000-0000-000000000000).
1120
+ # @yield [result, operation] Access the result along with the TransportOperation object
1121
+ # @yieldparam result [::Gapic::Operation]
1122
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1123
+ #
1124
+ # @return [::Gapic::Operation]
1125
+ #
1126
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1127
+ def restore_certificate_authority request, options = nil
1128
+ raise ::ArgumentError, "request must be provided" if request.nil?
1129
+
1130
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::RestoreCertificateAuthorityRequest
1131
+
1132
+ # Converts hash and nil to an options object
1133
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1134
+
1135
+ # Customize the options with defaults
1136
+ call_metadata = @config.rpcs.restore_certificate_authority.metadata.to_h
1137
+
1138
+ # Set x-goog-api-client and x-goog-user-project headers
1139
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1140
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1141
+ gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION,
1142
+ transports_version_send: [:rest]
1143
+
1144
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1145
+
1146
+ options.apply_defaults timeout: @config.rpcs.restore_certificate_authority.timeout,
1147
+ metadata: call_metadata,
1148
+ retry_policy: @config.rpcs.restore_certificate_authority.retry_policy
1149
+
1150
+ options.apply_defaults timeout: @config.timeout,
1151
+ metadata: @config.metadata,
1152
+ retry_policy: @config.retry_policy
1153
+
1154
+ @certificate_authority_service_stub.restore_certificate_authority request, options do |result, operation|
1155
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1156
+ yield result, operation if block_given?
1157
+ return result
1158
+ end
1159
+ rescue ::Gapic::Rest::Error => e
1160
+ raise ::Google::Cloud::Error.from_error(e)
1161
+ end
1162
+
1163
+ ##
1164
+ # Schedule a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} for deletion.
1165
+ #
1166
+ # @overload schedule_delete_certificate_authority(request, options = nil)
1167
+ # Pass arguments to `schedule_delete_certificate_authority` via a request object, either of type
1168
+ # {::Google::Cloud::Security::PrivateCA::V1beta1::ScheduleDeleteCertificateAuthorityRequest} or an equivalent Hash.
1169
+ #
1170
+ # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::ScheduleDeleteCertificateAuthorityRequest, ::Hash]
1171
+ # A request object representing the call parameters. Required. To specify no
1172
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1173
+ # @param options [::Gapic::CallOptions, ::Hash]
1174
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1175
+ #
1176
+ # @overload schedule_delete_certificate_authority(name: nil, request_id: nil)
1177
+ # Pass arguments to `schedule_delete_certificate_authority` via keyword arguments. Note that at
1178
+ # least one keyword argument is required. To specify no parameters, or to keep all
1179
+ # the default parameter values, pass an empty Hash as a request object (see above).
1180
+ #
1181
+ # @param name [::String]
1182
+ # Required. The resource name for this {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} in the
1183
+ # format `projects/*/locations/*/certificateAuthorities/*`.
1184
+ # @param request_id [::String]
1185
+ # Optional. An ID to identify requests. Specify a unique request ID so that if you must
1186
+ # retry your request, the server will know to ignore the request if it has
1187
+ # already been completed. The server will guarantee that for at least 60
1188
+ # minutes since the first request.
1189
+ #
1190
+ # For example, consider a situation where you make an initial request and t
1191
+ # he request times out. If you make the request again with the same request
1192
+ # ID, the server can check if original operation with the same request ID
1193
+ # was received, and if so, will ignore the second request. This prevents
1194
+ # clients from accidentally creating duplicate commitments.
1195
+ #
1196
+ # The request ID must be a valid UUID with the exception that zero UUID is
1197
+ # not supported (00000000-0000-0000-0000-000000000000).
1198
+ # @yield [result, operation] Access the result along with the TransportOperation object
1199
+ # @yieldparam result [::Gapic::Operation]
1200
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1201
+ #
1202
+ # @return [::Gapic::Operation]
1203
+ #
1204
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1205
+ def schedule_delete_certificate_authority request, options = nil
1206
+ raise ::ArgumentError, "request must be provided" if request.nil?
1207
+
1208
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::ScheduleDeleteCertificateAuthorityRequest
1209
+
1210
+ # Converts hash and nil to an options object
1211
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1212
+
1213
+ # Customize the options with defaults
1214
+ call_metadata = @config.rpcs.schedule_delete_certificate_authority.metadata.to_h
1215
+
1216
+ # Set x-goog-api-client and x-goog-user-project headers
1217
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1218
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1219
+ gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION,
1220
+ transports_version_send: [:rest]
1221
+
1222
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1223
+
1224
+ options.apply_defaults timeout: @config.rpcs.schedule_delete_certificate_authority.timeout,
1225
+ metadata: call_metadata,
1226
+ retry_policy: @config.rpcs.schedule_delete_certificate_authority.retry_policy
1227
+
1228
+ options.apply_defaults timeout: @config.timeout,
1229
+ metadata: @config.metadata,
1230
+ retry_policy: @config.retry_policy
1231
+
1232
+ @certificate_authority_service_stub.schedule_delete_certificate_authority request, options do |result, operation|
1233
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1234
+ yield result, operation if block_given?
1235
+ return result
1236
+ end
1237
+ rescue ::Gapic::Rest::Error => e
1238
+ raise ::Google::Cloud::Error.from_error(e)
1239
+ end
1240
+
1241
+ ##
1242
+ # Update a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority}.
1243
+ #
1244
+ # @overload update_certificate_authority(request, options = nil)
1245
+ # Pass arguments to `update_certificate_authority` via a request object, either of type
1246
+ # {::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateAuthorityRequest} or an equivalent Hash.
1247
+ #
1248
+ # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateAuthorityRequest, ::Hash]
1249
+ # A request object representing the call parameters. Required. To specify no
1250
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1251
+ # @param options [::Gapic::CallOptions, ::Hash]
1252
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1253
+ #
1254
+ # @overload update_certificate_authority(certificate_authority: nil, update_mask: nil, request_id: nil)
1255
+ # Pass arguments to `update_certificate_authority` via keyword arguments. Note that at
1256
+ # least one keyword argument is required. To specify no parameters, or to keep all
1257
+ # the default parameter values, pass an empty Hash as a request object (see above).
1258
+ #
1259
+ # @param certificate_authority [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority, ::Hash]
1260
+ # Required. {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority CertificateAuthority} with updated values.
1261
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1262
+ # Required. A list of fields to be updated in this request.
1263
+ # @param request_id [::String]
1264
+ # Optional. An ID to identify requests. Specify a unique request ID so that if you must
1265
+ # retry your request, the server will know to ignore the request if it has
1266
+ # already been completed. The server will guarantee that for at least 60
1267
+ # minutes since the first request.
1268
+ #
1269
+ # For example, consider a situation where you make an initial request and t
1270
+ # he request times out. If you make the request again with the same request
1271
+ # ID, the server can check if original operation with the same request ID
1272
+ # was received, and if so, will ignore the second request. This prevents
1273
+ # clients from accidentally creating duplicate commitments.
1274
+ #
1275
+ # The request ID must be a valid UUID with the exception that zero UUID is
1276
+ # not supported (00000000-0000-0000-0000-000000000000).
1277
+ # @yield [result, operation] Access the result along with the TransportOperation object
1278
+ # @yieldparam result [::Gapic::Operation]
1279
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1280
+ #
1281
+ # @return [::Gapic::Operation]
1282
+ #
1283
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1284
+ def update_certificate_authority request, options = nil
1285
+ raise ::ArgumentError, "request must be provided" if request.nil?
1286
+
1287
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateAuthorityRequest
1288
+
1289
+ # Converts hash and nil to an options object
1290
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1291
+
1292
+ # Customize the options with defaults
1293
+ call_metadata = @config.rpcs.update_certificate_authority.metadata.to_h
1294
+
1295
+ # Set x-goog-api-client and x-goog-user-project headers
1296
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1297
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1298
+ gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION,
1299
+ transports_version_send: [:rest]
1300
+
1301
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1302
+
1303
+ options.apply_defaults timeout: @config.rpcs.update_certificate_authority.timeout,
1304
+ metadata: call_metadata,
1305
+ retry_policy: @config.rpcs.update_certificate_authority.retry_policy
1306
+
1307
+ options.apply_defaults timeout: @config.timeout,
1308
+ metadata: @config.metadata,
1309
+ retry_policy: @config.retry_policy
1310
+
1311
+ @certificate_authority_service_stub.update_certificate_authority request, options do |result, operation|
1312
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1313
+ yield result, operation if block_given?
1314
+ return result
1315
+ end
1316
+ rescue ::Gapic::Rest::Error => e
1317
+ raise ::Google::Cloud::Error.from_error(e)
1318
+ end
1319
+
1320
+ ##
1321
+ # Returns a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationList}.
1322
+ #
1323
+ # @overload get_certificate_revocation_list(request, options = nil)
1324
+ # Pass arguments to `get_certificate_revocation_list` via a request object, either of type
1325
+ # {::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRevocationListRequest} or an equivalent Hash.
1326
+ #
1327
+ # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRevocationListRequest, ::Hash]
1328
+ # A request object representing the call parameters. Required. To specify no
1329
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1330
+ # @param options [::Gapic::CallOptions, ::Hash]
1331
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1332
+ #
1333
+ # @overload get_certificate_revocation_list(name: nil)
1334
+ # Pass arguments to `get_certificate_revocation_list` via keyword arguments. Note that at
1335
+ # least one keyword argument is required. To specify no parameters, or to keep all
1336
+ # the default parameter values, pass an empty Hash as a request object (see above).
1337
+ #
1338
+ # @param name [::String]
1339
+ # Required. The {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList#name name} of the
1340
+ # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationList} to get.
1341
+ # @yield [result, operation] Access the result along with the TransportOperation object
1342
+ # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList]
1343
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1344
+ #
1345
+ # @return [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList]
1346
+ #
1347
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1348
+ def get_certificate_revocation_list request, options = nil
1349
+ raise ::ArgumentError, "request must be provided" if request.nil?
1350
+
1351
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRevocationListRequest
1352
+
1353
+ # Converts hash and nil to an options object
1354
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1355
+
1356
+ # Customize the options with defaults
1357
+ call_metadata = @config.rpcs.get_certificate_revocation_list.metadata.to_h
1358
+
1359
+ # Set x-goog-api-client and x-goog-user-project headers
1360
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1361
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1362
+ gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION,
1363
+ transports_version_send: [:rest]
1364
+
1365
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1366
+
1367
+ options.apply_defaults timeout: @config.rpcs.get_certificate_revocation_list.timeout,
1368
+ metadata: call_metadata,
1369
+ retry_policy: @config.rpcs.get_certificate_revocation_list.retry_policy
1370
+
1371
+ options.apply_defaults timeout: @config.timeout,
1372
+ metadata: @config.metadata,
1373
+ retry_policy: @config.retry_policy
1374
+
1375
+ @certificate_authority_service_stub.get_certificate_revocation_list request, options do |result, operation|
1376
+ yield result, operation if block_given?
1377
+ return result
1378
+ end
1379
+ rescue ::Gapic::Rest::Error => e
1380
+ raise ::Google::Cloud::Error.from_error(e)
1381
+ end
1382
+
1383
+ ##
1384
+ # Lists {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationLists}.
1385
+ #
1386
+ # @overload list_certificate_revocation_lists(request, options = nil)
1387
+ # Pass arguments to `list_certificate_revocation_lists` via a request object, either of type
1388
+ # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsRequest} or an equivalent Hash.
1389
+ #
1390
+ # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsRequest, ::Hash]
1391
+ # A request object representing the call parameters. Required. To specify no
1392
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1393
+ # @param options [::Gapic::CallOptions, ::Hash]
1394
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1395
+ #
1396
+ # @overload list_certificate_revocation_lists(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
1397
+ # Pass arguments to `list_certificate_revocation_lists` via keyword arguments. Note that at
1398
+ # least one keyword argument is required. To specify no parameters, or to keep all
1399
+ # the default parameter values, pass an empty Hash as a request object (see above).
1400
+ #
1401
+ # @param parent [::String]
1402
+ # Required. The resource name of the location associated with the
1403
+ # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationLists}, in the format
1404
+ # `projects/*/locations/*/certificateauthorities/*`.
1405
+ # @param page_size [::Integer]
1406
+ # Optional. Limit on the number of
1407
+ # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationLists} to include in the
1408
+ # response. Further {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationLists}
1409
+ # can subsequently be obtained by including the
1410
+ # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsResponse#next_page_token ListCertificateRevocationListsResponse.next_page_token} in a subsequent
1411
+ # request. If unspecified, the server will pick an appropriate default.
1412
+ # @param page_token [::String]
1413
+ # Optional. Pagination token, returned earlier via
1414
+ # {::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsResponse#next_page_token ListCertificateRevocationListsResponse.next_page_token}.
1415
+ # @param filter [::String]
1416
+ # Optional. Only include resources that match the filter in the response.
1417
+ # @param order_by [::String]
1418
+ # Optional. Specify how the results should be sorted.
1419
+ # @yield [result, operation] Access the result along with the TransportOperation object
1420
+ # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsResponse]
1421
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1422
+ #
1423
+ # @return [::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsResponse]
1424
+ #
1425
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1426
+ def list_certificate_revocation_lists request, options = nil
1427
+ raise ::ArgumentError, "request must be provided" if request.nil?
1428
+
1429
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsRequest
1430
+
1431
+ # Converts hash and nil to an options object
1432
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1433
+
1434
+ # Customize the options with defaults
1435
+ call_metadata = @config.rpcs.list_certificate_revocation_lists.metadata.to_h
1436
+
1437
+ # Set x-goog-api-client and x-goog-user-project headers
1438
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1439
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1440
+ gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION,
1441
+ transports_version_send: [:rest]
1442
+
1443
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1444
+
1445
+ options.apply_defaults timeout: @config.rpcs.list_certificate_revocation_lists.timeout,
1446
+ metadata: call_metadata,
1447
+ retry_policy: @config.rpcs.list_certificate_revocation_lists.retry_policy
1448
+
1449
+ options.apply_defaults timeout: @config.timeout,
1450
+ metadata: @config.metadata,
1451
+ retry_policy: @config.retry_policy
1452
+
1453
+ @certificate_authority_service_stub.list_certificate_revocation_lists request, options do |result, operation|
1454
+ yield result, operation if block_given?
1455
+ return result
1456
+ end
1457
+ rescue ::Gapic::Rest::Error => e
1458
+ raise ::Google::Cloud::Error.from_error(e)
1459
+ end
1460
+
1461
+ ##
1462
+ # Update a {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationList}.
1463
+ #
1464
+ # @overload update_certificate_revocation_list(request, options = nil)
1465
+ # Pass arguments to `update_certificate_revocation_list` via a request object, either of type
1466
+ # {::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRevocationListRequest} or an equivalent Hash.
1467
+ #
1468
+ # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRevocationListRequest, ::Hash]
1469
+ # A request object representing the call parameters. Required. To specify no
1470
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1471
+ # @param options [::Gapic::CallOptions, ::Hash]
1472
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1473
+ #
1474
+ # @overload update_certificate_revocation_list(certificate_revocation_list: nil, update_mask: nil, request_id: nil)
1475
+ # Pass arguments to `update_certificate_revocation_list` via keyword arguments. Note that at
1476
+ # least one keyword argument is required. To specify no parameters, or to keep all
1477
+ # the default parameter values, pass an empty Hash as a request object (see above).
1478
+ #
1479
+ # @param certificate_revocation_list [::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList, ::Hash]
1480
+ # Required. {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList CertificateRevocationList} with updated values.
1481
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1482
+ # Required. A list of fields to be updated in this request.
1483
+ # @param request_id [::String]
1484
+ # Optional. An ID to identify requests. Specify a unique request ID so that if you must
1485
+ # retry your request, the server will know to ignore the request if it has
1486
+ # already been completed. The server will guarantee that for at least 60
1487
+ # minutes since the first request.
1488
+ #
1489
+ # For example, consider a situation where you make an initial request and t
1490
+ # he request times out. If you make the request again with the same request
1491
+ # ID, the server can check if original operation with the same request ID
1492
+ # was received, and if so, will ignore the second request. This prevents
1493
+ # clients from accidentally creating duplicate commitments.
1494
+ #
1495
+ # The request ID must be a valid UUID with the exception that zero UUID is
1496
+ # not supported (00000000-0000-0000-0000-000000000000).
1497
+ # @yield [result, operation] Access the result along with the TransportOperation object
1498
+ # @yieldparam result [::Gapic::Operation]
1499
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1500
+ #
1501
+ # @return [::Gapic::Operation]
1502
+ #
1503
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1504
+ def update_certificate_revocation_list request, options = nil
1505
+ raise ::ArgumentError, "request must be provided" if request.nil?
1506
+
1507
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRevocationListRequest
1508
+
1509
+ # Converts hash and nil to an options object
1510
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1511
+
1512
+ # Customize the options with defaults
1513
+ call_metadata = @config.rpcs.update_certificate_revocation_list.metadata.to_h
1514
+
1515
+ # Set x-goog-api-client and x-goog-user-project headers
1516
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1517
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1518
+ gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION,
1519
+ transports_version_send: [:rest]
1520
+
1521
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1522
+
1523
+ options.apply_defaults timeout: @config.rpcs.update_certificate_revocation_list.timeout,
1524
+ metadata: call_metadata,
1525
+ retry_policy: @config.rpcs.update_certificate_revocation_list.retry_policy
1526
+
1527
+ options.apply_defaults timeout: @config.timeout,
1528
+ metadata: @config.metadata,
1529
+ retry_policy: @config.retry_policy
1530
+
1531
+ @certificate_authority_service_stub.update_certificate_revocation_list request, options do |result, operation|
1532
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1533
+ yield result, operation if block_given?
1534
+ return result
1535
+ end
1536
+ rescue ::Gapic::Rest::Error => e
1537
+ raise ::Google::Cloud::Error.from_error(e)
1538
+ end
1539
+
1540
+ ##
1541
+ # Returns a {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig ReusableConfig}.
1542
+ #
1543
+ # @overload get_reusable_config(request, options = nil)
1544
+ # Pass arguments to `get_reusable_config` via a request object, either of type
1545
+ # {::Google::Cloud::Security::PrivateCA::V1beta1::GetReusableConfigRequest} or an equivalent Hash.
1546
+ #
1547
+ # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::GetReusableConfigRequest, ::Hash]
1548
+ # A request object representing the call parameters. Required. To specify no
1549
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1550
+ # @param options [::Gapic::CallOptions, ::Hash]
1551
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1552
+ #
1553
+ # @overload get_reusable_config(name: nil)
1554
+ # Pass arguments to `get_reusable_config` via keyword arguments. Note that at
1555
+ # least one keyword argument is required. To specify no parameters, or to keep all
1556
+ # the default parameter values, pass an empty Hash as a request object (see above).
1557
+ #
1558
+ # @param name [::String]
1559
+ # Required. The [name][ReusableConfigs.name] of the [ReusableConfigs][] to get.
1560
+ # @yield [result, operation] Access the result along with the TransportOperation object
1561
+ # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig]
1562
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1563
+ #
1564
+ # @return [::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig]
1565
+ #
1566
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1567
+ def get_reusable_config request, options = nil
1568
+ raise ::ArgumentError, "request must be provided" if request.nil?
1569
+
1570
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::GetReusableConfigRequest
1571
+
1572
+ # Converts hash and nil to an options object
1573
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1574
+
1575
+ # Customize the options with defaults
1576
+ call_metadata = @config.rpcs.get_reusable_config.metadata.to_h
1577
+
1578
+ # Set x-goog-api-client and x-goog-user-project headers
1579
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1580
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1581
+ gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION,
1582
+ transports_version_send: [:rest]
1583
+
1584
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1585
+
1586
+ options.apply_defaults timeout: @config.rpcs.get_reusable_config.timeout,
1587
+ metadata: call_metadata,
1588
+ retry_policy: @config.rpcs.get_reusable_config.retry_policy
1589
+
1590
+ options.apply_defaults timeout: @config.timeout,
1591
+ metadata: @config.metadata,
1592
+ retry_policy: @config.retry_policy
1593
+
1594
+ @certificate_authority_service_stub.get_reusable_config request, options do |result, operation|
1595
+ yield result, operation if block_given?
1596
+ return result
1597
+ end
1598
+ rescue ::Gapic::Rest::Error => e
1599
+ raise ::Google::Cloud::Error.from_error(e)
1600
+ end
1601
+
1602
+ ##
1603
+ # Lists {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig ReusableConfigs}.
1604
+ #
1605
+ # @overload list_reusable_configs(request, options = nil)
1606
+ # Pass arguments to `list_reusable_configs` via a request object, either of type
1607
+ # {::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsRequest} or an equivalent Hash.
1608
+ #
1609
+ # @param request [::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsRequest, ::Hash]
1610
+ # A request object representing the call parameters. Required. To specify no
1611
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1612
+ # @param options [::Gapic::CallOptions, ::Hash]
1613
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1614
+ #
1615
+ # @overload list_reusable_configs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
1616
+ # Pass arguments to `list_reusable_configs` via keyword arguments. Note that at
1617
+ # least one keyword argument is required. To specify no parameters, or to keep all
1618
+ # the default parameter values, pass an empty Hash as a request object (see above).
1619
+ #
1620
+ # @param parent [::String]
1621
+ # Required. The resource name of the location associated with the
1622
+ # {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig ReusableConfigs}, in the format
1623
+ # `projects/*/locations/*`.
1624
+ # @param page_size [::Integer]
1625
+ # Optional. Limit on the number of
1626
+ # {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig ReusableConfigs} to include in the response.
1627
+ # Further {::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig ReusableConfigs} can subsequently be
1628
+ # obtained by including the
1629
+ # {::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsResponse#next_page_token ListReusableConfigsResponse.next_page_token} in a subsequent request. If
1630
+ # unspecified, the server will pick an appropriate default.
1631
+ # @param page_token [::String]
1632
+ # Optional. Pagination token, returned earlier via
1633
+ # {::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsResponse#next_page_token ListReusableConfigsResponse.next_page_token}.
1634
+ # @param filter [::String]
1635
+ # Optional. Only include resources that match the filter in the response.
1636
+ # @param order_by [::String]
1637
+ # Optional. Specify how the results should be sorted.
1638
+ # @yield [result, operation] Access the result along with the TransportOperation object
1639
+ # @yieldparam result [::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsResponse]
1640
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1641
+ #
1642
+ # @return [::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsResponse]
1643
+ #
1644
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1645
+ def list_reusable_configs request, options = nil
1646
+ raise ::ArgumentError, "request must be provided" if request.nil?
1647
+
1648
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsRequest
1649
+
1650
+ # Converts hash and nil to an options object
1651
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1652
+
1653
+ # Customize the options with defaults
1654
+ call_metadata = @config.rpcs.list_reusable_configs.metadata.to_h
1655
+
1656
+ # Set x-goog-api-client and x-goog-user-project headers
1657
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1658
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1659
+ gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION,
1660
+ transports_version_send: [:rest]
1661
+
1662
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1663
+
1664
+ options.apply_defaults timeout: @config.rpcs.list_reusable_configs.timeout,
1665
+ metadata: call_metadata,
1666
+ retry_policy: @config.rpcs.list_reusable_configs.retry_policy
1667
+
1668
+ options.apply_defaults timeout: @config.timeout,
1669
+ metadata: @config.metadata,
1670
+ retry_policy: @config.retry_policy
1671
+
1672
+ @certificate_authority_service_stub.list_reusable_configs request, options do |result, operation|
1673
+ yield result, operation if block_given?
1674
+ return result
1675
+ end
1676
+ rescue ::Gapic::Rest::Error => e
1677
+ raise ::Google::Cloud::Error.from_error(e)
1678
+ end
1679
+
1680
+ ##
1681
+ # Configuration class for the CertificateAuthorityService REST API.
1682
+ #
1683
+ # This class represents the configuration for CertificateAuthorityService REST,
1684
+ # providing control over timeouts, retry behavior, logging, transport
1685
+ # parameters, and other low-level controls. Certain parameters can also be
1686
+ # applied individually to specific RPCs. See
1687
+ # {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client::Configuration::Rpcs}
1688
+ # for a list of RPCs that can be configured independently.
1689
+ #
1690
+ # Configuration can be applied globally to all clients, or to a single client
1691
+ # on construction.
1692
+ #
1693
+ # @example
1694
+ #
1695
+ # # Modify the global config, setting the timeout for
1696
+ # # create_certificate to 20 seconds,
1697
+ # # and all remaining timeouts to 10 seconds.
1698
+ # ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.configure do |config|
1699
+ # config.timeout = 10.0
1700
+ # config.rpcs.create_certificate.timeout = 20.0
1701
+ # end
1702
+ #
1703
+ # # Apply the above configuration only to a new client.
1704
+ # client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new do |config|
1705
+ # config.timeout = 10.0
1706
+ # config.rpcs.create_certificate.timeout = 20.0
1707
+ # end
1708
+ #
1709
+ # @!attribute [rw] endpoint
1710
+ # The hostname or hostname:port of the service endpoint.
1711
+ # Defaults to `"privateca.googleapis.com"`.
1712
+ # @return [::String]
1713
+ # @!attribute [rw] credentials
1714
+ # Credentials to send with calls. You may provide any of the following types:
1715
+ # * (`String`) The path to a service account key file in JSON format
1716
+ # * (`Hash`) A service account key as a Hash
1717
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1718
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
1719
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1720
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
1721
+ # * (`nil`) indicating no credentials
1722
+ # @return [::Object]
1723
+ # @!attribute [rw] scope
1724
+ # The OAuth scopes
1725
+ # @return [::Array<::String>]
1726
+ # @!attribute [rw] lib_name
1727
+ # The library name as recorded in instrumentation and logging
1728
+ # @return [::String]
1729
+ # @!attribute [rw] lib_version
1730
+ # The library version as recorded in instrumentation and logging
1731
+ # @return [::String]
1732
+ # @!attribute [rw] timeout
1733
+ # The call timeout in seconds.
1734
+ # @return [::Numeric]
1735
+ # @!attribute [rw] metadata
1736
+ # Additional headers to be sent with the call.
1737
+ # @return [::Hash{::Symbol=>::String}]
1738
+ # @!attribute [rw] retry_policy
1739
+ # The retry policy. The value is a hash with the following keys:
1740
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1741
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1742
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1743
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1744
+ # trigger a retry.
1745
+ # @return [::Hash]
1746
+ # @!attribute [rw] quota_project
1747
+ # A separate project against which to charge quota.
1748
+ # @return [::String]
1749
+ #
1750
+ class Configuration
1751
+ extend ::Gapic::Config
1752
+
1753
+ config_attr :endpoint, "privateca.googleapis.com", ::String
1754
+ config_attr :credentials, nil do |value|
1755
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1756
+ allowed.any? { |klass| klass === value }
1757
+ end
1758
+ config_attr :scope, nil, ::String, ::Array, nil
1759
+ config_attr :lib_name, nil, ::String, nil
1760
+ config_attr :lib_version, nil, ::String, nil
1761
+ config_attr :timeout, nil, ::Numeric, nil
1762
+ config_attr :metadata, nil, ::Hash, nil
1763
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1764
+ config_attr :quota_project, nil, ::String, nil
1765
+
1766
+ # @private
1767
+ def initialize parent_config = nil
1768
+ @parent_config = parent_config unless parent_config.nil?
1769
+
1770
+ yield self if block_given?
1771
+ end
1772
+
1773
+ ##
1774
+ # Configurations for individual RPCs
1775
+ # @return [Rpcs]
1776
+ #
1777
+ def rpcs
1778
+ @rpcs ||= begin
1779
+ parent_rpcs = nil
1780
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1781
+ Rpcs.new parent_rpcs
1782
+ end
1783
+ end
1784
+
1785
+ ##
1786
+ # Configuration RPC class for the CertificateAuthorityService API.
1787
+ #
1788
+ # Includes fields providing the configuration for each RPC in this service.
1789
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1790
+ # the following configuration fields:
1791
+ #
1792
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1793
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
1794
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1795
+ # include the following keys:
1796
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1797
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1798
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1799
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1800
+ # trigger a retry.
1801
+ #
1802
+ class Rpcs
1803
+ ##
1804
+ # RPC-specific configuration for `create_certificate`
1805
+ # @return [::Gapic::Config::Method]
1806
+ #
1807
+ attr_reader :create_certificate
1808
+ ##
1809
+ # RPC-specific configuration for `get_certificate`
1810
+ # @return [::Gapic::Config::Method]
1811
+ #
1812
+ attr_reader :get_certificate
1813
+ ##
1814
+ # RPC-specific configuration for `list_certificates`
1815
+ # @return [::Gapic::Config::Method]
1816
+ #
1817
+ attr_reader :list_certificates
1818
+ ##
1819
+ # RPC-specific configuration for `revoke_certificate`
1820
+ # @return [::Gapic::Config::Method]
1821
+ #
1822
+ attr_reader :revoke_certificate
1823
+ ##
1824
+ # RPC-specific configuration for `update_certificate`
1825
+ # @return [::Gapic::Config::Method]
1826
+ #
1827
+ attr_reader :update_certificate
1828
+ ##
1829
+ # RPC-specific configuration for `activate_certificate_authority`
1830
+ # @return [::Gapic::Config::Method]
1831
+ #
1832
+ attr_reader :activate_certificate_authority
1833
+ ##
1834
+ # RPC-specific configuration for `create_certificate_authority`
1835
+ # @return [::Gapic::Config::Method]
1836
+ #
1837
+ attr_reader :create_certificate_authority
1838
+ ##
1839
+ # RPC-specific configuration for `disable_certificate_authority`
1840
+ # @return [::Gapic::Config::Method]
1841
+ #
1842
+ attr_reader :disable_certificate_authority
1843
+ ##
1844
+ # RPC-specific configuration for `enable_certificate_authority`
1845
+ # @return [::Gapic::Config::Method]
1846
+ #
1847
+ attr_reader :enable_certificate_authority
1848
+ ##
1849
+ # RPC-specific configuration for `fetch_certificate_authority_csr`
1850
+ # @return [::Gapic::Config::Method]
1851
+ #
1852
+ attr_reader :fetch_certificate_authority_csr
1853
+ ##
1854
+ # RPC-specific configuration for `get_certificate_authority`
1855
+ # @return [::Gapic::Config::Method]
1856
+ #
1857
+ attr_reader :get_certificate_authority
1858
+ ##
1859
+ # RPC-specific configuration for `list_certificate_authorities`
1860
+ # @return [::Gapic::Config::Method]
1861
+ #
1862
+ attr_reader :list_certificate_authorities
1863
+ ##
1864
+ # RPC-specific configuration for `restore_certificate_authority`
1865
+ # @return [::Gapic::Config::Method]
1866
+ #
1867
+ attr_reader :restore_certificate_authority
1868
+ ##
1869
+ # RPC-specific configuration for `schedule_delete_certificate_authority`
1870
+ # @return [::Gapic::Config::Method]
1871
+ #
1872
+ attr_reader :schedule_delete_certificate_authority
1873
+ ##
1874
+ # RPC-specific configuration for `update_certificate_authority`
1875
+ # @return [::Gapic::Config::Method]
1876
+ #
1877
+ attr_reader :update_certificate_authority
1878
+ ##
1879
+ # RPC-specific configuration for `get_certificate_revocation_list`
1880
+ # @return [::Gapic::Config::Method]
1881
+ #
1882
+ attr_reader :get_certificate_revocation_list
1883
+ ##
1884
+ # RPC-specific configuration for `list_certificate_revocation_lists`
1885
+ # @return [::Gapic::Config::Method]
1886
+ #
1887
+ attr_reader :list_certificate_revocation_lists
1888
+ ##
1889
+ # RPC-specific configuration for `update_certificate_revocation_list`
1890
+ # @return [::Gapic::Config::Method]
1891
+ #
1892
+ attr_reader :update_certificate_revocation_list
1893
+ ##
1894
+ # RPC-specific configuration for `get_reusable_config`
1895
+ # @return [::Gapic::Config::Method]
1896
+ #
1897
+ attr_reader :get_reusable_config
1898
+ ##
1899
+ # RPC-specific configuration for `list_reusable_configs`
1900
+ # @return [::Gapic::Config::Method]
1901
+ #
1902
+ attr_reader :list_reusable_configs
1903
+
1904
+ # @private
1905
+ def initialize parent_rpcs = nil
1906
+ create_certificate_config = parent_rpcs.create_certificate if parent_rpcs.respond_to? :create_certificate
1907
+ @create_certificate = ::Gapic::Config::Method.new create_certificate_config
1908
+ get_certificate_config = parent_rpcs.get_certificate if parent_rpcs.respond_to? :get_certificate
1909
+ @get_certificate = ::Gapic::Config::Method.new get_certificate_config
1910
+ list_certificates_config = parent_rpcs.list_certificates if parent_rpcs.respond_to? :list_certificates
1911
+ @list_certificates = ::Gapic::Config::Method.new list_certificates_config
1912
+ revoke_certificate_config = parent_rpcs.revoke_certificate if parent_rpcs.respond_to? :revoke_certificate
1913
+ @revoke_certificate = ::Gapic::Config::Method.new revoke_certificate_config
1914
+ update_certificate_config = parent_rpcs.update_certificate if parent_rpcs.respond_to? :update_certificate
1915
+ @update_certificate = ::Gapic::Config::Method.new update_certificate_config
1916
+ activate_certificate_authority_config = parent_rpcs.activate_certificate_authority if parent_rpcs.respond_to? :activate_certificate_authority
1917
+ @activate_certificate_authority = ::Gapic::Config::Method.new activate_certificate_authority_config
1918
+ create_certificate_authority_config = parent_rpcs.create_certificate_authority if parent_rpcs.respond_to? :create_certificate_authority
1919
+ @create_certificate_authority = ::Gapic::Config::Method.new create_certificate_authority_config
1920
+ disable_certificate_authority_config = parent_rpcs.disable_certificate_authority if parent_rpcs.respond_to? :disable_certificate_authority
1921
+ @disable_certificate_authority = ::Gapic::Config::Method.new disable_certificate_authority_config
1922
+ enable_certificate_authority_config = parent_rpcs.enable_certificate_authority if parent_rpcs.respond_to? :enable_certificate_authority
1923
+ @enable_certificate_authority = ::Gapic::Config::Method.new enable_certificate_authority_config
1924
+ fetch_certificate_authority_csr_config = parent_rpcs.fetch_certificate_authority_csr if parent_rpcs.respond_to? :fetch_certificate_authority_csr
1925
+ @fetch_certificate_authority_csr = ::Gapic::Config::Method.new fetch_certificate_authority_csr_config
1926
+ get_certificate_authority_config = parent_rpcs.get_certificate_authority if parent_rpcs.respond_to? :get_certificate_authority
1927
+ @get_certificate_authority = ::Gapic::Config::Method.new get_certificate_authority_config
1928
+ list_certificate_authorities_config = parent_rpcs.list_certificate_authorities if parent_rpcs.respond_to? :list_certificate_authorities
1929
+ @list_certificate_authorities = ::Gapic::Config::Method.new list_certificate_authorities_config
1930
+ restore_certificate_authority_config = parent_rpcs.restore_certificate_authority if parent_rpcs.respond_to? :restore_certificate_authority
1931
+ @restore_certificate_authority = ::Gapic::Config::Method.new restore_certificate_authority_config
1932
+ schedule_delete_certificate_authority_config = parent_rpcs.schedule_delete_certificate_authority if parent_rpcs.respond_to? :schedule_delete_certificate_authority
1933
+ @schedule_delete_certificate_authority = ::Gapic::Config::Method.new schedule_delete_certificate_authority_config
1934
+ update_certificate_authority_config = parent_rpcs.update_certificate_authority if parent_rpcs.respond_to? :update_certificate_authority
1935
+ @update_certificate_authority = ::Gapic::Config::Method.new update_certificate_authority_config
1936
+ get_certificate_revocation_list_config = parent_rpcs.get_certificate_revocation_list if parent_rpcs.respond_to? :get_certificate_revocation_list
1937
+ @get_certificate_revocation_list = ::Gapic::Config::Method.new get_certificate_revocation_list_config
1938
+ list_certificate_revocation_lists_config = parent_rpcs.list_certificate_revocation_lists if parent_rpcs.respond_to? :list_certificate_revocation_lists
1939
+ @list_certificate_revocation_lists = ::Gapic::Config::Method.new list_certificate_revocation_lists_config
1940
+ update_certificate_revocation_list_config = parent_rpcs.update_certificate_revocation_list if parent_rpcs.respond_to? :update_certificate_revocation_list
1941
+ @update_certificate_revocation_list = ::Gapic::Config::Method.new update_certificate_revocation_list_config
1942
+ get_reusable_config_config = parent_rpcs.get_reusable_config if parent_rpcs.respond_to? :get_reusable_config
1943
+ @get_reusable_config = ::Gapic::Config::Method.new get_reusable_config_config
1944
+ list_reusable_configs_config = parent_rpcs.list_reusable_configs if parent_rpcs.respond_to? :list_reusable_configs
1945
+ @list_reusable_configs = ::Gapic::Config::Method.new list_reusable_configs_config
1946
+
1947
+ yield self if block_given?
1948
+ end
1949
+ end
1950
+ end
1951
+ end
1952
+ end
1953
+ end
1954
+ end
1955
+ end
1956
+ end
1957
+ end
1958
+ end