Google Cloud Access Approval V1 Client - Class AccessApprovalClient (1.1.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.

This class is currently experimental and may be subject to changes. See Google\Cloud\AccessApproval\V1\AccessApprovalClient for the stable implementation

Namespace

Google \ Cloud \ AccessApproval \ V1 \ Client

Methods

__construct

Constructor.

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

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 Google\Cloud\AccessApproval\V1\Client\AccessApprovalClient::approveApprovalRequestAsync() .

Parameters
NameDescription
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
TypeDescription
Google\Cloud\AccessApproval\V1\ApprovalRequest

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 Google\Cloud\AccessApproval\V1\Client\AccessApprovalClient::deleteAccessApprovalSettingsAsync() .

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

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 Google\Cloud\AccessApproval\V1\Client\AccessApprovalClient::dismissApprovalRequestAsync() .

Parameters
NameDescription
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
TypeDescription
Google\Cloud\AccessApproval\V1\ApprovalRequest

getAccessApprovalServiceAccount

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

The async variant is Google\Cloud\AccessApproval\V1\Client\AccessApprovalClient::getAccessApprovalServiceAccountAsync() .

Parameters
NameDescription
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
TypeDescription
Google\Cloud\AccessApproval\V1\AccessApprovalServiceAccount

getAccessApprovalSettings

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

The async variant is Google\Cloud\AccessApproval\V1\Client\AccessApprovalClient::getAccessApprovalSettingsAsync() .

Parameters
NameDescription
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
TypeDescription
Google\Cloud\AccessApproval\V1\AccessApprovalSettings

getApprovalRequest

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

The async variant is Google\Cloud\AccessApproval\V1\Client\AccessApprovalClient::getApprovalRequestAsync() .

Parameters
NameDescription
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
TypeDescription
Google\Cloud\AccessApproval\V1\ApprovalRequest

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 Google\Cloud\AccessApproval\V1\Client\AccessApprovalClient::invalidateApprovalRequestAsync() .

Parameters
NameDescription
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
TypeDescription
Google\Cloud\AccessApproval\V1\ApprovalRequest

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 Google\Cloud\AccessApproval\V1\Client\AccessApprovalClient::listApprovalRequestsAsync() .

Parameters
NameDescription
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
TypeDescription
Google\ApiCore\PagedListResponse

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 Google\Cloud\AccessApproval\V1\Client\AccessApprovalClient::updateAccessApprovalSettingsAsync() .

Parameters
NameDescription
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
TypeDescription
Google\Cloud\AccessApproval\V1\AccessApprovalSettings

approveApprovalRequestAsync

Parameters
NameDescription
request Google\Cloud\AccessApproval\V1\ApproveApprovalRequestMessage
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

deleteAccessApprovalSettingsAsync

Parameters
NameDescription
request Google\Cloud\AccessApproval\V1\DeleteAccessApprovalSettingsMessage
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

dismissApprovalRequestAsync

Parameters
NameDescription
request Google\Cloud\AccessApproval\V1\DismissApprovalRequestMessage
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getAccessApprovalServiceAccountAsync

Parameters
NameDescription
request Google\Cloud\AccessApproval\V1\GetAccessApprovalServiceAccountMessage
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getAccessApprovalSettingsAsync

Parameters
NameDescription
request Google\Cloud\AccessApproval\V1\GetAccessApprovalSettingsMessage
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getApprovalRequestAsync

Parameters
NameDescription
request Google\Cloud\AccessApproval\V1\GetApprovalRequestMessage
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

invalidateApprovalRequestAsync

Parameters
NameDescription
request Google\Cloud\AccessApproval\V1\InvalidateApprovalRequestMessage
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

listApprovalRequestsAsync

Parameters
NameDescription
request Google\Cloud\AccessApproval\V1\ListApprovalRequestsMessage
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

updateAccessApprovalSettingsAsync

Parameters
NameDescription
request Google\Cloud\AccessApproval\V1\UpdateAccessApprovalSettingsMessage
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

static::accessApprovalSettingsName

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

Parameter
NameDescription
project string
Returns
TypeDescription
stringThe formatted access_approval_settings resource.

static::approvalRequestName

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

Parameters
NameDescription
project string
approvalRequest string
Returns
TypeDescription
stringThe formatted approval_request resource.

static::folderName

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

Parameter
NameDescription
folder string
Returns
TypeDescription
stringThe formatted folder resource.

static::folderAccessApprovalSettingsName

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

Parameter
NameDescription
folder string
Returns
TypeDescription
stringThe formatted folder_accessApprovalSettings resource.

static::folderApprovalRequestName

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

Parameters
NameDescription
folder string
approvalRequest string
Returns
TypeDescription
stringThe formatted folder_approval_request resource.

static::organizationName

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

Parameter
NameDescription
organization string
Returns
TypeDescription
stringThe formatted organization resource.

static::organizationAccessApprovalSettingsName

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

Parameter
NameDescription
organization string
Returns
TypeDescription
stringThe formatted organization_accessApprovalSettings resource.

static::organizationApprovalRequestName

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

Parameters
NameDescription
organization string
approvalRequest string
Returns
TypeDescription
stringThe formatted organization_approval_request resource.

static::projectName

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

Parameter
NameDescription
project string
Returns
TypeDescription
stringThe formatted project resource.

static::projectAccessApprovalSettingsName

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

Parameter
NameDescription
project string
Returns
TypeDescription
stringThe formatted project_accessApprovalSettings resource.

static::projectApprovalRequestName

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

Parameters
NameDescription
project string
approvalRequest string
Returns
TypeDescription
stringThe 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
NameDescription
formattedName string

The formatted name string

template string

Optional name of template to match

Returns
TypeDescription
arrayAn associative array from name component IDs to component values.