# Compute V1 Client - Class OrganizationSecurityPoliciesClient (2.10.0)

2.10.0 (latest) 2.9.0 2.8.0 2.7.0 2.6.0 2.5.0 2.4.0 2.3.0 2.2.0 2.1.1 2.0.0 1.36.0 1.35.0 1.34.0 1.33.0 1.32.0 1.31.0 1.30.0 1.29.0 1.28.0 1.27.0 1.26.0 1.25.0 1.24.0 1.23.0 1.22.1 1.21.0 1.20.0 1.19.0 1.18.1 1.17.0 1.16.2 1.14.0 1.13.0 1.12.1 1.11.1 1.10.1 1.9.1 1.8.3 1.7.1 1.6.1 1.5.0 Reference documentation and code samples for the Compute V1 Client class OrganizationSecurityPoliciesClient.

Service Description: The OrganizationSecurityPolicies API.

This class provides the ability to make remote calls to the backing service through method
calls that map to API methods.

## Namespace

Google \\ Cloud \\ Compute \\ V1 \\ Client

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `options` | `array|https://docs.cloud.google.com/php/docs/reference/gax/latest/Options.ClientOptions.html` Optional. Options for configuring the service API wrapper. |
| `↳ apiEndpoint` | `string` The address of the API remote host. May optionally include the port, formatted as " |
| `↳ credentials` | `https://docs.cloud.google.com/php/docs/reference/auth/latest/FetchAuthTokenInterface.html|https://docs.cloud.google.com/php/docs/reference/gax/latest/CredentialsWrapper.html` This option should only be used with a pre-constructed [Google\\Auth\\FetchAuthTokenInterface](https://docs.cloud.google.com/php/docs/reference/auth/latest/FetchAuthTokenInterface.html) or [Google\\ApiCore\\CredentialsWrapper](https://docs.cloud.google.com/php/docs/reference/gax/latest/CredentialsWrapper.html) object. Note that when one of these objects are provided, any settings in $credentialsConfig will be ignored. **Important** : If you are providing a path to a credentials file, or a decoded credentials file as a PHP array, this usage is now DEPRECATED. Providing an unvalidated credential configuration to Google APIs can compromise the security of your systems and data. It is recommended to create the credentials explicitly `use Google\Auth\Credentials\ServiceAccountCredentials; use Google\Cloud\Compute\V1\OrganizationSecurityPoliciesClient; $creds = new ServiceAccountCredentials($scopes, $json); $options = new OrganizationSecurityPoliciesClient(['credentials' => $creds]);` <https://cloud.google.com/docs/authentication/external/externally-sourced-credentials> |
| `↳ credentialsConfig` | `array` Options used to configure credentials, including auth token caching, for the client. For a full list of supporting configuration options, see [Google\\ApiCore\\CredentialsWrapper::build()](https://docs.cloud.google.com/php/docs/reference/gax/latest/CredentialsWrapper.html#_Google_ApiCore_CredentialsWrapper__build__) . |
| `↳ disableRetries` | `bool` Determines whether or not retries defined by the client configuration should be disabled. Defaults to `false`. |
| `↳ clientConfig` | `string|array` Client method configuration, including retry settings. This option can be either a path to a JSON file, or a PHP array containing the decoded JSON data. By default this settings points to the default client config file, which is provided in the resources folder. |
| `↳ transport` | `string|https://docs.cloud.google.com/php/docs/reference/gax/latest/Transport.TransportInterface.html` The transport used for executing network requests. At the moment, supports only `rest`. *Advanced usage* : Additionally, it is possible to pass in an already instantiated [Google\\ApiCore\\Transport\\TransportInterface](https://docs.cloud.google.com/php/docs/reference/gax/latest/Transport.TransportInterface.html) object. Note that when this object is provided, any settings in $transportConfig, and any $apiEndpoint setting, will be ignored. |
| `↳ transportConfig` | `array` Configuration options that will be used to construct the transport. Options for each supported transport type should be passed in a key for that transport. For example: $transportConfig = \[ 'rest' =\> \[...\], \]; See the [Google\\ApiCore\\Transport\\RestTransport::build()](https://docs.cloud.google.com/php/docs/reference/gax/latest/Transport.RestTransport.html#_Google_ApiCore_Transport_RestTransport__build__) method for the supported options. |
| `↳ clientCertSource` | `callable` A callable which returns the client cert as a string. This can be used to provide a certificate and private key to the transport layer for mTLS. |
| `↳ logger` | `false|Psr\Log\LoggerInterface` A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the 'GOOGLE_SDK_PHP_LOGGING' environment flag |
| `↳ universeDomain` | `string` The service domain for the client. Defaults to 'googleapis.com'. |

### addAssociation

Inserts an association for the specified security policy.

This has billing implications. Projects in the hierarchy with effective
hierarchical security policies will be automatically enrolled into Cloud
Armor Enterprise if not already enrolled.

Use this API to modify Cloud Armor policies. Previously, alpha and beta
versions of this API were used to modify firewall policies. This usage is
now disabled for most organizations. Use firewallPolicies.addAssociation
instead.

The async variant is
[OrganizationSecurityPoliciesClient::addAssociationAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.Client.OrganizationSecurityPoliciesClient#_Google_Cloud_Compute_V1_Client_OrganizationSecurityPoliciesClient__addAssociationAsync__) .

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

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Cloud\Compute\V1\AddAssociationOrganizationSecurityPolicyRequest;
    use Google\Cloud\Compute\V1\Client\OrganizationSecurityPoliciesClient;
    use Google\Cloud\Compute\V1\SecurityPolicyAssociation;
    use Google\Rpc\Status;

    /**
     * @param string $securityPolicy Name of the security policy to update.
     */
    function add_association_sample(string $securityPolicy): void
    {
        // Create a client.
        $organizationSecurityPoliciesClient = new OrganizationSecurityPoliciesClient();

        // Prepare the request message.
        $securityPolicyAssociationResource = new SecurityPolicyAssociation();
        $request = (new AddAssociationOrganizationSecurityPolicyRequest())
            ->setSecurityPolicy($securityPolicy)
            ->setSecurityPolicyAssociationResource($securityPolicyAssociationResource);

        // Call the API and handle any network failures.
        try {
            /** @var OperationResponse $response */
            $response = $organizationSecurityPoliciesClient->addAssociation($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
    {
        $securityPolicy = '[SECURITY_POLICY]';

        add_association_sample($securityPolicy);
    }

### addRule

Inserts a rule into a security policy.

Use this API to modify Cloud Armor policies. Previously, alpha and beta
versions of this API were used to modify firewall policies. This usage is
now disabled for most organizations. Use firewallPolicies.addRule instead.

The async variant is [OrganizationSecurityPoliciesClient::addRuleAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.Client.OrganizationSecurityPoliciesClient#_Google_Cloud_Compute_V1_Client_OrganizationSecurityPoliciesClient__addRuleAsync__) .

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

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Cloud\Compute\V1\AddRuleOrganizationSecurityPolicyRequest;
    use Google\Cloud\Compute\V1\Client\OrganizationSecurityPoliciesClient;
    use Google\Cloud\Compute\V1\SecurityPolicyRule;
    use Google\Rpc\Status;

    /**
     * @param string $securityPolicy Name of the security policy to update.
     */
    function add_rule_sample(string $securityPolicy): void
    {
        // Create a client.
        $organizationSecurityPoliciesClient = new OrganizationSecurityPoliciesClient();

        // Prepare the request message.
        $securityPolicyRuleResource = new SecurityPolicyRule();
        $request = (new AddRuleOrganizationSecurityPolicyRequest())
            ->setSecurityPolicy($securityPolicy)
            ->setSecurityPolicyRuleResource($securityPolicyRuleResource);

        // Call the API and handle any network failures.
        try {
            /** @var OperationResponse $response */
            $response = $organizationSecurityPoliciesClient->addRule($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
    {
        $securityPolicy = '[SECURITY_POLICY]';

        add_rule_sample($securityPolicy);
    }

### copyRules

Copies rules to the specified security policy.

Use this API to modify Cloud Armor policies. Previously, alpha and beta
versions of this API were used to modify firewall policies. This usage is
now disabled for most organizations. Use firewallPolicies.cloneRules
instead.

The async variant is [OrganizationSecurityPoliciesClient::copyRulesAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.Client.OrganizationSecurityPoliciesClient#_Google_Cloud_Compute_V1_Client_OrganizationSecurityPoliciesClient__copyRulesAsync__)
.

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

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Cloud\Compute\V1\Client\OrganizationSecurityPoliciesClient;
    use Google\Cloud\Compute\V1\CopyRulesOrganizationSecurityPolicyRequest;
    use Google\Rpc\Status;

    /**
     * @param string $securityPolicy Name of the security policy to update.
     */
    function copy_rules_sample(string $securityPolicy): void
    {
        // Create a client.
        $organizationSecurityPoliciesClient = new OrganizationSecurityPoliciesClient();

        // Prepare the request message.
        $request = (new CopyRulesOrganizationSecurityPolicyRequest())
            ->setSecurityPolicy($securityPolicy);

        // Call the API and handle any network failures.
        try {
            /** @var OperationResponse $response */
            $response = $organizationSecurityPoliciesClient->copyRules($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
    {
        $securityPolicy = '[SECURITY_POLICY]';

        copy_rules_sample($securityPolicy);
    }

### delete

Deletes the specified policy.

Use this API to remove Cloud Armor policies. Previously, alpha and beta
versions of this API were used to remove firewall policies. This usage is
now disabled for most organizations. Use firewallPolicies.delete instead.

The async variant is [OrganizationSecurityPoliciesClient::deleteAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.Client.OrganizationSecurityPoliciesClient#_Google_Cloud_Compute_V1_Client_OrganizationSecurityPoliciesClient__deleteAsync__) .

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

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Cloud\Compute\V1\Client\OrganizationSecurityPoliciesClient;
    use Google\Cloud\Compute\V1\DeleteOrganizationSecurityPolicyRequest;
    use Google\Rpc\Status;

    /**
     * @param string $securityPolicy Name of the security policy to delete.
     */
    function delete_sample(string $securityPolicy): void
    {
        // Create a client.
        $organizationSecurityPoliciesClient = new OrganizationSecurityPoliciesClient();

        // Prepare the request message.
        $request = (new DeleteOrganizationSecurityPolicyRequest())
            ->setSecurityPolicy($securityPolicy);

        // Call the API and handle any network failures.
        try {
            /** @var OperationResponse $response */
            $response = $organizationSecurityPoliciesClient->delete($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
    {
        $securityPolicy = '[SECURITY_POLICY]';

        delete_sample($securityPolicy);
    }

### get

List all of the ordered rules present in a single specified policy.

Use this API to read Cloud Armor policies. Previously, alpha and beta
versions of this API were used to read firewall policies. This usage is now
disabled for most organizations. Use firewallPolicies.get instead.

The async variant is [OrganizationSecurityPoliciesClient::getAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.Client.OrganizationSecurityPoliciesClient#_Google_Cloud_Compute_V1_Client_OrganizationSecurityPoliciesClient__getAsync__) .

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.SecurityPolicy` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\Compute\V1\Client\OrganizationSecurityPoliciesClient;
    use Google\Cloud\Compute\V1\GetOrganizationSecurityPolicyRequest;
    use Google\Cloud\Compute\V1\SecurityPolicy;

    /**
     * @param string $securityPolicy Name of the security policy to get.
     */
    function get_sample(string $securityPolicy): void
    {
        // Create a client.
        $organizationSecurityPoliciesClient = new OrganizationSecurityPoliciesClient();

        // Prepare the request message.
        $request = (new GetOrganizationSecurityPolicyRequest())
            ->setSecurityPolicy($securityPolicy);

        // Call the API and handle any network failures.
        try {
            /** @var SecurityPolicy $response */
            $response = $organizationSecurityPoliciesClient->get($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
    {
        $securityPolicy = '[SECURITY_POLICY]';

        get_sample($securityPolicy);
    }

### getAssociation

Gets an association with the specified name.

Use this API to read Cloud Armor policies. Previously, alpha and beta
versions of this API were used to read firewall policies. This usage is
now disabled for most organizations. Use firewallPolicies.getAssociation
instead.

The async variant is
[OrganizationSecurityPoliciesClient::getAssociationAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.Client.OrganizationSecurityPoliciesClient#_Google_Cloud_Compute_V1_Client_OrganizationSecurityPoliciesClient__getAssociationAsync__) .

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.SecurityPolicyAssociation` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\Compute\V1\Client\OrganizationSecurityPoliciesClient;
    use Google\Cloud\Compute\V1\GetAssociationOrganizationSecurityPolicyRequest;
    use Google\Cloud\Compute\V1\SecurityPolicyAssociation;

    /**
     * @param string $securityPolicy Name of the security policy to which the queried rule belongs.
     */
    function get_association_sample(string $securityPolicy): void
    {
        // Create a client.
        $organizationSecurityPoliciesClient = new OrganizationSecurityPoliciesClient();

        // Prepare the request message.
        $request = (new GetAssociationOrganizationSecurityPolicyRequest())
            ->setSecurityPolicy($securityPolicy);

        // Call the API and handle any network failures.
        try {
            /** @var SecurityPolicyAssociation $response */
            $response = $organizationSecurityPoliciesClient->getAssociation($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
    {
        $securityPolicy = '[SECURITY_POLICY]';

        get_association_sample($securityPolicy);
    }

### getRule

Gets a rule at the specified priority.

Use this API to read Cloud Armor policies. Previously, alpha and beta
versions of this API were used to read firewall policies. This usage is now
disabled for most organizations. Use firewallPolicies.getRule instead.

The async variant is [OrganizationSecurityPoliciesClient::getRuleAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.Client.OrganizationSecurityPoliciesClient#_Google_Cloud_Compute_V1_Client_OrganizationSecurityPoliciesClient__getRuleAsync__) .

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.SecurityPolicyRule` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\Compute\V1\Client\OrganizationSecurityPoliciesClient;
    use Google\Cloud\Compute\V1\GetRuleOrganizationSecurityPolicyRequest;
    use Google\Cloud\Compute\V1\SecurityPolicyRule;

    /**
     * @param string $securityPolicy Name of the security policy to which the queried rule belongs.
     */
    function get_rule_sample(string $securityPolicy): void
    {
        // Create a client.
        $organizationSecurityPoliciesClient = new OrganizationSecurityPoliciesClient();

        // Prepare the request message.
        $request = (new GetRuleOrganizationSecurityPolicyRequest())
            ->setSecurityPolicy($securityPolicy);

        // Call the API and handle any network failures.
        try {
            /** @var SecurityPolicyRule $response */
            $response = $organizationSecurityPoliciesClient->getRule($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
    {
        $securityPolicy = '[SECURITY_POLICY]';

        get_rule_sample($securityPolicy);
    }

### insert

Creates a new policy in the specified organization using the data included
in the request.

Use this API to add Cloud Armor policies. Previously, alpha and beta
versions of this API were used to add firewall policies. This usage is now
disabled for most organizations. Use firewallPolicies.insert instead.

The async variant is [OrganizationSecurityPoliciesClient::insertAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.Client.OrganizationSecurityPoliciesClient#_Google_Cloud_Compute_V1_Client_OrganizationSecurityPoliciesClient__insertAsync__) .

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

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Cloud\Compute\V1\Client\OrganizationSecurityPoliciesClient;
    use Google\Cloud\Compute\V1\InsertOrganizationSecurityPolicyRequest;
    use Google\Cloud\Compute\V1\SecurityPolicy;
    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 insert_sample(): void
    {
        // Create a client.
        $organizationSecurityPoliciesClient = new OrganizationSecurityPoliciesClient();

        // Prepare the request message.
        $securityPolicyResource = new SecurityPolicy();
        $request = (new InsertOrganizationSecurityPolicyRequest())
            ->setSecurityPolicyResource($securityPolicyResource);

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

### list

List all the policies that have been configured for the specified
organization.

Use this API to read Cloud Armor policies. Previously, alpha and beta
versions of this API were used to read firewall policies. This usage is now
disabled for most organizations. Use firewallPolicies.list instead.

The async variant is [OrganizationSecurityPoliciesClient::listAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.Client.OrganizationSecurityPoliciesClient#_Google_Cloud_Compute_V1_Client_OrganizationSecurityPoliciesClient__listAsync__) .

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

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

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\PagedListResponse;
    use Google\Cloud\Compute\V1\Client\OrganizationSecurityPoliciesClient;
    use Google\Cloud\Compute\V1\ListOrganizationSecurityPoliciesRequest;

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

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

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

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

### listAssociations

Lists associations of a specified target, i.e., organization or folder.

Use this API to read Cloud Armor policies. Previously, alpha and beta
versions of this API were used to read firewall policies. This usage is
now disabled for most organizations. Use firewallPolicies.listAssociations
instead.

The async variant is
[OrganizationSecurityPoliciesClient::listAssociationsAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.Client.OrganizationSecurityPoliciesClient#_Google_Cloud_Compute_V1_Client_OrganizationSecurityPoliciesClient__listAssociationsAsync__) .

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.OrganizationSecurityPoliciesListAssociationsResponse` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\Compute\V1\Client\OrganizationSecurityPoliciesClient;
    use Google\Cloud\Compute\V1\ListAssociationsOrganizationSecurityPolicyRequest;
    use Google\Cloud\Compute\V1\OrganizationSecurityPoliciesListAssociationsResponse;

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

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

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

### listPreconfiguredExpressionSets

Gets the current list of preconfigured Web Application Firewall (WAF)
expressions.

The async variant is
[OrganizationSecurityPoliciesClient::listPreconfiguredExpressionSetsAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.Client.OrganizationSecurityPoliciesClient#_Google_Cloud_Compute_V1_Client_OrganizationSecurityPoliciesClient__listPreconfiguredExpressionSetsAsync__)
.

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.SecurityPoliciesListPreconfiguredExpressionSetsResponse` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\Compute\V1\Client\OrganizationSecurityPoliciesClient;
    use Google\Cloud\Compute\V1\ListPreconfiguredExpressionSetsOrganizationSecurityPoliciesRequest;
    use Google\Cloud\Compute\V1\SecurityPoliciesListPreconfiguredExpressionSetsResponse;

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

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

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

### move

Moves the specified security policy.

Use this API to modify Cloud Armor policies. Previously, alpha and beta
versions of this API were used to modify firewall policies. This usage is
now disabled for most organizations. Use firewallPolicies.move instead.

The async variant is [OrganizationSecurityPoliciesClient::moveAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.Client.OrganizationSecurityPoliciesClient#_Google_Cloud_Compute_V1_Client_OrganizationSecurityPoliciesClient__moveAsync__) .

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

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Cloud\Compute\V1\Client\OrganizationSecurityPoliciesClient;
    use Google\Cloud\Compute\V1\MoveOrganizationSecurityPolicyRequest;
    use Google\Rpc\Status;

    /**
     * @param string $securityPolicy Name of the security policy to update.
     */
    function move_sample(string $securityPolicy): void
    {
        // Create a client.
        $organizationSecurityPoliciesClient = new OrganizationSecurityPoliciesClient();

        // Prepare the request message.
        $request = (new MoveOrganizationSecurityPolicyRequest())
            ->setSecurityPolicy($securityPolicy);

        // Call the API and handle any network failures.
        try {
            /** @var OperationResponse $response */
            $response = $organizationSecurityPoliciesClient->move($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
    {
        $securityPolicy = '[SECURITY_POLICY]';

        move_sample($securityPolicy);
    }

### patch

Patches the specified policy with the data included in the request.

Use this API to modify Cloud Armor policies. Previously, alpha and beta
versions of this API were used to modify firewall policies. This usage is
now disabled for most organizations. Use firewallPolicies.patch instead.

The async variant is [OrganizationSecurityPoliciesClient::patchAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.Client.OrganizationSecurityPoliciesClient#_Google_Cloud_Compute_V1_Client_OrganizationSecurityPoliciesClient__patchAsync__) .

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

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Cloud\Compute\V1\Client\OrganizationSecurityPoliciesClient;
    use Google\Cloud\Compute\V1\PatchOrganizationSecurityPolicyRequest;
    use Google\Cloud\Compute\V1\SecurityPolicy;
    use Google\Rpc\Status;

    /**
     * @param string $securityPolicy Name of the security policy to update.
     */
    function patch_sample(string $securityPolicy): void
    {
        // Create a client.
        $organizationSecurityPoliciesClient = new OrganizationSecurityPoliciesClient();

        // Prepare the request message.
        $securityPolicyResource = new SecurityPolicy();
        $request = (new PatchOrganizationSecurityPolicyRequest())
            ->setSecurityPolicy($securityPolicy)
            ->setSecurityPolicyResource($securityPolicyResource);

        // Call the API and handle any network failures.
        try {
            /** @var OperationResponse $response */
            $response = $organizationSecurityPoliciesClient->patch($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
    {
        $securityPolicy = '[SECURITY_POLICY]';

        patch_sample($securityPolicy);
    }

### patchRule

Patches a rule at the specified priority.

Use this API to modify Cloud Armor policies. Previously, alpha and beta
versions of this API were used to modify firewall policies. This usage is
now disabled for most organizations. Use firewallPolicies.patchRule
instead.

The async variant is [OrganizationSecurityPoliciesClient::patchRuleAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.Client.OrganizationSecurityPoliciesClient#_Google_Cloud_Compute_V1_Client_OrganizationSecurityPoliciesClient__patchRuleAsync__)
.

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

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Cloud\Compute\V1\Client\OrganizationSecurityPoliciesClient;
    use Google\Cloud\Compute\V1\PatchRuleOrganizationSecurityPolicyRequest;
    use Google\Cloud\Compute\V1\SecurityPolicyRule;
    use Google\Rpc\Status;

    /**
     * @param string $securityPolicy Name of the security policy to update.
     */
    function patch_rule_sample(string $securityPolicy): void
    {
        // Create a client.
        $organizationSecurityPoliciesClient = new OrganizationSecurityPoliciesClient();

        // Prepare the request message.
        $securityPolicyRuleResource = new SecurityPolicyRule();
        $request = (new PatchRuleOrganizationSecurityPolicyRequest())
            ->setSecurityPolicy($securityPolicy)
            ->setSecurityPolicyRuleResource($securityPolicyRuleResource);

        // Call the API and handle any network failures.
        try {
            /** @var OperationResponse $response */
            $response = $organizationSecurityPoliciesClient->patchRule($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
    {
        $securityPolicy = '[SECURITY_POLICY]';

        patch_rule_sample($securityPolicy);
    }

### removeAssociation

Removes an association for the specified security policy.

Use this API to modify Cloud Armor policies. Previously, alpha and beta
versions of this API were used to modify firewall policies. This usage is
now disabled for most organizations. Use firewallPolicies.removeAssociation
instead.

The async variant is
[OrganizationSecurityPoliciesClient::removeAssociationAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.Client.OrganizationSecurityPoliciesClient#_Google_Cloud_Compute_V1_Client_OrganizationSecurityPoliciesClient__removeAssociationAsync__) .

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

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Cloud\Compute\V1\Client\OrganizationSecurityPoliciesClient;
    use Google\Cloud\Compute\V1\RemoveAssociationOrganizationSecurityPolicyRequest;
    use Google\Rpc\Status;

    /**
     * @param string $securityPolicy Name of the security policy to update.
     */
    function remove_association_sample(string $securityPolicy): void
    {
        // Create a client.
        $organizationSecurityPoliciesClient = new OrganizationSecurityPoliciesClient();

        // Prepare the request message.
        $request = (new RemoveAssociationOrganizationSecurityPolicyRequest())
            ->setSecurityPolicy($securityPolicy);

        // Call the API and handle any network failures.
        try {
            /** @var OperationResponse $response */
            $response = $organizationSecurityPoliciesClient->removeAssociation($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
    {
        $securityPolicy = '[SECURITY_POLICY]';

        remove_association_sample($securityPolicy);
    }

### removeRule

Deletes a rule at the specified priority.

Use this API to modify Cloud Armor policies. Previously, alpha and beta
versions of this API were used to modify firewall policies. This usage is
now disabled for most organizations. Use firewallPolicies.removeRule
instead.

The async variant is
[OrganizationSecurityPoliciesClient::removeRuleAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.Client.OrganizationSecurityPoliciesClient#_Google_Cloud_Compute_V1_Client_OrganizationSecurityPoliciesClient__removeRuleAsync__) .

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

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Cloud\Compute\V1\Client\OrganizationSecurityPoliciesClient;
    use Google\Cloud\Compute\V1\RemoveRuleOrganizationSecurityPolicyRequest;
    use Google\Rpc\Status;

    /**
     * @param string $securityPolicy Name of the security policy to update.
     */
    function remove_rule_sample(string $securityPolicy): void
    {
        // Create a client.
        $organizationSecurityPoliciesClient = new OrganizationSecurityPoliciesClient();

        // Prepare the request message.
        $request = (new RemoveRuleOrganizationSecurityPolicyRequest())
            ->setSecurityPolicy($securityPolicy);

        // Call the API and handle any network failures.
        try {
            /** @var OperationResponse $response */
            $response = $organizationSecurityPoliciesClient->removeRule($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
    {
        $securityPolicy = '[SECURITY_POLICY]';

        remove_rule_sample($securityPolicy);
    }

### addAssociationAsync

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

### addRuleAsync

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

### copyRulesAsync

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

### deleteAsync

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

### getAsync

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.SecurityPolicy>` |   |

### getAssociationAsync

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.SecurityPolicyAssociation>` |   |

### getRuleAsync

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.SecurityPolicyRule>` |   |

### insertAsync

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

### listAsync

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

### listAssociationsAsync

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.OrganizationSecurityPoliciesListAssociationsResponse>` |   |

### listPreconfiguredExpressionSetsAsync

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.SecurityPoliciesListPreconfiguredExpressionSetsResponse>` |   |

### moveAsync

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

### patchAsync

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

### patchRuleAsync

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

### removeAssociationAsync

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

### removeRuleAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.RemoveRuleOrganizationSecurityPolicyRequest` |
| `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 GlobalOrganizationOperationsClient object with the same endpoint as
$this.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.Client.GlobalOrganizationOperationsClient` |   |

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