Google Cloud Access Approval V1 Client - Class AccessApprovalClient (2.0.3)

Reference documentation and code samples for the Google Cloud Access Approval V1 Client class AccessApprovalClient.

Service Description: This API allows a customer to manage accesses to cloud resources by Google personnel. It defines the following resource model:

  • The API has a collection of ApprovalRequest resources, named approvalRequests/{approval_request}
  • The API has top-level settings per Project/Folder/Organization, named accessApprovalSettings

The service also periodically emails a list of recipients, defined at the Project/Folder/Organization level in the accessApprovalSettings, when there is a pending ApprovalRequest for them to act on. The ApprovalRequests can also optionally be published to a Pub/Sub topic owned by the customer (contact support if you would like to enable Pub/Sub notifications).

ApprovalRequests can be approved or dismissed. Google personnel can only access the indicated resource or resources if the request is approved (subject to some exclusions: https://cloud.google.com/access-approval/docs/overview#exclusions).

Note: Using Access Approval functionality will mean that Google may not be able to meet the SLAs for your chosen products, as any support response times may be dramatically increased. As such the SLAs do not apply to any service disruption to the extent impacted by Customer's use of Access Approval. Do not enable Access Approval for projects where you may require high service availability and rapid response by Google Cloud Support.

After a request is approved or dismissed, no further action may be taken on it. Requests with the requested_expiration in the past or with no activity for 14 days are considered dismissed. When an approval expires, the request is considered dismissed.

If a request is not approved or dismissed, we call it pending.

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

Methods

__construct

Constructor.

Parameters
Name Description
options array

Optional. Options for configuring the service API wrapper.

↳ apiEndpoint string

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

↳ credentials string|array|FetchAuthTokenInterface|CredentialsWrapper

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

↳ credentialsConfig array

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

↳ disableRetries bool

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

↳ clientConfig string|array

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

↳ transport string|TransportInterface

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

↳ transportConfig array

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

↳ clientCertSource callable

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

↳ logger false|LoggerInterface

A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the 'GOOGLE_SDK_PHP_LOGGING' environment flag

approveApprovalRequest

Approves a request and returns the updated ApprovalRequest.

Returns NOT_FOUND if the request does not exist. Returns FAILED_PRECONDITION if the request exists but is not in a pending state.

The async variant is AccessApprovalClient::approveApprovalRequestAsync() .

Parameters
Name Description
request Google\Cloud\AccessApproval\V1\ApproveApprovalRequestMessage

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\Cloud\AccessApproval\V1\ApprovalRequest
Example
use Google\ApiCore\ApiException;
use Google\Cloud\AccessApproval\V1\ApprovalRequest;
use Google\Cloud\AccessApproval\V1\ApproveApprovalRequestMessage;
use Google\Cloud\AccessApproval\V1\Client\AccessApprovalClient;

/**
 * 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 approve_approval_request_sample(): void
{
    // Create a client.
    $accessApprovalClient = new AccessApprovalClient();

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

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

deleteAccessApprovalSettings

Deletes the settings associated with a project, folder, or organization.

This will have the effect of disabling Access Approval for the project, folder, or organization, but only if all ancestors also have Access Approval disabled. If Access Approval is enabled at a higher level of the hierarchy, then Access Approval will still be enabled at this level as the settings are inherited.

The async variant is AccessApprovalClient::deleteAccessApprovalSettingsAsync() .

Parameters
Name Description
request Google\Cloud\AccessApproval\V1\DeleteAccessApprovalSettingsMessage

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Example
use Google\ApiCore\ApiException;
use Google\Cloud\AccessApproval\V1\Client\AccessApprovalClient;
use Google\Cloud\AccessApproval\V1\DeleteAccessApprovalSettingsMessage;

/**
 * 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 delete_access_approval_settings_sample(): void
{
    // Create a client.
    $accessApprovalClient = new AccessApprovalClient();

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

    // Call the API and handle any network failures.
    try {
        $accessApprovalClient->deleteAccessApprovalSettings($request);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

dismissApprovalRequest

Dismisses a request. Returns the updated ApprovalRequest.

NOTE: This does not deny access to the resource if another request has been made and approved. It is equivalent in effect to ignoring the request altogether.

Returns NOT_FOUND if the request does not exist.

Returns FAILED_PRECONDITION if the request exists but is not in a pending state.

The async variant is AccessApprovalClient::dismissApprovalRequestAsync() .

Parameters
Name Description
request Google\Cloud\AccessApproval\V1\DismissApprovalRequestMessage

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\Cloud\AccessApproval\V1\ApprovalRequest
Example
use Google\ApiCore\ApiException;
use Google\Cloud\AccessApproval\V1\ApprovalRequest;
use Google\Cloud\AccessApproval\V1\Client\AccessApprovalClient;
use Google\Cloud\AccessApproval\V1\DismissApprovalRequestMessage;

/**
 * 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 dismiss_approval_request_sample(): void
{
    // Create a client.
    $accessApprovalClient = new AccessApprovalClient();

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

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

getAccessApprovalServiceAccount

Retrieves the service account that is used by Access Approval to access KMS keys for signing approved approval requests.

The async variant is AccessApprovalClient::getAccessApprovalServiceAccountAsync() .

Parameters
Name Description
request Google\Cloud\AccessApproval\V1\GetAccessApprovalServiceAccountMessage

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\Cloud\AccessApproval\V1\AccessApprovalServiceAccount
Example
use Google\ApiCore\ApiException;
use Google\Cloud\AccessApproval\V1\AccessApprovalServiceAccount;
use Google\Cloud\AccessApproval\V1\Client\AccessApprovalClient;
use Google\Cloud\AccessApproval\V1\GetAccessApprovalServiceAccountMessage;

/**
 * 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_access_approval_service_account_sample(): void
{
    // Create a client.
    $accessApprovalClient = new AccessApprovalClient();

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

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

getAccessApprovalSettings

Gets the settings associated with a project, folder, or organization.

The async variant is AccessApprovalClient::getAccessApprovalSettingsAsync() .

Parameters
Name Description
request Google\Cloud\AccessApproval\V1\GetAccessApprovalSettingsMessage

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\Cloud\AccessApproval\V1\AccessApprovalSettings
Example
use Google\ApiCore\ApiException;
use Google\Cloud\AccessApproval\V1\AccessApprovalSettings;
use Google\Cloud\AccessApproval\V1\Client\AccessApprovalClient;
use Google\Cloud\AccessApproval\V1\GetAccessApprovalSettingsMessage;

/**
 * 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_access_approval_settings_sample(): void
{
    // Create a client.
    $accessApprovalClient = new AccessApprovalClient();

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

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

getApprovalRequest

Gets an approval request. Returns NOT_FOUND if the request does not exist.

The async variant is AccessApprovalClient::getApprovalRequestAsync() .

Parameters
Name Description
request Google\Cloud\AccessApproval\V1\GetApprovalRequestMessage

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\Cloud\AccessApproval\V1\ApprovalRequest
Example
use Google\ApiCore\ApiException;
use Google\Cloud\AccessApproval\V1\ApprovalRequest;
use Google\Cloud\AccessApproval\V1\Client\AccessApprovalClient;
use Google\Cloud\AccessApproval\V1\GetApprovalRequestMessage;

/**
 * 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_approval_request_sample(): void
{
    // Create a client.
    $accessApprovalClient = new AccessApprovalClient();

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

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

invalidateApprovalRequest

Invalidates an existing ApprovalRequest. Returns the updated ApprovalRequest.

NOTE: This does not deny access to the resource if another request has been made and approved. It only invalidates a single approval.

Returns FAILED_PRECONDITION if the request exists but is not in an approved state.

The async variant is AccessApprovalClient::invalidateApprovalRequestAsync() .

Parameters
Name Description
request Google\Cloud\AccessApproval\V1\InvalidateApprovalRequestMessage

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\Cloud\AccessApproval\V1\ApprovalRequest
Example
use Google\ApiCore\ApiException;
use Google\Cloud\AccessApproval\V1\ApprovalRequest;
use Google\Cloud\AccessApproval\V1\Client\AccessApprovalClient;
use Google\Cloud\AccessApproval\V1\InvalidateApprovalRequestMessage;

/**
 * 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 invalidate_approval_request_sample(): void
{
    // Create a client.
    $accessApprovalClient = new AccessApprovalClient();

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

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

listApprovalRequests

Lists approval requests associated with a project, folder, or organization.

Approval requests can be filtered by state (pending, active, dismissed). The order is reverse chronological.

The async variant is AccessApprovalClient::listApprovalRequestsAsync() .

Parameters
Name Description
request Google\Cloud\AccessApproval\V1\ListApprovalRequestsMessage

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\AccessApproval\V1\ApprovalRequest;
use Google\Cloud\AccessApproval\V1\Client\AccessApprovalClient;
use Google\Cloud\AccessApproval\V1\ListApprovalRequestsMessage;

/**
 * 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_approval_requests_sample(): void
{
    // Create a client.
    $accessApprovalClient = new AccessApprovalClient();

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

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

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

updateAccessApprovalSettings

Updates the settings associated with a project, folder, or organization.

Settings to update are determined by the value of field_mask.

The async variant is AccessApprovalClient::updateAccessApprovalSettingsAsync() .

Parameters
Name Description
request Google\Cloud\AccessApproval\V1\UpdateAccessApprovalSettingsMessage

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\Cloud\AccessApproval\V1\AccessApprovalSettings
Example
use Google\ApiCore\ApiException;
use Google\Cloud\AccessApproval\V1\AccessApprovalSettings;
use Google\Cloud\AccessApproval\V1\Client\AccessApprovalClient;
use Google\Cloud\AccessApproval\V1\UpdateAccessApprovalSettingsMessage;

/**
 * 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_access_approval_settings_sample(): void
{
    // Create a client.
    $accessApprovalClient = new AccessApprovalClient();

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

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

approveApprovalRequestAsync

Parameters
Name Description
request Google\Cloud\AccessApproval\V1\ApproveApprovalRequestMessage
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\AccessApproval\V1\ApprovalRequest>

deleteAccessApprovalSettingsAsync

Parameters
Name Description
request Google\Cloud\AccessApproval\V1\DeleteAccessApprovalSettingsMessage
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<void>

dismissApprovalRequestAsync

Parameters
Name Description
request Google\Cloud\AccessApproval\V1\DismissApprovalRequestMessage
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\AccessApproval\V1\ApprovalRequest>

getAccessApprovalServiceAccountAsync

Parameters
Name Description
request Google\Cloud\AccessApproval\V1\GetAccessApprovalServiceAccountMessage
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\AccessApproval\V1\AccessApprovalServiceAccount>

getAccessApprovalSettingsAsync

Parameters
Name Description
request Google\Cloud\AccessApproval\V1\GetAccessApprovalSettingsMessage
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\AccessApproval\V1\AccessApprovalSettings>

getApprovalRequestAsync

Parameters
Name Description
request Google\Cloud\AccessApproval\V1\GetApprovalRequestMessage
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\AccessApproval\V1\ApprovalRequest>

invalidateApprovalRequestAsync

Parameters
Name Description
request Google\Cloud\AccessApproval\V1\InvalidateApprovalRequestMessage
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\AccessApproval\V1\ApprovalRequest>

listApprovalRequestsAsync

Parameters
Name Description
request Google\Cloud\AccessApproval\V1\ListApprovalRequestsMessage
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse>

updateAccessApprovalSettingsAsync

Parameters
Name Description
request Google\Cloud\AccessApproval\V1\UpdateAccessApprovalSettingsMessage
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\AccessApproval\V1\AccessApprovalSettings>

static::accessApprovalSettingsName

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

Parameter
Name Description
project string
Returns
Type Description
string The formatted access_approval_settings resource.

static::approvalRequestName

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

Parameters
Name Description
project string
approvalRequest string
Returns
Type Description
string The formatted approval_request resource.

static::folderName

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

Parameter
Name Description
folder string
Returns
Type Description
string The formatted folder resource.

static::folderAccessApprovalSettingsName

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

Parameter
Name Description
folder string
Returns
Type Description
string The formatted folder_accessApprovalSettings resource.

static::folderApprovalRequestName

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

Parameters
Name Description
folder string
approvalRequest string
Returns
Type Description
string The formatted folder_approval_request resource.

static::organizationName

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

Parameter
Name Description
organization string
Returns
Type Description
string The formatted organization resource.

static::organizationAccessApprovalSettingsName

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

Parameter
Name Description
organization string
Returns
Type Description
string The formatted organization_accessApprovalSettings resource.

static::organizationApprovalRequestName

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

Parameters
Name Description
organization string
approvalRequest string
Returns
Type Description
string The formatted organization_approval_request 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::projectAccessApprovalSettingsName

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

Parameter
Name Description
project string
Returns
Type Description
string The formatted project_accessApprovalSettings resource.

static::projectApprovalRequestName

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

Parameters
Name Description
project string
approvalRequest string
Returns
Type Description
string The formatted project_approval_request 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

  • accessApprovalSettings: projects/{project}/accessApprovalSettings
  • approvalRequest: projects/{project}/approvalRequests/{approval_request}
  • folder: folders/{folder}
  • folderAccessApprovalSettings: folders/{folder}/accessApprovalSettings
  • folderApprovalRequest: folders/{folder}/approvalRequests/{approval_request}
  • organization: organizations/{organization}
  • organizationAccessApprovalSettings: organizations/{organization}/accessApprovalSettings
  • organizationApprovalRequest: organizations/{organization}/approvalRequests/{approval_request}
  • project: projects/{project}
  • projectAccessApprovalSettings: projects/{project}/accessApprovalSettings
  • projectApprovalRequest: projects/{project}/approvalRequests/{approval_request}

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.