Google Cloud Certificate Manager V1 Client - Class CertificateManagerClient (0.7.3)

Reference documentation and code samples for the Google Cloud Certificate Manager V1 Client class CertificateManagerClient.

Service Description: API Overview

Certificates Manager API allows customers to see and manage all their TLS certificates.

Certificates Manager API service provides methods to manage certificates, group them into collections, and create serving configuration that can be easily applied to other Cloud resources e.g. Target Proxies.

Data Model

The Certificates Manager service exposes the following resources:

  • Certificate that describes a single TLS certificate.
  • CertificateMap that describes a collection of certificates that can be attached to a target resource.
  • CertificateMapEntry that describes a single configuration entry that consists of a SNI and a group of certificates. It's a subresource of CertificateMap.

Certificate, CertificateMap and CertificateMapEntry IDs have to fully match the regexp [a-z0-9-]{1,63}. In other words,

  • only lower case letters, digits, and hyphen are allowed
  • length of the resource ID has to be in [1,63] range.

Provides methods to manage Cloud Certificate Manager entities.

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 \ CertificateManager \ V1 \ Client

Methods

__construct

Constructor.

Parameters
Name Description
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.

createCertificate

Creates a new Certificate in a given project and location.

The async variant is Google\Cloud\CertificateManager\V1\Client\CertificateManagerClient::createCertificateAsync() .

Parameters
Name Description
request Google\Cloud\CertificateManager\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
Type Description
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\CertificateManager\V1\Certificate;
use Google\Cloud\CertificateManager\V1\Client\CertificateManagerClient;
use Google\Cloud\CertificateManager\V1\CreateCertificateRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedParent The parent resource of the certificate. Must be in the format
 *                                `projects/*/locations/*`. Please see
 *                                {@see CertificateManagerClient::locationName()} for help formatting this field.
 * @param string $certificateId   A user-provided name of the certificate.
 */
function create_certificate_sample(string $formattedParent, string $certificateId): void
{
    // Create a client.
    $certificateManagerClient = new CertificateManagerClient();

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

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

        if ($response->operationSucceeded()) {
            /** @var Certificate $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 = CertificateManagerClient::locationName('[PROJECT]', '[LOCATION]');
    $certificateId = '[CERTIFICATE_ID]';

    create_certificate_sample($formattedParent, $certificateId);
}

createCertificateIssuanceConfig

Creates a new CertificateIssuanceConfig in a given project and location.

The async variant is Google\Cloud\CertificateManager\V1\Client\CertificateManagerClient::createCertificateIssuanceConfigAsync() .

Parameters
Name Description
request Google\Cloud\CertificateManager\V1\CreateCertificateIssuanceConfigRequest

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
Type Description
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\CertificateManager\V1\CertificateIssuanceConfig;
use Google\Cloud\CertificateManager\V1\CertificateIssuanceConfig\CertificateAuthorityConfig;
use Google\Cloud\CertificateManager\V1\CertificateIssuanceConfig\KeyAlgorithm;
use Google\Cloud\CertificateManager\V1\Client\CertificateManagerClient;
use Google\Cloud\CertificateManager\V1\CreateCertificateIssuanceConfigRequest;
use Google\Protobuf\Duration;
use Google\Rpc\Status;

/**
 * @param string $formattedParent                                   The parent resource of the certificate issuance config. Must be
 *                                                                  in the format `projects/*/locations/*`. Please see
 *                                                                  {@see CertificateManagerClient::locationName()} for help formatting this field.
 * @param string $certificateIssuanceConfigId                       A user-provided name of the certificate config.
 * @param int    $certificateIssuanceConfigRotationWindowPercentage Specifies the percentage of elapsed time of the certificate
 *                                                                  lifetime to wait before renewing the certificate. Must be a number between
 *                                                                  1-99, inclusive.
 * @param int    $certificateIssuanceConfigKeyAlgorithm             The key algorithm to use when generating the private key.
 */
function create_certificate_issuance_config_sample(
    string $formattedParent,
    string $certificateIssuanceConfigId,
    int $certificateIssuanceConfigRotationWindowPercentage,
    int $certificateIssuanceConfigKeyAlgorithm
): void {
    // Create a client.
    $certificateManagerClient = new CertificateManagerClient();

    // Prepare the request message.
    $certificateIssuanceConfigCertificateAuthorityConfig = new CertificateAuthorityConfig();
    $certificateIssuanceConfigLifetime = new Duration();
    $certificateIssuanceConfig = (new CertificateIssuanceConfig())
        ->setCertificateAuthorityConfig($certificateIssuanceConfigCertificateAuthorityConfig)
        ->setLifetime($certificateIssuanceConfigLifetime)
        ->setRotationWindowPercentage($certificateIssuanceConfigRotationWindowPercentage)
        ->setKeyAlgorithm($certificateIssuanceConfigKeyAlgorithm);
    $request = (new CreateCertificateIssuanceConfigRequest())
        ->setParent($formattedParent)
        ->setCertificateIssuanceConfigId($certificateIssuanceConfigId)
        ->setCertificateIssuanceConfig($certificateIssuanceConfig);

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

        if ($response->operationSucceeded()) {
            /** @var CertificateIssuanceConfig $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 = CertificateManagerClient::locationName('[PROJECT]', '[LOCATION]');
    $certificateIssuanceConfigId = '[CERTIFICATE_ISSUANCE_CONFIG_ID]';
    $certificateIssuanceConfigRotationWindowPercentage = 0;
    $certificateIssuanceConfigKeyAlgorithm = KeyAlgorithm::KEY_ALGORITHM_UNSPECIFIED;

    create_certificate_issuance_config_sample(
        $formattedParent,
        $certificateIssuanceConfigId,
        $certificateIssuanceConfigRotationWindowPercentage,
        $certificateIssuanceConfigKeyAlgorithm
    );
}

createCertificateMap

Creates a new CertificateMap in a given project and location.

The async variant is Google\Cloud\CertificateManager\V1\Client\CertificateManagerClient::createCertificateMapAsync() .

Parameters
Name Description
request Google\Cloud\CertificateManager\V1\CreateCertificateMapRequest

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
Type Description
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\CertificateManager\V1\CertificateMap;
use Google\Cloud\CertificateManager\V1\Client\CertificateManagerClient;
use Google\Cloud\CertificateManager\V1\CreateCertificateMapRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedParent  The parent resource of the certificate map. Must be in the format
 *                                 `projects/*/locations/*`. Please see
 *                                 {@see CertificateManagerClient::locationName()} for help formatting this field.
 * @param string $certificateMapId A user-provided name of the certificate map.
 */
function create_certificate_map_sample(string $formattedParent, string $certificateMapId): void
{
    // Create a client.
    $certificateManagerClient = new CertificateManagerClient();

    // Prepare the request message.
    $certificateMap = new CertificateMap();
    $request = (new CreateCertificateMapRequest())
        ->setParent($formattedParent)
        ->setCertificateMapId($certificateMapId)
        ->setCertificateMap($certificateMap);

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

        if ($response->operationSucceeded()) {
            /** @var CertificateMap $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 = CertificateManagerClient::locationName('[PROJECT]', '[LOCATION]');
    $certificateMapId = '[CERTIFICATE_MAP_ID]';

    create_certificate_map_sample($formattedParent, $certificateMapId);
}

createCertificateMapEntry

Creates a new CertificateMapEntry in a given project and location.

The async variant is Google\Cloud\CertificateManager\V1\Client\CertificateManagerClient::createCertificateMapEntryAsync() .

Parameters
Name Description
request Google\Cloud\CertificateManager\V1\CreateCertificateMapEntryRequest

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
Type Description
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\CertificateManager\V1\CertificateMapEntry;
use Google\Cloud\CertificateManager\V1\Client\CertificateManagerClient;
use Google\Cloud\CertificateManager\V1\CreateCertificateMapEntryRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedParent       The parent resource of the certificate map entry. Must be in the
 *                                      format `projects/*/locations/*/certificateMaps/*`. Please see
 *                                      {@see CertificateManagerClient::certificateMapName()} for help formatting this field.
 * @param string $certificateMapEntryId A user-provided name of the certificate map entry.
 */
function create_certificate_map_entry_sample(
    string $formattedParent,
    string $certificateMapEntryId
): void {
    // Create a client.
    $certificateManagerClient = new CertificateManagerClient();

    // Prepare the request message.
    $certificateMapEntry = new CertificateMapEntry();
    $request = (new CreateCertificateMapEntryRequest())
        ->setParent($formattedParent)
        ->setCertificateMapEntryId($certificateMapEntryId)
        ->setCertificateMapEntry($certificateMapEntry);

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

        if ($response->operationSucceeded()) {
            /** @var CertificateMapEntry $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 = CertificateManagerClient::certificateMapName(
        '[PROJECT]',
        '[LOCATION]',
        '[CERTIFICATE_MAP]'
    );
    $certificateMapEntryId = '[CERTIFICATE_MAP_ENTRY_ID]';

    create_certificate_map_entry_sample($formattedParent, $certificateMapEntryId);
}

createDnsAuthorization

Creates a new DnsAuthorization in a given project and location.

The async variant is Google\Cloud\CertificateManager\V1\Client\CertificateManagerClient::createDnsAuthorizationAsync() .

Parameters
Name Description
request Google\Cloud\CertificateManager\V1\CreateDnsAuthorizationRequest

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
Type Description
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\CertificateManager\V1\Client\CertificateManagerClient;
use Google\Cloud\CertificateManager\V1\CreateDnsAuthorizationRequest;
use Google\Cloud\CertificateManager\V1\DnsAuthorization;
use Google\Rpc\Status;

/**
 * @param string $formattedParent        The parent resource of the dns authorization. Must be in the
 *                                       format `projects/*/locations/*`. Please see
 *                                       {@see CertificateManagerClient::locationName()} for help formatting this field.
 * @param string $dnsAuthorizationId     A user-provided name of the dns authorization.
 * @param string $dnsAuthorizationDomain Immutable. A domain that is being authorized. A DnsAuthorization
 *                                       resource covers a single domain and its wildcard, e.g. authorization for
 *                                       `example.com` can be used to issue certificates for `example.com` and
 *                                       `*.example.com`.
 */
function create_dns_authorization_sample(
    string $formattedParent,
    string $dnsAuthorizationId,
    string $dnsAuthorizationDomain
): void {
    // Create a client.
    $certificateManagerClient = new CertificateManagerClient();

    // Prepare the request message.
    $dnsAuthorization = (new DnsAuthorization())
        ->setDomain($dnsAuthorizationDomain);
    $request = (new CreateDnsAuthorizationRequest())
        ->setParent($formattedParent)
        ->setDnsAuthorizationId($dnsAuthorizationId)
        ->setDnsAuthorization($dnsAuthorization);

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

        if ($response->operationSucceeded()) {
            /** @var DnsAuthorization $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 = CertificateManagerClient::locationName('[PROJECT]', '[LOCATION]');
    $dnsAuthorizationId = '[DNS_AUTHORIZATION_ID]';
    $dnsAuthorizationDomain = '[DOMAIN]';

    create_dns_authorization_sample($formattedParent, $dnsAuthorizationId, $dnsAuthorizationDomain);
}

createTrustConfig

Creates a new TrustConfig in a given project and location.

The async variant is Google\Cloud\CertificateManager\V1\Client\CertificateManagerClient::createTrustConfigAsync() .

Parameters
Name Description
request Google\Cloud\CertificateManager\V1\CreateTrustConfigRequest

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
Type Description
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\CertificateManager\V1\Client\CertificateManagerClient;
use Google\Cloud\CertificateManager\V1\CreateTrustConfigRequest;
use Google\Cloud\CertificateManager\V1\TrustConfig;
use Google\Rpc\Status;

/**
 * @param string $formattedParent The parent resource of the TrustConfig. Must be in the format
 *                                `projects/*/locations/*`. Please see
 *                                {@see CertificateManagerClient::locationName()} for help formatting this field.
 * @param string $trustConfigId   A user-provided name of the TrustConfig. Must match the regexp
 *                                `[a-z0-9-]{1,63}`.
 */
function create_trust_config_sample(string $formattedParent, string $trustConfigId): void
{
    // Create a client.
    $certificateManagerClient = new CertificateManagerClient();

    // Prepare the request message.
    $trustConfig = new TrustConfig();
    $request = (new CreateTrustConfigRequest())
        ->setParent($formattedParent)
        ->setTrustConfigId($trustConfigId)
        ->setTrustConfig($trustConfig);

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

        if ($response->operationSucceeded()) {
            /** @var TrustConfig $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 = CertificateManagerClient::locationName('[PROJECT]', '[LOCATION]');
    $trustConfigId = '[TRUST_CONFIG_ID]';

    create_trust_config_sample($formattedParent, $trustConfigId);
}

deleteCertificate

Parameters
Name Description
request Google\Cloud\CertificateManager\V1\DeleteCertificateRequest

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
Type Description
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\CertificateManager\V1\Client\CertificateManagerClient;
use Google\Cloud\CertificateManager\V1\DeleteCertificateRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedName A name of the certificate to delete. Must be in the format
 *                              `projects/*/locations/*/certificates/*`. Please see
 *                              {@see CertificateManagerClient::certificateName()} for help formatting this field.
 */
function delete_certificate_sample(string $formattedName): void
{
    // Create a client.
    $certificateManagerClient = new CertificateManagerClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $certificateManagerClient->deleteCertificate($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 = CertificateManagerClient::certificateName(
        '[PROJECT]',
        '[LOCATION]',
        '[CERTIFICATE]'
    );

    delete_certificate_sample($formattedName);
}

deleteCertificateIssuanceConfig

Parameters
Name Description
request Google\Cloud\CertificateManager\V1\DeleteCertificateIssuanceConfigRequest

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
Type Description
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\CertificateManager\V1\Client\CertificateManagerClient;
use Google\Cloud\CertificateManager\V1\DeleteCertificateIssuanceConfigRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedName A name of the certificate issuance config to delete. Must be in
 *                              the format `projects/*/locations/*/certificateIssuanceConfigs/*`. Please see
 *                              {@see CertificateManagerClient::certificateIssuanceConfigName()} for help formatting this field.
 */
function delete_certificate_issuance_config_sample(string $formattedName): void
{
    // Create a client.
    $certificateManagerClient = new CertificateManagerClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $certificateManagerClient->deleteCertificateIssuanceConfig($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 = CertificateManagerClient::certificateIssuanceConfigName(
        '[PROJECT]',
        '[LOCATION]',
        '[CERTIFICATE_ISSUANCE_CONFIG]'
    );

    delete_certificate_issuance_config_sample($formattedName);
}

deleteCertificateMap

Deletes a single CertificateMap. A Certificate Map can't be deleted if it contains Certificate Map Entries. Remove all the entries from the map before calling this method.

The async variant is Google\Cloud\CertificateManager\V1\Client\CertificateManagerClient::deleteCertificateMapAsync() .

Parameters
Name Description
request Google\Cloud\CertificateManager\V1\DeleteCertificateMapRequest

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
Type Description
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\CertificateManager\V1\Client\CertificateManagerClient;
use Google\Cloud\CertificateManager\V1\DeleteCertificateMapRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedName A name of the certificate map to delete. Must be in the format
 *                              `projects/*/locations/*/certificateMaps/*`. Please see
 *                              {@see CertificateManagerClient::certificateMapName()} for help formatting this field.
 */
function delete_certificate_map_sample(string $formattedName): void
{
    // Create a client.
    $certificateManagerClient = new CertificateManagerClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $certificateManagerClient->deleteCertificateMap($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 = CertificateManagerClient::certificateMapName(
        '[PROJECT]',
        '[LOCATION]',
        '[CERTIFICATE_MAP]'
    );

    delete_certificate_map_sample($formattedName);
}

deleteCertificateMapEntry

Parameters
Name Description
request Google\Cloud\CertificateManager\V1\DeleteCertificateMapEntryRequest

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
Type Description
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\CertificateManager\V1\Client\CertificateManagerClient;
use Google\Cloud\CertificateManager\V1\DeleteCertificateMapEntryRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedName A name of the certificate map entry to delete. Must be in the
 *                              format `projects/*/locations/*/certificateMaps/*/certificateMapEntries/*`. Please see
 *                              {@see CertificateManagerClient::certificateMapEntryName()} for help formatting this field.
 */
function delete_certificate_map_entry_sample(string $formattedName): void
{
    // Create a client.
    $certificateManagerClient = new CertificateManagerClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $certificateManagerClient->deleteCertificateMapEntry($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 = CertificateManagerClient::certificateMapEntryName(
        '[PROJECT]',
        '[LOCATION]',
        '[CERTIFICATE_MAP]',
        '[CERTIFICATE_MAP_ENTRY]'
    );

    delete_certificate_map_entry_sample($formattedName);
}

deleteDnsAuthorization

Parameters
Name Description
request Google\Cloud\CertificateManager\V1\DeleteDnsAuthorizationRequest

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
Type Description
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\CertificateManager\V1\Client\CertificateManagerClient;
use Google\Cloud\CertificateManager\V1\DeleteDnsAuthorizationRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedName A name of the dns authorization to delete. Must be in the format
 *                              `projects/*/locations/*/dnsAuthorizations/*`. Please see
 *                              {@see CertificateManagerClient::dnsAuthorizationName()} for help formatting this field.
 */
function delete_dns_authorization_sample(string $formattedName): void
{
    // Create a client.
    $certificateManagerClient = new CertificateManagerClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $certificateManagerClient->deleteDnsAuthorization($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 = CertificateManagerClient::dnsAuthorizationName(
        '[PROJECT]',
        '[LOCATION]',
        '[DNS_AUTHORIZATION]'
    );

    delete_dns_authorization_sample($formattedName);
}

deleteTrustConfig

Parameters
Name Description
request Google\Cloud\CertificateManager\V1\DeleteTrustConfigRequest

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
Type Description
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\CertificateManager\V1\Client\CertificateManagerClient;
use Google\Cloud\CertificateManager\V1\DeleteTrustConfigRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedName A name of the TrustConfig to delete. Must be in the format
 *                              `projects/*/locations/*/trustConfigs/*`. Please see
 *                              {@see CertificateManagerClient::trustConfigName()} for help formatting this field.
 */
function delete_trust_config_sample(string $formattedName): void
{
    // Create a client.
    $certificateManagerClient = new CertificateManagerClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $certificateManagerClient->deleteTrustConfig($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 = CertificateManagerClient::trustConfigName(
        '[PROJECT]',
        '[LOCATION]',
        '[TRUST_CONFIG]'
    );

    delete_trust_config_sample($formattedName);
}

getCertificate

Gets details of a single Certificate.

The async variant is Google\Cloud\CertificateManager\V1\Client\CertificateManagerClient::getCertificateAsync() .

Parameters
Name Description
request Google\Cloud\CertificateManager\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
Type Description
Google\Cloud\CertificateManager\V1\Certificate
Example
use Google\ApiCore\ApiException;
use Google\Cloud\CertificateManager\V1\Certificate;
use Google\Cloud\CertificateManager\V1\Client\CertificateManagerClient;
use Google\Cloud\CertificateManager\V1\GetCertificateRequest;

/**
 * @param string $formattedName A name of the certificate to describe. Must be in the format
 *                              `projects/*/locations/*/certificates/*`. Please see
 *                              {@see CertificateManagerClient::certificateName()} for help formatting this field.
 */
function get_certificate_sample(string $formattedName): void
{
    // Create a client.
    $certificateManagerClient = new CertificateManagerClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var Certificate $response */
        $response = $certificateManagerClient->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 = CertificateManagerClient::certificateName(
        '[PROJECT]',
        '[LOCATION]',
        '[CERTIFICATE]'
    );

    get_certificate_sample($formattedName);
}

getCertificateIssuanceConfig

Gets details of a single CertificateIssuanceConfig.

The async variant is Google\Cloud\CertificateManager\V1\Client\CertificateManagerClient::getCertificateIssuanceConfigAsync() .

Parameters
Name Description
request Google\Cloud\CertificateManager\V1\GetCertificateIssuanceConfigRequest

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
Type Description
Google\Cloud\CertificateManager\V1\CertificateIssuanceConfig
Example
use Google\ApiCore\ApiException;
use Google\Cloud\CertificateManager\V1\CertificateIssuanceConfig;
use Google\Cloud\CertificateManager\V1\Client\CertificateManagerClient;
use Google\Cloud\CertificateManager\V1\GetCertificateIssuanceConfigRequest;

/**
 * @param string $formattedName A name of the certificate issuance config to describe. Must be in
 *                              the format `projects/*/locations/*/certificateIssuanceConfigs/*`. Please see
 *                              {@see CertificateManagerClient::certificateIssuanceConfigName()} for help formatting this field.
 */
function get_certificate_issuance_config_sample(string $formattedName): void
{
    // Create a client.
    $certificateManagerClient = new CertificateManagerClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var CertificateIssuanceConfig $response */
        $response = $certificateManagerClient->getCertificateIssuanceConfig($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 = CertificateManagerClient::certificateIssuanceConfigName(
        '[PROJECT]',
        '[LOCATION]',
        '[CERTIFICATE_ISSUANCE_CONFIG]'
    );

    get_certificate_issuance_config_sample($formattedName);
}

getCertificateMap

Gets details of a single CertificateMap.

The async variant is Google\Cloud\CertificateManager\V1\Client\CertificateManagerClient::getCertificateMapAsync() .

Parameters
Name Description
request Google\Cloud\CertificateManager\V1\GetCertificateMapRequest

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
Type Description
Google\Cloud\CertificateManager\V1\CertificateMap
Example
use Google\ApiCore\ApiException;
use Google\Cloud\CertificateManager\V1\CertificateMap;
use Google\Cloud\CertificateManager\V1\Client\CertificateManagerClient;
use Google\Cloud\CertificateManager\V1\GetCertificateMapRequest;

/**
 * @param string $formattedName A name of the certificate map to describe. Must be in the format
 *                              `projects/*/locations/*/certificateMaps/*`. Please see
 *                              {@see CertificateManagerClient::certificateMapName()} for help formatting this field.
 */
function get_certificate_map_sample(string $formattedName): void
{
    // Create a client.
    $certificateManagerClient = new CertificateManagerClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var CertificateMap $response */
        $response = $certificateManagerClient->getCertificateMap($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 = CertificateManagerClient::certificateMapName(
        '[PROJECT]',
        '[LOCATION]',
        '[CERTIFICATE_MAP]'
    );

    get_certificate_map_sample($formattedName);
}

getCertificateMapEntry

Gets details of a single CertificateMapEntry.

The async variant is Google\Cloud\CertificateManager\V1\Client\CertificateManagerClient::getCertificateMapEntryAsync() .

Parameters
Name Description
request Google\Cloud\CertificateManager\V1\GetCertificateMapEntryRequest

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
Type Description
Google\Cloud\CertificateManager\V1\CertificateMapEntry
Example
use Google\ApiCore\ApiException;
use Google\Cloud\CertificateManager\V1\CertificateMapEntry;
use Google\Cloud\CertificateManager\V1\Client\CertificateManagerClient;
use Google\Cloud\CertificateManager\V1\GetCertificateMapEntryRequest;

/**
 * @param string $formattedName A name of the certificate map entry to describe. Must be in the
 *                              format `projects/*/locations/*/certificateMaps/*/certificateMapEntries/*`. Please see
 *                              {@see CertificateManagerClient::certificateMapEntryName()} for help formatting this field.
 */
function get_certificate_map_entry_sample(string $formattedName): void
{
    // Create a client.
    $certificateManagerClient = new CertificateManagerClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var CertificateMapEntry $response */
        $response = $certificateManagerClient->getCertificateMapEntry($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 = CertificateManagerClient::certificateMapEntryName(
        '[PROJECT]',
        '[LOCATION]',
        '[CERTIFICATE_MAP]',
        '[CERTIFICATE_MAP_ENTRY]'
    );

    get_certificate_map_entry_sample($formattedName);
}

getDnsAuthorization

Gets details of a single DnsAuthorization.

The async variant is Google\Cloud\CertificateManager\V1\Client\CertificateManagerClient::getDnsAuthorizationAsync() .

Parameters
Name Description
request Google\Cloud\CertificateManager\V1\GetDnsAuthorizationRequest

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
Type Description
Google\Cloud\CertificateManager\V1\DnsAuthorization
Example
use Google\ApiCore\ApiException;
use Google\Cloud\CertificateManager\V1\Client\CertificateManagerClient;
use Google\Cloud\CertificateManager\V1\DnsAuthorization;
use Google\Cloud\CertificateManager\V1\GetDnsAuthorizationRequest;

/**
 * @param string $formattedName A name of the dns authorization to describe. Must be in the
 *                              format `projects/*/locations/*/dnsAuthorizations/*`. Please see
 *                              {@see CertificateManagerClient::dnsAuthorizationName()} for help formatting this field.
 */
function get_dns_authorization_sample(string $formattedName): void
{
    // Create a client.
    $certificateManagerClient = new CertificateManagerClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var DnsAuthorization $response */
        $response = $certificateManagerClient->getDnsAuthorization($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 = CertificateManagerClient::dnsAuthorizationName(
        '[PROJECT]',
        '[LOCATION]',
        '[DNS_AUTHORIZATION]'
    );

    get_dns_authorization_sample($formattedName);
}

getTrustConfig

Gets details of a single TrustConfig.

The async variant is Google\Cloud\CertificateManager\V1\Client\CertificateManagerClient::getTrustConfigAsync() .

Parameters
Name Description
request Google\Cloud\CertificateManager\V1\GetTrustConfigRequest

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
Type Description
Google\Cloud\CertificateManager\V1\TrustConfig
Example
use Google\ApiCore\ApiException;
use Google\Cloud\CertificateManager\V1\Client\CertificateManagerClient;
use Google\Cloud\CertificateManager\V1\GetTrustConfigRequest;
use Google\Cloud\CertificateManager\V1\TrustConfig;

/**
 * @param string $formattedName A name of the TrustConfig to describe. Must be in the format
 *                              `projects/*/locations/*/trustConfigs/*`. Please see
 *                              {@see CertificateManagerClient::trustConfigName()} for help formatting this field.
 */
function get_trust_config_sample(string $formattedName): void
{
    // Create a client.
    $certificateManagerClient = new CertificateManagerClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var TrustConfig $response */
        $response = $certificateManagerClient->getTrustConfig($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 = CertificateManagerClient::trustConfigName(
        '[PROJECT]',
        '[LOCATION]',
        '[TRUST_CONFIG]'
    );

    get_trust_config_sample($formattedName);
}

listCertificateIssuanceConfigs

Lists CertificateIssuanceConfigs in a given project and location.

The async variant is Google\Cloud\CertificateManager\V1\Client\CertificateManagerClient::listCertificateIssuanceConfigsAsync() .

Parameters
Name Description
request Google\Cloud\CertificateManager\V1\ListCertificateIssuanceConfigsRequest

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
Type Description
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\CertificateManager\V1\CertificateIssuanceConfig;
use Google\Cloud\CertificateManager\V1\Client\CertificateManagerClient;
use Google\Cloud\CertificateManager\V1\ListCertificateIssuanceConfigsRequest;

/**
 * @param string $formattedParent The project and location from which the certificate should be
 *                                listed, specified in the format `projects/*/locations/*`. Please see
 *                                {@see CertificateManagerClient::locationName()} for help formatting this field.
 */
function list_certificate_issuance_configs_sample(string $formattedParent): void
{
    // Create a client.
    $certificateManagerClient = new CertificateManagerClient();

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

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

        /** @var CertificateIssuanceConfig $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 = CertificateManagerClient::locationName('[PROJECT]', '[LOCATION]');

    list_certificate_issuance_configs_sample($formattedParent);
}

listCertificateMapEntries

Lists CertificateMapEntries in a given project and location.

The async variant is Google\Cloud\CertificateManager\V1\Client\CertificateManagerClient::listCertificateMapEntriesAsync() .

Parameters
Name Description
request Google\Cloud\CertificateManager\V1\ListCertificateMapEntriesRequest

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
Type Description
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\CertificateManager\V1\CertificateMapEntry;
use Google\Cloud\CertificateManager\V1\Client\CertificateManagerClient;
use Google\Cloud\CertificateManager\V1\ListCertificateMapEntriesRequest;

/**
 * @param string $formattedParent The project, location and certificate map from which the
 *                                certificate map entries should be listed, specified in the format
 *                                `projects/*/locations/*/certificateMaps/*`. Please see
 *                                {@see CertificateManagerClient::certificateMapName()} for help formatting this field.
 */
function list_certificate_map_entries_sample(string $formattedParent): void
{
    // Create a client.
    $certificateManagerClient = new CertificateManagerClient();

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

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

        /** @var CertificateMapEntry $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 = CertificateManagerClient::certificateMapName(
        '[PROJECT]',
        '[LOCATION]',
        '[CERTIFICATE_MAP]'
    );

    list_certificate_map_entries_sample($formattedParent);
}

listCertificateMaps

Lists CertificateMaps in a given project and location.

The async variant is Google\Cloud\CertificateManager\V1\Client\CertificateManagerClient::listCertificateMapsAsync() .

Parameters
Name Description
request Google\Cloud\CertificateManager\V1\ListCertificateMapsRequest

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
Type Description
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\CertificateManager\V1\CertificateMap;
use Google\Cloud\CertificateManager\V1\Client\CertificateManagerClient;
use Google\Cloud\CertificateManager\V1\ListCertificateMapsRequest;

/**
 * @param string $formattedParent The project and location from which the certificate maps should
 *                                be listed, specified in the format `projects/*/locations/*`. Please see
 *                                {@see CertificateManagerClient::locationName()} for help formatting this field.
 */
function list_certificate_maps_sample(string $formattedParent): void
{
    // Create a client.
    $certificateManagerClient = new CertificateManagerClient();

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

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

        /** @var CertificateMap $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 = CertificateManagerClient::locationName('[PROJECT]', '[LOCATION]');

    list_certificate_maps_sample($formattedParent);
}

listCertificates

Lists Certificates in a given project and location.

The async variant is Google\Cloud\CertificateManager\V1\Client\CertificateManagerClient::listCertificatesAsync() .

Parameters
Name Description
request Google\Cloud\CertificateManager\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
Type Description
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\CertificateManager\V1\Certificate;
use Google\Cloud\CertificateManager\V1\Client\CertificateManagerClient;
use Google\Cloud\CertificateManager\V1\ListCertificatesRequest;

/**
 * @param string $formattedParent The project and location from which the certificate should be
 *                                listed, specified in the format `projects/*/locations/*`. Please see
 *                                {@see CertificateManagerClient::locationName()} for help formatting this field.
 */
function list_certificates_sample(string $formattedParent): void
{
    // Create a client.
    $certificateManagerClient = new CertificateManagerClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $certificateManagerClient->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 = CertificateManagerClient::locationName('[PROJECT]', '[LOCATION]');

    list_certificates_sample($formattedParent);
}

listDnsAuthorizations

Lists DnsAuthorizations in a given project and location.

The async variant is Google\Cloud\CertificateManager\V1\Client\CertificateManagerClient::listDnsAuthorizationsAsync() .

Parameters
Name Description
request Google\Cloud\CertificateManager\V1\ListDnsAuthorizationsRequest

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
Type Description
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\CertificateManager\V1\Client\CertificateManagerClient;
use Google\Cloud\CertificateManager\V1\DnsAuthorization;
use Google\Cloud\CertificateManager\V1\ListDnsAuthorizationsRequest;

/**
 * @param string $formattedParent The project and location from which the dns authorizations should
 *                                be listed, specified in the format `projects/*/locations/*`. Please see
 *                                {@see CertificateManagerClient::locationName()} for help formatting this field.
 */
function list_dns_authorizations_sample(string $formattedParent): void
{
    // Create a client.
    $certificateManagerClient = new CertificateManagerClient();

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

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

        /** @var DnsAuthorization $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 = CertificateManagerClient::locationName('[PROJECT]', '[LOCATION]');

    list_dns_authorizations_sample($formattedParent);
}

listTrustConfigs

Lists TrustConfigs in a given project and location.

The async variant is Google\Cloud\CertificateManager\V1\Client\CertificateManagerClient::listTrustConfigsAsync() .

Parameters
Name Description
request Google\Cloud\CertificateManager\V1\ListTrustConfigsRequest

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
Type Description
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\CertificateManager\V1\Client\CertificateManagerClient;
use Google\Cloud\CertificateManager\V1\ListTrustConfigsRequest;
use Google\Cloud\CertificateManager\V1\TrustConfig;

/**
 * @param string $formattedParent The project and location from which the TrustConfigs should be
 *                                listed, specified in the format `projects/*/locations/*`. Please see
 *                                {@see CertificateManagerClient::locationName()} for help formatting this field.
 */
function list_trust_configs_sample(string $formattedParent): void
{
    // Create a client.
    $certificateManagerClient = new CertificateManagerClient();

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

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

        /** @var TrustConfig $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 = CertificateManagerClient::locationName('[PROJECT]', '[LOCATION]');

    list_trust_configs_sample($formattedParent);
}

updateCertificate

Parameters
Name Description
request Google\Cloud\CertificateManager\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
Type Description
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\CertificateManager\V1\Certificate;
use Google\Cloud\CertificateManager\V1\Client\CertificateManagerClient;
use Google\Cloud\CertificateManager\V1\UpdateCertificateRequest;
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_sample(): void
{
    // Create a client.
    $certificateManagerClient = new CertificateManagerClient();

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

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

        if ($response->operationSucceeded()) {
            /** @var Certificate $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());
    }
}

updateCertificateMap

Parameters
Name Description
request Google\Cloud\CertificateManager\V1\UpdateCertificateMapRequest

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
Type Description
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\CertificateManager\V1\CertificateMap;
use Google\Cloud\CertificateManager\V1\Client\CertificateManagerClient;
use Google\Cloud\CertificateManager\V1\UpdateCertificateMapRequest;
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_map_sample(): void
{
    // Create a client.
    $certificateManagerClient = new CertificateManagerClient();

    // Prepare the request message.
    $certificateMap = new CertificateMap();
    $updateMask = new FieldMask();
    $request = (new UpdateCertificateMapRequest())
        ->setCertificateMap($certificateMap)
        ->setUpdateMask($updateMask);

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

        if ($response->operationSucceeded()) {
            /** @var CertificateMap $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());
    }
}

updateCertificateMapEntry

Parameters
Name Description
request Google\Cloud\CertificateManager\V1\UpdateCertificateMapEntryRequest

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
Type Description
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\CertificateManager\V1\CertificateMapEntry;
use Google\Cloud\CertificateManager\V1\Client\CertificateManagerClient;
use Google\Cloud\CertificateManager\V1\UpdateCertificateMapEntryRequest;
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_map_entry_sample(): void
{
    // Create a client.
    $certificateManagerClient = new CertificateManagerClient();

    // Prepare the request message.
    $certificateMapEntry = new CertificateMapEntry();
    $updateMask = new FieldMask();
    $request = (new UpdateCertificateMapEntryRequest())
        ->setCertificateMapEntry($certificateMapEntry)
        ->setUpdateMask($updateMask);

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

        if ($response->operationSucceeded()) {
            /** @var CertificateMapEntry $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());
    }
}

updateDnsAuthorization

Parameters
Name Description
request Google\Cloud\CertificateManager\V1\UpdateDnsAuthorizationRequest

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
Type Description
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\CertificateManager\V1\Client\CertificateManagerClient;
use Google\Cloud\CertificateManager\V1\DnsAuthorization;
use Google\Cloud\CertificateManager\V1\UpdateDnsAuthorizationRequest;
use Google\Protobuf\FieldMask;
use Google\Rpc\Status;

/**
 * @param string $dnsAuthorizationDomain Immutable. A domain that is being authorized. A DnsAuthorization
 *                                       resource covers a single domain and its wildcard, e.g. authorization for
 *                                       `example.com` can be used to issue certificates for `example.com` and
 *                                       `*.example.com`.
 */
function update_dns_authorization_sample(string $dnsAuthorizationDomain): void
{
    // Create a client.
    $certificateManagerClient = new CertificateManagerClient();

    // Prepare the request message.
    $dnsAuthorization = (new DnsAuthorization())
        ->setDomain($dnsAuthorizationDomain);
    $updateMask = new FieldMask();
    $request = (new UpdateDnsAuthorizationRequest())
        ->setDnsAuthorization($dnsAuthorization)
        ->setUpdateMask($updateMask);

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

        if ($response->operationSucceeded()) {
            /** @var DnsAuthorization $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
{
    $dnsAuthorizationDomain = '[DOMAIN]';

    update_dns_authorization_sample($dnsAuthorizationDomain);
}

updateTrustConfig

Parameters
Name Description
request Google\Cloud\CertificateManager\V1\UpdateTrustConfigRequest

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
Type Description
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\CertificateManager\V1\Client\CertificateManagerClient;
use Google\Cloud\CertificateManager\V1\TrustConfig;
use Google\Cloud\CertificateManager\V1\UpdateTrustConfigRequest;
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_trust_config_sample(): void
{
    // Create a client.
    $certificateManagerClient = new CertificateManagerClient();

    // Prepare the request message.
    $trustConfig = new TrustConfig();
    $updateMask = new FieldMask();
    $request = (new UpdateTrustConfigRequest())
        ->setTrustConfig($trustConfig)
        ->setUpdateMask($updateMask);

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

        if ($response->operationSucceeded()) {
            /** @var TrustConfig $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

Gets information about a location.

The async variant is Google\Cloud\CertificateManager\V1\Client\CertificateManagerClient::getLocationAsync() .

Parameters
Name Description
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
Type Description
Google\Cloud\Location\Location
Example
use Google\ApiCore\ApiException;
use Google\Cloud\CertificateManager\V1\Client\CertificateManagerClient;
use Google\Cloud\Location\GetLocationRequest;
use Google\Cloud\Location\Location;

/**
 * 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.
    $certificateManagerClient = new CertificateManagerClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var Location $response */
        $response = $certificateManagerClient->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\CertificateManager\V1\Client\CertificateManagerClient::listLocationsAsync() .

Parameters
Name Description
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
Type Description
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\CertificateManager\V1\Client\CertificateManagerClient;
use Google\Cloud\Location\ListLocationsRequest;
use Google\Cloud\Location\Location;

/**
 * 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.
    $certificateManagerClient = new CertificateManagerClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $certificateManagerClient->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());
    }
}

createCertificateAsync

Parameters
Name Description
request Google\Cloud\CertificateManager\V1\CreateCertificateRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

createCertificateIssuanceConfigAsync

Parameters
Name Description
request Google\Cloud\CertificateManager\V1\CreateCertificateIssuanceConfigRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

createCertificateMapAsync

Parameters
Name Description
request Google\Cloud\CertificateManager\V1\CreateCertificateMapRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

createCertificateMapEntryAsync

Parameters
Name Description
request Google\Cloud\CertificateManager\V1\CreateCertificateMapEntryRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

createDnsAuthorizationAsync

Parameters
Name Description
request Google\Cloud\CertificateManager\V1\CreateDnsAuthorizationRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

createTrustConfigAsync

Parameters
Name Description
request Google\Cloud\CertificateManager\V1\CreateTrustConfigRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

deleteCertificateAsync

Parameters
Name Description
request Google\Cloud\CertificateManager\V1\DeleteCertificateRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

deleteCertificateIssuanceConfigAsync

Parameters
Name Description
request Google\Cloud\CertificateManager\V1\DeleteCertificateIssuanceConfigRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

deleteCertificateMapAsync

Parameters
Name Description
request Google\Cloud\CertificateManager\V1\DeleteCertificateMapRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

deleteCertificateMapEntryAsync

Parameters
Name Description
request Google\Cloud\CertificateManager\V1\DeleteCertificateMapEntryRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

deleteDnsAuthorizationAsync

Parameters
Name Description
request Google\Cloud\CertificateManager\V1\DeleteDnsAuthorizationRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

deleteTrustConfigAsync

Parameters
Name Description
request Google\Cloud\CertificateManager\V1\DeleteTrustConfigRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

getCertificateAsync

Parameters
Name Description
request Google\Cloud\CertificateManager\V1\GetCertificateRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

getCertificateIssuanceConfigAsync

Parameters
Name Description
request Google\Cloud\CertificateManager\V1\GetCertificateIssuanceConfigRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

getCertificateMapAsync

Parameters
Name Description
request Google\Cloud\CertificateManager\V1\GetCertificateMapRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

getCertificateMapEntryAsync

Parameters
Name Description
request Google\Cloud\CertificateManager\V1\GetCertificateMapEntryRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

getDnsAuthorizationAsync

Parameters
Name Description
request Google\Cloud\CertificateManager\V1\GetDnsAuthorizationRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

getTrustConfigAsync

Parameters
Name Description
request Google\Cloud\CertificateManager\V1\GetTrustConfigRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listCertificateIssuanceConfigsAsync

Parameters
Name Description
request Google\Cloud\CertificateManager\V1\ListCertificateIssuanceConfigsRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listCertificateMapEntriesAsync

Parameters
Name Description
request Google\Cloud\CertificateManager\V1\ListCertificateMapEntriesRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listCertificateMapsAsync

Parameters
Name Description
request Google\Cloud\CertificateManager\V1\ListCertificateMapsRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listCertificatesAsync

Parameters
Name Description
request Google\Cloud\CertificateManager\V1\ListCertificatesRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listDnsAuthorizationsAsync

Parameters
Name Description
request Google\Cloud\CertificateManager\V1\ListDnsAuthorizationsRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listTrustConfigsAsync

Parameters
Name Description
request Google\Cloud\CertificateManager\V1\ListTrustConfigsRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

updateCertificateAsync

Parameters
Name Description
request Google\Cloud\CertificateManager\V1\UpdateCertificateRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

updateCertificateMapAsync

Parameters
Name Description
request Google\Cloud\CertificateManager\V1\UpdateCertificateMapRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

updateCertificateMapEntryAsync

Parameters
Name Description
request Google\Cloud\CertificateManager\V1\UpdateCertificateMapEntryRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

updateDnsAuthorizationAsync

Parameters
Name Description
request Google\Cloud\CertificateManager\V1\UpdateDnsAuthorizationRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

updateTrustConfigAsync

Parameters
Name Description
request Google\Cloud\CertificateManager\V1\UpdateTrustConfigRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

getLocationAsync

Parameters
Name Description
request Google\Cloud\Location\GetLocationRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listLocationsAsync

Parameters
Name Description
request Google\Cloud\Location\ListLocationsRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

getOperationsClient

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

Returns
Type Description
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
Name Description
operationName string

The name of the long running operation

methodName string

The name of the method used to start the operation

Returns
Type Description
Google\ApiCore\OperationResponse

static::caPoolName

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

Parameters
Name Description
project string
location string
caPool string
Returns
Type Description
string The formatted ca_pool resource.

static::certificateName

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

Parameters
Name Description
project string
location string
certificate string
Returns
Type Description
string The formatted certificate resource.

static::certificateIssuanceConfigName

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

Parameters
Name Description
project string
location string
certificateIssuanceConfig string
Returns
Type Description
string The formatted certificate_issuance_config resource.

static::certificateMapName

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

Parameters
Name Description
project string
location string
certificateMap string
Returns
Type Description
string The formatted certificate_map resource.

static::certificateMapEntryName

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

Parameters
Name Description
project string
location string
certificateMap string
certificateMapEntry string
Returns
Type Description
string The formatted certificate_map_entry resource.

static::dnsAuthorizationName

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

Parameters
Name Description
project string
location string
dnsAuthorization string
Returns
Type Description
string The formatted dns_authorization resource.

static::locationName

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

Parameters
Name Description
project string
location string
Returns
Type Description
string The formatted location resource.

static::trustConfigName

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

Parameters
Name Description
project string
location string
trustConfig string
Returns
Type Description
string The formatted trust_config 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}/certificates/{certificate}
  • certificateIssuanceConfig: projects/{project}/locations/{location}/certificateIssuanceConfigs/{certificate_issuance_config}
  • certificateMap: projects/{project}/locations/{location}/certificateMaps/{certificate_map}
  • certificateMapEntry: projects/{project}/locations/{location}/certificateMaps/{certificate_map}/certificateMapEntries/{certificate_map_entry}
  • dnsAuthorization: projects/{project}/locations/{location}/dnsAuthorizations/{dns_authorization}
  • location: projects/{project}/locations/{location}
  • trustConfig: projects/{project}/locations/{location}/trustConfigs/{trust_config}

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
Name Description
formattedName string

The formatted name string

template string

Optional name of template to match

Returns
Type Description
array An associative array from name component IDs to component values.