0.15.1 (latest) 0.15.0 0.14.1 0.8.0 0.7.0 0.6.2 0.5.0 0.4.1 0.3.1 0.2.0 0.1.3 Reference documentation and code samples for the Google Ads Ad Manager V1 Client class AudienceSegmentServiceClient.

Service Description: Provides methods for handling `AudienceSegment` objects.

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 \\ Ads \\ AdManager \\ 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\Ads\AdManager\V1\AudienceSegmentServiceClient; $creds = new ServiceAccountCredentials($scopes, $json); $options = new AudienceSegmentServiceClient(['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'. |

### batchActivateAudienceSegments

Activates `AudienceSegment` objects.

The async variant is
[AudienceSegmentServiceClient::batchActivateAudienceSegmentsAsync()](https://docs.cloud.google.com/php/docs/reference/ad-manager/latest/V1.Client.AudienceSegmentServiceClient#_Google_Ads_AdManager_V1_Client_AudienceSegmentServiceClient__batchActivateAudienceSegmentsAsync__) .

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

**Example**

    use Google\Ads\AdManager\V1\BatchActivateAudienceSegmentsRequest;
    use Google\Ads\AdManager\V1\BatchActivateAudienceSegmentsResponse;
    use Google\Ads\AdManager\V1\Client\AudienceSegmentServiceClient;
    use Google\ApiCore\ApiException;

    /**
     * @param string $formattedParent       Format: `networks/{network_code}`
     *                                      Please see {@see AudienceSegmentServiceClient::networkName()} for help formatting this field.
     * @param string $formattedNamesElement Resource names for the AudienceSegments.
     *                                      Format: `networks/{network_code}/audienceSegments/{audience_segment_id}`
     *                                      Please see {@see AudienceSegmentServiceClient::audienceSegmentName()} for help formatting this field.
     */
    function batch_activate_audience_segments_sample(
        string $formattedParent,
        string $formattedNamesElement
    ): void {
        // Create a client.
        $audienceSegmentServiceClient = new AudienceSegmentServiceClient();

        // Prepare the request message.
        $formattedNames = [$formattedNamesElement];
        $request = (new BatchActivateAudienceSegmentsRequest())
            ->setParent($formattedParent)
            ->setNames($formattedNames);

        // Call the API and handle any network failures.
        try {
            /** @var BatchActivateAudienceSegmentsResponse $response */
            $response = $audienceSegmentServiceClient->batchActivateAudienceSegments($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
    {
        $formattedParent = AudienceSegmentServiceClient::networkName('[NETWORK_CODE]');
        $formattedNamesElement = AudienceSegmentServiceClient::audienceSegmentName(
            '[NETWORK_CODE]',
            '[AUDIENCE_SEGMENT]'
        );

        batch_activate_audience_segments_sample($formattedParent, $formattedNamesElement);
    }

### batchApproveAudienceSegments

Approves `AudienceSegment` objects.

The async variant is
[AudienceSegmentServiceClient::batchApproveAudienceSegmentsAsync()](https://docs.cloud.google.com/php/docs/reference/ad-manager/latest/V1.Client.AudienceSegmentServiceClient#_Google_Ads_AdManager_V1_Client_AudienceSegmentServiceClient__batchApproveAudienceSegmentsAsync__) .

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

**Example**

    use Google\Ads\AdManager\V1\BatchApproveAudienceSegmentsRequest;
    use Google\Ads\AdManager\V1\BatchApproveAudienceSegmentsResponse;
    use Google\Ads\AdManager\V1\Client\AudienceSegmentServiceClient;
    use Google\ApiCore\ApiException;

    /**
     * @param string $formattedParent       Format: `networks/{network_code}`
     *                                      Please see {@see AudienceSegmentServiceClient::networkName()} for help formatting this field.
     * @param string $formattedNamesElement Resource names for the AudienceSegments.
     *                                      Format: `networks/{network_code}/audienceSegments/{audience_segment_id}`
     *                                      Please see {@see AudienceSegmentServiceClient::audienceSegmentName()} for help formatting this field.
     */
    function batch_approve_audience_segments_sample(
        string $formattedParent,
        string $formattedNamesElement
    ): void {
        // Create a client.
        $audienceSegmentServiceClient = new AudienceSegmentServiceClient();

        // Prepare the request message.
        $formattedNames = [$formattedNamesElement];
        $request = (new BatchApproveAudienceSegmentsRequest())
            ->setParent($formattedParent)
            ->setNames($formattedNames);

        // Call the API and handle any network failures.
        try {
            /** @var BatchApproveAudienceSegmentsResponse $response */
            $response = $audienceSegmentServiceClient->batchApproveAudienceSegments($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
    {
        $formattedParent = AudienceSegmentServiceClient::networkName('[NETWORK_CODE]');
        $formattedNamesElement = AudienceSegmentServiceClient::audienceSegmentName(
            '[NETWORK_CODE]',
            '[AUDIENCE_SEGMENT]'
        );

        batch_approve_audience_segments_sample($formattedParent, $formattedNamesElement);
    }

### batchCreateAudienceSegments

Creates `AudienceSegment` objects.

The async variant is
[AudienceSegmentServiceClient::batchCreateAudienceSegmentsAsync()](https://docs.cloud.google.com/php/docs/reference/ad-manager/latest/V1.Client.AudienceSegmentServiceClient#_Google_Ads_AdManager_V1_Client_AudienceSegmentServiceClient__batchCreateAudienceSegmentsAsync__) .

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

**Example**

    use Google\Ads\AdManager\V1\AudienceSegment;
    use Google\Ads\AdManager\V1\BatchCreateAudienceSegmentsRequest;
    use Google\Ads\AdManager\V1\BatchCreateAudienceSegmentsResponse;
    use Google\Ads\AdManager\V1\Client\AudienceSegmentServiceClient;
    use Google\Ads\AdManager\V1\CreateAudienceSegmentRequest;
    use Google\ApiCore\ApiException;

    /**
     * @param string $formattedParent                    The parent resource where `AudienceSegments` will be created.
     *                                                   Format: `networks/{network_code}`
     *                                                   The parent field in the CreateAudienceSegmentRequest must match this
     *                                                   field. Please see
     *                                                   {@see AudienceSegmentServiceClient::networkName()} for help formatting this field.
     * @param string $formattedRequestsParent            The parent resource where this `AudienceSegment` will be created.
     *                                                   Format: `networks/{network_code}`
     *                                                   Please see {@see AudienceSegmentServiceClient::networkName()} for help formatting this field.
     * @param string $requestsAudienceSegmentDisplayName Display name of the `AudienceSegment`. The attribute has a
     *                                                   maximum length of 255 characters.
     */
    function batch_create_audience_segments_sample(
        string $formattedParent,
        string $formattedRequestsParent,
        string $requestsAudienceSegmentDisplayName
    ): void {
        // Create a client.
        $audienceSegmentServiceClient = new AudienceSegmentServiceClient();

        // Prepare the request message.
        $requestsAudienceSegment = (new AudienceSegment())
            ->setDisplayName($requestsAudienceSegmentDisplayName);
        $createAudienceSegmentRequest = (new CreateAudienceSegmentRequest())
            ->setParent($formattedRequestsParent)
            ->setAudienceSegment($requestsAudienceSegment);
        $requests = [$createAudienceSegmentRequest];
        $request = (new BatchCreateAudienceSegmentsRequest())
            ->setParent($formattedParent)
            ->setRequests($requests);

        // Call the API and handle any network failures.
        try {
            /** @var BatchCreateAudienceSegmentsResponse $response */
            $response = $audienceSegmentServiceClient->batchCreateAudienceSegments($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
    {
        $formattedParent = AudienceSegmentServiceClient::networkName('[NETWORK_CODE]');
        $formattedRequestsParent = AudienceSegmentServiceClient::networkName('[NETWORK_CODE]');
        $requestsAudienceSegmentDisplayName = '[DISPLAY_NAME]';

        batch_create_audience_segments_sample(
            $formattedParent,
            $formattedRequestsParent,
            $requestsAudienceSegmentDisplayName
        );
    }

### batchDeactivateAudienceSegments

Deactivates `AudienceSegment` objects.

The async variant is
[AudienceSegmentServiceClient::batchDeactivateAudienceSegmentsAsync()](https://docs.cloud.google.com/php/docs/reference/ad-manager/latest/V1.Client.AudienceSegmentServiceClient#_Google_Ads_AdManager_V1_Client_AudienceSegmentServiceClient__batchDeactivateAudienceSegmentsAsync__) .

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

**Example**

    use Google\Ads\AdManager\V1\BatchDeactivateAudienceSegmentsRequest;
    use Google\Ads\AdManager\V1\BatchDeactivateAudienceSegmentsResponse;
    use Google\Ads\AdManager\V1\Client\AudienceSegmentServiceClient;
    use Google\ApiCore\ApiException;

    /**
     * @param string $formattedParent       Format: `networks/{network_code}`
     *                                      Please see {@see AudienceSegmentServiceClient::networkName()} for help formatting this field.
     * @param string $formattedNamesElement Resource names for the AudienceSegments.
     *                                      Format: `networks/{network_code}/audienceSegments/{audience_segment_id}`
     *                                      Please see {@see AudienceSegmentServiceClient::audienceSegmentName()} for help formatting this field.
     */
    function batch_deactivate_audience_segments_sample(
        string $formattedParent,
        string $formattedNamesElement
    ): void {
        // Create a client.
        $audienceSegmentServiceClient = new AudienceSegmentServiceClient();

        // Prepare the request message.
        $formattedNames = [$formattedNamesElement];
        $request = (new BatchDeactivateAudienceSegmentsRequest())
            ->setParent($formattedParent)
            ->setNames($formattedNames);

        // Call the API and handle any network failures.
        try {
            /** @var BatchDeactivateAudienceSegmentsResponse $response */
            $response = $audienceSegmentServiceClient->batchDeactivateAudienceSegments($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
    {
        $formattedParent = AudienceSegmentServiceClient::networkName('[NETWORK_CODE]');
        $formattedNamesElement = AudienceSegmentServiceClient::audienceSegmentName(
            '[NETWORK_CODE]',
            '[AUDIENCE_SEGMENT]'
        );

        batch_deactivate_audience_segments_sample($formattedParent, $formattedNamesElement);
    }

### batchPopulateAudienceSegments

Populates `AudienceSegment` objects.

The async variant is
[AudienceSegmentServiceClient::batchPopulateAudienceSegmentsAsync()](https://docs.cloud.google.com/php/docs/reference/ad-manager/latest/V1.Client.AudienceSegmentServiceClient#_Google_Ads_AdManager_V1_Client_AudienceSegmentServiceClient__batchPopulateAudienceSegmentsAsync__) .

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

**Example**

    use Google\Ads\AdManager\V1\BatchPopulateAudienceSegmentsRequest;
    use Google\Ads\AdManager\V1\BatchPopulateAudienceSegmentsResponse;
    use Google\Ads\AdManager\V1\Client\AudienceSegmentServiceClient;
    use Google\ApiCore\ApiException;

    /**
     * @param string $formattedParent       Format: `networks/{network_code}`
     *                                      Please see {@see AudienceSegmentServiceClient::networkName()} for help formatting this field.
     * @param string $formattedNamesElement Resource names for the AudienceSegments.
     *                                      Format: `networks/{network_code}/audienceSegments/{audience_segment_id}`
     *                                      Please see {@see AudienceSegmentServiceClient::audienceSegmentName()} for help formatting this field.
     */
    function batch_populate_audience_segments_sample(
        string $formattedParent,
        string $formattedNamesElement
    ): void {
        // Create a client.
        $audienceSegmentServiceClient = new AudienceSegmentServiceClient();

        // Prepare the request message.
        $formattedNames = [$formattedNamesElement];
        $request = (new BatchPopulateAudienceSegmentsRequest())
            ->setParent($formattedParent)
            ->setNames($formattedNames);

        // Call the API and handle any network failures.
        try {
            /** @var BatchPopulateAudienceSegmentsResponse $response */
            $response = $audienceSegmentServiceClient->batchPopulateAudienceSegments($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
    {
        $formattedParent = AudienceSegmentServiceClient::networkName('[NETWORK_CODE]');
        $formattedNamesElement = AudienceSegmentServiceClient::audienceSegmentName(
            '[NETWORK_CODE]',
            '[AUDIENCE_SEGMENT]'
        );

        batch_populate_audience_segments_sample($formattedParent, $formattedNamesElement);
    }

### batchRejectAudienceSegments

Rejects `AudienceSegment` objects.

The async variant is
[AudienceSegmentServiceClient::batchRejectAudienceSegmentsAsync()](https://docs.cloud.google.com/php/docs/reference/ad-manager/latest/V1.Client.AudienceSegmentServiceClient#_Google_Ads_AdManager_V1_Client_AudienceSegmentServiceClient__batchRejectAudienceSegmentsAsync__) .

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

**Example**

    use Google\Ads\AdManager\V1\BatchRejectAudienceSegmentsRequest;
    use Google\Ads\AdManager\V1\BatchRejectAudienceSegmentsResponse;
    use Google\Ads\AdManager\V1\Client\AudienceSegmentServiceClient;
    use Google\ApiCore\ApiException;

    /**
     * @param string $formattedParent       Format: `networks/{network_code}`
     *                                      Please see {@see AudienceSegmentServiceClient::networkName()} for help formatting this field.
     * @param string $formattedNamesElement Resource names for the AudienceSegments.
     *                                      Format: `networks/{network_code}/audienceSegments/{audience_segment_id}`
     *                                      Please see {@see AudienceSegmentServiceClient::audienceSegmentName()} for help formatting this field.
     */
    function batch_reject_audience_segments_sample(
        string $formattedParent,
        string $formattedNamesElement
    ): void {
        // Create a client.
        $audienceSegmentServiceClient = new AudienceSegmentServiceClient();

        // Prepare the request message.
        $formattedNames = [$formattedNamesElement];
        $request = (new BatchRejectAudienceSegmentsRequest())
            ->setParent($formattedParent)
            ->setNames($formattedNames);

        // Call the API and handle any network failures.
        try {
            /** @var BatchRejectAudienceSegmentsResponse $response */
            $response = $audienceSegmentServiceClient->batchRejectAudienceSegments($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
    {
        $formattedParent = AudienceSegmentServiceClient::networkName('[NETWORK_CODE]');
        $formattedNamesElement = AudienceSegmentServiceClient::audienceSegmentName(
            '[NETWORK_CODE]',
            '[AUDIENCE_SEGMENT]'
        );

        batch_reject_audience_segments_sample($formattedParent, $formattedNamesElement);
    }

### batchUpdateAudienceSegments

Batch updates `AudienceSegment` objects.

The async variant is
[AudienceSegmentServiceClient::batchUpdateAudienceSegmentsAsync()](https://docs.cloud.google.com/php/docs/reference/ad-manager/latest/V1.Client.AudienceSegmentServiceClient#_Google_Ads_AdManager_V1_Client_AudienceSegmentServiceClient__batchUpdateAudienceSegmentsAsync__) .

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

**Example**

    use Google\Ads\AdManager\V1\AudienceSegment;
    use Google\Ads\AdManager\V1\BatchUpdateAudienceSegmentsRequest;
    use Google\Ads\AdManager\V1\BatchUpdateAudienceSegmentsResponse;
    use Google\Ads\AdManager\V1\Client\AudienceSegmentServiceClient;
    use Google\Ads\AdManager\V1\UpdateAudienceSegmentRequest;
    use Google\ApiCore\ApiException;

    /**
     * @param string $formattedParent                    The parent resource where `AudienceSegments` will be updated.
     *                                                   Format: `networks/{network_code}`
     *                                                   The parent field in the UpdateAudienceSegmentRequest.audienceSegment must
     *                                                   match this field. Please see
     *                                                   {@see AudienceSegmentServiceClient::networkName()} for help formatting this field.
     * @param string $requestsAudienceSegmentDisplayName Display name of the `AudienceSegment`. The attribute has a
     *                                                   maximum length of 255 characters.
     */
    function batch_update_audience_segments_sample(
        string $formattedParent,
        string $requestsAudienceSegmentDisplayName
    ): void {
        // Create a client.
        $audienceSegmentServiceClient = new AudienceSegmentServiceClient();

        // Prepare the request message.
        $requestsAudienceSegment = (new AudienceSegment())
            ->setDisplayName($requestsAudienceSegmentDisplayName);
        $updateAudienceSegmentRequest = (new UpdateAudienceSegmentRequest())
            ->setAudienceSegment($requestsAudienceSegment);
        $requests = [$updateAudienceSegmentRequest];
        $request = (new BatchUpdateAudienceSegmentsRequest())
            ->setParent($formattedParent)
            ->setRequests($requests);

        // Call the API and handle any network failures.
        try {
            /** @var BatchUpdateAudienceSegmentsResponse $response */
            $response = $audienceSegmentServiceClient->batchUpdateAudienceSegments($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
    {
        $formattedParent = AudienceSegmentServiceClient::networkName('[NETWORK_CODE]');
        $requestsAudienceSegmentDisplayName = '[DISPLAY_NAME]';

        batch_update_audience_segments_sample($formattedParent, $requestsAudienceSegmentDisplayName);
    }

### createAudienceSegment

Creates an `AudienceSegment` object.

The async variant is
[AudienceSegmentServiceClient::createAudienceSegmentAsync()](https://docs.cloud.google.com/php/docs/reference/ad-manager/latest/V1.Client.AudienceSegmentServiceClient#_Google_Ads_AdManager_V1_Client_AudienceSegmentServiceClient__createAudienceSegmentAsync__) .

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

**Example**

    use Google\Ads\AdManager\V1\AudienceSegment;
    use Google\Ads\AdManager\V1\Client\AudienceSegmentServiceClient;
    use Google\Ads\AdManager\V1\CreateAudienceSegmentRequest;
    use Google\ApiCore\ApiException;

    /**
     * @param string $formattedParent            The parent resource where this `AudienceSegment` will be created.
     *                                           Format: `networks/{network_code}`
     *                                           Please see {@see AudienceSegmentServiceClient::networkName()} for help formatting this field.
     * @param string $audienceSegmentDisplayName Display name of the `AudienceSegment`. The attribute has a
     *                                           maximum length of 255 characters.
     */
    function create_audience_segment_sample(
        string $formattedParent,
        string $audienceSegmentDisplayName
    ): void {
        // Create a client.
        $audienceSegmentServiceClient = new AudienceSegmentServiceClient();

        // Prepare the request message.
        $audienceSegment = (new AudienceSegment())
            ->setDisplayName($audienceSegmentDisplayName);
        $request = (new CreateAudienceSegmentRequest())
            ->setParent($formattedParent)
            ->setAudienceSegment($audienceSegment);

        // Call the API and handle any network failures.
        try {
            /** @var AudienceSegment $response */
            $response = $audienceSegmentServiceClient->createAudienceSegment($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
    {
        $formattedParent = AudienceSegmentServiceClient::networkName('[NETWORK_CODE]');
        $audienceSegmentDisplayName = '[DISPLAY_NAME]';

        create_audience_segment_sample($formattedParent, $audienceSegmentDisplayName);
    }

### getAudienceSegment

Retrieves an `AudienceSegment` object.

The async variant is
[AudienceSegmentServiceClient::getAudienceSegmentAsync()](https://docs.cloud.google.com/php/docs/reference/ad-manager/latest/V1.Client.AudienceSegmentServiceClient#_Google_Ads_AdManager_V1_Client_AudienceSegmentServiceClient__getAudienceSegmentAsync__) .

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

**Example**

    use Google\Ads\AdManager\V1\AudienceSegment;
    use Google\Ads\AdManager\V1\Client\AudienceSegmentServiceClient;
    use Google\Ads\AdManager\V1\GetAudienceSegmentRequest;
    use Google\ApiCore\ApiException;

    /**
     * @param string $formattedName The resource name of the AudienceSegment.
     *                              Format: `networks/{network_code}/audienceSegments/{audience_segment_id}`
     *                              Please see {@see AudienceSegmentServiceClient::audienceSegmentName()} for help formatting this field.
     */
    function get_audience_segment_sample(string $formattedName): void
    {
        // Create a client.
        $audienceSegmentServiceClient = new AudienceSegmentServiceClient();

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

        // Call the API and handle any network failures.
        try {
            /** @var AudienceSegment $response */
            $response = $audienceSegmentServiceClient->getAudienceSegment($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 = AudienceSegmentServiceClient::audienceSegmentName(
            '[NETWORK_CODE]',
            '[AUDIENCE_SEGMENT]'
        );

        get_audience_segment_sample($formattedName);
    }

### listAudienceSegments

Lists `AudienceSegment` objects.

The async variant is
[AudienceSegmentServiceClient::listAudienceSegmentsAsync()](https://docs.cloud.google.com/php/docs/reference/ad-manager/latest/V1.Client.AudienceSegmentServiceClient#_Google_Ads_AdManager_V1_Client_AudienceSegmentServiceClient__listAudienceSegmentsAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/ad-manager/latest/V1.ListAudienceSegmentsRequest` 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\Ads\AdManager\V1\Client\AudienceSegmentServiceClient;
    use Google\Ads\AdManager\V1\ListAudienceSegmentsRequest;
    use Google\ApiCore\ApiException;
    use Google\ApiCore\PagedListResponse;

    /**
     * @param string $formattedParent The parent publisher network associated with these audience
     *                                segments. Format: `networks/{network_code}`
     *                                Please see {@see AudienceSegmentServiceClient::networkName()} for help formatting this field.
     */
    function list_audience_segments_sample(string $formattedParent): void
    {
        // Create a client.
        $audienceSegmentServiceClient = new AudienceSegmentServiceClient();

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

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

    /**
     * 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 = AudienceSegmentServiceClient::networkName('[NETWORK_CODE]');

        list_audience_segments_sample($formattedParent);
    }

### updateAudienceSegment

Updates an `AudienceSegment` object.

The async variant is
[AudienceSegmentServiceClient::updateAudienceSegmentAsync()](https://docs.cloud.google.com/php/docs/reference/ad-manager/latest/V1.Client.AudienceSegmentServiceClient#_Google_Ads_AdManager_V1_Client_AudienceSegmentServiceClient__updateAudienceSegmentAsync__) .

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

**Example**

    use Google\Ads\AdManager\V1\AudienceSegment;
    use Google\Ads\AdManager\V1\Client\AudienceSegmentServiceClient;
    use Google\Ads\AdManager\V1\UpdateAudienceSegmentRequest;
    use Google\ApiCore\ApiException;

    /**
     * @param string $audienceSegmentDisplayName Display name of the `AudienceSegment`. The attribute has a
     *                                           maximum length of 255 characters.
     */
    function update_audience_segment_sample(string $audienceSegmentDisplayName): void
    {
        // Create a client.
        $audienceSegmentServiceClient = new AudienceSegmentServiceClient();

        // Prepare the request message.
        $audienceSegment = (new AudienceSegment())
            ->setDisplayName($audienceSegmentDisplayName);
        $request = (new UpdateAudienceSegmentRequest())
            ->setAudienceSegment($audienceSegment);

        // Call the API and handle any network failures.
        try {
            /** @var AudienceSegment $response */
            $response = $audienceSegmentServiceClient->updateAudienceSegment($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
    {
        $audienceSegmentDisplayName = '[DISPLAY_NAME]';

        update_audience_segment_sample($audienceSegmentDisplayName);
    }

### batchActivateAudienceSegmentsAsync

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

### batchApproveAudienceSegmentsAsync

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

### batchCreateAudienceSegmentsAsync

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

### batchDeactivateAudienceSegmentsAsync

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

### batchPopulateAudienceSegmentsAsync

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

### batchRejectAudienceSegmentsAsync

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

### batchUpdateAudienceSegmentsAsync

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

### createAudienceSegmentAsync

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

### getAudienceSegmentAsync

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

### listAudienceSegmentsAsync

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

### updateAudienceSegmentAsync

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

### static::adUnitName

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

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `networkCode` | `string` |
| `adUnit` | `string` |

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

### static::audienceSegmentName

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

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `networkCode` | `string` |
| `audienceSegment` | `string` |

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

### static::cmsMetadataValueName

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

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `networkCode` | `string` |
| `cmsMetadataValue` | `string` |

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

### static::customTargetingKeyName

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

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `networkCode` | `string` |
| `customTargetingKey` | `string` |

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

### static::customTargetingValueName

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

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `networkCode` | `string` |
| `customTargetingValue` | `string` |

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

### static::networkName

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

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

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

### static::placementName

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

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `networkCode` | `string` |
| `placement` | `string` |

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

- adUnit: networks/{network_code}/adUnits/{ad_unit}
- audienceSegment: networks/{network_code}/audienceSegments/{audience_segment}
- cmsMetadataValue: networks/{network_code}/cmsMetadataValues/{cms_metadata_value}
- customTargetingKey: networks/{network_code}/customTargetingKeys/{custom_targeting_key}
- customTargetingValue: networks/{network_code}/customTargetingValues/{custom_targeting_value}
- network: networks/{network_code}
- placement: networks/{network_code}/placements/{placement}

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