Class: Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client

Inherits:
Object
  • Object
show all
Includes:
Paths
Defined in:
lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/client.rb

Overview

REST client for the CertificateAuthorityService service.

[Certificate Authority Service][google.cloud.security.privateca.v1.CertificateAuthorityService] manages private certificate authorities and issued certificates.

Defined Under Namespace

Classes: Configuration

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Paths

#ca_pool_path, #certificate_authority_path, #certificate_path, #certificate_revocation_list_path, #certificate_template_path, #location_path

Constructor Details

#initialize {|config| ... } ⇒ Client

Create a new CertificateAuthorityService REST client object.

Examples:


# Create a client using the default configuration
client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the CertificateAuthorityService client.

Yield Parameters:



133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# File 'lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/client.rb', line 133

def initialize
  # Create the configuration object
  @config = Configuration.new Client.configure

  # Yield the configuration if needed
  yield @config if block_given?

  # Create credentials
  credentials = @config.credentials
  # Use self-signed JWT if the endpoint is unchanged from default,
  # but only if the default endpoint does not have a region prefix.
  enable_self_signed_jwt = @config.endpoint.nil? ||
                           (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
                           !@config.endpoint.split(".").first.include?("-"))
  credentials ||= Credentials.default scope: @config.scope,
                                      enable_self_signed_jwt: enable_self_signed_jwt
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
    credentials = Credentials.new credentials, scope: @config.scope
  end

  @quota_project_id = @config.quota_project
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id

  @operations_client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Operations.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @config.endpoint
    config.universe_domain = @config.universe_domain
  end

  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @config.endpoint
    config.universe_domain = @config.universe_domain
    config.bindings_override = @config.bindings_override
  end

  @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @config.endpoint
    config.universe_domain = @config.universe_domain
    config.bindings_override = @config.bindings_override
  end

  @certificate_authority_service_stub = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.new(
    endpoint: @config.endpoint,
    endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
    universe_domain: @config.universe_domain,
    credentials: credentials
  )
end

Instance Attribute Details

#iam_policy_clientGoogle::Iam::V1::IAMPolicy::Rest::Client (readonly)

Get the associated client for mix-in of the IAMPolicy.

Returns:

  • (Google::Iam::V1::IAMPolicy::Rest::Client)


206
207
208
# File 'lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/client.rb', line 206

def iam_policy_client
  @iam_policy_client
end

#location_clientGoogle::Cloud::Location::Locations::Rest::Client (readonly)

Get the associated client for mix-in of the Locations.

Returns:

  • (Google::Cloud::Location::Locations::Rest::Client)


199
200
201
# File 'lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/client.rb', line 199

def location_client
  @location_client
end

#operations_client::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Operations (readonly)

Get the associated client for long-running operations.



192
193
194
# File 'lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/client.rb', line 192

def operations_client
  @operations_client
end

Class Method Details

.configure {|config| ... } ⇒ Client::Configuration

Configure the CertificateAuthorityService Client class.

See Configuration for a description of the configuration fields.

Examples:


# Modify the configuration for all CertificateAuthorityService clients
::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.configure do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/client.rb', line 66

def self.configure
  @configure ||= begin
    namespace = ["Google", "Cloud", "Security", "PrivateCA", "V1"]
    parent_config = while namespace.any?
                      parent_name = namespace.join "::"
                      parent_const = const_get parent_name
                      break parent_const.configure if parent_const.respond_to? :configure
                      namespace.pop
                    end
    default_config = Client::Configuration.new parent_config

    default_config.timeout = 60.0
    default_config.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [2, 14, 4]
    }

    default_config
  end
  yield @configure if block_given?
  @configure
end

Instance Method Details

#activate_certificate_authority(request, options = nil) ⇒ ::Gapic::Operation #activate_certificate_authority(name: nil, pem_ca_certificate: nil, subordinate_config: nil, request_id: nil) ⇒ ::Gapic::Operation

Activate a CertificateAuthority that is in state AWAITING_USER_ACTIVATION and is of type SUBORDINATE. After the parent Certificate Authority signs a certificate signing request from FetchCertificateAuthorityCsr, this method can complete the activation process.

Examples:

Basic example

require "google/cloud/security/private_ca/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Security::PrivateCA::V1::ActivateCertificateAuthorityRequest.new

# Call the activate_certificate_authority method.
result = client.activate_certificate_authority request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #activate_certificate_authority(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to activate_certificate_authority via a request object, either of type ActivateCertificateAuthorityRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Security::PrivateCA::V1::ActivateCertificateAuthorityRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #activate_certificate_authority(name: nil, pem_ca_certificate: nil, subordinate_config: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to activate_certificate_authority via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The resource name for this CertificateAuthority in the format projects/*/locations/*/caPools/*/certificateAuthorities/*.

    • pem_ca_certificate (::String) (defaults to: nil)

      Required. The signed CA certificate issued from FetchCertificateAuthorityCsrResponse.pem_csr.

    • subordinate_config (::Google::Cloud::Security::PrivateCA::V1::SubordinateConfig, ::Hash) (defaults to: nil)

      Required. Must include information about the issuer of 'pem_ca_certificate', and any further issuers until the self-signed CA.

    • request_id (::String) (defaults to: nil)

      Optional. An ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

      For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
# File 'lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/client.rb', line 805

def activate_certificate_authority request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::ActivateCertificateAuthorityRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.activate_certificate_authority..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Security::PrivateCA::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.activate_certificate_authority.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.activate_certificate_authority.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @certificate_authority_service_stub.activate_certificate_authority request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#configure {|config| ... } ⇒ Client::Configuration

Configure the CertificateAuthorityService Client instance.

The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on configure.

See Configuration for a description of the configuration fields.

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



103
104
105
106
# File 'lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/client.rb', line 103

def configure
  yield @config if block_given?
  @config
end

#create_ca_pool(request, options = nil) ⇒ ::Gapic::Operation #create_ca_pool(parent: nil, ca_pool_id: nil, ca_pool: nil, request_id: nil) ⇒ ::Gapic::Operation

Create a CaPool.

Examples:

Basic example

require "google/cloud/security/private_ca/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Security::PrivateCA::V1::CreateCaPoolRequest.new

# Call the create_ca_pool method.
result = client.create_ca_pool request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #create_ca_pool(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to create_ca_pool via a request object, either of type Google::Cloud::Security::PrivateCA::V1::CreateCaPoolRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Security::PrivateCA::V1::CreateCaPoolRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #create_ca_pool(parent: nil, ca_pool_id: nil, ca_pool: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to create_ca_pool via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The resource name of the location associated with the CaPool, in the format projects/*/locations/*.

    • ca_pool_id (::String) (defaults to: nil)

      Required. It must be unique within a location and match the regular expression [a-zA-Z0-9_-]{1,63}

    • ca_pool (::Google::Cloud::Security::PrivateCA::V1::CaPool, ::Hash) (defaults to: nil)

      Required. A CaPool with initial field values.

    • request_id (::String) (defaults to: nil)

      Optional. An ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

      For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
# File 'lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/client.rb', line 1834

def create_ca_pool request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::CreateCaPoolRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_ca_pool..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Security::PrivateCA::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.create_ca_pool.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_ca_pool.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @certificate_authority_service_stub.create_ca_pool request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_certificate(request, options = nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1::Certificate #create_certificate(parent: nil, certificate_id: nil, certificate: nil, request_id: nil, validate_only: nil, issuing_certificate_authority_id: nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1::Certificate

Create a new Certificate in a given Project, Location from a particular CaPool.

Examples:

Basic example

require "google/cloud/security/private_ca/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest.new

# Call the create_certificate method.
result = client.create_certificate request

# The returned object is of type Google::Cloud::Security::PrivateCA::V1::Certificate.
p result

Overloads:

  • #create_certificate(request, options = nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1::Certificate

    Pass arguments to create_certificate via a request object, either of type Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #create_certificate(parent: nil, certificate_id: nil, certificate: nil, request_id: nil, validate_only: nil, issuing_certificate_authority_id: nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1::Certificate

    Pass arguments to create_certificate via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The resource name of the CaPool associated with the Certificate, in the format projects/*/locations/*/caPools/*.

    • certificate_id (::String) (defaults to: nil)

      Optional. It must be unique within a location and match the regular expression [a-zA-Z0-9_-]{1,63}. This field is required when using a CertificateAuthority in the Enterprise [CertificateAuthority.Tier][], but is optional and its value is ignored otherwise.

    • certificate (::Google::Cloud::Security::PrivateCA::V1::Certificate, ::Hash) (defaults to: nil)

      Required. A Certificate with initial field values.

    • request_id (::String) (defaults to: nil)

      Optional. An ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

      For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

    • validate_only (::Boolean) (defaults to: nil)

      Optional. If this is true, no Certificate resource will be persisted regardless of the CaPool's tier, and the returned Certificate will not contain the pem_certificate field.

    • issuing_certificate_authority_id (::String) (defaults to: nil)

      Optional. The resource ID of the CertificateAuthority that should issue the certificate. This optional field will ignore the load-balancing scheme of the Pool and directly issue the certificate from the CA with the specified ID, contained in the same CaPool referenced by parent. Per-CA quota rules apply. If left empty, a CertificateAuthority will be chosen from the CaPool by the service. For example, to issue a Certificate from a Certificate Authority with resource name "projects/my-project/locations/us-central1/caPools/my-pool/certificateAuthorities/my-ca", you can set the parent to "projects/my-project/locations/us-central1/caPools/my-pool" and the issuing_certificate_authority_id to "my-ca".

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
# File 'lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/client.rb', line 310

def create_certificate request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_certificate..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Security::PrivateCA::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.create_certificate.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_certificate.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @certificate_authority_service_stub.create_certificate request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_certificate_authority(request, options = nil) ⇒ ::Gapic::Operation #create_certificate_authority(parent: nil, certificate_authority_id: nil, certificate_authority: nil, request_id: nil) ⇒ ::Gapic::Operation

Create a new CertificateAuthority in a given Project and Location.

Examples:

Basic example

require "google/cloud/security/private_ca/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Security::PrivateCA::V1::CreateCertificateAuthorityRequest.new

# Call the create_certificate_authority method.
result = client.create_certificate_authority request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #create_certificate_authority(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to create_certificate_authority via a request object, either of type Google::Cloud::Security::PrivateCA::V1::CreateCertificateAuthorityRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Security::PrivateCA::V1::CreateCertificateAuthorityRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #create_certificate_authority(parent: nil, certificate_authority_id: nil, certificate_authority: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to create_certificate_authority via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The resource name of the CaPool associated with the CertificateAuthorities, in the format projects/*/locations/*/caPools/*.

    • certificate_authority_id (::String) (defaults to: nil)

      Required. It must be unique within a location and match the regular expression [a-zA-Z0-9_-]{1,63}

    • certificate_authority (::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority, ::Hash) (defaults to: nil)

      Required. A CertificateAuthority with initial field values.

    • request_id (::String) (defaults to: nil)

      Optional. An ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

      For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
# File 'lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/client.rb', line 917

def create_certificate_authority request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::CreateCertificateAuthorityRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_certificate_authority..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Security::PrivateCA::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.create_certificate_authority.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_certificate_authority.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @certificate_authority_service_stub.create_certificate_authority request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_certificate_template(request, options = nil) ⇒ ::Gapic::Operation #create_certificate_template(parent: nil, certificate_template_id: nil, certificate_template: nil, request_id: nil) ⇒ ::Gapic::Operation

Create a new CertificateTemplate in a given Project and Location.

Examples:

Basic example

require "google/cloud/security/private_ca/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Security::PrivateCA::V1::CreateCertificateTemplateRequest.new

# Call the create_certificate_template method.
result = client.create_certificate_template request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #create_certificate_template(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to create_certificate_template via a request object, either of type Google::Cloud::Security::PrivateCA::V1::CreateCertificateTemplateRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Security::PrivateCA::V1::CreateCertificateTemplateRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #create_certificate_template(parent: nil, certificate_template_id: nil, certificate_template: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to create_certificate_template via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The resource name of the location associated with the CertificateTemplate, in the format projects/*/locations/*.

    • certificate_template_id (::String) (defaults to: nil)

      Required. It must be unique within a location and match the regular expression [a-zA-Z0-9_-]{1,63}

    • certificate_template (::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate, ::Hash) (defaults to: nil)

      Required. A CertificateTemplate with initial field values.

    • request_id (::String) (defaults to: nil)

      Optional. An ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

      For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
# File 'lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/client.rb', line 2720

def create_certificate_template request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::CreateCertificateTemplateRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_certificate_template..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Security::PrivateCA::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.create_certificate_template.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_certificate_template.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @certificate_authority_service_stub.create_certificate_template request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_ca_pool(request, options = nil) ⇒ ::Gapic::Operation #delete_ca_pool(name: nil, request_id: nil, ignore_dependent_resources: nil) ⇒ ::Gapic::Operation

Delete a CaPool.

Examples:

Basic example

require "google/cloud/security/private_ca/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Security::PrivateCA::V1::DeleteCaPoolRequest.new

# Call the delete_ca_pool method.
result = client.delete_ca_pool request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #delete_ca_pool(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_ca_pool via a request object, either of type DeleteCaPoolRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Security::PrivateCA::V1::DeleteCaPoolRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #delete_ca_pool(name: nil, request_id: nil, ignore_dependent_resources: nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_ca_pool via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The resource name for this CaPool in the format projects/*/locations/*/caPools/*.

    • request_id (::String) (defaults to: nil)

      Optional. An ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

      For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

    • ignore_dependent_resources (::Boolean) (defaults to: nil)

      Optional. This field allows this pool to be deleted even if it's being depended on by another resource. However, doing so may result in unintended and unrecoverable effects on any dependent resource(s) since the pool will no longer be able to issue certificates.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
# File 'lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/client.rb', line 2222

def delete_ca_pool request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::DeleteCaPoolRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_ca_pool..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Security::PrivateCA::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_ca_pool.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_ca_pool.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @certificate_authority_service_stub.delete_ca_pool request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_certificate_authority(request, options = nil) ⇒ ::Gapic::Operation #delete_certificate_authority(name: nil, request_id: nil, ignore_active_certificates: nil, skip_grace_period: nil, ignore_dependent_resources: nil) ⇒ ::Gapic::Operation

Examples:

Basic example

require "google/cloud/security/private_ca/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Security::PrivateCA::V1::DeleteCertificateAuthorityRequest.new

# Call the delete_certificate_authority method.
result = client.delete_certificate_authority request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #delete_certificate_authority(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_certificate_authority via a request object, either of type DeleteCertificateAuthorityRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateAuthorityRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #delete_certificate_authority(name: nil, request_id: nil, ignore_active_certificates: nil, skip_grace_period: nil, ignore_dependent_resources: nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_certificate_authority via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The resource name for this CertificateAuthority in the format projects/*/locations/*/caPools/*/certificateAuthorities/*.

    • request_id (::String) (defaults to: nil)

      Optional. An ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

      For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

    • ignore_active_certificates (::Boolean) (defaults to: nil)

      Optional. This field allows the CA to be deleted even if the CA has active certs. Active certs include both unrevoked and unexpired certs.

    • skip_grace_period (::Boolean) (defaults to: nil)

      Optional. If this flag is set, the Certificate Authority will be deleted as soon as possible without a 30-day grace period where undeletion would have been allowed. If you proceed, there will be no way to recover this CA.

    • ignore_dependent_resources (::Boolean) (defaults to: nil)

      Optional. This field allows this ca to be deleted even if it's being depended on by another resource. However, doing so may result in unintended and unrecoverable effects on any dependent resource(s) since the CA will no longer be able to issue certificates.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
# File 'lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/client.rb', line 1621

def delete_certificate_authority request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateAuthorityRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_certificate_authority..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Security::PrivateCA::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_certificate_authority.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_certificate_authority.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @certificate_authority_service_stub.delete_certificate_authority request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_certificate_template(request, options = nil) ⇒ ::Gapic::Operation #delete_certificate_template(name: nil, request_id: nil) ⇒ ::Gapic::Operation

DeleteCertificateTemplate deletes a CertificateTemplate.

Examples:

Basic example

require "google/cloud/security/private_ca/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Security::PrivateCA::V1::DeleteCertificateTemplateRequest.new

# Call the delete_certificate_template method.
result = client.delete_certificate_template request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #delete_certificate_template(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_certificate_template via a request object, either of type DeleteCertificateTemplateRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateTemplateRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #delete_certificate_template(name: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_certificate_template via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The resource name for this CertificateTemplate in the format projects/*/locations/*/certificateTemplates/*.

    • request_id (::String) (defaults to: nil)

      Optional. An ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

      For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
# File 'lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/client.rb', line 2823

def delete_certificate_template request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::DeleteCertificateTemplateRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_certificate_template..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Security::PrivateCA::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_certificate_template.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_certificate_template.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @certificate_authority_service_stub.delete_certificate_template request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#disable_certificate_authority(request, options = nil) ⇒ ::Gapic::Operation #disable_certificate_authority(name: nil, request_id: nil, ignore_dependent_resources: nil) ⇒ ::Gapic::Operation

Examples:

Basic example

require "google/cloud/security/private_ca/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Security::PrivateCA::V1::DisableCertificateAuthorityRequest.new

# Call the disable_certificate_authority method.
result = client.disable_certificate_authority request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #disable_certificate_authority(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to disable_certificate_authority via a request object, either of type DisableCertificateAuthorityRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Security::PrivateCA::V1::DisableCertificateAuthorityRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #disable_certificate_authority(name: nil, request_id: nil, ignore_dependent_resources: nil) ⇒ ::Gapic::Operation

    Pass arguments to disable_certificate_authority via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The resource name for this CertificateAuthority in the format projects/*/locations/*/caPools/*/certificateAuthorities/*.

    • request_id (::String) (defaults to: nil)

      Optional. An ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

      For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

    • ignore_dependent_resources (::Boolean) (defaults to: nil)

      Optional. This field allows this CA to be disabled even if it's being depended on by another resource. However, doing so may result in unintended and unrecoverable effects on any dependent resource(s) since the CA will no longer be able to issue certificates.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
# File 'lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/client.rb', line 1025

def disable_certificate_authority request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::DisableCertificateAuthorityRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.disable_certificate_authority..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Security::PrivateCA::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.disable_certificate_authority.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.disable_certificate_authority.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @certificate_authority_service_stub.disable_certificate_authority request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#enable_certificate_authority(request, options = nil) ⇒ ::Gapic::Operation #enable_certificate_authority(name: nil, request_id: nil) ⇒ ::Gapic::Operation

Examples:

Basic example

require "google/cloud/security/private_ca/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Security::PrivateCA::V1::EnableCertificateAuthorityRequest.new

# Call the enable_certificate_authority method.
result = client.enable_certificate_authority request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #enable_certificate_authority(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to enable_certificate_authority via a request object, either of type EnableCertificateAuthorityRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Security::PrivateCA::V1::EnableCertificateAuthorityRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #enable_certificate_authority(name: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to enable_certificate_authority via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The resource name for this CertificateAuthority in the format projects/*/locations/*/caPools/*/certificateAuthorities/*.

    • request_id (::String) (defaults to: nil)

      Optional. An ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

      For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
# File 'lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/client.rb', line 1128

def enable_certificate_authority request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::EnableCertificateAuthorityRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.enable_certificate_authority..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Security::PrivateCA::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.enable_certificate_authority.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.enable_certificate_authority.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @certificate_authority_service_stub.enable_certificate_authority request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#fetch_ca_certs(request, options = nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsResponse #fetch_ca_certs(ca_pool: nil, request_id: nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsResponse

FetchCaCerts returns the current trust anchor for the CaPool. This will include CA certificate chains for all ACTIVE CertificateAuthority resources in the CaPool.

Examples:

Basic example

require "google/cloud/security/private_ca/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Security::PrivateCA::V1::FetchCaCertsRequest.new

# Call the fetch_ca_certs method.
result = client.fetch_ca_certs request

# The returned object is of type Google::Cloud::Security::PrivateCA::V1::FetchCaCertsResponse.
p result

Overloads:

  • #fetch_ca_certs(request, options = nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsResponse

    Pass arguments to fetch_ca_certs via a request object, either of type FetchCaCertsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #fetch_ca_certs(ca_pool: nil, request_id: nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsResponse

    Pass arguments to fetch_ca_certs via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • ca_pool (::String) (defaults to: nil)

      Required. The resource name for the CaPool in the format projects/*/locations/*/caPools/*.

    • request_id (::String) (defaults to: nil)

      Optional. An ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

      For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
# File 'lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/client.rb', line 2321

def fetch_ca_certs request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::FetchCaCertsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.fetch_ca_certs..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Security::PrivateCA::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.fetch_ca_certs.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.fetch_ca_certs.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @certificate_authority_service_stub.fetch_ca_certs request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#fetch_certificate_authority_csr(request, options = nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrResponse #fetch_certificate_authority_csr(name: nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrResponse

Fetch a certificate signing request (CSR) from a CertificateAuthority that is in state AWAITING_USER_ACTIVATION and is of type SUBORDINATE. The CSR must then be signed by the desired parent Certificate Authority, which could be another CertificateAuthority resource, or could be an on-prem certificate authority. See also ActivateCertificateAuthority.

Examples:

Basic example

require "google/cloud/security/private_ca/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrRequest.new

# Call the fetch_certificate_authority_csr method.
result = client.fetch_certificate_authority_csr request

# The returned object is of type Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrResponse.
p result

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
# File 'lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/client.rb', line 1219

def fetch_certificate_authority_csr request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.fetch_certificate_authority_csr..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Security::PrivateCA::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.fetch_certificate_authority_csr.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.fetch_certificate_authority_csr.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @certificate_authority_service_stub.fetch_certificate_authority_csr request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_ca_pool(request, options = nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1::CaPool #get_ca_pool(name: nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1::CaPool

Returns a CaPool.

Examples:

Basic example

require "google/cloud/security/private_ca/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Security::PrivateCA::V1::GetCaPoolRequest.new

# Call the get_ca_pool method.
result = client.get_ca_pool request

# The returned object is of type Google::Cloud::Security::PrivateCA::V1::CaPool.
p result

Overloads:

  • #get_ca_pool(request, options = nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1::CaPool

    Pass arguments to get_ca_pool via a request object, either of type GetCaPoolRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Security::PrivateCA::V1::GetCaPoolRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_ca_pool(name: nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1::CaPool

    Pass arguments to get_ca_pool via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the CaPool to get.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
# File 'lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/client.rb', line 2017

def get_ca_pool request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::GetCaPoolRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_ca_pool..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Security::PrivateCA::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_ca_pool.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_ca_pool.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @certificate_authority_service_stub.get_ca_pool request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_certificate(request, options = nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1::Certificate #get_certificate(name: nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1::Certificate

Returns a Certificate.

Examples:

Basic example

require "google/cloud/security/private_ca/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Security::PrivateCA::V1::GetCertificateRequest.new

# Call the get_certificate method.
result = client.get_certificate request

# The returned object is of type Google::Cloud::Security::PrivateCA::V1::Certificate.
p result

Overloads:

  • #get_certificate(request, options = nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1::Certificate

    Pass arguments to get_certificate via a request object, either of type GetCertificateRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Security::PrivateCA::V1::GetCertificateRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_certificate(name: nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1::Certificate

    Pass arguments to get_certificate via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the Certificate to get.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
# File 'lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/client.rb', line 390

def get_certificate request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::GetCertificateRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_certificate..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Security::PrivateCA::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_certificate.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_certificate.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @certificate_authority_service_stub.get_certificate request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_certificate_authority(request, options = nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority #get_certificate_authority(name: nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority

Examples:

Basic example

require "google/cloud/security/private_ca/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Security::PrivateCA::V1::GetCertificateAuthorityRequest.new

# Call the get_certificate_authority method.
result = client.get_certificate_authority request

# The returned object is of type Google::Cloud::Security::PrivateCA::V1::CertificateAuthority.
p result

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
# File 'lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/client.rb', line 1301

def get_certificate_authority request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::GetCertificateAuthorityRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_certificate_authority..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Security::PrivateCA::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_certificate_authority.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_certificate_authority.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @certificate_authority_service_stub.get_certificate_authority request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_certificate_revocation_list(request, options = nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList #get_certificate_revocation_list(name: nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList

Examples:

Basic example

require "google/cloud/security/private_ca/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Security::PrivateCA::V1::GetCertificateRevocationListRequest.new

# Call the get_certificate_revocation_list method.
result = client.get_certificate_revocation_list request

# The returned object is of type Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList.
p result

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
# File 'lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/client.rb', line 2404

def get_certificate_revocation_list request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::GetCertificateRevocationListRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_certificate_revocation_list..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Security::PrivateCA::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_certificate_revocation_list.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_certificate_revocation_list.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @certificate_authority_service_stub.get_certificate_revocation_list request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_certificate_template(request, options = nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate #get_certificate_template(name: nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate

Returns a CertificateTemplate.

Examples:

Basic example

require "google/cloud/security/private_ca/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Security::PrivateCA::V1::GetCertificateTemplateRequest.new

# Call the get_certificate_template method.
result = client.get_certificate_template request

# The returned object is of type Google::Cloud::Security::PrivateCA::V1::CertificateTemplate.
p result

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
# File 'lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/client.rb', line 2906

def get_certificate_template request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::GetCertificateTemplateRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_certificate_template..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Security::PrivateCA::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_certificate_template.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_certificate_template.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @certificate_authority_service_stub.get_certificate_template request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_ca_pools(request, options = nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsResponse #list_ca_pools(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsResponse

Lists CaPools.

Examples:

Basic example

require "google/cloud/security/private_ca/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Security::PrivateCA::V1::ListCaPoolsRequest.new

# Call the list_ca_pools method.
result = client.list_ca_pools request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Security::PrivateCA::V1::CaPool.
  p item
end

Overloads:

  • #list_ca_pools(request, options = nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsResponse

    Pass arguments to list_ca_pools via a request object, either of type ListCaPoolsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_ca_pools(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsResponse

    Pass arguments to list_ca_pools via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The resource name of the location associated with the CaPools, in the format projects/*/locations/*.

    • page_size (::Integer) (defaults to: nil)

      Optional. Limit on the number of CaPools to include in the response. Further CaPools can subsequently be obtained by including the ListCaPoolsResponse.next_page_token in a subsequent request. If unspecified, the server will pick an appropriate default.

    • page_token (::String) (defaults to: nil)

      Optional. Pagination token, returned earlier via ListCaPoolsResponse.next_page_token.

    • filter (::String) (defaults to: nil)

      Optional. Only include resources that match the filter in the response.

    • order_by (::String) (defaults to: nil)

      Optional. Specify how the results should be sorted.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
# File 'lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/client.rb', line 2116

def list_ca_pools request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::ListCaPoolsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_ca_pools..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Security::PrivateCA::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_ca_pools.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_ca_pools.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @certificate_authority_service_stub.list_ca_pools request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_certificate_authorities(request, options = nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesResponse #list_certificate_authorities(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesResponse

Examples:

Basic example

require "google/cloud/security/private_ca/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesRequest.new

# Call the list_certificate_authorities method.
result = client.list_certificate_authorities request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority.
  p item
end

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
# File 'lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/client.rb', line 1403

def list_certificate_authorities request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_certificate_authorities..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Security::PrivateCA::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_certificate_authorities.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_certificate_authorities.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @certificate_authority_service_stub.list_certificate_authorities request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_certificate_revocation_lists(request, options = nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsResponse #list_certificate_revocation_lists(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsResponse

Examples:

Basic example

require "google/cloud/security/private_ca/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsRequest.new

# Call the list_certificate_revocation_lists method.
result = client.list_certificate_revocation_lists request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList.
  p item
end

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
# File 'lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/client.rb', line 2505

def list_certificate_revocation_lists request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_certificate_revocation_lists..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Security::PrivateCA::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_certificate_revocation_lists.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_certificate_revocation_lists.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @certificate_authority_service_stub.list_certificate_revocation_lists request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_certificate_templates(request, options = nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesResponse #list_certificate_templates(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesResponse

Examples:

Basic example

require "google/cloud/security/private_ca/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesRequest.new

# Call the list_certificate_templates method.
result = client.list_certificate_templates request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate.
  p item
end

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
# File 'lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/client.rb', line 3007

def list_certificate_templates request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_certificate_templates..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Security::PrivateCA::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_certificate_templates.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_certificate_templates.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @certificate_authority_service_stub.list_certificate_templates request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_certificates(request, options = nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1::ListCertificatesResponse #list_certificates(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1::ListCertificatesResponse

Lists Certificates.

Examples:

Basic example

require "google/cloud/security/private_ca/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Security::PrivateCA::V1::ListCertificatesRequest.new

# Call the list_certificates method.
result = client.list_certificates request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Security::PrivateCA::V1::Certificate.
  p item
end

Overloads:

  • #list_certificates(request, options = nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1::ListCertificatesResponse

    Pass arguments to list_certificates via a request object, either of type ListCertificatesRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Security::PrivateCA::V1::ListCertificatesRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_certificates(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1::ListCertificatesResponse

    Pass arguments to list_certificates via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The resource name of the location associated with the Certificates, in the format projects/*/locations/*/caPools/*.

    • page_size (::Integer) (defaults to: nil)

      Optional. Limit on the number of Certificates to include in the response. Further Certificates can subsequently be obtained by including the ListCertificatesResponse.next_page_token in a subsequent request. If unspecified, the server will pick an appropriate default.

    • page_token (::String) (defaults to: nil)

      Optional. Pagination token, returned earlier via ListCertificatesResponse.next_page_token.

    • filter (::String) (defaults to: nil)

      Optional. Only include resources that match the filter in the response. For details on supported filters and syntax, see Certificates Filtering documentation.

    • order_by (::String) (defaults to: nil)

      Optional. Specify how the results should be sorted. For details on supported fields and syntax, see Certificates Sorting documentation.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
# File 'lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/client.rb', line 494

def list_certificates request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::ListCertificatesRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_certificates..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Security::PrivateCA::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_certificates.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_certificates.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @certificate_authority_service_stub.list_certificates request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#revoke_certificate(request, options = nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1::Certificate #revoke_certificate(name: nil, reason: nil, request_id: nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1::Certificate

Revoke a Certificate.

Examples:

Basic example

require "google/cloud/security/private_ca/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Security::PrivateCA::V1::RevokeCertificateRequest.new

# Call the revoke_certificate method.
result = client.revoke_certificate request

# The returned object is of type Google::Cloud::Security::PrivateCA::V1::Certificate.
p result

Overloads:

  • #revoke_certificate(request, options = nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1::Certificate

    Pass arguments to revoke_certificate via a request object, either of type RevokeCertificateRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Security::PrivateCA::V1::RevokeCertificateRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #revoke_certificate(name: nil, reason: nil, request_id: nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1::Certificate

    Pass arguments to revoke_certificate via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The resource name for this Certificate in the format projects/*/locations/*/caPools/*/certificates/*.

    • reason (::Google::Cloud::Security::PrivateCA::V1::RevocationReason) (defaults to: nil)

      Required. The RevocationReason for revoking this certificate.

    • request_id (::String) (defaults to: nil)

      Optional. An ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

      For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
# File 'lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/client.rb', line 592

def revoke_certificate request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::RevokeCertificateRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.revoke_certificate..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Security::PrivateCA::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.revoke_certificate.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.revoke_certificate.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @certificate_authority_service_stub.revoke_certificate request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#undelete_certificate_authority(request, options = nil) ⇒ ::Gapic::Operation #undelete_certificate_authority(name: nil, request_id: nil) ⇒ ::Gapic::Operation

Undelete a CertificateAuthority that has been deleted.

Examples:

Basic example

require "google/cloud/security/private_ca/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Security::PrivateCA::V1::UndeleteCertificateAuthorityRequest.new

# Call the undelete_certificate_authority method.
result = client.undelete_certificate_authority request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #undelete_certificate_authority(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to undelete_certificate_authority via a request object, either of type UndeleteCertificateAuthorityRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Security::PrivateCA::V1::UndeleteCertificateAuthorityRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #undelete_certificate_authority(name: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to undelete_certificate_authority via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The resource name for this CertificateAuthority in the format projects/*/locations/*/caPools/*/certificateAuthorities/*.

    • request_id (::String) (defaults to: nil)

      Optional. An ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

      For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
# File 'lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/client.rb', line 1506

def undelete_certificate_authority request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::UndeleteCertificateAuthorityRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.undelete_certificate_authority..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Security::PrivateCA::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.undelete_certificate_authority.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.undelete_certificate_authority.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @certificate_authority_service_stub.undelete_certificate_authority request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#universe_domainString

The effective universe domain

Returns:

  • (String)


113
114
115
# File 'lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/client.rb', line 113

def universe_domain
  @certificate_authority_service_stub.universe_domain
end

#update_ca_pool(request, options = nil) ⇒ ::Gapic::Operation #update_ca_pool(ca_pool: nil, update_mask: nil, request_id: nil) ⇒ ::Gapic::Operation

Update a CaPool.

Examples:

Basic example

require "google/cloud/security/private_ca/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Security::PrivateCA::V1::UpdateCaPoolRequest.new

# Call the update_ca_pool method.
result = client.update_ca_pool request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #update_ca_pool(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to update_ca_pool via a request object, either of type UpdateCaPoolRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Security::PrivateCA::V1::UpdateCaPoolRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #update_ca_pool(ca_pool: nil, update_mask: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to update_ca_pool via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • ca_pool (::Google::Cloud::Security::PrivateCA::V1::CaPool, ::Hash) (defaults to: nil)

      Required. CaPool with updated values.

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      Required. A list of fields to be updated in this request.

    • request_id (::String) (defaults to: nil)

      Optional. An ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

      For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
# File 'lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/client.rb', line 1937

def update_ca_pool request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::UpdateCaPoolRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_ca_pool..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Security::PrivateCA::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.update_ca_pool.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_ca_pool.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @certificate_authority_service_stub.update_ca_pool request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_certificate(request, options = nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1::Certificate #update_certificate(certificate: nil, update_mask: nil, request_id: nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1::Certificate

Update a Certificate. Currently, the only field you can update is the labels field.

Examples:

Basic example

require "google/cloud/security/private_ca/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRequest.new

# Call the update_certificate method.
result = client.update_certificate request

# The returned object is of type Google::Cloud::Security::PrivateCA::V1::Certificate.
p result

Overloads:

  • #update_certificate(request, options = nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1::Certificate

    Pass arguments to update_certificate via a request object, either of type UpdateCertificateRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #update_certificate(certificate: nil, update_mask: nil, request_id: nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1::Certificate

    Pass arguments to update_certificate via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • certificate (::Google::Cloud::Security::PrivateCA::V1::Certificate, ::Hash) (defaults to: nil)

      Required. Certificate with updated values.

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      Required. A list of fields to be updated in this request.

    • request_id (::String) (defaults to: nil)

      Optional. An ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

      For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
# File 'lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/client.rb', line 689

def update_certificate request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_certificate..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Security::PrivateCA::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.update_certificate.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_certificate.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @certificate_authority_service_stub.update_certificate request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_certificate_authority(request, options = nil) ⇒ ::Gapic::Operation #update_certificate_authority(certificate_authority: nil, update_mask: nil, request_id: nil) ⇒ ::Gapic::Operation

Examples:

Basic example

require "google/cloud/security/private_ca/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Security::PrivateCA::V1::UpdateCertificateAuthorityRequest.new

# Call the update_certificate_authority method.
result = client.update_certificate_authority request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #update_certificate_authority(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to update_certificate_authority via a request object, either of type UpdateCertificateAuthorityRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateAuthorityRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #update_certificate_authority(certificate_authority: nil, update_mask: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to update_certificate_authority via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • certificate_authority (::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority, ::Hash) (defaults to: nil)

      Required. CertificateAuthority with updated values.

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      Required. A list of fields to be updated in this request.

    • request_id (::String) (defaults to: nil)

      Optional. An ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

      For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
# File 'lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/client.rb', line 1726

def update_certificate_authority request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateAuthorityRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_certificate_authority..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Security::PrivateCA::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.update_certificate_authority.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_certificate_authority.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @certificate_authority_service_stub.update_certificate_authority request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_certificate_revocation_list(request, options = nil) ⇒ ::Gapic::Operation #update_certificate_revocation_list(certificate_revocation_list: nil, update_mask: nil, request_id: nil) ⇒ ::Gapic::Operation

Examples:

Basic example

require "google/cloud/security/private_ca/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRevocationListRequest.new

# Call the update_certificate_revocation_list method.
result = client.update_certificate_revocation_list request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #update_certificate_revocation_list(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to update_certificate_revocation_list via a request object, either of type UpdateCertificateRevocationListRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRevocationListRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #update_certificate_revocation_list(certificate_revocation_list: nil, update_mask: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to update_certificate_revocation_list via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • certificate_revocation_list (::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList, ::Hash) (defaults to: nil)

      Required. CertificateRevocationList with updated values.

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      Required. A list of fields to be updated in this request.

    • request_id (::String) (defaults to: nil)

      Optional. An ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

      For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
# File 'lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/client.rb', line 2609

def update_certificate_revocation_list request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRevocationListRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_certificate_revocation_list..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Security::PrivateCA::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.update_certificate_revocation_list.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_certificate_revocation_list.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @certificate_authority_service_stub.update_certificate_revocation_list request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_certificate_template(request, options = nil) ⇒ ::Gapic::Operation #update_certificate_template(certificate_template: nil, update_mask: nil, request_id: nil) ⇒ ::Gapic::Operation

Examples:

Basic example

require "google/cloud/security/private_ca/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Security::PrivateCA::V1::UpdateCertificateTemplateRequest.new

# Call the update_certificate_template method.
result = client.update_certificate_template request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #update_certificate_template(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to update_certificate_template via a request object, either of type UpdateCertificateTemplateRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateTemplateRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #update_certificate_template(certificate_template: nil, update_mask: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to update_certificate_template via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • certificate_template (::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate, ::Hash) (defaults to: nil)

      Required. CertificateTemplate with updated values.

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      Required. A list of fields to be updated in this request.

    • request_id (::String) (defaults to: nil)

      Optional. An ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

      For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
# File 'lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/client.rb', line 3111

def update_certificate_template request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1::UpdateCertificateTemplateRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_certificate_template..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Security::PrivateCA::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.update_certificate_template.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_certificate_template.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @certificate_authority_service_stub.update_certificate_template request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end