Google Ads Ad Manager V1 Client - Class LabelServiceClient (0.7.0)

Reference documentation and code samples for the Google Ads Ad Manager V1 Client class LabelServiceClient.

Service Description: Provides methods for handling Label 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|Google\ApiCore\Options\ClientOptions

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 FetchAuthTokenInterface|CredentialsWrapper

This option should only be used with a pre-constructed Google\Auth\FetchAuthTokenInterface or Google\ApiCore\CredentialsWrapper 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\LabelServiceClient; $creds = new ServiceAccountCredentials($scopes, $json); $options = new LabelServiceClient(['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() .

↳ disableRetries bool

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

↳ clientConfig string|array

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

↳ transport string|TransportInterface

The transport used for executing network requests. At the moment, supports only rest. Advanced usage: Additionally, it is possible to pass in an already instantiated Google\ApiCore\Transport\TransportInterface object. Note that when this object is provided, any settings in $transportConfig, and any $apiEndpoint setting, will be ignored.

↳ transportConfig array

Configuration options that will be used to construct the transport. Options for each supported transport type should be passed in a key for that transport. For example: $transportConfig = [ 'rest' => [...], ]; See the 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|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'.

batchActivateLabels

API to activate Label objects.

The async variant is LabelServiceClient::batchActivateLabelsAsync() .

Parameters
Name Description
request Google\Ads\AdManager\V1\BatchActivateLabelsRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\Ads\AdManager\V1\BatchActivateLabelsResponse
Example
use Google\Ads\AdManager\V1\BatchActivateLabelsRequest;
use Google\Ads\AdManager\V1\BatchActivateLabelsResponse;
use Google\Ads\AdManager\V1\Client\LabelServiceClient;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedParent       Format: `networks/{network_code}`
 *                                      Please see {@see LabelServiceClient::networkName()} for help formatting this field.
 * @param string $formattedNamesElement Resource names for the Label.
 *                                      Format: `networks/{network_code}/labels/{label_id}`
 *                                      Please see {@see LabelServiceClient::labelName()} for help formatting this field.
 */
function batch_activate_labels_sample(
    string $formattedParent,
    string $formattedNamesElement
): void {
    // Create a client.
    $labelServiceClient = new LabelServiceClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var BatchActivateLabelsResponse $response */
        $response = $labelServiceClient->batchActivateLabels($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 = LabelServiceClient::networkName('[NETWORK_CODE]');
    $formattedNamesElement = LabelServiceClient::labelName('[NETWORK_CODE]', '[LABEL]');

    batch_activate_labels_sample($formattedParent, $formattedNamesElement);
}

batchCreateLabels

API to batch create Label objects.

The async variant is LabelServiceClient::batchCreateLabelsAsync() .

Parameters
Name Description
request Google\Ads\AdManager\V1\BatchCreateLabelsRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\Ads\AdManager\V1\BatchCreateLabelsResponse
Example
use Google\Ads\AdManager\V1\BatchCreateLabelsRequest;
use Google\Ads\AdManager\V1\BatchCreateLabelsResponse;
use Google\Ads\AdManager\V1\Client\LabelServiceClient;
use Google\Ads\AdManager\V1\CreateLabelRequest;
use Google\Ads\AdManager\V1\Label;
use Google\Ads\AdManager\V1\LabelTypeEnum\LabelType;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedParent           The parent resource where `Labels` will be created.
 *                                          Format: `networks/{network_code}`
 *                                          The parent field in the CreateLabelRequest must match this
 *                                          field. Please see
 *                                          {@see LabelServiceClient::networkName()} for help formatting this field.
 * @param string $formattedRequestsParent   The parent resource where this `Label` will be created.
 *                                          Format: `networks/{network_code}`
 *                                          Please see {@see LabelServiceClient::networkName()} for help formatting this field.
 * @param string $requestsLabelDisplayName  Display name of the Label. This attribute has a maximum length of
 *                                          127 characters.
 * @param int    $requestsLabelTypesElement Unordered list. The types of the Label.
 */
function batch_create_labels_sample(
    string $formattedParent,
    string $formattedRequestsParent,
    string $requestsLabelDisplayName,
    int $requestsLabelTypesElement
): void {
    // Create a client.
    $labelServiceClient = new LabelServiceClient();

    // Prepare the request message.
    $requestsLabelTypes = [$requestsLabelTypesElement,];
    $requestsLabel = (new Label())
        ->setDisplayName($requestsLabelDisplayName)
        ->setTypes($requestsLabelTypes);
    $createLabelRequest = (new CreateLabelRequest())
        ->setParent($formattedRequestsParent)
        ->setLabel($requestsLabel);
    $requests = [$createLabelRequest,];
    $request = (new BatchCreateLabelsRequest())
        ->setParent($formattedParent)
        ->setRequests($requests);

    // Call the API and handle any network failures.
    try {
        /** @var BatchCreateLabelsResponse $response */
        $response = $labelServiceClient->batchCreateLabels($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 = LabelServiceClient::networkName('[NETWORK_CODE]');
    $formattedRequestsParent = LabelServiceClient::networkName('[NETWORK_CODE]');
    $requestsLabelDisplayName = '[DISPLAY_NAME]';
    $requestsLabelTypesElement = LabelType::LABEL_TYPE_UNSPECIFIED;

    batch_create_labels_sample(
        $formattedParent,
        $formattedRequestsParent,
        $requestsLabelDisplayName,
        $requestsLabelTypesElement
    );
}

batchDeactivateLabels

API to deactivate Label objects.

The async variant is LabelServiceClient::batchDeactivateLabelsAsync() .

Parameters
Name Description
request Google\Ads\AdManager\V1\BatchDeactivateLabelsRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\Ads\AdManager\V1\BatchDeactivateLabelsResponse
Example
use Google\Ads\AdManager\V1\BatchDeactivateLabelsRequest;
use Google\Ads\AdManager\V1\BatchDeactivateLabelsResponse;
use Google\Ads\AdManager\V1\Client\LabelServiceClient;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedParent       Format: `networks/{network_code}`
 *                                      Please see {@see LabelServiceClient::networkName()} for help formatting this field.
 * @param string $formattedNamesElement Resource names for the Label.
 *                                      Format: `networks/{network_code}/labels/{label_id}`
 *                                      Please see {@see LabelServiceClient::labelName()} for help formatting this field.
 */
function batch_deactivate_labels_sample(
    string $formattedParent,
    string $formattedNamesElement
): void {
    // Create a client.
    $labelServiceClient = new LabelServiceClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var BatchDeactivateLabelsResponse $response */
        $response = $labelServiceClient->batchDeactivateLabels($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 = LabelServiceClient::networkName('[NETWORK_CODE]');
    $formattedNamesElement = LabelServiceClient::labelName('[NETWORK_CODE]', '[LABEL]');

    batch_deactivate_labels_sample($formattedParent, $formattedNamesElement);
}

batchUpdateLabels

API to batch update Label objects.

The async variant is LabelServiceClient::batchUpdateLabelsAsync() .

Parameters
Name Description
request Google\Ads\AdManager\V1\BatchUpdateLabelsRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\Ads\AdManager\V1\BatchUpdateLabelsResponse
Example
use Google\Ads\AdManager\V1\BatchUpdateLabelsRequest;
use Google\Ads\AdManager\V1\BatchUpdateLabelsResponse;
use Google\Ads\AdManager\V1\Client\LabelServiceClient;
use Google\Ads\AdManager\V1\Label;
use Google\Ads\AdManager\V1\LabelTypeEnum\LabelType;
use Google\Ads\AdManager\V1\UpdateLabelRequest;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedParent           The parent resource where `Labels` will be updated.
 *                                          Format: `networks/{network_code}`
 *                                          The parent field in the UpdateLabelRequest must match this
 *                                          field. Please see
 *                                          {@see LabelServiceClient::networkName()} for help formatting this field.
 * @param string $requestsLabelDisplayName  Display name of the Label. This attribute has a maximum length of
 *                                          127 characters.
 * @param int    $requestsLabelTypesElement Unordered list. The types of the Label.
 */
function batch_update_labels_sample(
    string $formattedParent,
    string $requestsLabelDisplayName,
    int $requestsLabelTypesElement
): void {
    // Create a client.
    $labelServiceClient = new LabelServiceClient();

    // Prepare the request message.
    $requestsLabelTypes = [$requestsLabelTypesElement,];
    $requestsLabel = (new Label())
        ->setDisplayName($requestsLabelDisplayName)
        ->setTypes($requestsLabelTypes);
    $updateLabelRequest = (new UpdateLabelRequest())
        ->setLabel($requestsLabel);
    $requests = [$updateLabelRequest,];
    $request = (new BatchUpdateLabelsRequest())
        ->setParent($formattedParent)
        ->setRequests($requests);

    // Call the API and handle any network failures.
    try {
        /** @var BatchUpdateLabelsResponse $response */
        $response = $labelServiceClient->batchUpdateLabels($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 = LabelServiceClient::networkName('[NETWORK_CODE]');
    $requestsLabelDisplayName = '[DISPLAY_NAME]';
    $requestsLabelTypesElement = LabelType::LABEL_TYPE_UNSPECIFIED;

    batch_update_labels_sample($formattedParent, $requestsLabelDisplayName, $requestsLabelTypesElement);
}

createLabel

API to create a Label object.

The async variant is LabelServiceClient::createLabelAsync() .

Parameters
Name Description
request Google\Ads\AdManager\V1\CreateLabelRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\Ads\AdManager\V1\Label
Example
use Google\Ads\AdManager\V1\Client\LabelServiceClient;
use Google\Ads\AdManager\V1\CreateLabelRequest;
use Google\Ads\AdManager\V1\Label;
use Google\Ads\AdManager\V1\LabelTypeEnum\LabelType;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedParent   The parent resource where this `Label` will be created.
 *                                  Format: `networks/{network_code}`
 *                                  Please see {@see LabelServiceClient::networkName()} for help formatting this field.
 * @param string $labelDisplayName  Display name of the Label. This attribute has a maximum length of
 *                                  127 characters.
 * @param int    $labelTypesElement Unordered list. The types of the Label.
 */
function create_label_sample(
    string $formattedParent,
    string $labelDisplayName,
    int $labelTypesElement
): void {
    // Create a client.
    $labelServiceClient = new LabelServiceClient();

    // Prepare the request message.
    $labelTypes = [$labelTypesElement,];
    $label = (new Label())
        ->setDisplayName($labelDisplayName)
        ->setTypes($labelTypes);
    $request = (new CreateLabelRequest())
        ->setParent($formattedParent)
        ->setLabel($label);

    // Call the API and handle any network failures.
    try {
        /** @var Label $response */
        $response = $labelServiceClient->createLabel($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 = LabelServiceClient::networkName('[NETWORK_CODE]');
    $labelDisplayName = '[DISPLAY_NAME]';
    $labelTypesElement = LabelType::LABEL_TYPE_UNSPECIFIED;

    create_label_sample($formattedParent, $labelDisplayName, $labelTypesElement);
}

getLabel

API to retrieve a Label object.

The async variant is LabelServiceClient::getLabelAsync() .

Parameters
Name Description
request Google\Ads\AdManager\V1\GetLabelRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\Ads\AdManager\V1\Label
Example
use Google\Ads\AdManager\V1\Client\LabelServiceClient;
use Google\Ads\AdManager\V1\GetLabelRequest;
use Google\Ads\AdManager\V1\Label;
use Google\ApiCore\ApiException;

/**
 * @param string $formattedName The resource name of the Label.
 *                              Format: `networks/{network_code}/labels/{label_id}`
 *                              Please see {@see LabelServiceClient::labelName()} for help formatting this field.
 */
function get_label_sample(string $formattedName): void
{
    // Create a client.
    $labelServiceClient = new LabelServiceClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var Label $response */
        $response = $labelServiceClient->getLabel($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 = LabelServiceClient::labelName('[NETWORK_CODE]', '[LABEL]');

    get_label_sample($formattedName);
}

listLabels

API to retrieve a list of Label objects.

The async variant is LabelServiceClient::listLabelsAsync() .

Parameters
Name Description
request Google\Ads\AdManager\V1\ListLabelsRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\ApiCore\PagedListResponse
Example
use Google\Ads\AdManager\V1\Client\LabelServiceClient;
use Google\Ads\AdManager\V1\ListLabelsRequest;
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;

/**
 * @param string $formattedParent The parent, which owns this collection of Labels.
 *                                Format: `networks/{network_code}`
 *                                Please see {@see LabelServiceClient::networkName()} for help formatting this field.
 */
function list_labels_sample(string $formattedParent): void
{
    // Create a client.
    $labelServiceClient = new LabelServiceClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $labelServiceClient->listLabels($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 = LabelServiceClient::networkName('[NETWORK_CODE]');

    list_labels_sample($formattedParent);
}

updateLabel

API to update a Label object.

The async variant is LabelServiceClient::updateLabelAsync() .

Parameters
Name Description
request Google\Ads\AdManager\V1\UpdateLabelRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
Type Description
Google\Ads\AdManager\V1\Label
Example
use Google\Ads\AdManager\V1\Client\LabelServiceClient;
use Google\Ads\AdManager\V1\Label;
use Google\Ads\AdManager\V1\LabelTypeEnum\LabelType;
use Google\Ads\AdManager\V1\UpdateLabelRequest;
use Google\ApiCore\ApiException;

/**
 * @param string $labelDisplayName  Display name of the Label. This attribute has a maximum length of
 *                                  127 characters.
 * @param int    $labelTypesElement Unordered list. The types of the Label.
 */
function update_label_sample(string $labelDisplayName, int $labelTypesElement): void
{
    // Create a client.
    $labelServiceClient = new LabelServiceClient();

    // Prepare the request message.
    $labelTypes = [$labelTypesElement,];
    $label = (new Label())
        ->setDisplayName($labelDisplayName)
        ->setTypes($labelTypes);
    $request = (new UpdateLabelRequest())
        ->setLabel($label);

    // Call the API and handle any network failures.
    try {
        /** @var Label $response */
        $response = $labelServiceClient->updateLabel($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
{
    $labelDisplayName = '[DISPLAY_NAME]';
    $labelTypesElement = LabelType::LABEL_TYPE_UNSPECIFIED;

    update_label_sample($labelDisplayName, $labelTypesElement);
}

batchActivateLabelsAsync

Parameters
Name Description
request Google\Ads\AdManager\V1\BatchActivateLabelsRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Ads\AdManager\V1\BatchActivateLabelsResponse>

batchCreateLabelsAsync

Parameters
Name Description
request Google\Ads\AdManager\V1\BatchCreateLabelsRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Ads\AdManager\V1\BatchCreateLabelsResponse>

batchDeactivateLabelsAsync

Parameters
Name Description
request Google\Ads\AdManager\V1\BatchDeactivateLabelsRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Ads\AdManager\V1\BatchDeactivateLabelsResponse>

batchUpdateLabelsAsync

Parameters
Name Description
request Google\Ads\AdManager\V1\BatchUpdateLabelsRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Ads\AdManager\V1\BatchUpdateLabelsResponse>

createLabelAsync

Parameters
Name Description
request Google\Ads\AdManager\V1\CreateLabelRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Ads\AdManager\V1\Label>

getLabelAsync

Parameters
Name Description
request Google\Ads\AdManager\V1\GetLabelRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Ads\AdManager\V1\Label>

listLabelsAsync

Parameters
Name Description
request Google\Ads\AdManager\V1\ListLabelsRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse>

updateLabelAsync

Parameters
Name Description
request Google\Ads\AdManager\V1\UpdateLabelRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Ads\AdManager\V1\Label>

static::labelName

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

Parameters
Name Description
networkCode string
label string
Returns
Type Description
string The formatted label 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::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

  • label: networks/{network_code}/labels/{label}
  • network: networks/{network_code}

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.