# Google Cloud Domains V1 Client - Class DomainsClient (1.1.3)

1.1.3 (latest) 1.1.2 1.0.4 0.5.5 0.4.2 0.3.1 0.2.11 Reference documentation and code samples for the Google Cloud Domains V1 Client class DomainsClient.

Service Description: The Cloud Domains API enables management and configuration of domain names.

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

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `options` | `array|https://docs.cloud.google.com/php/docs/reference/gax/latest/Options.ClientOptions.html` 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` | `https://docs.cloud.google.com/php/docs/reference/auth/latest/FetchAuthTokenInterface.html|https://docs.cloud.google.com/php/docs/reference/gax/latest/CredentialsWrapper.html` This option should only be used with a pre-constructed [Google\\Auth\\FetchAuthTokenInterface](https://docs.cloud.google.com/php/docs/reference/auth/latest/FetchAuthTokenInterface.html) or [Google\\ApiCore\\CredentialsWrapper](https://docs.cloud.google.com/php/docs/reference/gax/latest/CredentialsWrapper.html) object. Note that when one of these objects are provided, any settings in $credentialsConfig will be ignored. **Important** : If you are providing a path to a credentials file, or a decoded credentials file as a PHP array, this usage is now DEPRECATED. Providing an unvalidated credential configuration to Google APIs can compromise the security of your systems and data. It is recommended to create the credentials explicitly `use Google\Auth\Credentials\ServiceAccountCredentials; use Google\Cloud\Domains\V1\DomainsClient; $creds = new ServiceAccountCredentials($scopes, $json); $options = new DomainsClient(['credentials' => $creds]);` <https://cloud.google.com/docs/authentication/external/externally-sourced-credentials> |
| `↳ 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()](https://docs.cloud.google.com/php/docs/reference/gax/latest/CredentialsWrapper.html#_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|https://docs.cloud.google.com/php/docs/reference/gax/latest/Transport.TransportInterface.html` 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](https://docs.cloud.google.com/php/docs/reference/gax/latest/Transport.TransportInterface.html) 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()](https://docs.cloud.google.com/php/docs/reference/gax/latest/Transport.GrpcTransport.html#_Google_ApiCore_Transport_GrpcTransport__build__) and [Google\\ApiCore\\Transport\\RestTransport::build()](https://docs.cloud.google.com/php/docs/reference/gax/latest/Transport.RestTransport.html#_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. |
| `↳ logger` | `false|Psr\Log\LoggerInterface` A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the 'GOOGLE_SDK_PHP_LOGGING' environment flag |
| `↳ universeDomain` | `string` The service domain for the client. Defaults to 'googleapis.com'. |

### configureContactSettings

Updates a `Registration`'s contact settings. Some changes require
confirmation by the domain's registrant contact .

The async variant is [DomainsClient::configureContactSettingsAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.Client.DomainsClient#_Google_Cloud_Domains_V1_Client_DomainsClient__configureContactSettingsAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.ConfigureContactSettingsRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html<https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.Registration>` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Cloud\Domains\V1\Client\DomainsClient;
    use Google\Cloud\Domains\V1\ConfigureContactSettingsRequest;
    use Google\Cloud\Domains\V1\Registration;
    use Google\Protobuf\FieldMask;
    use Google\Rpc\Status;

    /**
     * @param string $formattedRegistration The name of the `Registration` whose contact settings are being updated,
     *                                      in the format `projects/&#42;/locations/&#42;/registrations/*`. Please see
     *                                      {@see DomainsClient::registrationName()} for help formatting this field.
     */
    function configure_contact_settings_sample(string $formattedRegistration): void
    {
        // Create a client.
        $domainsClient = new DomainsClient();

        // Prepare the request message.
        $updateMask = new FieldMask();
        $request = (new ConfigureContactSettingsRequest())
            ->setRegistration($formattedRegistration)
            ->setUpdateMask($updateMask);

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

            if ($response->operationSucceeded()) {
                /** @var Registration $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
    {
        $formattedRegistration = DomainsClient::registrationName(
            '[PROJECT]',
            '[LOCATION]',
            '[REGISTRATION]'
        );

        configure_contact_settings_sample($formattedRegistration);
    }

### configureDnsSettings

Updates a `Registration`'s DNS settings.

The async variant is [DomainsClient::configureDnsSettingsAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.Client.DomainsClient#_Google_Cloud_Domains_V1_Client_DomainsClient__configureDnsSettingsAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.ConfigureDnsSettingsRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html<https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.Registration>` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Cloud\Domains\V1\Client\DomainsClient;
    use Google\Cloud\Domains\V1\ConfigureDnsSettingsRequest;
    use Google\Cloud\Domains\V1\Registration;
    use Google\Protobuf\FieldMask;
    use Google\Rpc\Status;

    /**
     * @param string $formattedRegistration The name of the `Registration` whose DNS settings are being updated,
     *                                      in the format `projects/&#42;/locations/&#42;/registrations/*`. Please see
     *                                      {@see DomainsClient::registrationName()} for help formatting this field.
     */
    function configure_dns_settings_sample(string $formattedRegistration): void
    {
        // Create a client.
        $domainsClient = new DomainsClient();

        // Prepare the request message.
        $updateMask = new FieldMask();
        $request = (new ConfigureDnsSettingsRequest())
            ->setRegistration($formattedRegistration)
            ->setUpdateMask($updateMask);

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

            if ($response->operationSucceeded()) {
                /** @var Registration $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
    {
        $formattedRegistration = DomainsClient::registrationName(
            '[PROJECT]',
            '[LOCATION]',
            '[REGISTRATION]'
        );

        configure_dns_settings_sample($formattedRegistration);
    }

### configureManagementSettings

Updates a `Registration`'s management settings.

The async variant is [DomainsClient::configureManagementSettingsAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.Client.DomainsClient#_Google_Cloud_Domains_V1_Client_DomainsClient__configureManagementSettingsAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.ConfigureManagementSettingsRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html<https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.Registration>` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Cloud\Domains\V1\Client\DomainsClient;
    use Google\Cloud\Domains\V1\ConfigureManagementSettingsRequest;
    use Google\Cloud\Domains\V1\Registration;
    use Google\Protobuf\FieldMask;
    use Google\Rpc\Status;

    /**
     * @param string $formattedRegistration The name of the `Registration` whose management settings are being updated,
     *                                      in the format `projects/&#42;/locations/&#42;/registrations/*`. Please see
     *                                      {@see DomainsClient::registrationName()} for help formatting this field.
     */
    function configure_management_settings_sample(string $formattedRegistration): void
    {
        // Create a client.
        $domainsClient = new DomainsClient();

        // Prepare the request message.
        $updateMask = new FieldMask();
        $request = (new ConfigureManagementSettingsRequest())
            ->setRegistration($formattedRegistration)
            ->setUpdateMask($updateMask);

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

            if ($response->operationSucceeded()) {
                /** @var Registration $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
    {
        $formattedRegistration = DomainsClient::registrationName(
            '[PROJECT]',
            '[LOCATION]',
            '[REGISTRATION]'
        );

        configure_management_settings_sample($formattedRegistration);
    }

### deleteRegistration

Deletes a `Registration` resource.

This method works on any `Registration` resource using [Subscription or
Commitment billing](https://docs.cloud.google.com/domains/pricing#billing-models), provided that the
resource was created at least 1 day in the past.

For `Registration` resources using
[Monthly billing](https://docs.cloud.google.com/domains/pricing#billing-models), this method works if:

- `state` is `EXPORTED` with `expire_time` in the past
- `state` is `REGISTRATION_FAILED`
- `state` is `TRANSFER_FAILED`

When an active registration is successfully deleted, you can continue to
use the domain in [Google Domains](https://domains.google/) until it
expires. The calling user becomes the domain's sole owner in Google
Domains, and permissions for the domain are subsequently managed there. The
domain does not renew automatically unless the new owner sets up billing in
Google Domains.

The async variant is [DomainsClient::deleteRegistrationAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.Client.DomainsClient#_Google_Cloud_Domains_V1_Client_DomainsClient__deleteRegistrationAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.DeleteRegistrationRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html<null>` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Cloud\Domains\V1\Client\DomainsClient;
    use Google\Cloud\Domains\V1\DeleteRegistrationRequest;
    use Google\Rpc\Status;

    /**
     * @param string $formattedName The name of the `Registration` to delete,
     *                              in the format `projects/&#42;/locations/&#42;/registrations/*`. Please see
     *                              {@see DomainsClient::registrationName()} for help formatting this field.
     */
    function delete_registration_sample(string $formattedName): void
    {
        // Create a client.
        $domainsClient = new DomainsClient();

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

        // Call the API and handle any network failures.
        try {
            /** @var OperationResponse $response */
            $response = $domainsClient->deleteRegistration($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 = DomainsClient::registrationName('[PROJECT]', '[LOCATION]', '[REGISTRATION]');

        delete_registration_sample($formattedName);
    }

### exportRegistration

Exports a `Registration` resource, such that it is no longer managed by
Cloud Domains.

When an active domain is successfully exported, you can continue to use the
domain in [Google Domains](https://domains.google/) until it expires. The
calling user becomes the domain's sole owner in Google Domains, and
permissions for the domain are subsequently managed there. The domain does
not renew automatically unless the new owner sets up billing in Google
Domains.

The async variant is [DomainsClient::exportRegistrationAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.Client.DomainsClient#_Google_Cloud_Domains_V1_Client_DomainsClient__exportRegistrationAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.ExportRegistrationRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html<https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.Registration>` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Cloud\Domains\V1\Client\DomainsClient;
    use Google\Cloud\Domains\V1\ExportRegistrationRequest;
    use Google\Cloud\Domains\V1\Registration;
    use Google\Rpc\Status;

    /**
     * @param string $formattedName The name of the `Registration` to export,
     *                              in the format `projects/&#42;/locations/&#42;/registrations/*`. Please see
     *                              {@see DomainsClient::registrationName()} for help formatting this field.
     */
    function export_registration_sample(string $formattedName): void
    {
        // Create a client.
        $domainsClient = new DomainsClient();

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

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

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

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

        export_registration_sample($formattedName);
    }

### getRegistration

Gets the details of a `Registration` resource.

The async variant is [DomainsClient::getRegistrationAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.Client.DomainsClient#_Google_Cloud_Domains_V1_Client_DomainsClient__getRegistrationAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.GetRegistrationRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.Registration` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\Domains\V1\Client\DomainsClient;
    use Google\Cloud\Domains\V1\GetRegistrationRequest;
    use Google\Cloud\Domains\V1\Registration;

    /**
     * @param string $formattedName The name of the `Registration` to get, in the format
     *                              `projects/&#42;/locations/&#42;/registrations/*`. Please see
     *                              {@see DomainsClient::registrationName()} for help formatting this field.
     */
    function get_registration_sample(string $formattedName): void
    {
        // Create a client.
        $domainsClient = new DomainsClient();

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

        // Call the API and handle any network failures.
        try {
            /** @var Registration $response */
            $response = $domainsClient->getRegistration($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 = DomainsClient::registrationName('[PROJECT]', '[LOCATION]', '[REGISTRATION]');

        get_registration_sample($formattedName);
    }

### listRegistrations

Lists the `Registration` resources in a project.

The async variant is [DomainsClient::listRegistrationsAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.Client.DomainsClient#_Google_Cloud_Domains_V1_Client_DomainsClient__listRegistrationsAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.ListRegistrationsRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\PagedListResponse;
    use Google\Cloud\Domains\V1\Client\DomainsClient;
    use Google\Cloud\Domains\V1\ListRegistrationsRequest;
    use Google\Cloud\Domains\V1\Registration;

    /**
     * @param string $formattedParent The project and location from which to list `Registration`s, specified in
     *                                the format `projects/&#42;/locations/*`. Please see
     *                                {@see DomainsClient::locationName()} for help formatting this field.
     */
    function list_registrations_sample(string $formattedParent): void
    {
        // Create a client.
        $domainsClient = new DomainsClient();

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

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

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

        list_registrations_sample($formattedParent);
    }

### registerDomain

Registers a new domain name and creates a corresponding `Registration`
resource.

Call `RetrieveRegisterParameters` first to check availability of the domain
name and determine parameters like price that are needed to build a call to
this method.

A successful call creates a `Registration` resource in state
`REGISTRATION_PENDING`, which resolves to `ACTIVE` within 1-2
minutes, indicating that the domain was successfully registered. If the
resource ends up in state `REGISTRATION_FAILED`, it indicates that the
domain was not registered successfully, and you can safely delete the
resource and retry registration.

The async variant is [DomainsClient::registerDomainAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.Client.DomainsClient#_Google_Cloud_Domains_V1_Client_DomainsClient__registerDomainAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.RegisterDomainRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html<https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.Registration>` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Cloud\Domains\V1\Client\DomainsClient;
    use Google\Cloud\Domains\V1\ContactPrivacy;
    use Google\Cloud\Domains\V1\ContactSettings;
    use Google\Cloud\Domains\V1\ContactSettings\Contact;
    use Google\Cloud\Domains\V1\RegisterDomainRequest;
    use Google\Cloud\Domains\V1\Registration;
    use Google\Rpc\Status;
    use Google\Type\Money;
    use Google\Type\PostalAddress;

    /**
     * @param string $formattedParent                                         The parent resource of the `Registration`. Must be in the
     *                                                                        format `projects/&#42;/locations/*`. Please see
     *                                                                        {@see DomainsClient::locationName()} for help formatting this field.
     * @param string $registrationDomainName                                  Immutable. The domain name. Unicode domain names must be expressed in Punycode format.
     * @param int    $registrationContactSettingsPrivacy                      Privacy setting for the contacts associated with the `Registration`.
     * @param string $registrationContactSettingsRegistrantContactEmail       Email address of the contact.
     * @param string $registrationContactSettingsRegistrantContactPhoneNumber Phone number of the contact in international format. For example,
     *                                                                        `"+1-800-555-0123"`.
     * @param string $registrationContactSettingsAdminContactEmail            Email address of the contact.
     * @param string $registrationContactSettingsAdminContactPhoneNumber      Phone number of the contact in international format. For example,
     *                                                                        `"+1-800-555-0123"`.
     * @param string $registrationContactSettingsTechnicalContactEmail        Email address of the contact.
     * @param string $registrationContactSettingsTechnicalContactPhoneNumber  Phone number of the contact in international format. For example,
     *                                                                        `"+1-800-555-0123"`.
     */
    function register_domain_sample(
        string $formattedParent,
        string $registrationDomainName,
        int $registrationContactSettingsPrivacy,
        string $registrationContactSettingsRegistrantContactEmail,
        string $registrationContactSettingsRegistrantContactPhoneNumber,
        string $registrationContactSettingsAdminContactEmail,
        string $registrationContactSettingsAdminContactPhoneNumber,
        string $registrationContactSettingsTechnicalContactEmail,
        string $registrationContactSettingsTechnicalContactPhoneNumber
    ): void {
        // Create a client.
        $domainsClient = new DomainsClient();

        // Prepare the request message.
        $registrationContactSettingsRegistrantContactPostalAddress = new PostalAddress();
        $registrationContactSettingsRegistrantContact = (new Contact())
            ->setPostalAddress($registrationContactSettingsRegistrantContactPostalAddress)
            ->setEmail($registrationContactSettingsRegistrantContactEmail)
            ->setPhoneNumber($registrationContactSettingsRegistrantContactPhoneNumber);
        $registrationContactSettingsAdminContactPostalAddress = new PostalAddress();
        $registrationContactSettingsAdminContact = (new Contact())
            ->setPostalAddress($registrationContactSettingsAdminContactPostalAddress)
            ->setEmail($registrationContactSettingsAdminContactEmail)
            ->setPhoneNumber($registrationContactSettingsAdminContactPhoneNumber);
        $registrationContactSettingsTechnicalContactPostalAddress = new PostalAddress();
        $registrationContactSettingsTechnicalContact = (new Contact())
            ->setPostalAddress($registrationContactSettingsTechnicalContactPostalAddress)
            ->setEmail($registrationContactSettingsTechnicalContactEmail)
            ->setPhoneNumber($registrationContactSettingsTechnicalContactPhoneNumber);
        $registrationContactSettings = (new ContactSettings())
            ->setPrivacy($registrationContactSettingsPrivacy)
            ->setRegistrantContact($registrationContactSettingsRegistrantContact)
            ->setAdminContact($registrationContactSettingsAdminContact)
            ->setTechnicalContact($registrationContactSettingsTechnicalContact);
        $registration = (new Registration())
            ->setDomainName($registrationDomainName)
            ->setContactSettings($registrationContactSettings);
        $yearlyPrice = new Money();
        $request = (new RegisterDomainRequest())
            ->setParent($formattedParent)
            ->setRegistration($registration)
            ->setYearlyPrice($yearlyPrice);

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

            if ($response->operationSucceeded()) {
                /** @var Registration $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 = DomainsClient::locationName('[PROJECT]', '[LOCATION]');
        $registrationDomainName = '[DOMAIN_NAME]';
        $registrationContactSettingsPrivacy = ContactPrivacy::CONTACT_PRIVACY_UNSPECIFIED;
        $registrationContactSettingsRegistrantContactEmail = '[EMAIL]';
        $registrationContactSettingsRegistrantContactPhoneNumber = '[PHONE_NUMBER]';
        $registrationContactSettingsAdminContactEmail = '[EMAIL]';
        $registrationContactSettingsAdminContactPhoneNumber = '[PHONE_NUMBER]';
        $registrationContactSettingsTechnicalContactEmail = '[EMAIL]';
        $registrationContactSettingsTechnicalContactPhoneNumber = '[PHONE_NUMBER]';

        register_domain_sample(
            $formattedParent,
            $registrationDomainName,
            $registrationContactSettingsPrivacy,
            $registrationContactSettingsRegistrantContactEmail,
            $registrationContactSettingsRegistrantContactPhoneNumber,
            $registrationContactSettingsAdminContactEmail,
            $registrationContactSettingsAdminContactPhoneNumber,
            $registrationContactSettingsTechnicalContactEmail,
            $registrationContactSettingsTechnicalContactPhoneNumber
        );
    }

### resetAuthorizationCode

Resets the authorization code of the `Registration` to a new random string.

You can call this method only after 60 days have elapsed since the initial
domain registration.

The async variant is [DomainsClient::resetAuthorizationCodeAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.Client.DomainsClient#_Google_Cloud_Domains_V1_Client_DomainsClient__resetAuthorizationCodeAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.ResetAuthorizationCodeRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.AuthorizationCode` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\Domains\V1\AuthorizationCode;
    use Google\Cloud\Domains\V1\Client\DomainsClient;
    use Google\Cloud\Domains\V1\ResetAuthorizationCodeRequest;

    /**
     * @param string $formattedRegistration The name of the `Registration` whose authorization code is being reset,
     *                                      in the format `projects/&#42;/locations/&#42;/registrations/*`. Please see
     *                                      {@see DomainsClient::registrationName()} for help formatting this field.
     */
    function reset_authorization_code_sample(string $formattedRegistration): void
    {
        // Create a client.
        $domainsClient = new DomainsClient();

        // Prepare the request message.
        $request = (new ResetAuthorizationCodeRequest())
            ->setRegistration($formattedRegistration);

        // Call the API and handle any network failures.
        try {
            /** @var AuthorizationCode $response */
            $response = $domainsClient->resetAuthorizationCode($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
    {
        $formattedRegistration = DomainsClient::registrationName(
            '[PROJECT]',
            '[LOCATION]',
            '[REGISTRATION]'
        );

        reset_authorization_code_sample($formattedRegistration);
    }

### retrieveAuthorizationCode

Gets the authorization code of the `Registration` for the purpose of
transferring the domain to another registrar.

You can call this method only after 60 days have elapsed since the initial
domain registration.

The async variant is [DomainsClient::retrieveAuthorizationCodeAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.Client.DomainsClient#_Google_Cloud_Domains_V1_Client_DomainsClient__retrieveAuthorizationCodeAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.RetrieveAuthorizationCodeRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.AuthorizationCode` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\Domains\V1\AuthorizationCode;
    use Google\Cloud\Domains\V1\Client\DomainsClient;
    use Google\Cloud\Domains\V1\RetrieveAuthorizationCodeRequest;

    /**
     * @param string $formattedRegistration The name of the `Registration` whose authorization code is being retrieved,
     *                                      in the format `projects/&#42;/locations/&#42;/registrations/*`. Please see
     *                                      {@see DomainsClient::registrationName()} for help formatting this field.
     */
    function retrieve_authorization_code_sample(string $formattedRegistration): void
    {
        // Create a client.
        $domainsClient = new DomainsClient();

        // Prepare the request message.
        $request = (new RetrieveAuthorizationCodeRequest())
            ->setRegistration($formattedRegistration);

        // Call the API and handle any network failures.
        try {
            /** @var AuthorizationCode $response */
            $response = $domainsClient->retrieveAuthorizationCode($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
    {
        $formattedRegistration = DomainsClient::registrationName(
            '[PROJECT]',
            '[LOCATION]',
            '[REGISTRATION]'
        );

        retrieve_authorization_code_sample($formattedRegistration);
    }

### retrieveRegisterParameters

Gets parameters needed to register a new domain name, including price and
up-to-date availability. Use the returned values to call `RegisterDomain`.

The async variant is [DomainsClient::retrieveRegisterParametersAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.Client.DomainsClient#_Google_Cloud_Domains_V1_Client_DomainsClient__retrieveRegisterParametersAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.RetrieveRegisterParametersRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.RetrieveRegisterParametersResponse` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\Domains\V1\Client\DomainsClient;
    use Google\Cloud\Domains\V1\RetrieveRegisterParametersRequest;
    use Google\Cloud\Domains\V1\RetrieveRegisterParametersResponse;

    /**
     * @param string $domainName        The domain name. Unicode domain names must be expressed in Punycode format.
     * @param string $formattedLocation The location. Must be in the format `projects/&#42;/locations/*`. Please see
     *                                  {@see DomainsClient::locationName()} for help formatting this field.
     */
    function retrieve_register_parameters_sample(string $domainName, string $formattedLocation): void
    {
        // Create a client.
        $domainsClient = new DomainsClient();

        // Prepare the request message.
        $request = (new RetrieveRegisterParametersRequest())
            ->setDomainName($domainName)
            ->setLocation($formattedLocation);

        // Call the API and handle any network failures.
        try {
            /** @var RetrieveRegisterParametersResponse $response */
            $response = $domainsClient->retrieveRegisterParameters($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
    {
        $domainName = '[DOMAIN_NAME]';
        $formattedLocation = DomainsClient::locationName('[PROJECT]', '[LOCATION]');

        retrieve_register_parameters_sample($domainName, $formattedLocation);
    }

### retrieveTransferParameters

Gets parameters needed to transfer a domain name from another registrar to
Cloud Domains. For domains managed by Google Domains, transferring to Cloud
Domains is not supported.

Use the returned values to call `TransferDomain`.

The async variant is [DomainsClient::retrieveTransferParametersAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.Client.DomainsClient#_Google_Cloud_Domains_V1_Client_DomainsClient__retrieveTransferParametersAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.RetrieveTransferParametersRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.RetrieveTransferParametersResponse` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\Domains\V1\Client\DomainsClient;
    use Google\Cloud\Domains\V1\RetrieveTransferParametersRequest;
    use Google\Cloud\Domains\V1\RetrieveTransferParametersResponse;

    /**
     * @param string $domainName        The domain name. Unicode domain names must be expressed in Punycode format.
     * @param string $formattedLocation The location. Must be in the format `projects/&#42;/locations/*`. Please see
     *                                  {@see DomainsClient::locationName()} for help formatting this field.
     */
    function retrieve_transfer_parameters_sample(string $domainName, string $formattedLocation): void
    {
        // Create a client.
        $domainsClient = new DomainsClient();

        // Prepare the request message.
        $request = (new RetrieveTransferParametersRequest())
            ->setDomainName($domainName)
            ->setLocation($formattedLocation);

        // Call the API and handle any network failures.
        try {
            /** @var RetrieveTransferParametersResponse $response */
            $response = $domainsClient->retrieveTransferParameters($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
    {
        $domainName = '[DOMAIN_NAME]';
        $formattedLocation = DomainsClient::locationName('[PROJECT]', '[LOCATION]');

        retrieve_transfer_parameters_sample($domainName, $formattedLocation);
    }

### searchDomains

Searches for available domain names similar to the provided query.

Availability results from this method are approximate; call
`RetrieveRegisterParameters` on a domain before registering to confirm
availability.

The async variant is [DomainsClient::searchDomainsAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.Client.DomainsClient#_Google_Cloud_Domains_V1_Client_DomainsClient__searchDomainsAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.SearchDomainsRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.SearchDomainsResponse` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\Domains\V1\Client\DomainsClient;
    use Google\Cloud\Domains\V1\SearchDomainsRequest;
    use Google\Cloud\Domains\V1\SearchDomainsResponse;

    /**
     * @param string $query             String used to search for available domain names.
     * @param string $formattedLocation The location. Must be in the format `projects/&#42;/locations/*`. Please see
     *                                  {@see DomainsClient::locationName()} for help formatting this field.
     */
    function search_domains_sample(string $query, string $formattedLocation): void
    {
        // Create a client.
        $domainsClient = new DomainsClient();

        // Prepare the request message.
        $request = (new SearchDomainsRequest())
            ->setQuery($query)
            ->setLocation($formattedLocation);

        // Call the API and handle any network failures.
        try {
            /** @var SearchDomainsResponse $response */
            $response = $domainsClient->searchDomains($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
    {
        $query = '[QUERY]';
        $formattedLocation = DomainsClient::locationName('[PROJECT]', '[LOCATION]');

        search_domains_sample($query, $formattedLocation);
    }

### transferDomain

Transfers a domain name from another registrar to Cloud Domains. For
domains managed by Google Domains, transferring to Cloud Domains is not
supported.

Before calling this method, go to the domain's current registrar to unlock
the domain for transfer and retrieve the domain's transfer authorization
code. Then call `RetrieveTransferParameters` to confirm that the domain is
unlocked and to get values needed to build a call to this method.

A successful call creates a `Registration` resource in state
`TRANSFER_PENDING`. It can take several days to complete the transfer
process. The registrant can often speed up this process by approving the
transfer through the current registrar, either by clicking a link in an
email from the registrar or by visiting the registrar's website.

A few minutes after transfer approval, the resource transitions to state
`ACTIVE`, indicating that the transfer was successful. If the transfer is
rejected or the request expires without being approved, the resource can
end up in state `TRANSFER_FAILED`. If transfer fails, you can safely delete
the resource and retry the transfer.

The async variant is [DomainsClient::transferDomainAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.Client.DomainsClient#_Google_Cloud_Domains_V1_Client_DomainsClient__transferDomainAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.TransferDomainRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html<https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.Registration>` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Cloud\Domains\V1\Client\DomainsClient;
    use Google\Cloud\Domains\V1\ContactPrivacy;
    use Google\Cloud\Domains\V1\ContactSettings;
    use Google\Cloud\Domains\V1\ContactSettings\Contact;
    use Google\Cloud\Domains\V1\Registration;
    use Google\Cloud\Domains\V1\TransferDomainRequest;
    use Google\Rpc\Status;
    use Google\Type\Money;
    use Google\Type\PostalAddress;

    /**
     * @param string $formattedParent                                         The parent resource of the `Registration`. Must be in the
     *                                                                        format `projects/&#42;/locations/*`. Please see
     *                                                                        {@see DomainsClient::locationName()} for help formatting this field.
     * @param string $registrationDomainName                                  Immutable. The domain name. Unicode domain names must be expressed in Punycode format.
     * @param int    $registrationContactSettingsPrivacy                      Privacy setting for the contacts associated with the `Registration`.
     * @param string $registrationContactSettingsRegistrantContactEmail       Email address of the contact.
     * @param string $registrationContactSettingsRegistrantContactPhoneNumber Phone number of the contact in international format. For example,
     *                                                                        `"+1-800-555-0123"`.
     * @param string $registrationContactSettingsAdminContactEmail            Email address of the contact.
     * @param string $registrationContactSettingsAdminContactPhoneNumber      Phone number of the contact in international format. For example,
     *                                                                        `"+1-800-555-0123"`.
     * @param string $registrationContactSettingsTechnicalContactEmail        Email address of the contact.
     * @param string $registrationContactSettingsTechnicalContactPhoneNumber  Phone number of the contact in international format. For example,
     *                                                                        `"+1-800-555-0123"`.
     */
    function transfer_domain_sample(
        string $formattedParent,
        string $registrationDomainName,
        int $registrationContactSettingsPrivacy,
        string $registrationContactSettingsRegistrantContactEmail,
        string $registrationContactSettingsRegistrantContactPhoneNumber,
        string $registrationContactSettingsAdminContactEmail,
        string $registrationContactSettingsAdminContactPhoneNumber,
        string $registrationContactSettingsTechnicalContactEmail,
        string $registrationContactSettingsTechnicalContactPhoneNumber
    ): void {
        // Create a client.
        $domainsClient = new DomainsClient();

        // Prepare the request message.
        $registrationContactSettingsRegistrantContactPostalAddress = new PostalAddress();
        $registrationContactSettingsRegistrantContact = (new Contact())
            ->setPostalAddress($registrationContactSettingsRegistrantContactPostalAddress)
            ->setEmail($registrationContactSettingsRegistrantContactEmail)
            ->setPhoneNumber($registrationContactSettingsRegistrantContactPhoneNumber);
        $registrationContactSettingsAdminContactPostalAddress = new PostalAddress();
        $registrationContactSettingsAdminContact = (new Contact())
            ->setPostalAddress($registrationContactSettingsAdminContactPostalAddress)
            ->setEmail($registrationContactSettingsAdminContactEmail)
            ->setPhoneNumber($registrationContactSettingsAdminContactPhoneNumber);
        $registrationContactSettingsTechnicalContactPostalAddress = new PostalAddress();
        $registrationContactSettingsTechnicalContact = (new Contact())
            ->setPostalAddress($registrationContactSettingsTechnicalContactPostalAddress)
            ->setEmail($registrationContactSettingsTechnicalContactEmail)
            ->setPhoneNumber($registrationContactSettingsTechnicalContactPhoneNumber);
        $registrationContactSettings = (new ContactSettings())
            ->setPrivacy($registrationContactSettingsPrivacy)
            ->setRegistrantContact($registrationContactSettingsRegistrantContact)
            ->setAdminContact($registrationContactSettingsAdminContact)
            ->setTechnicalContact($registrationContactSettingsTechnicalContact);
        $registration = (new Registration())
            ->setDomainName($registrationDomainName)
            ->setContactSettings($registrationContactSettings);
        $yearlyPrice = new Money();
        $request = (new TransferDomainRequest())
            ->setParent($formattedParent)
            ->setRegistration($registration)
            ->setYearlyPrice($yearlyPrice);

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

            if ($response->operationSucceeded()) {
                /** @var Registration $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 = DomainsClient::locationName('[PROJECT]', '[LOCATION]');
        $registrationDomainName = '[DOMAIN_NAME]';
        $registrationContactSettingsPrivacy = ContactPrivacy::CONTACT_PRIVACY_UNSPECIFIED;
        $registrationContactSettingsRegistrantContactEmail = '[EMAIL]';
        $registrationContactSettingsRegistrantContactPhoneNumber = '[PHONE_NUMBER]';
        $registrationContactSettingsAdminContactEmail = '[EMAIL]';
        $registrationContactSettingsAdminContactPhoneNumber = '[PHONE_NUMBER]';
        $registrationContactSettingsTechnicalContactEmail = '[EMAIL]';
        $registrationContactSettingsTechnicalContactPhoneNumber = '[PHONE_NUMBER]';

        transfer_domain_sample(
            $formattedParent,
            $registrationDomainName,
            $registrationContactSettingsPrivacy,
            $registrationContactSettingsRegistrantContactEmail,
            $registrationContactSettingsRegistrantContactPhoneNumber,
            $registrationContactSettingsAdminContactEmail,
            $registrationContactSettingsAdminContactPhoneNumber,
            $registrationContactSettingsTechnicalContactEmail,
            $registrationContactSettingsTechnicalContactPhoneNumber
        );
    }

### updateRegistration

Updates select fields of a `Registration` resource, notably `labels`. To
update other fields, use the appropriate custom update method:

- To update management settings, see `ConfigureManagementSettings`
- To update DNS configuration, see `ConfigureDnsSettings`
- To update contact information, see `ConfigureContactSettings`

The async variant is [DomainsClient::updateRegistrationAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.Client.DomainsClient#_Google_Cloud_Domains_V1_Client_DomainsClient__updateRegistrationAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.UpdateRegistrationRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html<https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.Registration>` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Cloud\Domains\V1\Client\DomainsClient;
    use Google\Cloud\Domains\V1\Registration;
    use Google\Cloud\Domains\V1\UpdateRegistrationRequest;
    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_registration_sample(): void
    {
        // Create a client.
        $domainsClient = new DomainsClient();

        // Prepare the request message.
        $updateMask = new FieldMask();
        $request = (new UpdateRegistrationRequest())
            ->setUpdateMask($updateMask);

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

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

### configureContactSettingsAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.ConfigureContactSettingsRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html>` |   |

### configureDnsSettingsAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.ConfigureDnsSettingsRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html>` |   |

### configureManagementSettingsAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.ConfigureManagementSettingsRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html>` |   |

### deleteRegistrationAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.DeleteRegistrationRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html>` |   |

### exportRegistrationAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.ExportRegistrationRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html>` |   |

### getRegistrationAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.GetRegistrationRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.Registration>` |   |

### listRegistrationsAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.ListRegistrationsRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html>` |   |

### registerDomainAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.RegisterDomainRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html>` |   |

### resetAuthorizationCodeAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.ResetAuthorizationCodeRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.AuthorizationCode>` |   |

### retrieveAuthorizationCodeAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.RetrieveAuthorizationCodeRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.AuthorizationCode>` |   |

### retrieveRegisterParametersAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.RetrieveRegisterParametersRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.RetrieveRegisterParametersResponse>` |   |

### retrieveTransferParametersAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.RetrieveTransferParametersRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.RetrieveTransferParametersResponse>` |   |

### searchDomainsAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.SearchDomainsRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.SearchDomainsResponse>` |   |

### transferDomainAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.TransferDomainRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html>` |   |

### updateRegistrationAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-domains/latest/V1.UpdateRegistrationRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html>` |   |

### getOperationsClient

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google\LongRunning\Client\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** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html` |   |

### 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::registrationName

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

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `project` | `string` |
| `location` | `string` |
| `registration` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` | The formatted registration 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

- location: projects/{project}/locations/{location}
- registration: projects/{project}/locations/{location}/registrations/{registration}

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. |