0.4.4 (latest) 0.4.3 0.3.0 0.2.1 0.1.4 Reference documentation and code samples for the Google Cloud Api Hub V1 Client class RuntimeProjectAttachmentServiceClient.

Service Description: This service is used for managing the runtime project attachments.

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 \\ ApiHub \\ 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\ApiHub\V1\RuntimeProjectAttachmentServiceClient; $creds = new ServiceAccountCredentials($scopes, $json); $options = new RuntimeProjectAttachmentServiceClient(['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. At the moment, supports only `rest`. *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 = \[ 'rest' =\> \[...\], \]; See the [Google\\ApiCore\\Transport\\RestTransport::build()](https://docs.cloud.google.com/php/docs/reference/gax/latest/Transport.RestTransport.html#_Google_ApiCore_Transport_RestTransport__build__) method 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'. |

### createRuntimeProjectAttachment

Attaches a runtime project to the host project.

The async variant is
[RuntimeProjectAttachmentServiceClient::createRuntimeProjectAttachmentAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-apihub/latest/V1.Client.RuntimeProjectAttachmentServiceClient#_Google_Cloud_ApiHub_V1_Client_RuntimeProjectAttachmentServiceClient__createRuntimeProjectAttachmentAsync__)
.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-apihub/latest/V1.CreateRuntimeProjectAttachmentRequest` 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-apihub/latest/V1.RuntimeProjectAttachment` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\ApiHub\V1\Client\RuntimeProjectAttachmentServiceClient;
    use Google\Cloud\ApiHub\V1\CreateRuntimeProjectAttachmentRequest;
    use Google\Cloud\ApiHub\V1\RuntimeProjectAttachment;

    /**
     * @param string $formattedParent                                 The parent resource for the Runtime Project Attachment.
     *                                                                Format: `projects/{project}/locations/{location}`
     *                                                                Please see {@see RuntimeProjectAttachmentServiceClient::locationName()} for help formatting this field.
     * @param string $runtimeProjectAttachmentId                      The ID to use for the Runtime Project Attachment, which will
     *                                                                become the final component of the Runtime Project Attachment's name. The ID
     *                                                                must be the same as the project ID of the Google cloud project specified in
     *                                                                the runtime_project_attachment.runtime_project field.
     * @param string $formattedRuntimeProjectAttachmentRuntimeProject Immutable. Google cloud project name in the format:
     *                                                                "projects/abc" or "projects/123". As input, project name with either
     *                                                                project id or number are accepted. As output, this field will contain
     *                                                                project number. Please see
     *                                                                {@see RuntimeProjectAttachmentServiceClient::projectName()} for help formatting this field.
     */
    function create_runtime_project_attachment_sample(
        string $formattedParent,
        string $runtimeProjectAttachmentId,
        string $formattedRuntimeProjectAttachmentRuntimeProject
    ): void {
        // Create a client.
        $runtimeProjectAttachmentServiceClient = new RuntimeProjectAttachmentServiceClient();

        // Prepare the request message.
        $runtimeProjectAttachment = (new RuntimeProjectAttachment())
            ->setRuntimeProject($formattedRuntimeProjectAttachmentRuntimeProject);
        $request = (new CreateRuntimeProjectAttachmentRequest())
            ->setParent($formattedParent)
            ->setRuntimeProjectAttachmentId($runtimeProjectAttachmentId)
            ->setRuntimeProjectAttachment($runtimeProjectAttachment);

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

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

        create_runtime_project_attachment_sample(
            $formattedParent,
            $runtimeProjectAttachmentId,
            $formattedRuntimeProjectAttachmentRuntimeProject
        );
    }

### deleteRuntimeProjectAttachment

Delete a runtime project attachment in the API Hub. This call will detach
the runtime project from the host project.

The async variant is
[RuntimeProjectAttachmentServiceClient::deleteRuntimeProjectAttachmentAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-apihub/latest/V1.Client.RuntimeProjectAttachmentServiceClient#_Google_Cloud_ApiHub_V1_Client_RuntimeProjectAttachmentServiceClient__deleteRuntimeProjectAttachmentAsync__)
.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-apihub/latest/V1.DeleteRuntimeProjectAttachmentRequest` 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. |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\ApiHub\V1\Client\RuntimeProjectAttachmentServiceClient;
    use Google\Cloud\ApiHub\V1\DeleteRuntimeProjectAttachmentRequest;

    /**
     * @param string $formattedName The name of the Runtime Project Attachment to delete.
     *                              Format:
     *                              `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}`
     *                              Please see {@see RuntimeProjectAttachmentServiceClient::runtimeProjectAttachmentName()} for help formatting this field.
     */
    function delete_runtime_project_attachment_sample(string $formattedName): void
    {
        // Create a client.
        $runtimeProjectAttachmentServiceClient = new RuntimeProjectAttachmentServiceClient();

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

        // Call the API and handle any network failures.
        try {
            $runtimeProjectAttachmentServiceClient->deleteRuntimeProjectAttachment($request);
            printf('Call completed successfully.' . PHP_EOL);
        } 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 = RuntimeProjectAttachmentServiceClient::runtimeProjectAttachmentName(
            '[PROJECT]',
            '[LOCATION]',
            '[RUNTIME_PROJECT_ATTACHMENT]'
        );

        delete_runtime_project_attachment_sample($formattedName);
    }

### getRuntimeProjectAttachment

Gets a runtime project attachment.

The async variant is
[RuntimeProjectAttachmentServiceClient::getRuntimeProjectAttachmentAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-apihub/latest/V1.Client.RuntimeProjectAttachmentServiceClient#_Google_Cloud_ApiHub_V1_Client_RuntimeProjectAttachmentServiceClient__getRuntimeProjectAttachmentAsync__)
.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-apihub/latest/V1.GetRuntimeProjectAttachmentRequest` 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-apihub/latest/V1.RuntimeProjectAttachment` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\ApiHub\V1\Client\RuntimeProjectAttachmentServiceClient;
    use Google\Cloud\ApiHub\V1\GetRuntimeProjectAttachmentRequest;
    use Google\Cloud\ApiHub\V1\RuntimeProjectAttachment;

    /**
     * @param string $formattedName The name of the API resource to retrieve.
     *                              Format:
     *                              `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}`
     *                              Please see {@see RuntimeProjectAttachmentServiceClient::runtimeProjectAttachmentName()} for help formatting this field.
     */
    function get_runtime_project_attachment_sample(string $formattedName): void
    {
        // Create a client.
        $runtimeProjectAttachmentServiceClient = new RuntimeProjectAttachmentServiceClient();

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

        // Call the API and handle any network failures.
        try {
            /** @var RuntimeProjectAttachment $response */
            $response = $runtimeProjectAttachmentServiceClient->getRuntimeProjectAttachment($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 = RuntimeProjectAttachmentServiceClient::runtimeProjectAttachmentName(
            '[PROJECT]',
            '[LOCATION]',
            '[RUNTIME_PROJECT_ATTACHMENT]'
        );

        get_runtime_project_attachment_sample($formattedName);
    }

### listRuntimeProjectAttachments

List runtime projects attached to the host project.

The async variant is
[RuntimeProjectAttachmentServiceClient::listRuntimeProjectAttachmentsAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-apihub/latest/V1.Client.RuntimeProjectAttachmentServiceClient#_Google_Cloud_ApiHub_V1_Client_RuntimeProjectAttachmentServiceClient__listRuntimeProjectAttachmentsAsync__)
.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-apihub/latest/V1.ListRuntimeProjectAttachmentsRequest` 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\ApiHub\V1\Client\RuntimeProjectAttachmentServiceClient;
    use Google\Cloud\ApiHub\V1\ListRuntimeProjectAttachmentsRequest;

    /**
     * @param string $formattedParent The parent, which owns this collection of runtime project
     *                                attachments. Format: `projects/{project}/locations/{location}`
     *                                Please see {@see RuntimeProjectAttachmentServiceClient::locationName()} for help formatting this field.
     */
    function list_runtime_project_attachments_sample(string $formattedParent): void
    {
        // Create a client.
        $runtimeProjectAttachmentServiceClient = new RuntimeProjectAttachmentServiceClient();

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

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

            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 = RuntimeProjectAttachmentServiceClient::locationName('[PROJECT]', '[LOCATION]');

        list_runtime_project_attachments_sample($formattedParent);
    }

### lookupRuntimeProjectAttachment

Look up a runtime project attachment. This API can be called in the context
of any project.

The async variant is
[RuntimeProjectAttachmentServiceClient::lookupRuntimeProjectAttachmentAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-apihub/latest/V1.Client.RuntimeProjectAttachmentServiceClient#_Google_Cloud_ApiHub_V1_Client_RuntimeProjectAttachmentServiceClient__lookupRuntimeProjectAttachmentAsync__)
.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-apihub/latest/V1.LookupRuntimeProjectAttachmentRequest` 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-apihub/latest/V1.LookupRuntimeProjectAttachmentResponse` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\ApiHub\V1\Client\RuntimeProjectAttachmentServiceClient;
    use Google\Cloud\ApiHub\V1\LookupRuntimeProjectAttachmentRequest;
    use Google\Cloud\ApiHub\V1\LookupRuntimeProjectAttachmentResponse;

    /**
     * @param string $formattedName Runtime project ID to look up runtime project attachment for.
     *                              Lookup happens across all regions. Expected format:
     *                              `projects/{project}/locations/{location}`. Please see
     *                              {@see RuntimeProjectAttachmentServiceClient::locationName()} for help formatting this field.
     */
    function lookup_runtime_project_attachment_sample(string $formattedName): void
    {
        // Create a client.
        $runtimeProjectAttachmentServiceClient = new RuntimeProjectAttachmentServiceClient();

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

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

        lookup_runtime_project_attachment_sample($formattedName);
    }

### getLocation

Gets information about a location.

The async variant is
[RuntimeProjectAttachmentServiceClient::getLocationAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-apihub/latest/V1.Client.RuntimeProjectAttachmentServiceClient#_Google_Cloud_ApiHub_V1_Client_RuntimeProjectAttachmentServiceClient__getLocationAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Cloud.Location.GetLocationRequest.html` 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/common-protos/latest/Cloud.Location.Location.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\ApiHub\V1\Client\RuntimeProjectAttachmentServiceClient;
    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.
        $runtimeProjectAttachmentServiceClient = new RuntimeProjectAttachmentServiceClient();

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

        // Call the API and handle any network failures.
        try {
            /** @var Location $response */
            $response = $runtimeProjectAttachmentServiceClient->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
[RuntimeProjectAttachmentServiceClient::listLocationsAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-apihub/latest/V1.Client.RuntimeProjectAttachmentServiceClient#_Google_Cloud_ApiHub_V1_Client_RuntimeProjectAttachmentServiceClient__listLocationsAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Cloud.Location.ListLocationsRequest.html` 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\ApiHub\V1\Client\RuntimeProjectAttachmentServiceClient;
    use Google\Cloud\Location\ListLocationsRequest;

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

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

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

            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());
        }
    }

### createRuntimeProjectAttachmentAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-apihub/latest/V1.CreateRuntimeProjectAttachmentRequest` |
| `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-apihub/latest/V1.RuntimeProjectAttachment>` |   |

### deleteRuntimeProjectAttachmentAsync

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<void>` |   |

### getRuntimeProjectAttachmentAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-apihub/latest/V1.GetRuntimeProjectAttachmentRequest` |
| `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-apihub/latest/V1.RuntimeProjectAttachment>` |   |

### listRuntimeProjectAttachmentsAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-apihub/latest/V1.ListRuntimeProjectAttachmentsRequest` |
| `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>` |   |

### lookupRuntimeProjectAttachmentAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-apihub/latest/V1.LookupRuntimeProjectAttachmentRequest` |
| `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-apihub/latest/V1.LookupRuntimeProjectAttachmentResponse>` |   |

### getLocationAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Cloud.Location.GetLocationRequest.html` |
| `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/common-protos/latest/Cloud.Location.Location.html>` |   |

### listLocationsAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Cloud.Location.ListLocationsRequest.html` |
| `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>` |   |

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

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `project` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` | The formatted project resource. |

### static::runtimeProjectAttachmentName

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

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` | The formatted runtime_project_attachment 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}
- project: projects/{project}
- runtimeProjectAttachment: projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}

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