Google Certificate Authority Service V1 Client - Class CertificateAuthorityServiceClient (1.5.0)

Reference documentation and code samples for the Google Certificate Authority Service V1 Client class CertificateAuthorityServiceClient.

Service Description: Certificate Authority Service manages private certificate authorities and issued certificates.

This class provides the ability to make remote calls to the backing service through method calls that map to API methods.

Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parseName method to extract the individual identifiers contained within formatted names that are returned by the API.

Namespace

Google \ Cloud \ Security \ PrivateCA \ V1 \ Client

Methods

__construct

Constructor.

Parameters
NameDescription
options array

Optional. Options for configuring the service API wrapper.

↳ apiEndpoint string

The address of the API remote host. May optionally include the port, formatted as "

↳ credentials string|array|FetchAuthTokenInterface|CredentialsWrapper

The credentials to be used by the client to authorize API calls. This option accepts either a path to a credentials file, or a decoded credentials file as a PHP array. Advanced usage: In addition, this option can also accept a pre-constructed Google\Auth\FetchAuthTokenInterface object or Google\ApiCore\CredentialsWrapper object. Note that when one of these objects are provided, any settings in $credentialsConfig will be ignored.

↳ credentialsConfig array

Options used to configure credentials, including auth token caching, for the client. For a full list of supporting configuration options, see Google\ApiCore\CredentialsWrapper::build() .

↳ disableRetries bool

Determines whether or not retries defined by the client configuration should be disabled. Defaults to false.

↳ clientConfig string|array

Client method configuration, including retry settings. This option can be either a path to a JSON file, or a PHP array containing the decoded JSON data. By default this settings points to the default client config file, which is provided in the resources folder.

↳ transport string|TransportInterface

The transport used for executing network requests. May be either the string rest or grpc. Defaults to grpc if gRPC support is detected on the system. Advanced usage: Additionally, it is possible to pass in an already instantiated Google\ApiCore\Transport\TransportInterface object. Note that when this object is provided, any settings in $transportConfig, and any $apiEndpoint setting, will be ignored.

↳ transportConfig array

Configuration options that will be used to construct the transport. Options for each supported transport type should be passed in a key for that transport. For example: $transportConfig = [ 'grpc' => [...], 'rest' => [...], ]; See the Google\ApiCore\Transport\GrpcTransport::build() and Google\ApiCore\Transport\RestTransport::build() methods for the supported options.

↳ clientCertSource callable

A callable which returns the client cert as a string. This can be used to provide a certificate and private key to the transport layer for mTLS.

activateCertificateAuthority

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.

The async variant is Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient::activateCertificateAuthorityAsync() .

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\ActivateCertificateAuthorityRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Security\PrivateCA\V1\ActivateCertificateAuthorityRequest;
use Google\Cloud\Security\PrivateCA\V1\CertificateAuthority;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\SubordinateConfig;
use Google\Rpc\Status;

/**
 * @param string $formattedName                                  The resource name for this
 *                                                               [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
 *                                                               in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. Please see
 *                                                               {@see CertificateAuthorityServiceClient::certificateAuthorityName()} for help formatting this field.
 * @param string $pemCaCertificate                               The signed CA certificate issued from
 *                                                               [FetchCertificateAuthorityCsrResponse.pem_csr][google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse.pem_csr].
 * @param string $formattedSubordinateConfigCertificateAuthority This can refer to a
 *                                                               [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
 *                                                               that was used to create a subordinate
 *                                                               [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority].
 *                                                               This field is used for information and usability purposes only. The
 *                                                               resource name is in the format
 *                                                               `projects/*/locations/*/caPools/*/certificateAuthorities/*`. Please see
 *                                                               {@see CertificateAuthorityServiceClient::certificateAuthorityName()} for help formatting this field.
 */
function activate_certificate_authority_sample(
    string $formattedName,
    string $pemCaCertificate,
    string $formattedSubordinateConfigCertificateAuthority
): void {
    // Create a client.
    $certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();

    // Prepare the request message.
    $subordinateConfig = (new SubordinateConfig())
        ->setCertificateAuthority($formattedSubordinateConfigCertificateAuthority);
    $request = (new ActivateCertificateAuthorityRequest())
        ->setName($formattedName)
        ->setPemCaCertificate($pemCaCertificate)
        ->setSubordinateConfig($subordinateConfig);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $certificateAuthorityServiceClient->activateCertificateAuthority($request);
        $response->pollUntilComplete();

        if ($response->operationSucceeded()) {
            /** @var CertificateAuthority $result */
            $result = $response->getResult();
            printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
        } else {
            /** @var Status $error */
            $error = $response->getError();
            printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = CertificateAuthorityServiceClient::certificateAuthorityName(
        '[PROJECT]',
        '[LOCATION]',
        '[CA_POOL]',
        '[CERTIFICATE_AUTHORITY]'
    );
    $pemCaCertificate = '[PEM_CA_CERTIFICATE]';
    $formattedSubordinateConfigCertificateAuthority = CertificateAuthorityServiceClient::certificateAuthorityName(
        '[PROJECT]',
        '[LOCATION]',
        '[CA_POOL]',
        '[CERTIFICATE_AUTHORITY]'
    );

    activate_certificate_authority_sample(
        $formattedName,
        $pemCaCertificate,
        $formattedSubordinateConfigCertificateAuthority
    );
}

createCaPool

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\CreateCaPoolRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Security\PrivateCA\V1\CaPool;
use Google\Cloud\Security\PrivateCA\V1\CaPool\Tier;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\CreateCaPoolRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedParent The resource name of the location associated with the
 *                                [CaPool][google.cloud.security.privateca.v1.CaPool], in the format
 *                                `projects/*/locations/*`. Please see
 *                                {@see CertificateAuthorityServiceClient::locationName()} for help formatting this field.
 * @param string $caPoolId        It must be unique within a location and match the regular
 *                                expression `[a-zA-Z0-9_-]{1,63}`
 * @param int    $caPoolTier      Immutable. The
 *                                [Tier][google.cloud.security.privateca.v1.CaPool.Tier] of this
 *                                [CaPool][google.cloud.security.privateca.v1.CaPool].
 */
function create_ca_pool_sample(string $formattedParent, string $caPoolId, int $caPoolTier): void
{
    // Create a client.
    $certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();

    // Prepare the request message.
    $caPool = (new CaPool())
        ->setTier($caPoolTier);
    $request = (new CreateCaPoolRequest())
        ->setParent($formattedParent)
        ->setCaPoolId($caPoolId)
        ->setCaPool($caPool);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $certificateAuthorityServiceClient->createCaPool($request);
        $response->pollUntilComplete();

        if ($response->operationSucceeded()) {
            /** @var CaPool $result */
            $result = $response->getResult();
            printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
        } else {
            /** @var Status $error */
            $error = $response->getError();
            printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = CertificateAuthorityServiceClient::locationName('[PROJECT]', '[LOCATION]');
    $caPoolId = '[CA_POOL_ID]';
    $caPoolTier = Tier::TIER_UNSPECIFIED;

    create_ca_pool_sample($formattedParent, $caPoolId, $caPoolTier);
}

createCertificate

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

The async variant is Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient::createCertificateAsync() .

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\CreateCertificateRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\Security\PrivateCA\V1\Certificate
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Security\PrivateCA\V1\Certificate;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\CreateCertificateRequest;
use Google\Protobuf\Duration;

/**
 * @param string $formattedParent The resource name of the
 *                                [CaPool][google.cloud.security.privateca.v1.CaPool] associated with the
 *                                [Certificate][google.cloud.security.privateca.v1.Certificate], in the
 *                                format `projects/*/locations/*/caPools/*`. Please see
 *                                {@see CertificateAuthorityServiceClient::caPoolName()} for help formatting this field.
 */
function create_certificate_sample(string $formattedParent): void
{
    // Create a client.
    $certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();

    // Prepare the request message.
    $certificateLifetime = new Duration();
    $certificate = (new Certificate())
        ->setLifetime($certificateLifetime);
    $request = (new CreateCertificateRequest())
        ->setParent($formattedParent)
        ->setCertificate($certificate);

    // Call the API and handle any network failures.
    try {
        /** @var Certificate $response */
        $response = $certificateAuthorityServiceClient->createCertificate($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = CertificateAuthorityServiceClient::caPoolName(
        '[PROJECT]',
        '[LOCATION]',
        '[CA_POOL]'
    );

    create_certificate_sample($formattedParent);
}

createCertificateAuthority

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\CreateCertificateAuthorityRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Security\PrivateCA\V1\CertificateAuthority;
use Google\Cloud\Security\PrivateCA\V1\CertificateAuthority\KeyVersionSpec;
use Google\Cloud\Security\PrivateCA\V1\CertificateAuthority\Type;
use Google\Cloud\Security\PrivateCA\V1\CertificateConfig;
use Google\Cloud\Security\PrivateCA\V1\CertificateConfig\SubjectConfig;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\CreateCertificateAuthorityRequest;
use Google\Cloud\Security\PrivateCA\V1\Subject;
use Google\Cloud\Security\PrivateCA\V1\X509Parameters;
use Google\Protobuf\Duration;
use Google\Rpc\Status;

/**
 * @param string $formattedParent          The resource name of the
 *                                         [CaPool][google.cloud.security.privateca.v1.CaPool] associated with the
 *                                         [CertificateAuthorities][google.cloud.security.privateca.v1.CertificateAuthority],
 *                                         in the format `projects/*/locations/*/caPools/*`. Please see
 *                                         {@see CertificateAuthorityServiceClient::caPoolName()} for help formatting this field.
 * @param string $certificateAuthorityId   It must be unique within a location and match the regular
 *                                         expression `[a-zA-Z0-9_-]{1,63}`
 * @param int    $certificateAuthorityType Immutable. The
 *                                         [Type][google.cloud.security.privateca.v1.CertificateAuthority.Type] of
 *                                         this
 *                                         [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority].
 */
function create_certificate_authority_sample(
    string $formattedParent,
    string $certificateAuthorityId,
    int $certificateAuthorityType
): void {
    // Create a client.
    $certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();

    // Prepare the request message.
    $certificateAuthorityConfigSubjectConfigSubject = new Subject();
    $certificateAuthorityConfigSubjectConfig = (new SubjectConfig())
        ->setSubject($certificateAuthorityConfigSubjectConfigSubject);
    $certificateAuthorityConfigX509Config = new X509Parameters();
    $certificateAuthorityConfig = (new CertificateConfig())
        ->setSubjectConfig($certificateAuthorityConfigSubjectConfig)
        ->setX509Config($certificateAuthorityConfigX509Config);
    $certificateAuthorityLifetime = new Duration();
    $certificateAuthorityKeySpec = new KeyVersionSpec();
    $certificateAuthority = (new CertificateAuthority())
        ->setType($certificateAuthorityType)
        ->setConfig($certificateAuthorityConfig)
        ->setLifetime($certificateAuthorityLifetime)
        ->setKeySpec($certificateAuthorityKeySpec);
    $request = (new CreateCertificateAuthorityRequest())
        ->setParent($formattedParent)
        ->setCertificateAuthorityId($certificateAuthorityId)
        ->setCertificateAuthority($certificateAuthority);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $certificateAuthorityServiceClient->createCertificateAuthority($request);
        $response->pollUntilComplete();

        if ($response->operationSucceeded()) {
            /** @var CertificateAuthority $result */
            $result = $response->getResult();
            printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
        } else {
            /** @var Status $error */
            $error = $response->getError();
            printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = CertificateAuthorityServiceClient::caPoolName(
        '[PROJECT]',
        '[LOCATION]',
        '[CA_POOL]'
    );
    $certificateAuthorityId = '[CERTIFICATE_AUTHORITY_ID]';
    $certificateAuthorityType = Type::TYPE_UNSPECIFIED;

    create_certificate_authority_sample(
        $formattedParent,
        $certificateAuthorityId,
        $certificateAuthorityType
    );
}

createCertificateTemplate

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\CreateCertificateTemplateRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Security\PrivateCA\V1\CertificateTemplate;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\CreateCertificateTemplateRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedParent       The resource name of the location associated with the
 *                                      [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate],
 *                                      in the format `projects/*/locations/*`. Please see
 *                                      {@see CertificateAuthorityServiceClient::locationName()} for help formatting this field.
 * @param string $certificateTemplateId It must be unique within a location and match the regular
 *                                      expression `[a-zA-Z0-9_-]{1,63}`
 */
function create_certificate_template_sample(
    string $formattedParent,
    string $certificateTemplateId
): void {
    // Create a client.
    $certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();

    // Prepare the request message.
    $certificateTemplate = new CertificateTemplate();
    $request = (new CreateCertificateTemplateRequest())
        ->setParent($formattedParent)
        ->setCertificateTemplateId($certificateTemplateId)
        ->setCertificateTemplate($certificateTemplate);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $certificateAuthorityServiceClient->createCertificateTemplate($request);
        $response->pollUntilComplete();

        if ($response->operationSucceeded()) {
            /** @var CertificateTemplate $result */
            $result = $response->getResult();
            printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
        } else {
            /** @var Status $error */
            $error = $response->getError();
            printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = CertificateAuthorityServiceClient::locationName('[PROJECT]', '[LOCATION]');
    $certificateTemplateId = '[CERTIFICATE_TEMPLATE_ID]';

    create_certificate_template_sample($formattedParent, $certificateTemplateId);
}

deleteCaPool

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\DeleteCaPoolRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\DeleteCaPoolRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedName The resource name for this
 *                              [CaPool][google.cloud.security.privateca.v1.CaPool] in the format
 *                              `projects/*/locations/*/caPools/*`. Please see
 *                              {@see CertificateAuthorityServiceClient::caPoolName()} for help formatting this field.
 */
function delete_ca_pool_sample(string $formattedName): void
{
    // Create a client.
    $certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();

    // Prepare the request message.
    $request = (new DeleteCaPoolRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $certificateAuthorityServiceClient->deleteCaPool($request);
        $response->pollUntilComplete();

        if ($response->operationSucceeded()) {
            printf('Operation completed successfully.' . PHP_EOL);
        } else {
            /** @var Status $error */
            $error = $response->getError();
            printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = CertificateAuthorityServiceClient::caPoolName(
        '[PROJECT]',
        '[LOCATION]',
        '[CA_POOL]'
    );

    delete_ca_pool_sample($formattedName);
}

deleteCertificateAuthority

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\DeleteCertificateAuthorityRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Security\PrivateCA\V1\CertificateAuthority;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\DeleteCertificateAuthorityRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedName The resource name for this
 *                              [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
 *                              in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. Please see
 *                              {@see CertificateAuthorityServiceClient::certificateAuthorityName()} for help formatting this field.
 */
function delete_certificate_authority_sample(string $formattedName): void
{
    // Create a client.
    $certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();

    // Prepare the request message.
    $request = (new DeleteCertificateAuthorityRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $certificateAuthorityServiceClient->deleteCertificateAuthority($request);
        $response->pollUntilComplete();

        if ($response->operationSucceeded()) {
            /** @var CertificateAuthority $result */
            $result = $response->getResult();
            printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
        } else {
            /** @var Status $error */
            $error = $response->getError();
            printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = CertificateAuthorityServiceClient::certificateAuthorityName(
        '[PROJECT]',
        '[LOCATION]',
        '[CA_POOL]',
        '[CERTIFICATE_AUTHORITY]'
    );

    delete_certificate_authority_sample($formattedName);
}

deleteCertificateTemplate

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\DeleteCertificateTemplateRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\DeleteCertificateTemplateRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedName The resource name for this
 *                              [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate]
 *                              in the format `projects/*/locations/*/certificateTemplates/*`. Please see
 *                              {@see CertificateAuthorityServiceClient::certificateTemplateName()} for help formatting this field.
 */
function delete_certificate_template_sample(string $formattedName): void
{
    // Create a client.
    $certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();

    // Prepare the request message.
    $request = (new DeleteCertificateTemplateRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $certificateAuthorityServiceClient->deleteCertificateTemplate($request);
        $response->pollUntilComplete();

        if ($response->operationSucceeded()) {
            printf('Operation completed successfully.' . PHP_EOL);
        } else {
            /** @var Status $error */
            $error = $response->getError();
            printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = CertificateAuthorityServiceClient::certificateTemplateName(
        '[PROJECT]',
        '[LOCATION]',
        '[CERTIFICATE_TEMPLATE]'
    );

    delete_certificate_template_sample($formattedName);
}

disableCertificateAuthority

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\DisableCertificateAuthorityRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Security\PrivateCA\V1\CertificateAuthority;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\DisableCertificateAuthorityRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedName The resource name for this
 *                              [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
 *                              in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. Please see
 *                              {@see CertificateAuthorityServiceClient::certificateAuthorityName()} for help formatting this field.
 */
function disable_certificate_authority_sample(string $formattedName): void
{
    // Create a client.
    $certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();

    // Prepare the request message.
    $request = (new DisableCertificateAuthorityRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $certificateAuthorityServiceClient->disableCertificateAuthority($request);
        $response->pollUntilComplete();

        if ($response->operationSucceeded()) {
            /** @var CertificateAuthority $result */
            $result = $response->getResult();
            printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
        } else {
            /** @var Status $error */
            $error = $response->getError();
            printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = CertificateAuthorityServiceClient::certificateAuthorityName(
        '[PROJECT]',
        '[LOCATION]',
        '[CA_POOL]',
        '[CERTIFICATE_AUTHORITY]'
    );

    disable_certificate_authority_sample($formattedName);
}

enableCertificateAuthority

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\EnableCertificateAuthorityRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Security\PrivateCA\V1\CertificateAuthority;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\EnableCertificateAuthorityRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedName The resource name for this
 *                              [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
 *                              in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. Please see
 *                              {@see CertificateAuthorityServiceClient::certificateAuthorityName()} for help formatting this field.
 */
function enable_certificate_authority_sample(string $formattedName): void
{
    // Create a client.
    $certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();

    // Prepare the request message.
    $request = (new EnableCertificateAuthorityRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $certificateAuthorityServiceClient->enableCertificateAuthority($request);
        $response->pollUntilComplete();

        if ($response->operationSucceeded()) {
            /** @var CertificateAuthority $result */
            $result = $response->getResult();
            printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
        } else {
            /** @var Status $error */
            $error = $response->getError();
            printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = CertificateAuthorityServiceClient::certificateAuthorityName(
        '[PROJECT]',
        '[LOCATION]',
        '[CA_POOL]',
        '[CERTIFICATE_AUTHORITY]'
    );

    enable_certificate_authority_sample($formattedName);
}

fetchCaCerts

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

The async variant is Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient::fetchCaCertsAsync() .

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\FetchCaCertsRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\Security\PrivateCA\V1\FetchCaCertsResponse
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\FetchCaCertsRequest;
use Google\Cloud\Security\PrivateCA\V1\FetchCaCertsResponse;

/**
 * @param string $formattedCaPool The resource name for the
 *                                [CaPool][google.cloud.security.privateca.v1.CaPool] in the format
 *                                `projects/*/locations/*/caPools/*`. Please see
 *                                {@see CertificateAuthorityServiceClient::caPoolName()} for help formatting this field.
 */
function fetch_ca_certs_sample(string $formattedCaPool): void
{
    // Create a client.
    $certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();

    // Prepare the request message.
    $request = (new FetchCaCertsRequest())
        ->setCaPool($formattedCaPool);

    // Call the API and handle any network failures.
    try {
        /** @var FetchCaCertsResponse $response */
        $response = $certificateAuthorityServiceClient->fetchCaCerts($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedCaPool = CertificateAuthorityServiceClient::caPoolName(
        '[PROJECT]',
        '[LOCATION]',
        '[CA_POOL]'
    );

    fetch_ca_certs_sample($formattedCaPool);
}

fetchCertificateAuthorityCsr

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.

The async variant is Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient::fetchCertificateAuthorityCsrAsync() .

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\FetchCertificateAuthorityCsrRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\Security\PrivateCA\V1\FetchCertificateAuthorityCsrResponse
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\FetchCertificateAuthorityCsrRequest;
use Google\Cloud\Security\PrivateCA\V1\FetchCertificateAuthorityCsrResponse;

/**
 * @param string $formattedName The resource name for this
 *                              [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
 *                              in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. Please see
 *                              {@see CertificateAuthorityServiceClient::certificateAuthorityName()} for help formatting this field.
 */
function fetch_certificate_authority_csr_sample(string $formattedName): void
{
    // Create a client.
    $certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();

    // Prepare the request message.
    $request = (new FetchCertificateAuthorityCsrRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var FetchCertificateAuthorityCsrResponse $response */
        $response = $certificateAuthorityServiceClient->fetchCertificateAuthorityCsr($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = CertificateAuthorityServiceClient::certificateAuthorityName(
        '[PROJECT]',
        '[LOCATION]',
        '[CA_POOL]',
        '[CERTIFICATE_AUTHORITY]'
    );

    fetch_certificate_authority_csr_sample($formattedName);
}

getCaPool

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\GetCaPoolRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\Security\PrivateCA\V1\CaPool
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Security\PrivateCA\V1\CaPool;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\GetCaPoolRequest;

/**
 * @param string $formattedName The [name][google.cloud.security.privateca.v1.CaPool.name] of the
 *                              [CaPool][google.cloud.security.privateca.v1.CaPool] to get. Please see
 *                              {@see CertificateAuthorityServiceClient::caPoolName()} for help formatting this field.
 */
function get_ca_pool_sample(string $formattedName): void
{
    // Create a client.
    $certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();

    // Prepare the request message.
    $request = (new GetCaPoolRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var CaPool $response */
        $response = $certificateAuthorityServiceClient->getCaPool($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = CertificateAuthorityServiceClient::caPoolName(
        '[PROJECT]',
        '[LOCATION]',
        '[CA_POOL]'
    );

    get_ca_pool_sample($formattedName);
}

getCertificate

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\GetCertificateRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\Security\PrivateCA\V1\Certificate
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Security\PrivateCA\V1\Certificate;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\GetCertificateRequest;

/**
 * @param string $formattedName The [name][google.cloud.security.privateca.v1.Certificate.name]
 *                              of the [Certificate][google.cloud.security.privateca.v1.Certificate] to
 *                              get. Please see
 *                              {@see CertificateAuthorityServiceClient::certificateName()} for help formatting this field.
 */
function get_certificate_sample(string $formattedName): void
{
    // Create a client.
    $certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();

    // Prepare the request message.
    $request = (new GetCertificateRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var Certificate $response */
        $response = $certificateAuthorityServiceClient->getCertificate($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = CertificateAuthorityServiceClient::certificateName(
        '[PROJECT]',
        '[LOCATION]',
        '[CA_POOL]',
        '[CERTIFICATE]'
    );

    get_certificate_sample($formattedName);
}

getCertificateAuthority

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\GetCertificateAuthorityRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\Security\PrivateCA\V1\CertificateAuthority
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Security\PrivateCA\V1\CertificateAuthority;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\GetCertificateAuthorityRequest;

/**
 * @param string $formattedName The
 *                              [name][google.cloud.security.privateca.v1.CertificateAuthority.name] of the
 *                              [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
 *                              to get. Please see
 *                              {@see CertificateAuthorityServiceClient::certificateAuthorityName()} for help formatting this field.
 */
function get_certificate_authority_sample(string $formattedName): void
{
    // Create a client.
    $certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();

    // Prepare the request message.
    $request = (new GetCertificateAuthorityRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var CertificateAuthority $response */
        $response = $certificateAuthorityServiceClient->getCertificateAuthority($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = CertificateAuthorityServiceClient::certificateAuthorityName(
        '[PROJECT]',
        '[LOCATION]',
        '[CA_POOL]',
        '[CERTIFICATE_AUTHORITY]'
    );

    get_certificate_authority_sample($formattedName);
}

getCertificateRevocationList

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\GetCertificateRevocationListRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\Security\PrivateCA\V1\CertificateRevocationList
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Security\PrivateCA\V1\CertificateRevocationList;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\GetCertificateRevocationListRequest;

/**
 * @param string $formattedName The
 *                              [name][google.cloud.security.privateca.v1.CertificateRevocationList.name]
 *                              of the
 *                              [CertificateRevocationList][google.cloud.security.privateca.v1.CertificateRevocationList]
 *                              to get. Please see
 *                              {@see CertificateAuthorityServiceClient::certificateRevocationListName()} for help formatting this field.
 */
function get_certificate_revocation_list_sample(string $formattedName): void
{
    // Create a client.
    $certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();

    // Prepare the request message.
    $request = (new GetCertificateRevocationListRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var CertificateRevocationList $response */
        $response = $certificateAuthorityServiceClient->getCertificateRevocationList($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = CertificateAuthorityServiceClient::certificateRevocationListName(
        '[PROJECT]',
        '[LOCATION]',
        '[CA_POOL]',
        '[CERTIFICATE_AUTHORITY]',
        '[CERTIFICATE_REVOCATION_LIST]'
    );

    get_certificate_revocation_list_sample($formattedName);
}

getCertificateTemplate

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\GetCertificateTemplateRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\Security\PrivateCA\V1\CertificateTemplate
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Security\PrivateCA\V1\CertificateTemplate;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\GetCertificateTemplateRequest;

/**
 * @param string $formattedName The
 *                              [name][google.cloud.security.privateca.v1.CertificateTemplate.name] of the
 *                              [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate]
 *                              to get. Please see
 *                              {@see CertificateAuthorityServiceClient::certificateTemplateName()} for help formatting this field.
 */
function get_certificate_template_sample(string $formattedName): void
{
    // Create a client.
    $certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();

    // Prepare the request message.
    $request = (new GetCertificateTemplateRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var CertificateTemplate $response */
        $response = $certificateAuthorityServiceClient->getCertificateTemplate($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = CertificateAuthorityServiceClient::certificateTemplateName(
        '[PROJECT]',
        '[LOCATION]',
        '[CERTIFICATE_TEMPLATE]'
    );

    get_certificate_template_sample($formattedName);
}

listCaPools

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\ListCaPoolsRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Security\PrivateCA\V1\CaPool;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\ListCaPoolsRequest;

/**
 * @param string $formattedParent The resource name of the location associated with the
 *                                [CaPools][google.cloud.security.privateca.v1.CaPool], in the format
 *                                `projects/*/locations/*`. Please see
 *                                {@see CertificateAuthorityServiceClient::locationName()} for help formatting this field.
 */
function list_ca_pools_sample(string $formattedParent): void
{
    // Create a client.
    $certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();

    // Prepare the request message.
    $request = (new ListCaPoolsRequest())
        ->setParent($formattedParent);

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $certificateAuthorityServiceClient->listCaPools($request);

        /** @var CaPool $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = CertificateAuthorityServiceClient::locationName('[PROJECT]', '[LOCATION]');

    list_ca_pools_sample($formattedParent);
}

listCertificateAuthorities

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\ListCertificateAuthoritiesRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Security\PrivateCA\V1\CertificateAuthority;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\ListCertificateAuthoritiesRequest;

/**
 * @param string $formattedParent The resource name of the
 *                                [CaPool][google.cloud.security.privateca.v1.CaPool] associated with the
 *                                [CertificateAuthorities][google.cloud.security.privateca.v1.CertificateAuthority],
 *                                in the format `projects/*/locations/*/caPools/*`. Please see
 *                                {@see CertificateAuthorityServiceClient::caPoolName()} for help formatting this field.
 */
function list_certificate_authorities_sample(string $formattedParent): void
{
    // Create a client.
    $certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();

    // Prepare the request message.
    $request = (new ListCertificateAuthoritiesRequest())
        ->setParent($formattedParent);

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $certificateAuthorityServiceClient->listCertificateAuthorities($request);

        /** @var CertificateAuthority $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = CertificateAuthorityServiceClient::caPoolName(
        '[PROJECT]',
        '[LOCATION]',
        '[CA_POOL]'
    );

    list_certificate_authorities_sample($formattedParent);
}

listCertificateRevocationLists

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\ListCertificateRevocationListsRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Security\PrivateCA\V1\CertificateRevocationList;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\ListCertificateRevocationListsRequest;

/**
 * @param string $formattedParent The resource name of the location associated with the
 *                                [CertificateRevocationLists][google.cloud.security.privateca.v1.CertificateRevocationList],
 *                                in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. Please see
 *                                {@see CertificateAuthorityServiceClient::certificateAuthorityName()} for help formatting this field.
 */
function list_certificate_revocation_lists_sample(string $formattedParent): void
{
    // Create a client.
    $certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();

    // Prepare the request message.
    $request = (new ListCertificateRevocationListsRequest())
        ->setParent($formattedParent);

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $certificateAuthorityServiceClient->listCertificateRevocationLists($request);

        /** @var CertificateRevocationList $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = CertificateAuthorityServiceClient::certificateAuthorityName(
        '[PROJECT]',
        '[LOCATION]',
        '[CA_POOL]',
        '[CERTIFICATE_AUTHORITY]'
    );

    list_certificate_revocation_lists_sample($formattedParent);
}

listCertificateTemplates

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\ListCertificateTemplatesRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Security\PrivateCA\V1\CertificateTemplate;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\ListCertificateTemplatesRequest;

/**
 * @param string $formattedParent The resource name of the location associated with the
 *                                [CertificateTemplates][google.cloud.security.privateca.v1.CertificateTemplate],
 *                                in the format `projects/*/locations/*`. Please see
 *                                {@see CertificateAuthorityServiceClient::locationName()} for help formatting this field.
 */
function list_certificate_templates_sample(string $formattedParent): void
{
    // Create a client.
    $certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();

    // Prepare the request message.
    $request = (new ListCertificateTemplatesRequest())
        ->setParent($formattedParent);

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $certificateAuthorityServiceClient->listCertificateTemplates($request);

        /** @var CertificateTemplate $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = CertificateAuthorityServiceClient::locationName('[PROJECT]', '[LOCATION]');

    list_certificate_templates_sample($formattedParent);
}

listCertificates

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\ListCertificatesRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Security\PrivateCA\V1\Certificate;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\ListCertificatesRequest;

/**
 * @param string $formattedParent The resource name of the location associated with the
 *                                [Certificates][google.cloud.security.privateca.v1.Certificate], in the
 *                                format `projects/*/locations/*/caPools/*`. Please see
 *                                {@see CertificateAuthorityServiceClient::caPoolName()} for help formatting this field.
 */
function list_certificates_sample(string $formattedParent): void
{
    // Create a client.
    $certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();

    // Prepare the request message.
    $request = (new ListCertificatesRequest())
        ->setParent($formattedParent);

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $certificateAuthorityServiceClient->listCertificates($request);

        /** @var Certificate $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = CertificateAuthorityServiceClient::caPoolName(
        '[PROJECT]',
        '[LOCATION]',
        '[CA_POOL]'
    );

    list_certificates_sample($formattedParent);
}

revokeCertificate

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\RevokeCertificateRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\Security\PrivateCA\V1\Certificate
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Security\PrivateCA\V1\Certificate;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\RevocationReason;
use Google\Cloud\Security\PrivateCA\V1\RevokeCertificateRequest;

/**
 * @param string $formattedName The resource name for this
 *                              [Certificate][google.cloud.security.privateca.v1.Certificate] in the format
 *                              `projects/*/locations/*/caPools/*/certificates/*`. Please see
 *                              {@see CertificateAuthorityServiceClient::certificateName()} for help formatting this field.
 * @param int    $reason        The
 *                              [RevocationReason][google.cloud.security.privateca.v1.RevocationReason] for
 *                              revoking this certificate.
 */
function revoke_certificate_sample(string $formattedName, int $reason): void
{
    // Create a client.
    $certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();

    // Prepare the request message.
    $request = (new RevokeCertificateRequest())
        ->setName($formattedName)
        ->setReason($reason);

    // Call the API and handle any network failures.
    try {
        /** @var Certificate $response */
        $response = $certificateAuthorityServiceClient->revokeCertificate($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = CertificateAuthorityServiceClient::certificateName(
        '[PROJECT]',
        '[LOCATION]',
        '[CA_POOL]',
        '[CERTIFICATE]'
    );
    $reason = RevocationReason::REVOCATION_REASON_UNSPECIFIED;

    revoke_certificate_sample($formattedName, $reason);
}

undeleteCertificateAuthority

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\UndeleteCertificateAuthorityRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Security\PrivateCA\V1\CertificateAuthority;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\UndeleteCertificateAuthorityRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedName The resource name for this
 *                              [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
 *                              in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`. Please see
 *                              {@see CertificateAuthorityServiceClient::certificateAuthorityName()} for help formatting this field.
 */
function undelete_certificate_authority_sample(string $formattedName): void
{
    // Create a client.
    $certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();

    // Prepare the request message.
    $request = (new UndeleteCertificateAuthorityRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $certificateAuthorityServiceClient->undeleteCertificateAuthority($request);
        $response->pollUntilComplete();

        if ($response->operationSucceeded()) {
            /** @var CertificateAuthority $result */
            $result = $response->getResult();
            printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
        } else {
            /** @var Status $error */
            $error = $response->getError();
            printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = CertificateAuthorityServiceClient::certificateAuthorityName(
        '[PROJECT]',
        '[LOCATION]',
        '[CA_POOL]',
        '[CERTIFICATE_AUTHORITY]'
    );

    undelete_certificate_authority_sample($formattedName);
}

updateCaPool

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\UpdateCaPoolRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Security\PrivateCA\V1\CaPool;
use Google\Cloud\Security\PrivateCA\V1\CaPool\Tier;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\UpdateCaPoolRequest;
use Google\Protobuf\FieldMask;
use Google\Rpc\Status;

/**
 * @param int $caPoolTier Immutable. The
 *                        [Tier][google.cloud.security.privateca.v1.CaPool.Tier] of this
 *                        [CaPool][google.cloud.security.privateca.v1.CaPool].
 */
function update_ca_pool_sample(int $caPoolTier): void
{
    // Create a client.
    $certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();

    // Prepare the request message.
    $caPool = (new CaPool())
        ->setTier($caPoolTier);
    $updateMask = new FieldMask();
    $request = (new UpdateCaPoolRequest())
        ->setCaPool($caPool)
        ->setUpdateMask($updateMask);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $certificateAuthorityServiceClient->updateCaPool($request);
        $response->pollUntilComplete();

        if ($response->operationSucceeded()) {
            /** @var CaPool $result */
            $result = $response->getResult();
            printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
        } else {
            /** @var Status $error */
            $error = $response->getError();
            printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $caPoolTier = Tier::TIER_UNSPECIFIED;

    update_ca_pool_sample($caPoolTier);
}

updateCertificate

Update a Certificate.

Currently, the only field you can update is the labels field.

The async variant is Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient::updateCertificateAsync() .

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\UpdateCertificateRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\Security\PrivateCA\V1\Certificate
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Security\PrivateCA\V1\Certificate;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\UpdateCertificateRequest;
use Google\Protobuf\Duration;
use Google\Protobuf\FieldMask;

/**
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function update_certificate_sample(): void
{
    // Create a client.
    $certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();

    // Prepare the request message.
    $certificateLifetime = new Duration();
    $certificate = (new Certificate())
        ->setLifetime($certificateLifetime);
    $updateMask = new FieldMask();
    $request = (new UpdateCertificateRequest())
        ->setCertificate($certificate)
        ->setUpdateMask($updateMask);

    // Call the API and handle any network failures.
    try {
        /** @var Certificate $response */
        $response = $certificateAuthorityServiceClient->updateCertificate($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

updateCertificateAuthority

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\UpdateCertificateAuthorityRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Security\PrivateCA\V1\CertificateAuthority;
use Google\Cloud\Security\PrivateCA\V1\CertificateAuthority\KeyVersionSpec;
use Google\Cloud\Security\PrivateCA\V1\CertificateAuthority\Type;
use Google\Cloud\Security\PrivateCA\V1\CertificateConfig;
use Google\Cloud\Security\PrivateCA\V1\CertificateConfig\SubjectConfig;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\Subject;
use Google\Cloud\Security\PrivateCA\V1\UpdateCertificateAuthorityRequest;
use Google\Cloud\Security\PrivateCA\V1\X509Parameters;
use Google\Protobuf\Duration;
use Google\Protobuf\FieldMask;
use Google\Rpc\Status;

/**
 * @param int $certificateAuthorityType Immutable. The
 *                                      [Type][google.cloud.security.privateca.v1.CertificateAuthority.Type] of
 *                                      this
 *                                      [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority].
 */
function update_certificate_authority_sample(int $certificateAuthorityType): void
{
    // Create a client.
    $certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();

    // Prepare the request message.
    $certificateAuthorityConfigSubjectConfigSubject = new Subject();
    $certificateAuthorityConfigSubjectConfig = (new SubjectConfig())
        ->setSubject($certificateAuthorityConfigSubjectConfigSubject);
    $certificateAuthorityConfigX509Config = new X509Parameters();
    $certificateAuthorityConfig = (new CertificateConfig())
        ->setSubjectConfig($certificateAuthorityConfigSubjectConfig)
        ->setX509Config($certificateAuthorityConfigX509Config);
    $certificateAuthorityLifetime = new Duration();
    $certificateAuthorityKeySpec = new KeyVersionSpec();
    $certificateAuthority = (new CertificateAuthority())
        ->setType($certificateAuthorityType)
        ->setConfig($certificateAuthorityConfig)
        ->setLifetime($certificateAuthorityLifetime)
        ->setKeySpec($certificateAuthorityKeySpec);
    $updateMask = new FieldMask();
    $request = (new UpdateCertificateAuthorityRequest())
        ->setCertificateAuthority($certificateAuthority)
        ->setUpdateMask($updateMask);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $certificateAuthorityServiceClient->updateCertificateAuthority($request);
        $response->pollUntilComplete();

        if ($response->operationSucceeded()) {
            /** @var CertificateAuthority $result */
            $result = $response->getResult();
            printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
        } else {
            /** @var Status $error */
            $error = $response->getError();
            printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $certificateAuthorityType = Type::TYPE_UNSPECIFIED;

    update_certificate_authority_sample($certificateAuthorityType);
}

updateCertificateRevocationList

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\UpdateCertificateRevocationListRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Security\PrivateCA\V1\CertificateRevocationList;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\UpdateCertificateRevocationListRequest;
use Google\Protobuf\FieldMask;
use Google\Rpc\Status;

/**
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function update_certificate_revocation_list_sample(): void
{
    // Create a client.
    $certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();

    // Prepare the request message.
    $certificateRevocationList = new CertificateRevocationList();
    $updateMask = new FieldMask();
    $request = (new UpdateCertificateRevocationListRequest())
        ->setCertificateRevocationList($certificateRevocationList)
        ->setUpdateMask($updateMask);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $certificateAuthorityServiceClient->updateCertificateRevocationList($request);
        $response->pollUntilComplete();

        if ($response->operationSucceeded()) {
            /** @var CertificateRevocationList $result */
            $result = $response->getResult();
            printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
        } else {
            /** @var Status $error */
            $error = $response->getError();
            printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

updateCertificateTemplate

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\UpdateCertificateTemplateRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Security\PrivateCA\V1\CertificateTemplate;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;
use Google\Cloud\Security\PrivateCA\V1\UpdateCertificateTemplateRequest;
use Google\Protobuf\FieldMask;
use Google\Rpc\Status;

/**
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function update_certificate_template_sample(): void
{
    // Create a client.
    $certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();

    // Prepare the request message.
    $certificateTemplate = new CertificateTemplate();
    $updateMask = new FieldMask();
    $request = (new UpdateCertificateTemplateRequest())
        ->setCertificateTemplate($certificateTemplate)
        ->setUpdateMask($updateMask);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $certificateAuthorityServiceClient->updateCertificateTemplate($request);
        $response->pollUntilComplete();

        if ($response->operationSucceeded()) {
            /** @var CertificateTemplate $result */
            $result = $response->getResult();
            printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
        } else {
            /** @var Status $error */
            $error = $response->getError();
            printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

getLocation

Parameters
NameDescription
request Google\Cloud\Location\GetLocationRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\Location\Location
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Location\GetLocationRequest;
use Google\Cloud\Location\Location;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;

/**
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function get_location_sample(): void
{
    // Create a client.
    $certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();

    // Prepare the request message.
    $request = new GetLocationRequest();

    // Call the API and handle any network failures.
    try {
        /** @var Location $response */
        $response = $certificateAuthorityServiceClient->getLocation($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

listLocations

Lists information about the supported locations for this service.

The async variant is Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient::listLocationsAsync() .

Parameters
NameDescription
request Google\Cloud\Location\ListLocationsRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Location\ListLocationsRequest;
use Google\Cloud\Location\Location;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;

/**
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function list_locations_sample(): void
{
    // Create a client.
    $certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();

    // Prepare the request message.
    $request = new ListLocationsRequest();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $certificateAuthorityServiceClient->listLocations($request);

        /** @var Location $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

getIamPolicy

Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.

The async variant is Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient::getIamPolicyAsync() .

Parameters
NameDescription
request Google\Cloud\Iam\V1\GetIamPolicyRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\Iam\V1\Policy
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Iam\V1\GetIamPolicyRequest;
use Google\Cloud\Iam\V1\Policy;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;

/**
 * @param string $resource REQUIRED: The resource for which the policy is being requested.
 *                         See the operation documentation for the appropriate value for this field.
 */
function get_iam_policy_sample(string $resource): void
{
    // Create a client.
    $certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();

    // Prepare the request message.
    $request = (new GetIamPolicyRequest())
        ->setResource($resource);

    // Call the API and handle any network failures.
    try {
        /** @var Policy $response */
        $response = $certificateAuthorityServiceClient->getIamPolicy($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $resource = '[RESOURCE]';

    get_iam_policy_sample($resource);
}

setIamPolicy

Sets the access control policy on the specified resource. Replaces any existing policy.

Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.

The async variant is Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient::setIamPolicyAsync() .

Parameters
NameDescription
request Google\Cloud\Iam\V1\SetIamPolicyRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\Iam\V1\Policy
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Iam\V1\Policy;
use Google\Cloud\Iam\V1\SetIamPolicyRequest;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;

/**
 * @param string $resource REQUIRED: The resource for which the policy is being specified.
 *                         See the operation documentation for the appropriate value for this field.
 */
function set_iam_policy_sample(string $resource): void
{
    // Create a client.
    $certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();

    // Prepare the request message.
    $policy = new Policy();
    $request = (new SetIamPolicyRequest())
        ->setResource($resource)
        ->setPolicy($policy);

    // Call the API and handle any network failures.
    try {
        /** @var Policy $response */
        $response = $certificateAuthorityServiceClient->setIamPolicy($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $resource = '[RESOURCE]';

    set_iam_policy_sample($resource);
}

testIamPermissions

Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.

Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

The async variant is Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient::testIamPermissionsAsync() .

Parameters
NameDescription
request Google\Cloud\Iam\V1\TestIamPermissionsRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\Iam\V1\TestIamPermissionsResponse
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Iam\V1\TestIamPermissionsRequest;
use Google\Cloud\Iam\V1\TestIamPermissionsResponse;
use Google\Cloud\Security\PrivateCA\V1\Client\CertificateAuthorityServiceClient;

/**
 * @param string $resource           REQUIRED: The resource for which the policy detail is being requested.
 *                                   See the operation documentation for the appropriate value for this field.
 * @param string $permissionsElement The set of permissions to check for the `resource`. Permissions with
 *                                   wildcards (such as '*' or 'storage.*') are not allowed. For more
 *                                   information see
 *                                   [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
 */
function test_iam_permissions_sample(string $resource, string $permissionsElement): void
{
    // Create a client.
    $certificateAuthorityServiceClient = new CertificateAuthorityServiceClient();

    // Prepare the request message.
    $permissions = [$permissionsElement,];
    $request = (new TestIamPermissionsRequest())
        ->setResource($resource)
        ->setPermissions($permissions);

    // Call the API and handle any network failures.
    try {
        /** @var TestIamPermissionsResponse $response */
        $response = $certificateAuthorityServiceClient->testIamPermissions($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $resource = '[RESOURCE]';
    $permissionsElement = '[PERMISSIONS]';

    test_iam_permissions_sample($resource, $permissionsElement);
}

activateCertificateAuthorityAsync

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\ActivateCertificateAuthorityRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

createCaPoolAsync

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\CreateCaPoolRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

createCertificateAsync

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\CreateCertificateRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

createCertificateAuthorityAsync

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\CreateCertificateAuthorityRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

createCertificateTemplateAsync

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\CreateCertificateTemplateRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

deleteCaPoolAsync

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\DeleteCaPoolRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

deleteCertificateAuthorityAsync

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\DeleteCertificateAuthorityRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

deleteCertificateTemplateAsync

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\DeleteCertificateTemplateRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

disableCertificateAuthorityAsync

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\DisableCertificateAuthorityRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

enableCertificateAuthorityAsync

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\EnableCertificateAuthorityRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

fetchCaCertsAsync

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\FetchCaCertsRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

fetchCertificateAuthorityCsrAsync

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\FetchCertificateAuthorityCsrRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getCaPoolAsync

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\GetCaPoolRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getCertificateAsync

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\GetCertificateRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getCertificateAuthorityAsync

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\GetCertificateAuthorityRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getCertificateRevocationListAsync

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\GetCertificateRevocationListRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getCertificateTemplateAsync

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\GetCertificateTemplateRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

listCaPoolsAsync

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\ListCaPoolsRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

listCertificateAuthoritiesAsync

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\ListCertificateAuthoritiesRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

listCertificateRevocationListsAsync

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\ListCertificateRevocationListsRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

listCertificateTemplatesAsync

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\ListCertificateTemplatesRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

listCertificatesAsync

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\ListCertificatesRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

revokeCertificateAsync

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\RevokeCertificateRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

undeleteCertificateAuthorityAsync

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\UndeleteCertificateAuthorityRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

updateCaPoolAsync

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\UpdateCaPoolRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

updateCertificateAsync

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\UpdateCertificateRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

updateCertificateAuthorityAsync

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\UpdateCertificateAuthorityRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

updateCertificateRevocationListAsync

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\UpdateCertificateRevocationListRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

updateCertificateTemplateAsync

Parameters
NameDescription
request Google\Cloud\Security\PrivateCA\V1\UpdateCertificateTemplateRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getLocationAsync

Parameters
NameDescription
request Google\Cloud\Location\GetLocationRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

listLocationsAsync

Parameters
NameDescription
request Google\Cloud\Location\ListLocationsRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getIamPolicyAsync

Parameters
NameDescription
request Google\Cloud\Iam\V1\GetIamPolicyRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

setIamPolicyAsync

Parameters
NameDescription
request Google\Cloud\Iam\V1\SetIamPolicyRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

testIamPermissionsAsync

Parameters
NameDescription
request Google\Cloud\Iam\V1\TestIamPermissionsRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getOperationsClient

Return an OperationsClient object with the same endpoint as $this.

Returns
TypeDescription
Google\ApiCore\LongRunning\OperationsClient

resumeOperation

Resume an existing long running operation that was previously started by a long running API method. If $methodName is not provided, or does not match a long running API method, then the operation can still be resumed, but the OperationResponse object will not deserialize the final response.

Parameters
NameDescription
operationName string

The name of the long running operation

methodName string

The name of the method used to start the operation

Returns
TypeDescription
Google\ApiCore\OperationResponse

static::caPoolName

Formats a string containing the fully-qualified path to represent a ca_pool resource.

Parameters
NameDescription
project string
location string
caPool string
Returns
TypeDescription
stringThe formatted ca_pool resource.

static::certificateName

Formats a string containing the fully-qualified path to represent a certificate resource.

Parameters
NameDescription
project string
location string
caPool string
certificate string
Returns
TypeDescription
stringThe formatted certificate resource.

static::certificateAuthorityName

Formats a string containing the fully-qualified path to represent a certificate_authority resource.

Parameters
NameDescription
project string
location string
caPool string
certificateAuthority string
Returns
TypeDescription
stringThe formatted certificate_authority resource.

static::certificateRevocationListName

Formats a string containing the fully-qualified path to represent a certificate_revocation_list resource.

Parameters
NameDescription
project string
location string
caPool string
certificateAuthority string
certificateRevocationList string
Returns
TypeDescription
stringThe formatted certificate_revocation_list resource.

static::certificateTemplateName

Formats a string containing the fully-qualified path to represent a certificate_template resource.

Parameters
NameDescription
project string
location string
certificateTemplate string
Returns
TypeDescription
stringThe formatted certificate_template resource.

static::locationName

Formats a string containing the fully-qualified path to represent a location resource.

Parameters
NameDescription
project string
location string
Returns
TypeDescription
stringThe formatted location resource.

static::parseName

Parses a formatted name string and returns an associative array of the components in the name.

The following name formats are supported: Template: Pattern

  • caPool: projects/{project}/locations/{location}/caPools/{ca_pool}
  • certificate: projects/{project}/locations/{location}/caPools/{ca_pool}/certificates/{certificate}
  • certificateAuthority: projects/{project}/locations/{location}/caPools/{ca_pool}/certificateAuthorities/{certificate_authority}
  • certificateRevocationList: projects/{project}/locations/{location}/caPools/{ca_pool}/certificateAuthorities/{certificate_authority}/certificateRevocationLists/{certificate_revocation_list}
  • certificateTemplate: projects/{project}/locations/{location}/certificateTemplates/{certificate_template}
  • location: projects/{project}/locations/{location}

The optional $template argument can be supplied to specify a particular pattern, and must match one of the templates listed above. If no $template argument is provided, or if the $template argument does not match one of the templates listed, then parseName will check each of the supported templates, and return the first match.

Parameters
NameDescription
formattedName string

The formatted name string

template string

Optional name of template to match

Returns
TypeDescription
arrayAn associative array from name component IDs to component values.