# Google Cloud Resource Manager V3 Client - Class ProjectsClient (1.1.3)

1.1.3 (latest) 1.1.2 1.0.4 0.8.5 0.7.2 0.6.1 0.5.0 0.4.1 0.3.9 Reference documentation and code samples for the Google Cloud Resource Manager V3 Client class ProjectsClient.

Service Description: Manages Google Cloud Projects.

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 \\ ResourceManager \\ V3 \\ 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\ResourceManager\V3\ProjectsClient; $creds = new ServiceAccountCredentials($scopes, $json); $options = new ProjectsClient(['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'. |

### createProject

Request that a new project be created. The result is an `Operation` which
can be used to track the creation process. This process usually takes a few
seconds, but can sometimes take much longer. The tracking `Operation` is
automatically deleted after a few hours, so there is no need to call
`DeleteOperation`.

The async variant is [ProjectsClient::createProjectAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-resource-manager/latest/V3.Client.ProjectsClient#_Google_Cloud_ResourceManager_V3_Client_ProjectsClient__createProjectAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-resource-manager/latest/V3.CreateProjectRequest` 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-resource-manager/latest/V3.Project>` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Cloud\ResourceManager\V3\Client\ProjectsClient;
    use Google\Cloud\ResourceManager\V3\CreateProjectRequest;
    use Google\Cloud\ResourceManager\V3\Project;
    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 create_project_sample(): void
    {
        // Create a client.
        $projectsClient = new ProjectsClient();

        // Prepare the request message.
        $project = new Project();
        $request = (new CreateProjectRequest())
            ->setProject($project);

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

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

### deleteProject

Marks the project identified by the specified
`name` (for example, `projects/415104041262`) for deletion.

This method will only affect the project if it has a lifecycle state of
[ACTIVE](https://docs.cloud.google.com/php/docs/reference/cloud-resource-manager/latest/V3.Project.State#_Google_Cloud_ResourceManager_V3_Project_State__ACTIVE).

This method changes the Project's lifecycle state from
[ACTIVE](https://docs.cloud.google.com/php/docs/reference/cloud-resource-manager/latest/V3.Project.State#_Google_Cloud_ResourceManager_V3_Project_State__ACTIVE)
to
[DELETE_REQUESTED](https://docs.cloud.google.com/php/docs/reference/cloud-resource-manager/latest/V3.Project.State#_Google_Cloud_ResourceManager_V3_Project_State__DELETE_REQUESTED).
The deletion starts at an unspecified time,
at which point the Project is no longer accessible.

Until the deletion completes, you can check the lifecycle state
checked by retrieving the project with [GetProject](https://docs.cloud.google.com/php/docs/reference/cloud-resource-manager/latest/V3.Client.ProjectsClient#_Google_Cloud_ResourceManager_V3_Client_ProjectsClient__getProject__),
and the project remains visible to [ListProjects](https://docs.cloud.google.com/php/docs/reference/cloud-resource-manager/latest/V3.Client.ProjectsClient#_Google_Cloud_ResourceManager_V3_Client_ProjectsClient__listProjects__).
However, you cannot update the project.

After the deletion completes, the project is not retrievable by
the [GetProject](https://docs.cloud.google.com/php/docs/reference/cloud-resource-manager/latest/V3.Client.ProjectsClient#_Google_Cloud_ResourceManager_V3_Client_ProjectsClient__getProject__),
[ListProjects](https://docs.cloud.google.com/php/docs/reference/cloud-resource-manager/latest/V3.Client.ProjectsClient#_Google_Cloud_ResourceManager_V3_Client_ProjectsClient__listProjects__), and
[SearchProjects](https://docs.cloud.google.com/php/docs/reference/cloud-resource-manager/latest/V3.Client.ProjectsClient#_Google_Cloud_ResourceManager_V3_Client_ProjectsClient__searchProjects__)
methods.

This method behaves idempotently, such that deleting a `DELETE_REQUESTED`
project will not cause an error, but also won't do anything.

The caller must have `resourcemanager.projects.delete` permissions for this
project.

The async variant is [ProjectsClient::deleteProjectAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-resource-manager/latest/V3.Client.ProjectsClient#_Google_Cloud_ResourceManager_V3_Client_ProjectsClient__deleteProjectAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-resource-manager/latest/V3.DeleteProjectRequest` 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-resource-manager/latest/V3.Project>` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Cloud\ResourceManager\V3\Client\ProjectsClient;
    use Google\Cloud\ResourceManager\V3\DeleteProjectRequest;
    use Google\Cloud\ResourceManager\V3\Project;
    use Google\Rpc\Status;

    /**
     * @param string $formattedName The name of the Project (for example, `projects/415104041262`). Please see
     *                              {@see ProjectsClient::projectName()} for help formatting this field.
     */
    function delete_project_sample(string $formattedName): void
    {
        // Create a client.
        $projectsClient = new ProjectsClient();

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

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

            if ($response->operationSucceeded()) {
                /** @var Project $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 = ProjectsClient::projectName('[PROJECT]');

        delete_project_sample($formattedName);
    }

### getIamPolicy

Returns the IAM access control policy for the specified project, in the
format `projects/{ProjectIdOrNumber}` e.g. projects/123.

Permission is denied if the policy or the resource do not exist.

The async variant is [ProjectsClient::getIamPolicyAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-resource-manager/latest/V3.Client.ProjectsClient#_Google_Cloud_ResourceManager_V3_Client_ProjectsClient__getIamPolicyAsync__) .

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

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\Iam\V1\GetIamPolicyRequest;
    use Google\Cloud\Iam\V1\Policy;
    use Google\Cloud\ResourceManager\V3\Client\ProjectsClient;

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

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

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

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

        get_iam_policy_sample($resource);
    }

### getProject

Retrieves the project identified by the specified `name` (for example,
`projects/415104041262`).

The caller must have `resourcemanager.projects.get` permission
for this project.

The async variant is [ProjectsClient::getProjectAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-resource-manager/latest/V3.Client.ProjectsClient#_Google_Cloud_ResourceManager_V3_Client_ProjectsClient__getProjectAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-resource-manager/latest/V3.GetProjectRequest` 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-resource-manager/latest/V3.Project` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\ResourceManager\V3\Client\ProjectsClient;
    use Google\Cloud\ResourceManager\V3\GetProjectRequest;
    use Google\Cloud\ResourceManager\V3\Project;

    /**
     * @param string $formattedName The name of the project (for example, `projects/415104041262`). Please see
     *                              {@see ProjectsClient::projectName()} for help formatting this field.
     */
    function get_project_sample(string $formattedName): void
    {
        // Create a client.
        $projectsClient = new ProjectsClient();

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

        // Call the API and handle any network failures.
        try {
            /** @var Project $response */
            $response = $projectsClient->getProject($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 = ProjectsClient::projectName('[PROJECT]');

        get_project_sample($formattedName);
    }

### listProjects

Lists projects that are direct children of the specified folder or
organization resource. `list()` provides a strongly consistent view of the
projects underneath the specified parent resource. `list()` returns
projects sorted based upon the (ascending) lexical ordering of their
`display_name`. The caller must have `resourcemanager.projects.list`
permission on the identified parent.

The async variant is [ProjectsClient::listProjectsAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-resource-manager/latest/V3.Client.ProjectsClient#_Google_Cloud_ResourceManager_V3_Client_ProjectsClient__listProjectsAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-resource-manager/latest/V3.ListProjectsRequest` 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\ResourceManager\V3\Client\ProjectsClient;
    use Google\Cloud\ResourceManager\V3\ListProjectsRequest;
    use Google\Cloud\ResourceManager\V3\Project;

    /**
     * @param string $parent The name of the parent resource whose projects are being listed.
     *                       Only children of this parent resource are listed; descendants are not
     *                       listed.
     *
     *                       If the parent is a folder, use the value `folders/{folder_id}`. If the
     *                       parent is an organization, use the value `organizations/{org_id}`.
     */
    function list_projects_sample(string $parent): void
    {
        // Create a client.
        $projectsClient = new ProjectsClient();

        // Prepare the request message.
        $request = (new ListProjectsRequest())
            ->setParent($parent);

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

            /** @var Project $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
    {
        $parent = '[PARENT]';

        list_projects_sample($parent);
    }

### moveProject

Move a project to another place in your resource hierarchy, under a new
resource parent.

Returns an operation which can be used to track the process of the project
move workflow.
Upon success, the `Operation.response` field will be populated with the
moved project.

The caller must have `resourcemanager.projects.move` permission on the
project, on the project's current and proposed new parent.

If project has no current parent, or it currently does not have an
associated organization resource, you will also need the
`resourcemanager.projects.setIamPolicy` permission in the project.

The async variant is [ProjectsClient::moveProjectAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-resource-manager/latest/V3.Client.ProjectsClient#_Google_Cloud_ResourceManager_V3_Client_ProjectsClient__moveProjectAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-resource-manager/latest/V3.MoveProjectRequest` 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-resource-manager/latest/V3.Project>` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Cloud\ResourceManager\V3\Client\ProjectsClient;
    use Google\Cloud\ResourceManager\V3\MoveProjectRequest;
    use Google\Cloud\ResourceManager\V3\Project;
    use Google\Rpc\Status;

    /**
     * @param string $formattedName     The name of the project to move. Please see
     *                                  {@see ProjectsClient::projectName()} for help formatting this field.
     * @param string $destinationParent The new parent to move the Project under.
     */
    function move_project_sample(string $formattedName, string $destinationParent): void
    {
        // Create a client.
        $projectsClient = new ProjectsClient();

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

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

            if ($response->operationSucceeded()) {
                /** @var Project $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 = ProjectsClient::projectName('[PROJECT]');
        $destinationParent = '[DESTINATION_PARENT]';

        move_project_sample($formattedName, $destinationParent);
    }

### searchProjects

Search for projects that the caller has both `resourcemanager.projects.get`
permission on, and also satisfy the specified query.

This method returns projects in an unspecified order.

This method is eventually consistent with project mutations; this means
that a newly created project may not appear in the results or recent
updates to an existing project may not be reflected in the results. To
retrieve the latest state of a project, use the
[GetProject](https://docs.cloud.google.com/php/docs/reference/cloud-resource-manager/latest/V3.Client.ProjectsClient#_Google_Cloud_ResourceManager_V3_Client_ProjectsClient__getProject__) method.

The async variant is [ProjectsClient::searchProjectsAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-resource-manager/latest/V3.Client.ProjectsClient#_Google_Cloud_ResourceManager_V3_Client_ProjectsClient__searchProjectsAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-resource-manager/latest/V3.SearchProjectsRequest` 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\ResourceManager\V3\Client\ProjectsClient;
    use Google\Cloud\ResourceManager\V3\Project;
    use Google\Cloud\ResourceManager\V3\SearchProjectsRequest;

    /**
     * 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 search_projects_sample(): void
    {
        // Create a client.
        $projectsClient = new ProjectsClient();

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

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

            /** @var Project $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());
        }
    }

### setIamPolicy

Sets the IAM access control policy for the specified project, in the
format `projects/{ProjectIdOrNumber}` e.g. projects/123.

CAUTION: This method will replace the existing policy, and cannot be used
to append additional IAM settings.

Note: Removing service accounts from policies or changing their roles can
render services completely inoperable. It is important to understand how
the service account is being used before removing or updating its roles.

The following constraints apply when using `setIamPolicy()`:

- Project does not support `allUsers` and `allAuthenticatedUsers` as
  `members` in a `Binding` of a `Policy`.

- The owner role can be granted to a `user`, `serviceAccount`, or a group
  that is part of an organization. For example,
  group@myownpersonaldomain.com could be added as an owner to a project in
  the myownpersonaldomain.com organization, but not the examplepetstore.com
  organization.

- Service accounts can be made owners of a project directly
  without any restrictions. However, to be added as an owner, a user must be
  invited using the Cloud Platform console and must accept the invitation.

- A user cannot be granted the owner role using `setIamPolicy()`. The user
  must be granted the owner role using the Cloud Platform Console and must
  explicitly accept the invitation.

- Invitations to grant the owner role cannot be sent using
  `setIamPolicy()`;
  they must be sent only using the Cloud Platform Console.

- If the project is not part of an organization, there must be at least
  one owner who has accepted the Terms of Service (ToS) agreement in the
  policy. Calling `setIamPolicy()` to remove the last ToS-accepted owner
  from the policy will fail. This restriction also applies to legacy
  projects that no longer have owners who have accepted the ToS. Edits to
  IAM policies will be rejected until the lack of a ToS-accepting owner is
  rectified. If the project is part of an organization, you can remove all
  owners, potentially making the organization inaccessible.

The async variant is [ProjectsClient::setIamPolicyAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-resource-manager/latest/V3.Client.ProjectsClient#_Google_Cloud_ResourceManager_V3_Client_ProjectsClient__setIamPolicyAsync__) .

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

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\Iam\V1\Policy;
    use Google\Cloud\Iam\V1\SetIamPolicyRequest;
    use Google\Cloud\ResourceManager\V3\Client\ProjectsClient;

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

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

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

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

        set_iam_policy_sample($resource);
    }

### testIamPermissions

Returns permissions that a caller has on the specified project, in the
format `projects/{ProjectIdOrNumber}` e.g. projects/123..

The async variant is ProjectsClient::testIamPermissionsAsync() .

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

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\Iam\V1\TestIamPermissionsRequest;
    use Google\Cloud\Iam\V1\TestIamPermissionsResponse;
    use Google\Cloud\ResourceManager\V3\Client\ProjectsClient;

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

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

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

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

        test_iam_permissions_sample($resource, $permissionsElement);
    }

### undeleteProject

Restores the project identified by the specified
`name` (for example, `projects/415104041262`).

You can only use this method for a project that has a lifecycle state of
DELETE_REQUESTED.
After deletion starts, the project cannot be restored.

The caller must have `resourcemanager.projects.undelete` permission for
this project.

The async variant is [ProjectsClient::undeleteProjectAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-resource-manager/latest/V3.Client.ProjectsClient#_Google_Cloud_ResourceManager_V3_Client_ProjectsClient__undeleteProjectAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-resource-manager/latest/V3.UndeleteProjectRequest` 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-resource-manager/latest/V3.Project>` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Cloud\ResourceManager\V3\Client\ProjectsClient;
    use Google\Cloud\ResourceManager\V3\Project;
    use Google\Cloud\ResourceManager\V3\UndeleteProjectRequest;
    use Google\Rpc\Status;

    /**
     * @param string $formattedName The name of the project (for example, `projects/415104041262`).
     *
     *                              Please see
     *                              {@see ProjectsClient::projectName()} for help formatting this field.
     */
    function undelete_project_sample(string $formattedName): void
    {
        // Create a client.
        $projectsClient = new ProjectsClient();

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

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

            if ($response->operationSucceeded()) {
                /** @var Project $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 = ProjectsClient::projectName('[PROJECT]');

        undelete_project_sample($formattedName);
    }

### updateProject

Updates the `display_name` and labels of the project identified by the
specified `name` (for example, `projects/415104041262`). Deleting all
labels requires an update mask for labels field.

The caller must have `resourcemanager.projects.update` permission for this
project.

The async variant is [ProjectsClient::updateProjectAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-resource-manager/latest/V3.Client.ProjectsClient#_Google_Cloud_ResourceManager_V3_Client_ProjectsClient__updateProjectAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-resource-manager/latest/V3.UpdateProjectRequest` 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-resource-manager/latest/V3.Project>` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Cloud\ResourceManager\V3\Client\ProjectsClient;
    use Google\Cloud\ResourceManager\V3\Project;
    use Google\Cloud\ResourceManager\V3\UpdateProjectRequest;
    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_project_sample(): void
    {
        // Create a client.
        $projectsClient = new ProjectsClient();

        // Prepare the request message.
        $project = new Project();
        $request = (new UpdateProjectRequest())
            ->setProject($project);

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

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

### createProjectAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-resource-manager/latest/V3.CreateProjectRequest` |
| `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>` |   |

### deleteProjectAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-resource-manager/latest/V3.DeleteProjectRequest` |
| `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>` |   |

### getIamPolicyAsync

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

### getProjectAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-resource-manager/latest/V3.GetProjectRequest` |
| `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-resource-manager/latest/V3.Project>` |   |

### listProjectsAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-resource-manager/latest/V3.ListProjectsRequest` |
| `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>` |   |

### moveProjectAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-resource-manager/latest/V3.MoveProjectRequest` |
| `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>` |   |

### searchProjectsAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-resource-manager/latest/V3.SearchProjectsRequest` |
| `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>` |   |

### setIamPolicyAsync

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

### testIamPermissionsAsync

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

### undeleteProjectAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-resource-manager/latest/V3.UndeleteProjectRequest` |
| `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>` |   |

### updateProjectAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-resource-manager/latest/V3.UpdateProjectRequest` |
| `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::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::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

- project: projects/{project}

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