1.3.0 (latest) 1.2.4 1.1.3 1.0.4 0.5.5 0.4.5 0.3.5 Reference documentation and code samples for the Access Context Manager V1 Client class AccessContextManagerClient.

Service Description: API for setting [access levels](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.AccessLevel) and [service
perimeters](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.ServicePerimeter)
for Google Cloud projects. Each organization has one [access policy](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.AccessPolicy) that contains the
[access levels](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.AccessLevel)
and [service perimeters](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.ServicePerimeter). This
[access policy](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.AccessPolicy) is
applicable to all resources in the organization.

AccessPolicies

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 \\ Identity \\ AccessContextManager \\ V1 \\ Client

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `options` | `array|https://docs.cloud.google.com/php/docs/reference/gax/latest/Options.ClientOptions.html` Optional. Options for configuring the service API wrapper. |
| `↳ apiEndpoint` | `string` The address of the API remote host. May optionally include the port, formatted as " |
| `↳ credentials` | `https://docs.cloud.google.com/php/docs/reference/auth/latest/FetchAuthTokenInterface.html|https://docs.cloud.google.com/php/docs/reference/gax/latest/CredentialsWrapper.html` This option should only be used with a pre-constructed [Google\\Auth\\FetchAuthTokenInterface](https://docs.cloud.google.com/php/docs/reference/auth/latest/FetchAuthTokenInterface.html) or [Google\\ApiCore\\CredentialsWrapper](https://docs.cloud.google.com/php/docs/reference/gax/latest/CredentialsWrapper.html) object. Note that when one of these objects are provided, any settings in $credentialsConfig will be ignored. **Important** : If you are providing a path to a credentials file, or a decoded credentials file as a PHP array, this usage is now DEPRECATED. Providing an unvalidated credential configuration to Google APIs can compromise the security of your systems and data. It is recommended to create the credentials explicitly `use Google\Auth\Credentials\ServiceAccountCredentials; use Google\Identity\AccessContextManager\V1\AccessContextManagerClient; $creds = new ServiceAccountCredentials($scopes, $json); $options = new AccessContextManagerClient(['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'. |

### commitServicePerimeters

Commits the dry-run specification for all the [service perimeters](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.ServicePerimeter) in an
[access policy](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.AccessPolicy).

A commit operation on a service perimeter involves copying its `spec` field
to the `status` field of the service perimeter. Only [service perimeters](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.ServicePerimeter) with
`use_explicit_dry_run_spec` field set to true are affected by a commit
operation. The long-running operation from this RPC has a successful
status after the dry-run specifications for all the [service perimeters](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.ServicePerimeter) have been
committed. If a commit fails, it causes the long-running operation to
return an error response and the entire commit operation is cancelled.
When successful, the Operation.response field contains
CommitServicePerimetersResponse. The `dry_run` and the `spec` fields are
cleared after a successful commit operation.

The async variant is
[AccessContextManagerClient::commitServicePerimetersAsync()](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.Client.AccessContextManagerClient#_Google_Identity_AccessContextManager_V1_Client_AccessContextManagerClient__commitServicePerimetersAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.CommitServicePerimetersRequest` 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/access-context-manager/latest/V1.CommitServicePerimetersResponse>` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Identity\AccessContextManager\V1\Client\AccessContextManagerClient;
    use Google\Identity\AccessContextManager\V1\CommitServicePerimetersRequest;
    use Google\Identity\AccessContextManager\V1\CommitServicePerimetersResponse;
    use Google\Rpc\Status;

    /**
     * @param string $formattedParent Resource name for the parent [Access Policy]
     *                                [google.identity.accesscontextmanager.v1.AccessPolicy] which owns all
     *                                [Service Perimeters]
     *                                [google.identity.accesscontextmanager.v1.ServicePerimeter] in scope for
     *                                the commit operation.
     *
     *                                Format: `accessPolicies/{policy_id}`
     *                                Please see {@see AccessContextManagerClient::accessPolicyName()} for help formatting this field.
     */
    function commit_service_perimeters_sample(string $formattedParent): void
    {
        // Create a client.
        $accessContextManagerClient = new AccessContextManagerClient();

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

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

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

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

        commit_service_perimeters_sample($formattedParent);
    }

### createAccessLevel

Creates an [access level](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.AccessLevel). The long-running
operation from this RPC has a successful status after the [access
level](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.AccessLevel)
propagates to long-lasting storage. If [access levels](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.AccessLevel) contain
errors, an error response is returned for the first error encountered.

The async variant is [AccessContextManagerClient::createAccessLevelAsync()](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.Client.AccessContextManagerClient#_Google_Identity_AccessContextManager_V1_Client_AccessContextManagerClient__createAccessLevelAsync__)
.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.CreateAccessLevelRequest` 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/access-context-manager/latest/V1.AccessLevel>` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Identity\AccessContextManager\V1\AccessLevel;
    use Google\Identity\AccessContextManager\V1\Client\AccessContextManagerClient;
    use Google\Identity\AccessContextManager\V1\CreateAccessLevelRequest;
    use Google\Rpc\Status;

    /**
     * @param string $formattedParent Resource name for the access policy which owns this [Access
     *                                Level] [google.identity.accesscontextmanager.v1.AccessLevel].
     *
     *                                Format: `accessPolicies/{policy_id}`
     *                                Please see {@see AccessContextManagerClient::accessPolicyName()} for help formatting this field.
     */
    function create_access_level_sample(string $formattedParent): void
    {
        // Create a client.
        $accessContextManagerClient = new AccessContextManagerClient();

        // Prepare the request message.
        $accessLevel = new AccessLevel();
        $request = (new CreateAccessLevelRequest())
            ->setParent($formattedParent)
            ->setAccessLevel($accessLevel);

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

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

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

        create_access_level_sample($formattedParent);
    }

### createAccessPolicy

Creates an access policy. This method fails if the organization already has
an access policy. The long-running operation has a successful status
after the access policy propagates to long-lasting storage.

Syntactic and basic semantic errors are returned in `metadata` as a
BadRequest proto.

The async variant is
[AccessContextManagerClient::createAccessPolicyAsync()](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.Client.AccessContextManagerClient#_Google_Identity_AccessContextManager_V1_Client_AccessContextManagerClient__createAccessPolicyAsync__) .

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

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Identity\AccessContextManager\V1\AccessPolicy;
    use Google\Identity\AccessContextManager\V1\Client\AccessContextManagerClient;
    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_access_policy_sample(): void
    {
        // Create a client.
        $accessContextManagerClient = new AccessContextManagerClient();

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

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

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

### createGcpUserAccessBinding

Creates a [GcpUserAccessBinding](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.GcpUserAccessBinding). If the
client specifies a [name](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.GcpUserAccessBinding#_Google_Identity_AccessContextManager_V1_GcpUserAccessBinding__getName__),
the server ignores it. Fails if a resource already exists with the same
[group_key](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.GcpUserAccessBinding#_Google_Identity_AccessContextManager_V1_GcpUserAccessBinding__getGroupKey__).

Completion of this long-running operation does not necessarily signify that
the new binding is deployed onto all affected users, which may take more
time.

The async variant is
[AccessContextManagerClient::createGcpUserAccessBindingAsync()](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.Client.AccessContextManagerClient#_Google_Identity_AccessContextManager_V1_Client_AccessContextManagerClient__createGcpUserAccessBindingAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.CreateGcpUserAccessBindingRequest` 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/access-context-manager/latest/V1.GcpUserAccessBinding>` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Identity\AccessContextManager\V1\Client\AccessContextManagerClient;
    use Google\Identity\AccessContextManager\V1\CreateGcpUserAccessBindingRequest;
    use Google\Identity\AccessContextManager\V1\GcpUserAccessBinding;
    use Google\Rpc\Status;

    /**
     * @param string $formattedParent                                  Example: "organizations/256"
     *                                                                 Please see {@see AccessContextManagerClient::organizationName()} for help formatting this field.
     * @param string $gcpUserAccessBindingGroupKey                     Immutable. Google Group id whose members are subject to this binding's restrictions.
     *                                                                 See "id" in the [G Suite Directory API's Groups resource]
     *                                                                 (https://developers.google.com/admin-sdk/directory/v1/reference/groups#resource).
     *                                                                 If a group's email address/alias is changed, this resource will continue
     *                                                                 to point at the changed group. This field does not accept group email
     *                                                                 addresses or aliases.
     *                                                                 Example: "01d520gv4vjcrht"
     * @param string $formattedGcpUserAccessBindingAccessLevelsElement Access level that a user must have to be granted access. Only one access
     *                                                                 level is supported, not multiple. This repeated field must have exactly
     *                                                                 one element.
     *                                                                 Example: "accessPolicies/9522/accessLevels/device_trusted"
     *                                                                 Please see {@see AccessContextManagerClient::accessLevelName()} for help formatting this field.
     */
    function create_gcp_user_access_binding_sample(
        string $formattedParent,
        string $gcpUserAccessBindingGroupKey,
        string $formattedGcpUserAccessBindingAccessLevelsElement
    ): void {
        // Create a client.
        $accessContextManagerClient = new AccessContextManagerClient();

        // Prepare the request message.
        $formattedGcpUserAccessBindingAccessLevels = [$formattedGcpUserAccessBindingAccessLevelsElement];
        $gcpUserAccessBinding = (new GcpUserAccessBinding())
            ->setGroupKey($gcpUserAccessBindingGroupKey)
            ->setAccessLevels($formattedGcpUserAccessBindingAccessLevels);
        $request = (new CreateGcpUserAccessBindingRequest())
            ->setParent($formattedParent)
            ->setGcpUserAccessBinding($gcpUserAccessBinding);

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

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

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

        create_gcp_user_access_binding_sample(
            $formattedParent,
            $gcpUserAccessBindingGroupKey,
            $formattedGcpUserAccessBindingAccessLevelsElement
        );
    }

### createServicePerimeter

Creates a [service perimeter](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.ServicePerimeter). The
long-running operation from this RPC has a successful status after the
[service perimeter](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.ServicePerimeter)
propagates to long-lasting storage. If a [service perimeter](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.ServicePerimeter) contains
errors, an error response is returned for the first error encountered.

The async variant is
[AccessContextManagerClient::createServicePerimeterAsync()](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.Client.AccessContextManagerClient#_Google_Identity_AccessContextManager_V1_Client_AccessContextManagerClient__createServicePerimeterAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.CreateServicePerimeterRequest` 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/access-context-manager/latest/V1.ServicePerimeter>` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Identity\AccessContextManager\V1\Client\AccessContextManagerClient;
    use Google\Identity\AccessContextManager\V1\CreateServicePerimeterRequest;
    use Google\Identity\AccessContextManager\V1\ServicePerimeter;
    use Google\Rpc\Status;

    /**
     * @param string $formattedParent Resource name for the access policy which owns this [Service
     *                                Perimeter] [google.identity.accesscontextmanager.v1.ServicePerimeter].
     *
     *                                Format: `accessPolicies/{policy_id}`
     *                                Please see {@see AccessContextManagerClient::accessPolicyName()} for help formatting this field.
     */
    function create_service_perimeter_sample(string $formattedParent): void
    {
        // Create a client.
        $accessContextManagerClient = new AccessContextManagerClient();

        // Prepare the request message.
        $servicePerimeter = new ServicePerimeter();
        $request = (new CreateServicePerimeterRequest())
            ->setParent($formattedParent)
            ->setServicePerimeter($servicePerimeter);

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

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

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

        create_service_perimeter_sample($formattedParent);
    }

### deleteAccessLevel

Deletes an [access level](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.AccessLevel) based on the resource
name. The long-running operation from this RPC has a successful status
after the [access level](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.AccessLevel) has been removed
from long-lasting storage.

The async variant is [AccessContextManagerClient::deleteAccessLevelAsync()](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.Client.AccessContextManagerClient#_Google_Identity_AccessContextManager_V1_Client_AccessContextManagerClient__deleteAccessLevelAsync__)
.

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

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

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Identity\AccessContextManager\V1\Client\AccessContextManagerClient;
    use Google\Identity\AccessContextManager\V1\DeleteAccessLevelRequest;
    use Google\Rpc\Status;

    /**
     * @param string $formattedName Resource name for the [Access Level]
     *                              [google.identity.accesscontextmanager.v1.AccessLevel].
     *
     *                              Format:
     *                              `accessPolicies/{policy_id}/accessLevels/{access_level_id}`
     *                              Please see {@see AccessContextManagerClient::accessLevelName()} for help formatting this field.
     */
    function delete_access_level_sample(string $formattedName): void
    {
        // Create a client.
        $accessContextManagerClient = new AccessContextManagerClient();

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

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

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

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

        delete_access_level_sample($formattedName);
    }

### deleteAccessPolicy

Deletes an [access policy](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.AccessPolicy) based on the
resource name. The long-running operation has a successful status after the
[access policy](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.AccessPolicy)
is removed from long-lasting storage.

The async variant is
[AccessContextManagerClient::deleteAccessPolicyAsync()](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.Client.AccessContextManagerClient#_Google_Identity_AccessContextManager_V1_Client_AccessContextManagerClient__deleteAccessPolicyAsync__) .

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

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

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Identity\AccessContextManager\V1\Client\AccessContextManagerClient;
    use Google\Identity\AccessContextManager\V1\DeleteAccessPolicyRequest;
    use Google\Rpc\Status;

    /**
     * @param string $formattedName Resource name for the access policy to delete.
     *
     *                              Format `accessPolicies/{policy_id}`
     *                              Please see {@see AccessContextManagerClient::accessPolicyName()} for help formatting this field.
     */
    function delete_access_policy_sample(string $formattedName): void
    {
        // Create a client.
        $accessContextManagerClient = new AccessContextManagerClient();

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

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

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

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

        delete_access_policy_sample($formattedName);
    }

### deleteGcpUserAccessBinding

Deletes a [GcpUserAccessBinding](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.GcpUserAccessBinding).

Completion of this long-running operation does not necessarily signify that
the binding deletion is deployed onto all affected users, which may take
more time.

The async variant is
[AccessContextManagerClient::deleteGcpUserAccessBindingAsync()](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.Client.AccessContextManagerClient#_Google_Identity_AccessContextManager_V1_Client_AccessContextManagerClient__deleteGcpUserAccessBindingAsync__) .

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

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

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Identity\AccessContextManager\V1\Client\AccessContextManagerClient;
    use Google\Identity\AccessContextManager\V1\DeleteGcpUserAccessBindingRequest;
    use Google\Rpc\Status;

    /**
     * @param string $formattedName Example: "organizations/256/gcpUserAccessBindings/b3-BhcX_Ud5N"
     *                              Please see {@see AccessContextManagerClient::gcpUserAccessBindingName()} for help formatting this field.
     */
    function delete_gcp_user_access_binding_sample(string $formattedName): void
    {
        // Create a client.
        $accessContextManagerClient = new AccessContextManagerClient();

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

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

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

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

        delete_gcp_user_access_binding_sample($formattedName);
    }

### deleteServicePerimeter

Deletes a [service perimeter](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.ServicePerimeter) based on the
resource name. The long-running operation from this RPC has a successful
status after the [service perimeter](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.ServicePerimeter) is removed from
long-lasting storage.

The async variant is
[AccessContextManagerClient::deleteServicePerimeterAsync()](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.Client.AccessContextManagerClient#_Google_Identity_AccessContextManager_V1_Client_AccessContextManagerClient__deleteServicePerimeterAsync__) .

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

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

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Identity\AccessContextManager\V1\Client\AccessContextManagerClient;
    use Google\Identity\AccessContextManager\V1\DeleteServicePerimeterRequest;
    use Google\Rpc\Status;

    /**
     * @param string $formattedName Resource name for the [Service Perimeter]
     *                              [google.identity.accesscontextmanager.v1.ServicePerimeter].
     *
     *                              Format:
     *                              `accessPolicies/{policy_id}/servicePerimeters/{service_perimeter_id}`
     *                              Please see {@see AccessContextManagerClient::servicePerimeterName()} for help formatting this field.
     */
    function delete_service_perimeter_sample(string $formattedName): void
    {
        // Create a client.
        $accessContextManagerClient = new AccessContextManagerClient();

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

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

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

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

        delete_service_perimeter_sample($formattedName);
    }

### getAccessLevel

Gets an [access level](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.AccessLevel) based on the resource
name.

The async variant is [AccessContextManagerClient::getAccessLevelAsync()](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.Client.AccessContextManagerClient#_Google_Identity_AccessContextManager_V1_Client_AccessContextManagerClient__getAccessLevelAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.GetAccessLevelRequest` 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/access-context-manager/latest/V1.AccessLevel` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Identity\AccessContextManager\V1\AccessLevel;
    use Google\Identity\AccessContextManager\V1\Client\AccessContextManagerClient;
    use Google\Identity\AccessContextManager\V1\GetAccessLevelRequest;

    /**
     * @param string $formattedName Resource name for the [Access Level]
     *                              [google.identity.accesscontextmanager.v1.AccessLevel].
     *
     *                              Format:
     *                              `accessPolicies/{policy_id}/accessLevels/{access_level_id}`
     *                              Please see {@see AccessContextManagerClient::accessLevelName()} for help formatting this field.
     */
    function get_access_level_sample(string $formattedName): void
    {
        // Create a client.
        $accessContextManagerClient = new AccessContextManagerClient();

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

        // Call the API and handle any network failures.
        try {
            /** @var AccessLevel $response */
            $response = $accessContextManagerClient->getAccessLevel($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 = AccessContextManagerClient::accessLevelName('[ACCESS_POLICY]', '[ACCESS_LEVEL]');

        get_access_level_sample($formattedName);
    }

### getAccessPolicy

Returns an [access policy](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.AccessPolicy) based on the name.

The async variant is [AccessContextManagerClient::getAccessPolicyAsync()](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.Client.AccessContextManagerClient#_Google_Identity_AccessContextManager_V1_Client_AccessContextManagerClient__getAccessPolicyAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.GetAccessPolicyRequest` 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/access-context-manager/latest/V1.AccessPolicy` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Identity\AccessContextManager\V1\AccessPolicy;
    use Google\Identity\AccessContextManager\V1\Client\AccessContextManagerClient;
    use Google\Identity\AccessContextManager\V1\GetAccessPolicyRequest;

    /**
     * @param string $formattedName Resource name for the access policy to get.
     *
     *                              Format `accessPolicies/{policy_id}`
     *                              Please see {@see AccessContextManagerClient::accessPolicyName()} for help formatting this field.
     */
    function get_access_policy_sample(string $formattedName): void
    {
        // Create a client.
        $accessContextManagerClient = new AccessContextManagerClient();

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

        // Call the API and handle any network failures.
        try {
            /** @var AccessPolicy $response */
            $response = $accessContextManagerClient->getAccessPolicy($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 = AccessContextManagerClient::accessPolicyName('[ACCESS_POLICY]');

        get_access_policy_sample($formattedName);
    }

### getGcpUserAccessBinding

Gets the [GcpUserAccessBinding](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.GcpUserAccessBinding) with
the given name.

The async variant is
[AccessContextManagerClient::getGcpUserAccessBindingAsync()](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.Client.AccessContextManagerClient#_Google_Identity_AccessContextManager_V1_Client_AccessContextManagerClient__getGcpUserAccessBindingAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.GetGcpUserAccessBindingRequest` 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/access-context-manager/latest/V1.GcpUserAccessBinding` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Identity\AccessContextManager\V1\Client\AccessContextManagerClient;
    use Google\Identity\AccessContextManager\V1\GcpUserAccessBinding;
    use Google\Identity\AccessContextManager\V1\GetGcpUserAccessBindingRequest;

    /**
     * @param string $formattedName Example: "organizations/256/gcpUserAccessBindings/b3-BhcX_Ud5N"
     *                              Please see {@see AccessContextManagerClient::gcpUserAccessBindingName()} for help formatting this field.
     */
    function get_gcp_user_access_binding_sample(string $formattedName): void
    {
        // Create a client.
        $accessContextManagerClient = new AccessContextManagerClient();

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

        // Call the API and handle any network failures.
        try {
            /** @var GcpUserAccessBinding $response */
            $response = $accessContextManagerClient->getGcpUserAccessBinding($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 = AccessContextManagerClient::gcpUserAccessBindingName(
            '[ORGANIZATION]',
            '[GCP_USER_ACCESS_BINDING]'
        );

        get_gcp_user_access_binding_sample($formattedName);
    }

### getIamPolicy

Gets the IAM policy for the specified Access Context Manager
[access policy](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.AccessPolicy).

The async variant is [AccessContextManagerClient::getIamPolicyAsync()](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.Client.AccessContextManagerClient#_Google_Identity_AccessContextManager_V1_Client_AccessContextManagerClient__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\Identity\AccessContextManager\V1\Client\AccessContextManagerClient;

    /**
     * @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.
        $accessContextManagerClient = new AccessContextManagerClient();

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

        // Call the API and handle any network failures.
        try {
            /** @var Policy $response */
            $response = $accessContextManagerClient->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);
    }

### getServicePerimeter

Gets a [service perimeter](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.ServicePerimeter) based on the
resource name.

The async variant is
[AccessContextManagerClient::getServicePerimeterAsync()](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.Client.AccessContextManagerClient#_Google_Identity_AccessContextManager_V1_Client_AccessContextManagerClient__getServicePerimeterAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.GetServicePerimeterRequest` 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/access-context-manager/latest/V1.ServicePerimeter` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Identity\AccessContextManager\V1\Client\AccessContextManagerClient;
    use Google\Identity\AccessContextManager\V1\GetServicePerimeterRequest;
    use Google\Identity\AccessContextManager\V1\ServicePerimeter;

    /**
     * @param string $formattedName Resource name for the [Service Perimeter]
     *                              [google.identity.accesscontextmanager.v1.ServicePerimeter].
     *
     *                              Format:
     *                              `accessPolicies/{policy_id}/servicePerimeters/{service_perimeters_id}`
     *                              Please see {@see AccessContextManagerClient::servicePerimeterName()} for help formatting this field.
     */
    function get_service_perimeter_sample(string $formattedName): void
    {
        // Create a client.
        $accessContextManagerClient = new AccessContextManagerClient();

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

        // Call the API and handle any network failures.
        try {
            /** @var ServicePerimeter $response */
            $response = $accessContextManagerClient->getServicePerimeter($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 = AccessContextManagerClient::servicePerimeterName(
            '[ACCESS_POLICY]',
            '[SERVICE_PERIMETER]'
        );

        get_service_perimeter_sample($formattedName);
    }

### listAccessLevels

Lists all [access levels](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.AccessLevel) for an access
policy.

The async variant is [AccessContextManagerClient::listAccessLevelsAsync()](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.Client.AccessContextManagerClient#_Google_Identity_AccessContextManager_V1_Client_AccessContextManagerClient__listAccessLevelsAsync__)
.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.ListAccessLevelsRequest` 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\Identity\AccessContextManager\V1\AccessLevel;
    use Google\Identity\AccessContextManager\V1\Client\AccessContextManagerClient;
    use Google\Identity\AccessContextManager\V1\ListAccessLevelsRequest;

    /**
     * @param string $formattedParent Resource name for the access policy to list [Access Levels]
     *                                [google.identity.accesscontextmanager.v1.AccessLevel] from.
     *
     *                                Format:
     *                                `accessPolicies/{policy_id}`
     *                                Please see {@see AccessContextManagerClient::accessPolicyName()} for help formatting this field.
     */
    function list_access_levels_sample(string $formattedParent): void
    {
        // Create a client.
        $accessContextManagerClient = new AccessContextManagerClient();

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

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

            /** @var AccessLevel $element */
            foreach ($response as $element) {
                printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
            }
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

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

        list_access_levels_sample($formattedParent);
    }

### listAccessPolicies

Lists all [access policies](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.AccessPolicy) in an
organization.

The async variant is
[AccessContextManagerClient::listAccessPoliciesAsync()](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.Client.AccessContextManagerClient#_Google_Identity_AccessContextManager_V1_Client_AccessContextManagerClient__listAccessPoliciesAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.ListAccessPoliciesRequest` 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\Identity\AccessContextManager\V1\AccessPolicy;
    use Google\Identity\AccessContextManager\V1\Client\AccessContextManagerClient;
    use Google\Identity\AccessContextManager\V1\ListAccessPoliciesRequest;

    /**
     * @param string $formattedParent Resource name for the container to list AccessPolicy instances
     *                                from.
     *
     *                                Format:
     *                                `organizations/{org_id}`
     *                                Please see {@see AccessContextManagerClient::organizationName()} for help formatting this field.
     */
    function list_access_policies_sample(string $formattedParent): void
    {
        // Create a client.
        $accessContextManagerClient = new AccessContextManagerClient();

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

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

            /** @var AccessPolicy $element */
            foreach ($response as $element) {
                printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
            }
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

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

        list_access_policies_sample($formattedParent);
    }

### listGcpUserAccessBindings

Lists all [GcpUserAccessBindings](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.GcpUserAccessBinding) for a
Google Cloud organization.

The async variant is
[AccessContextManagerClient::listGcpUserAccessBindingsAsync()](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.Client.AccessContextManagerClient#_Google_Identity_AccessContextManager_V1_Client_AccessContextManagerClient__listGcpUserAccessBindingsAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.ListGcpUserAccessBindingsRequest` 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\Identity\AccessContextManager\V1\Client\AccessContextManagerClient;
    use Google\Identity\AccessContextManager\V1\GcpUserAccessBinding;
    use Google\Identity\AccessContextManager\V1\ListGcpUserAccessBindingsRequest;

    /**
     * @param string $formattedParent Example: "organizations/256"
     *                                Please see {@see AccessContextManagerClient::organizationName()} for help formatting this field.
     */
    function list_gcp_user_access_bindings_sample(string $formattedParent): void
    {
        // Create a client.
        $accessContextManagerClient = new AccessContextManagerClient();

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

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

            /** @var GcpUserAccessBinding $element */
            foreach ($response as $element) {
                printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
            }
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

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

        list_gcp_user_access_bindings_sample($formattedParent);
    }

### listServicePerimeters

Lists all [service perimeters](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.ServicePerimeter) for an
access policy.

The async variant is
[AccessContextManagerClient::listServicePerimetersAsync()](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.Client.AccessContextManagerClient#_Google_Identity_AccessContextManager_V1_Client_AccessContextManagerClient__listServicePerimetersAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.ListServicePerimetersRequest` 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\Identity\AccessContextManager\V1\Client\AccessContextManagerClient;
    use Google\Identity\AccessContextManager\V1\ListServicePerimetersRequest;
    use Google\Identity\AccessContextManager\V1\ServicePerimeter;

    /**
     * @param string $formattedParent Resource name for the access policy to list [Service Perimeters]
     *                                [google.identity.accesscontextmanager.v1.ServicePerimeter] from.
     *
     *                                Format:
     *                                `accessPolicies/{policy_id}`
     *                                Please see {@see AccessContextManagerClient::accessPolicyName()} for help formatting this field.
     */
    function list_service_perimeters_sample(string $formattedParent): void
    {
        // Create a client.
        $accessContextManagerClient = new AccessContextManagerClient();

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

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

            /** @var ServicePerimeter $element */
            foreach ($response as $element) {
                printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
            }
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

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

        list_service_perimeters_sample($formattedParent);
    }

### replaceAccessLevels

Replaces all existing [access levels](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.AccessLevel) in an [access
policy](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.AccessPolicy) with
the [access levels](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.AccessLevel) provided. This
is done atomically. The long-running operation from this RPC has a
successful status after all replacements propagate to long-lasting
storage. If the replacement contains errors, an error response is returned
for the first error encountered. Upon error, the replacement is cancelled,
and existing [access levels](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.AccessLevel) are not
affected. The Operation.response field contains
ReplaceAccessLevelsResponse. Removing [access levels](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.AccessLevel) contained in existing
[service perimeters](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.ServicePerimeter) result in an
error.

The async variant is
[AccessContextManagerClient::replaceAccessLevelsAsync()](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.Client.AccessContextManagerClient#_Google_Identity_AccessContextManager_V1_Client_AccessContextManagerClient__replaceAccessLevelsAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.ReplaceAccessLevelsRequest` 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/access-context-manager/latest/V1.ReplaceAccessLevelsResponse>` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Identity\AccessContextManager\V1\AccessLevel;
    use Google\Identity\AccessContextManager\V1\Client\AccessContextManagerClient;
    use Google\Identity\AccessContextManager\V1\ReplaceAccessLevelsRequest;
    use Google\Identity\AccessContextManager\V1\ReplaceAccessLevelsResponse;
    use Google\Rpc\Status;

    /**
     * @param string $formattedParent Resource name for the access policy which owns these
     *                                [Access Levels]
     *                                [google.identity.accesscontextmanager.v1.AccessLevel].
     *
     *                                Format: `accessPolicies/{policy_id}`
     *                                Please see {@see AccessContextManagerClient::accessPolicyName()} for help formatting this field.
     */
    function replace_access_levels_sample(string $formattedParent): void
    {
        // Create a client.
        $accessContextManagerClient = new AccessContextManagerClient();

        // Prepare the request message.
        $accessLevels = [new AccessLevel()];
        $request = (new ReplaceAccessLevelsRequest())
            ->setParent($formattedParent)
            ->setAccessLevels($accessLevels);

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

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

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

        replace_access_levels_sample($formattedParent);
    }

### replaceServicePerimeters

Replace all existing [service perimeters](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.ServicePerimeter) in an [access
policy](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.AccessPolicy) with the
[service perimeters](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.ServicePerimeter) provided. This
is done atomically. The long-running operation from this RPC has a
successful status after all replacements propagate to long-lasting storage.

Replacements containing errors result in an error response for the first
error encountered. Upon an error, replacement are cancelled and existing
[service perimeters](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.ServicePerimeter) are not
affected. The Operation.response field contains
ReplaceServicePerimetersResponse.

The async variant is
[AccessContextManagerClient::replaceServicePerimetersAsync()](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.Client.AccessContextManagerClient#_Google_Identity_AccessContextManager_V1_Client_AccessContextManagerClient__replaceServicePerimetersAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.ReplaceServicePerimetersRequest` 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/access-context-manager/latest/V1.ReplaceServicePerimetersResponse>` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Identity\AccessContextManager\V1\Client\AccessContextManagerClient;
    use Google\Identity\AccessContextManager\V1\ReplaceServicePerimetersRequest;
    use Google\Identity\AccessContextManager\V1\ReplaceServicePerimetersResponse;
    use Google\Identity\AccessContextManager\V1\ServicePerimeter;
    use Google\Rpc\Status;

    /**
     * @param string $formattedParent Resource name for the access policy which owns these
     *                                [Service Perimeters]
     *                                [google.identity.accesscontextmanager.v1.ServicePerimeter].
     *
     *                                Format: `accessPolicies/{policy_id}`
     *                                Please see {@see AccessContextManagerClient::accessPolicyName()} for help formatting this field.
     */
    function replace_service_perimeters_sample(string $formattedParent): void
    {
        // Create a client.
        $accessContextManagerClient = new AccessContextManagerClient();

        // Prepare the request message.
        $servicePerimeters = [new ServicePerimeter()];
        $request = (new ReplaceServicePerimetersRequest())
            ->setParent($formattedParent)
            ->setServicePerimeters($servicePerimeters);

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

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

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

        replace_service_perimeters_sample($formattedParent);
    }

### setIamPolicy

Sets the IAM policy for the specified Access Context Manager
[access policy](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.AccessPolicy).

This method replaces the existing IAM policy on the access policy. The IAM
policy controls the set of users who can perform specific operations on the
Access Context Manager [access
policy](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.AccessPolicy).

The async variant is [AccessContextManagerClient::setIamPolicyAsync()](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.Client.AccessContextManagerClient#_Google_Identity_AccessContextManager_V1_Client_AccessContextManagerClient__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\Identity\AccessContextManager\V1\Client\AccessContextManagerClient;

    /**
     * @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.
        $accessContextManagerClient = new AccessContextManagerClient();

        // 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 = $accessContextManagerClient->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 the IAM permissions that the caller has on the specified Access
Context Manager resource. The resource can be an
[AccessPolicy](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.AccessPolicy),
[AccessLevel](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.AccessLevel), or
\[ServicePerimeter\]\[google.identity.accesscontextmanager.v1.ServicePerimeter
\]. This method does not support other resources.

The async variant is
[AccessContextManagerClient::testIamPermissionsAsync()](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.Client.AccessContextManagerClient#_Google_Identity_AccessContextManager_V1_Client_AccessContextManagerClient__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\Identity\AccessContextManager\V1\Client\AccessContextManagerClient;

    /**
     * @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.
        $accessContextManagerClient = new AccessContextManagerClient();

        // 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 = $accessContextManagerClient->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);
    }

### updateAccessLevel

Updates an [access level](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.AccessLevel). The long-running
operation from this RPC has a successful status after the changes to
the [access level](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.AccessLevel) propagate
to long-lasting storage. If [access levels](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.AccessLevel) contain
errors, an error response is returned for the first error encountered.

The async variant is [AccessContextManagerClient::updateAccessLevelAsync()](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.Client.AccessContextManagerClient#_Google_Identity_AccessContextManager_V1_Client_AccessContextManagerClient__updateAccessLevelAsync__)
.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.UpdateAccessLevelRequest` 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/access-context-manager/latest/V1.AccessLevel>` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Identity\AccessContextManager\V1\AccessLevel;
    use Google\Identity\AccessContextManager\V1\Client\AccessContextManagerClient;
    use Google\Identity\AccessContextManager\V1\UpdateAccessLevelRequest;
    use Google\Protobuf\FieldMask;
    use Google\Rpc\Status;

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

        // Prepare the request message.
        $accessLevel = new AccessLevel();
        $updateMask = new FieldMask();
        $request = (new UpdateAccessLevelRequest())
            ->setAccessLevel($accessLevel)
            ->setUpdateMask($updateMask);

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

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

### updateAccessPolicy

Updates an [access policy](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.AccessPolicy). The
long-running operation from this RPC has a successful status after the
changes to the [access policy](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.AccessPolicy) propagate
to long-lasting storage.

The async variant is
[AccessContextManagerClient::updateAccessPolicyAsync()](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.Client.AccessContextManagerClient#_Google_Identity_AccessContextManager_V1_Client_AccessContextManagerClient__updateAccessPolicyAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.UpdateAccessPolicyRequest` 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/access-context-manager/latest/V1.AccessPolicy>` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Identity\AccessContextManager\V1\AccessPolicy;
    use Google\Identity\AccessContextManager\V1\Client\AccessContextManagerClient;
    use Google\Identity\AccessContextManager\V1\UpdateAccessPolicyRequest;
    use Google\Protobuf\FieldMask;
    use Google\Rpc\Status;

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

        // Prepare the request message.
        $policy = new AccessPolicy();
        $updateMask = new FieldMask();
        $request = (new UpdateAccessPolicyRequest())
            ->setPolicy($policy)
            ->setUpdateMask($updateMask);

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

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

### updateGcpUserAccessBinding

Updates a [GcpUserAccessBinding](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.GcpUserAccessBinding).

Completion of this long-running operation does not necessarily signify that
the changed binding is deployed onto all affected users, which may take
more time.

The async variant is
[AccessContextManagerClient::updateGcpUserAccessBindingAsync()](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.Client.AccessContextManagerClient#_Google_Identity_AccessContextManager_V1_Client_AccessContextManagerClient__updateGcpUserAccessBindingAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.UpdateGcpUserAccessBindingRequest` 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/access-context-manager/latest/V1.GcpUserAccessBinding>` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Identity\AccessContextManager\V1\Client\AccessContextManagerClient;
    use Google\Identity\AccessContextManager\V1\GcpUserAccessBinding;
    use Google\Identity\AccessContextManager\V1\UpdateGcpUserAccessBindingRequest;
    use Google\Protobuf\FieldMask;
    use Google\Rpc\Status;

    /**
     * @param string $gcpUserAccessBindingGroupKey                     Immutable. Google Group id whose members are subject to this binding's restrictions.
     *                                                                 See "id" in the [G Suite Directory API's Groups resource]
     *                                                                 (https://developers.google.com/admin-sdk/directory/v1/reference/groups#resource).
     *                                                                 If a group's email address/alias is changed, this resource will continue
     *                                                                 to point at the changed group. This field does not accept group email
     *                                                                 addresses or aliases.
     *                                                                 Example: "01d520gv4vjcrht"
     * @param string $formattedGcpUserAccessBindingAccessLevelsElement Access level that a user must have to be granted access. Only one access
     *                                                                 level is supported, not multiple. This repeated field must have exactly
     *                                                                 one element.
     *                                                                 Example: "accessPolicies/9522/accessLevels/device_trusted"
     *                                                                 Please see {@see AccessContextManagerClient::accessLevelName()} for help formatting this field.
     */
    function update_gcp_user_access_binding_sample(
        string $gcpUserAccessBindingGroupKey,
        string $formattedGcpUserAccessBindingAccessLevelsElement
    ): void {
        // Create a client.
        $accessContextManagerClient = new AccessContextManagerClient();

        // Prepare the request message.
        $formattedGcpUserAccessBindingAccessLevels = [$formattedGcpUserAccessBindingAccessLevelsElement];
        $gcpUserAccessBinding = (new GcpUserAccessBinding())
            ->setGroupKey($gcpUserAccessBindingGroupKey)
            ->setAccessLevels($formattedGcpUserAccessBindingAccessLevels);
        $updateMask = new FieldMask();
        $request = (new UpdateGcpUserAccessBindingRequest())
            ->setGcpUserAccessBinding($gcpUserAccessBinding)
            ->setUpdateMask($updateMask);

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

            if ($response->operationSucceeded()) {
                /** @var GcpUserAccessBinding $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
    {
        $gcpUserAccessBindingGroupKey = '[GROUP_KEY]';
        $formattedGcpUserAccessBindingAccessLevelsElement = AccessContextManagerClient::accessLevelName(
            '[ACCESS_POLICY]',
            '[ACCESS_LEVEL]'
        );

        update_gcp_user_access_binding_sample(
            $gcpUserAccessBindingGroupKey,
            $formattedGcpUserAccessBindingAccessLevelsElement
        );
    }

### updateServicePerimeter

Updates a [service perimeter](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.ServicePerimeter). The
long-running operation from this RPC has a successful status after the
[service perimeter](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.ServicePerimeter)
propagates to long-lasting storage. If a [service perimeter](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.ServicePerimeter) contains
errors, an error response is returned for the first error encountered.

The async variant is
[AccessContextManagerClient::updateServicePerimeterAsync()](https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.Client.AccessContextManagerClient#_Google_Identity_AccessContextManager_V1_Client_AccessContextManagerClient__updateServicePerimeterAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.UpdateServicePerimeterRequest` 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/access-context-manager/latest/V1.ServicePerimeter>` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Identity\AccessContextManager\V1\Client\AccessContextManagerClient;
    use Google\Identity\AccessContextManager\V1\ServicePerimeter;
    use Google\Identity\AccessContextManager\V1\UpdateServicePerimeterRequest;
    use Google\Protobuf\FieldMask;
    use Google\Rpc\Status;

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

        // Prepare the request message.
        $servicePerimeter = new ServicePerimeter();
        $updateMask = new FieldMask();
        $request = (new UpdateServicePerimeterRequest())
            ->setServicePerimeter($servicePerimeter)
            ->setUpdateMask($updateMask);

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

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

### commitServicePerimetersAsync

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

### createAccessLevelAsync

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

### createAccessPolicyAsync

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

### createGcpUserAccessBindingAsync

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

### createServicePerimeterAsync

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

### deleteAccessLevelAsync

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

### deleteAccessPolicyAsync

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

### deleteGcpUserAccessBindingAsync

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

### deleteServicePerimeterAsync

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

### getAccessLevelAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.GetAccessLevelRequest` |
| `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/access-context-manager/latest/V1.AccessLevel>` |   |

### getAccessPolicyAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.GetAccessPolicyRequest` |
| `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/access-context-manager/latest/V1.AccessPolicy>` |   |

### getGcpUserAccessBindingAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.GetGcpUserAccessBindingRequest` |
| `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/access-context-manager/latest/V1.GcpUserAccessBinding>` |   |

### 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>` |   |

### getServicePerimeterAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.GetServicePerimeterRequest` |
| `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/access-context-manager/latest/V1.ServicePerimeter>` |   |

### listAccessLevelsAsync

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

### listAccessPoliciesAsync

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

### listGcpUserAccessBindingsAsync

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

### listServicePerimetersAsync

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

### replaceAccessLevelsAsync

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

### replaceServicePerimetersAsync

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

### 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>` |   |

### updateAccessLevelAsync

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

### updateAccessPolicyAsync

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

### updateGcpUserAccessBindingAsync

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

### updateServicePerimeterAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/access-context-manager/latest/V1.UpdateServicePerimeterRequest` |
| `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::accessLevelName

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

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `accessPolicy` | `string` |
| `accessLevel` | `string` |

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

### static::accessPolicyName

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

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

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

### static::gcpUserAccessBindingName

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

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `organization` | `string` |
| `gcpUserAccessBinding` | `string` |

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

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

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `accessPolicy` | `string` |
| `servicePerimeter` | `string` |

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

- accessLevel: accessPolicies/{access_policy}/accessLevels/{access_level}
- accessPolicy: accessPolicies/{access_policy}
- gcpUserAccessBinding: organizations/{organization}/gcpUserAccessBindings/{gcp_user_access_binding}
- organization: organizations/{organization}
- servicePerimeter: accessPolicies/{access_policy}/servicePerimeters/{service_perimeter}

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