Google Cloud Video Stitcher V1 Client - Class VideoStitcherServiceClient (1.0.0-RC1)

Reference documentation and code samples for the Google Cloud Video Stitcher V1 Client class VideoStitcherServiceClient.

Service Description: Video-On-Demand content stitching API allows you to insert ads into (VoD) video on demand files. You will be able to render custom scrubber bars with highlighted ads, enforce ad policies, allow seamless playback and tracking on native players and monetize content with any standard VMAP compliant ad server.

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 \ Cloud \ Video \ Stitcher \ V1 \ Client

Methods

__construct

Constructor.

Parameters
Name Description
options array

Optional. Options for configuring the service API wrapper.

↳ apiEndpoint string

The address of the API remote host. May optionally include the port, formatted as "

↳ credentials string|array|FetchAuthTokenInterface|CredentialsWrapper

The credentials to be used by the client to authorize API calls. This option accepts either a path to a credentials file, or a decoded credentials file as a PHP array. Advanced usage: In addition, this option can also accept a pre-constructed Google\Auth\FetchAuthTokenInterface object or Google\ApiCore\CredentialsWrapper object. Note that when one of these objects are provided, any settings in $credentialsConfig will be ignored.

↳ credentialsConfig array

Options used to configure credentials, including auth token caching, for the client. For a full list of supporting configuration options, see Google\ApiCore\CredentialsWrapper::build() .

↳ disableRetries bool

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

↳ clientConfig string|array

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

↳ transport string|TransportInterface

The transport used for executing network requests. May be either the string rest or grpc. Defaults to grpc if gRPC support is detected on the system. Advanced usage: Additionally, it is possible to pass in an already instantiated Google\ApiCore\Transport\TransportInterface object. Note that when this object is provided, any settings in $transportConfig, and any $apiEndpoint setting, will be ignored.

↳ transportConfig array

Configuration options that will be used to construct the transport. Options for each supported transport type should be passed in a key for that transport. For example: $transportConfig = [ 'grpc' => [...], 'rest' => [...], ]; See the Google\ApiCore\Transport\GrpcTransport::build() and Google\ApiCore\Transport\RestTransport::build() methods for the supported options.

↳ clientCertSource callable

A callable which returns the client cert as a string. This can be used to provide a certificate and private key to the transport layer for mTLS.

createCdnKey

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\CreateCdnKeyRequest

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\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Video\Stitcher\V1\CdnKey;
use Google\Cloud\Video\Stitcher\V1\Client\VideoStitcherServiceClient;
use Google\Cloud\Video\Stitcher\V1\CreateCdnKeyRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedParent The project in which the CDN key should be created, in the form
 *                                of `projects/{project_number}/locations/{location}`. Please see
 *                                {@see VideoStitcherServiceClient::locationName()} for help formatting this field.
 * @param string $cdnKeyId        The ID to use for the CDN key, which will become the final
 *                                component of the CDN key's resource name.
 *
 *                                This value should conform to RFC-1034, which restricts to
 *                                lower-case letters, numbers, and hyphen, with the first character a
 *                                letter, the last a letter or a number, and a 63 character maximum.
 */
function create_cdn_key_sample(string $formattedParent, string $cdnKeyId): void
{
    // Create a client.
    $videoStitcherServiceClient = new VideoStitcherServiceClient();

    // Prepare the request message.
    $cdnKey = new CdnKey();
    $request = (new CreateCdnKeyRequest())
        ->setParent($formattedParent)
        ->setCdnKey($cdnKey)
        ->setCdnKeyId($cdnKeyId);

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

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

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

    create_cdn_key_sample($formattedParent, $cdnKeyId);
}

createLiveConfig

Registers the live config with the provided unique ID in the specified region.

The async variant is Google\Cloud\Video\Stitcher\V1\Client\VideoStitcherServiceClient::createLiveConfigAsync() .

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\CreateLiveConfigRequest

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\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Video\Stitcher\V1\AdTracking;
use Google\Cloud\Video\Stitcher\V1\Client\VideoStitcherServiceClient;
use Google\Cloud\Video\Stitcher\V1\CreateLiveConfigRequest;
use Google\Cloud\Video\Stitcher\V1\LiveConfig;
use Google\Rpc\Status;

/**
 * @param string $formattedParent      The project in which the live config should be created, in
 *                                     the form of `projects/{project_number}/locations/{location}`. Please see
 *                                     {@see VideoStitcherServiceClient::locationName()} for help formatting this field.
 * @param string $liveConfigId         The unique identifier ID to use for the live config.
 * @param string $liveConfigSourceUri  Source URI for the live stream manifest.
 * @param int    $liveConfigAdTracking Determines how the ads are tracked.
 */
function create_live_config_sample(
    string $formattedParent,
    string $liveConfigId,
    string $liveConfigSourceUri,
    int $liveConfigAdTracking
): void {
    // Create a client.
    $videoStitcherServiceClient = new VideoStitcherServiceClient();

    // Prepare the request message.
    $liveConfig = (new LiveConfig())
        ->setSourceUri($liveConfigSourceUri)
        ->setAdTracking($liveConfigAdTracking);
    $request = (new CreateLiveConfigRequest())
        ->setParent($formattedParent)
        ->setLiveConfigId($liveConfigId)
        ->setLiveConfig($liveConfig);

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

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

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

    create_live_config_sample(
        $formattedParent,
        $liveConfigId,
        $liveConfigSourceUri,
        $liveConfigAdTracking
    );
}

createLiveSession

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\CreateLiveSessionRequest

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\Cloud\Video\Stitcher\V1\LiveSession
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Video\Stitcher\V1\Client\VideoStitcherServiceClient;
use Google\Cloud\Video\Stitcher\V1\CreateLiveSessionRequest;
use Google\Cloud\Video\Stitcher\V1\LiveSession;

/**
 * @param string $formattedParent                The project and location in which the live session should be
 *                                               created, in the form of `projects/{project_number}/locations/{location}`. Please see
 *                                               {@see VideoStitcherServiceClient::locationName()} for help formatting this field.
 * @param string $formattedLiveSessionLiveConfig The resource name of the live config for this session, in the
 *                                               form of `projects/{project}/locations/{location}/liveConfigs/{id}`. Please see
 *                                               {@see VideoStitcherServiceClient::liveConfigName()} for help formatting this field.
 */
function create_live_session_sample(
    string $formattedParent,
    string $formattedLiveSessionLiveConfig
): void {
    // Create a client.
    $videoStitcherServiceClient = new VideoStitcherServiceClient();

    // Prepare the request message.
    $liveSession = (new LiveSession())
        ->setLiveConfig($formattedLiveSessionLiveConfig);
    $request = (new CreateLiveSessionRequest())
        ->setParent($formattedParent)
        ->setLiveSession($liveSession);

    // Call the API and handle any network failures.
    try {
        /** @var LiveSession $response */
        $response = $videoStitcherServiceClient->createLiveSession($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 = VideoStitcherServiceClient::locationName('[PROJECT]', '[LOCATION]');
    $formattedLiveSessionLiveConfig = VideoStitcherServiceClient::liveConfigName(
        '[PROJECT]',
        '[LOCATION]',
        '[LIVE_CONFIG]'
    );

    create_live_session_sample($formattedParent, $formattedLiveSessionLiveConfig);
}

createSlate

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\CreateSlateRequest

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\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Video\Stitcher\V1\Client\VideoStitcherServiceClient;
use Google\Cloud\Video\Stitcher\V1\CreateSlateRequest;
use Google\Cloud\Video\Stitcher\V1\Slate;
use Google\Rpc\Status;

/**
 * @param string $formattedParent The project in which the slate should be created, in the form of
 *                                `projects/{project_number}/locations/{location}`. Please see
 *                                {@see VideoStitcherServiceClient::locationName()} for help formatting this field.
 * @param string $slateId         The unique identifier for the slate.
 *                                This value should conform to RFC-1034, which restricts to
 *                                lower-case letters, numbers, and hyphen, with the first character a
 *                                letter, the last a letter or a number, and a 63 character maximum.
 */
function create_slate_sample(string $formattedParent, string $slateId): void
{
    // Create a client.
    $videoStitcherServiceClient = new VideoStitcherServiceClient();

    // Prepare the request message.
    $slate = new Slate();
    $request = (new CreateSlateRequest())
        ->setParent($formattedParent)
        ->setSlateId($slateId)
        ->setSlate($slate);

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

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

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

    create_slate_sample($formattedParent, $slateId);
}

createVodConfig

Registers the VOD config with the provided unique ID in the specified region.

The async variant is Google\Cloud\Video\Stitcher\V1\Client\VideoStitcherServiceClient::createVodConfigAsync() .

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\CreateVodConfigRequest

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\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Video\Stitcher\V1\Client\VideoStitcherServiceClient;
use Google\Cloud\Video\Stitcher\V1\CreateVodConfigRequest;
use Google\Cloud\Video\Stitcher\V1\VodConfig;
use Google\Rpc\Status;

/**
 * @param string $formattedParent    The project in which the VOD config should be created, in
 *                                   the form of `projects/{project_number}/locations/{location}`. Please see
 *                                   {@see VideoStitcherServiceClient::locationName()} for help formatting this field.
 * @param string $vodConfigId        The unique identifier ID to use for the VOD config.
 * @param string $vodConfigSourceUri Source URI for the VOD stream manifest.
 * @param string $vodConfigAdTagUri  The default ad tag associated with this VOD config.
 */
function create_vod_config_sample(
    string $formattedParent,
    string $vodConfigId,
    string $vodConfigSourceUri,
    string $vodConfigAdTagUri
): void {
    // Create a client.
    $videoStitcherServiceClient = new VideoStitcherServiceClient();

    // Prepare the request message.
    $vodConfig = (new VodConfig())
        ->setSourceUri($vodConfigSourceUri)
        ->setAdTagUri($vodConfigAdTagUri);
    $request = (new CreateVodConfigRequest())
        ->setParent($formattedParent)
        ->setVodConfigId($vodConfigId)
        ->setVodConfig($vodConfig);

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

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

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

    create_vod_config_sample($formattedParent, $vodConfigId, $vodConfigSourceUri, $vodConfigAdTagUri);
}

createVodSession

Creates a client side playback VOD session and returns the full tracking and playback metadata of the session.

The async variant is Google\Cloud\Video\Stitcher\V1\Client\VideoStitcherServiceClient::createVodSessionAsync() .

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\CreateVodSessionRequest

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\Cloud\Video\Stitcher\V1\VodSession
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Video\Stitcher\V1\AdTracking;
use Google\Cloud\Video\Stitcher\V1\Client\VideoStitcherServiceClient;
use Google\Cloud\Video\Stitcher\V1\CreateVodSessionRequest;
use Google\Cloud\Video\Stitcher\V1\VodSession;

/**
 * @param string $formattedParent      The project and location in which the VOD session should be
 *                                     created, in the form of `projects/{project_number}/locations/{location}`. Please see
 *                                     {@see VideoStitcherServiceClient::locationName()} for help formatting this field.
 * @param int    $vodSessionAdTracking Determines how the ad should be tracked.
 */
function create_vod_session_sample(string $formattedParent, int $vodSessionAdTracking): void
{
    // Create a client.
    $videoStitcherServiceClient = new VideoStitcherServiceClient();

    // Prepare the request message.
    $vodSession = (new VodSession())
        ->setAdTracking($vodSessionAdTracking);
    $request = (new CreateVodSessionRequest())
        ->setParent($formattedParent)
        ->setVodSession($vodSession);

    // Call the API and handle any network failures.
    try {
        /** @var VodSession $response */
        $response = $videoStitcherServiceClient->createVodSession($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 = VideoStitcherServiceClient::locationName('[PROJECT]', '[LOCATION]');
    $vodSessionAdTracking = AdTracking::AD_TRACKING_UNSPECIFIED;

    create_vod_session_sample($formattedParent, $vodSessionAdTracking);
}

deleteCdnKey

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\DeleteCdnKeyRequest

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\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Video\Stitcher\V1\Client\VideoStitcherServiceClient;
use Google\Cloud\Video\Stitcher\V1\DeleteCdnKeyRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedName The name of the CDN key to be deleted, in the form of
 *                              `projects/{project_number}/locations/{location}/cdnKeys/{id}`. Please see
 *                              {@see VideoStitcherServiceClient::cdnKeyName()} for help formatting this field.
 */
function delete_cdn_key_sample(string $formattedName): void
{
    // Create a client.
    $videoStitcherServiceClient = new VideoStitcherServiceClient();

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

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

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

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

    delete_cdn_key_sample($formattedName);
}

deleteLiveConfig

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\DeleteLiveConfigRequest

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\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Video\Stitcher\V1\Client\VideoStitcherServiceClient;
use Google\Cloud\Video\Stitcher\V1\DeleteLiveConfigRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedName The name of the live config to be deleted, in the form of
 *                              `projects/{project_number}/locations/{location}/liveConfigs/{id}`. Please see
 *                              {@see VideoStitcherServiceClient::liveConfigName()} for help formatting this field.
 */
function delete_live_config_sample(string $formattedName): void
{
    // Create a client.
    $videoStitcherServiceClient = new VideoStitcherServiceClient();

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

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

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

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

    delete_live_config_sample($formattedName);
}

deleteSlate

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\DeleteSlateRequest

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\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Video\Stitcher\V1\Client\VideoStitcherServiceClient;
use Google\Cloud\Video\Stitcher\V1\DeleteSlateRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedName The name of the slate to be deleted, in the form of
 *                              `projects/{project_number}/locations/{location}/slates/{id}`. Please see
 *                              {@see VideoStitcherServiceClient::slateName()} for help formatting this field.
 */
function delete_slate_sample(string $formattedName): void
{
    // Create a client.
    $videoStitcherServiceClient = new VideoStitcherServiceClient();

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

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

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

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

    delete_slate_sample($formattedName);
}

deleteVodConfig

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\DeleteVodConfigRequest

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\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Video\Stitcher\V1\Client\VideoStitcherServiceClient;
use Google\Cloud\Video\Stitcher\V1\DeleteVodConfigRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedName The name of the VOD config to be deleted, in the form of
 *                              `projects/{project_number}/locations/{location}/vodConfigs/{id}`. Please see
 *                              {@see VideoStitcherServiceClient::vodConfigName()} for help formatting this field.
 */
function delete_vod_config_sample(string $formattedName): void
{
    // Create a client.
    $videoStitcherServiceClient = new VideoStitcherServiceClient();

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

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

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

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

    delete_vod_config_sample($formattedName);
}

getCdnKey

Returns the specified CDN key.

The async variant is Google\Cloud\Video\Stitcher\V1\Client\VideoStitcherServiceClient::getCdnKeyAsync() .

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\GetCdnKeyRequest

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\Cloud\Video\Stitcher\V1\CdnKey
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Video\Stitcher\V1\CdnKey;
use Google\Cloud\Video\Stitcher\V1\Client\VideoStitcherServiceClient;
use Google\Cloud\Video\Stitcher\V1\GetCdnKeyRequest;

/**
 * @param string $formattedName The name of the CDN key to be retrieved, in the form of
 *                              `projects/{project}/locations/{location}/cdnKeys/{id}`. Please see
 *                              {@see VideoStitcherServiceClient::cdnKeyName()} for help formatting this field.
 */
function get_cdn_key_sample(string $formattedName): void
{
    // Create a client.
    $videoStitcherServiceClient = new VideoStitcherServiceClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var CdnKey $response */
        $response = $videoStitcherServiceClient->getCdnKey($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 = VideoStitcherServiceClient::cdnKeyName('[PROJECT]', '[LOCATION]', '[CDN_KEY]');

    get_cdn_key_sample($formattedName);
}

getLiveAdTagDetail

Returns the specified ad tag detail for the specified live session.

The async variant is Google\Cloud\Video\Stitcher\V1\Client\VideoStitcherServiceClient::getLiveAdTagDetailAsync() .

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\GetLiveAdTagDetailRequest

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\Cloud\Video\Stitcher\V1\LiveAdTagDetail
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Video\Stitcher\V1\Client\VideoStitcherServiceClient;
use Google\Cloud\Video\Stitcher\V1\GetLiveAdTagDetailRequest;
use Google\Cloud\Video\Stitcher\V1\LiveAdTagDetail;

/**
 * @param string $formattedName The resource name in the form of
 *                              `projects/{project}/locations/{location}/liveSessions/{live_session}/liveAdTagDetails/{live_ad_tag_detail}`. Please see
 *                              {@see VideoStitcherServiceClient::liveAdTagDetailName()} for help formatting this field.
 */
function get_live_ad_tag_detail_sample(string $formattedName): void
{
    // Create a client.
    $videoStitcherServiceClient = new VideoStitcherServiceClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var LiveAdTagDetail $response */
        $response = $videoStitcherServiceClient->getLiveAdTagDetail($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 = VideoStitcherServiceClient::liveAdTagDetailName(
        '[PROJECT]',
        '[LOCATION]',
        '[LIVE_SESSION]',
        '[LIVE_AD_TAG_DETAIL]'
    );

    get_live_ad_tag_detail_sample($formattedName);
}

getLiveConfig

Returns the specified live config managed by the Video Stitcher service.

The async variant is Google\Cloud\Video\Stitcher\V1\Client\VideoStitcherServiceClient::getLiveConfigAsync() .

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\GetLiveConfigRequest

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\Cloud\Video\Stitcher\V1\LiveConfig
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Video\Stitcher\V1\Client\VideoStitcherServiceClient;
use Google\Cloud\Video\Stitcher\V1\GetLiveConfigRequest;
use Google\Cloud\Video\Stitcher\V1\LiveConfig;

/**
 * @param string $formattedName The name of the live config to be retrieved, in the form
 *                              of
 *                              `projects/{project_number}/locations/{location}/liveConfigs/{id}`. Please see
 *                              {@see VideoStitcherServiceClient::liveConfigName()} for help formatting this field.
 */
function get_live_config_sample(string $formattedName): void
{
    // Create a client.
    $videoStitcherServiceClient = new VideoStitcherServiceClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var LiveConfig $response */
        $response = $videoStitcherServiceClient->getLiveConfig($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 = VideoStitcherServiceClient::liveConfigName(
        '[PROJECT]',
        '[LOCATION]',
        '[LIVE_CONFIG]'
    );

    get_live_config_sample($formattedName);
}

getLiveSession

Returns the details for the specified live session.

The async variant is Google\Cloud\Video\Stitcher\V1\Client\VideoStitcherServiceClient::getLiveSessionAsync() .

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\GetLiveSessionRequest

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\Cloud\Video\Stitcher\V1\LiveSession
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Video\Stitcher\V1\Client\VideoStitcherServiceClient;
use Google\Cloud\Video\Stitcher\V1\GetLiveSessionRequest;
use Google\Cloud\Video\Stitcher\V1\LiveSession;

/**
 * @param string $formattedName The name of the live session, in the form of
 *                              `projects/{project_number}/locations/{location}/liveSessions/{id}`. Please see
 *                              {@see VideoStitcherServiceClient::liveSessionName()} for help formatting this field.
 */
function get_live_session_sample(string $formattedName): void
{
    // Create a client.
    $videoStitcherServiceClient = new VideoStitcherServiceClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var LiveSession $response */
        $response = $videoStitcherServiceClient->getLiveSession($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 = VideoStitcherServiceClient::liveSessionName(
        '[PROJECT]',
        '[LOCATION]',
        '[LIVE_SESSION]'
    );

    get_live_session_sample($formattedName);
}

getSlate

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\GetSlateRequest

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\Cloud\Video\Stitcher\V1\Slate
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Video\Stitcher\V1\Client\VideoStitcherServiceClient;
use Google\Cloud\Video\Stitcher\V1\GetSlateRequest;
use Google\Cloud\Video\Stitcher\V1\Slate;

/**
 * @param string $formattedName The name of the slate to be retrieved, of the slate, in the form
 *                              of `projects/{project_number}/locations/{location}/slates/{id}`. Please see
 *                              {@see VideoStitcherServiceClient::slateName()} for help formatting this field.
 */
function get_slate_sample(string $formattedName): void
{
    // Create a client.
    $videoStitcherServiceClient = new VideoStitcherServiceClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var Slate $response */
        $response = $videoStitcherServiceClient->getSlate($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 = VideoStitcherServiceClient::slateName('[PROJECT]', '[LOCATION]', '[SLATE]');

    get_slate_sample($formattedName);
}

getVodAdTagDetail

Returns the specified ad tag detail for the specified VOD session.

The async variant is Google\Cloud\Video\Stitcher\V1\Client\VideoStitcherServiceClient::getVodAdTagDetailAsync() .

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\GetVodAdTagDetailRequest

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\Cloud\Video\Stitcher\V1\VodAdTagDetail
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Video\Stitcher\V1\Client\VideoStitcherServiceClient;
use Google\Cloud\Video\Stitcher\V1\GetVodAdTagDetailRequest;
use Google\Cloud\Video\Stitcher\V1\VodAdTagDetail;

/**
 * @param string $formattedName The name of the ad tag detail for the specified VOD session, in
 *                              the form of
 *                              `projects/{project}/locations/{location}/vodSessions/{vod_session_id}/vodAdTagDetails/{vod_ad_tag_detail}`. Please see
 *                              {@see VideoStitcherServiceClient::vodAdTagDetailName()} for help formatting this field.
 */
function get_vod_ad_tag_detail_sample(string $formattedName): void
{
    // Create a client.
    $videoStitcherServiceClient = new VideoStitcherServiceClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var VodAdTagDetail $response */
        $response = $videoStitcherServiceClient->getVodAdTagDetail($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 = VideoStitcherServiceClient::vodAdTagDetailName(
        '[PROJECT]',
        '[LOCATION]',
        '[VOD_SESSION]',
        '[VOD_AD_TAG_DETAIL]'
    );

    get_vod_ad_tag_detail_sample($formattedName);
}

getVodConfig

Returns the specified VOD config managed by the Video Stitcher API service.

The async variant is Google\Cloud\Video\Stitcher\V1\Client\VideoStitcherServiceClient::getVodConfigAsync() .

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\GetVodConfigRequest

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\Cloud\Video\Stitcher\V1\VodConfig
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Video\Stitcher\V1\Client\VideoStitcherServiceClient;
use Google\Cloud\Video\Stitcher\V1\GetVodConfigRequest;
use Google\Cloud\Video\Stitcher\V1\VodConfig;

/**
 * @param string $formattedName The name of the VOD config to be retrieved, in the form
 *                              of `projects/{project_number}/locations/{location}/vodConfigs/{id}`. Please see
 *                              {@see VideoStitcherServiceClient::vodConfigName()} for help formatting this field.
 */
function get_vod_config_sample(string $formattedName): void
{
    // Create a client.
    $videoStitcherServiceClient = new VideoStitcherServiceClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var VodConfig $response */
        $response = $videoStitcherServiceClient->getVodConfig($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 = VideoStitcherServiceClient::vodConfigName(
        '[PROJECT]',
        '[LOCATION]',
        '[VOD_CONFIG]'
    );

    get_vod_config_sample($formattedName);
}

getVodSession

Returns the full tracking, playback metadata, and relevant ad-ops logs for the specified VOD session.

The async variant is Google\Cloud\Video\Stitcher\V1\Client\VideoStitcherServiceClient::getVodSessionAsync() .

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\GetVodSessionRequest

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\Cloud\Video\Stitcher\V1\VodSession
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Video\Stitcher\V1\Client\VideoStitcherServiceClient;
use Google\Cloud\Video\Stitcher\V1\GetVodSessionRequest;
use Google\Cloud\Video\Stitcher\V1\VodSession;

/**
 * @param string $formattedName The name of the VOD session to be retrieved, in the form of
 *                              `projects/{project_number}/locations/{location}/vodSessions/{id}`. Please see
 *                              {@see VideoStitcherServiceClient::vodSessionName()} for help formatting this field.
 */
function get_vod_session_sample(string $formattedName): void
{
    // Create a client.
    $videoStitcherServiceClient = new VideoStitcherServiceClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var VodSession $response */
        $response = $videoStitcherServiceClient->getVodSession($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 = VideoStitcherServiceClient::vodSessionName(
        '[PROJECT]',
        '[LOCATION]',
        '[VOD_SESSION]'
    );

    get_vod_session_sample($formattedName);
}

getVodStitchDetail

Returns the specified stitching information for the specified VOD session.

The async variant is Google\Cloud\Video\Stitcher\V1\Client\VideoStitcherServiceClient::getVodStitchDetailAsync() .

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\GetVodStitchDetailRequest

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\Cloud\Video\Stitcher\V1\VodStitchDetail
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Video\Stitcher\V1\Client\VideoStitcherServiceClient;
use Google\Cloud\Video\Stitcher\V1\GetVodStitchDetailRequest;
use Google\Cloud\Video\Stitcher\V1\VodStitchDetail;

/**
 * @param string $formattedName The name of the stitch detail in the specified VOD session, in
 *                              the form of
 *                              `projects/{project}/locations/{location}/vodSessions/{vod_session_id}/vodStitchDetails/{id}`. Please see
 *                              {@see VideoStitcherServiceClient::vodStitchDetailName()} for help formatting this field.
 */
function get_vod_stitch_detail_sample(string $formattedName): void
{
    // Create a client.
    $videoStitcherServiceClient = new VideoStitcherServiceClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var VodStitchDetail $response */
        $response = $videoStitcherServiceClient->getVodStitchDetail($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 = VideoStitcherServiceClient::vodStitchDetailName(
        '[PROJECT]',
        '[LOCATION]',
        '[VOD_SESSION]',
        '[VOD_STITCH_DETAIL]'
    );

    get_vod_stitch_detail_sample($formattedName);
}

listCdnKeys

Lists all CDN keys in the specified project and location.

The async variant is Google\Cloud\Video\Stitcher\V1\Client\VideoStitcherServiceClient::listCdnKeysAsync() .

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\ListCdnKeysRequest

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\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Video\Stitcher\V1\CdnKey;
use Google\Cloud\Video\Stitcher\V1\Client\VideoStitcherServiceClient;
use Google\Cloud\Video\Stitcher\V1\ListCdnKeysRequest;

/**
 * @param string $formattedParent The project that contains the list of CDN keys, in the form of
 *                                `projects/{project_number}/locations/{location}`. Please see
 *                                {@see VideoStitcherServiceClient::locationName()} for help formatting this field.
 */
function list_cdn_keys_sample(string $formattedParent): void
{
    // Create a client.
    $videoStitcherServiceClient = new VideoStitcherServiceClient();

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

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

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

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

    list_cdn_keys_sample($formattedParent);
}

listLiveAdTagDetails

Return the list of ad tag details for the specified live session.

The async variant is Google\Cloud\Video\Stitcher\V1\Client\VideoStitcherServiceClient::listLiveAdTagDetailsAsync() .

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\ListLiveAdTagDetailsRequest

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\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Video\Stitcher\V1\Client\VideoStitcherServiceClient;
use Google\Cloud\Video\Stitcher\V1\ListLiveAdTagDetailsRequest;
use Google\Cloud\Video\Stitcher\V1\LiveAdTagDetail;

/**
 * @param string $formattedParent The resource parent in the form of
 *                                `projects/{project}/locations/{location}/liveSessions/{live_session}`. Please see
 *                                {@see VideoStitcherServiceClient::liveSessionName()} for help formatting this field.
 */
function list_live_ad_tag_details_sample(string $formattedParent): void
{
    // Create a client.
    $videoStitcherServiceClient = new VideoStitcherServiceClient();

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

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

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

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

    list_live_ad_tag_details_sample($formattedParent);
}

listLiveConfigs

Lists all live configs managed by the Video Stitcher that belong to the specified project and region.

The async variant is Google\Cloud\Video\Stitcher\V1\Client\VideoStitcherServiceClient::listLiveConfigsAsync() .

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\ListLiveConfigsRequest

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\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Video\Stitcher\V1\Client\VideoStitcherServiceClient;
use Google\Cloud\Video\Stitcher\V1\ListLiveConfigsRequest;
use Google\Cloud\Video\Stitcher\V1\LiveConfig;

/**
 * @param string $formattedParent The project that contains the list of live configs, in the
 *                                form of `projects/{project_number}/locations/{location}`. Please see
 *                                {@see VideoStitcherServiceClient::locationName()} for help formatting this field.
 */
function list_live_configs_sample(string $formattedParent): void
{
    // Create a client.
    $videoStitcherServiceClient = new VideoStitcherServiceClient();

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

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

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

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

    list_live_configs_sample($formattedParent);
}

listSlates

Lists all slates in the specified project and location.

The async variant is Google\Cloud\Video\Stitcher\V1\Client\VideoStitcherServiceClient::listSlatesAsync() .

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\ListSlatesRequest

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\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Video\Stitcher\V1\Client\VideoStitcherServiceClient;
use Google\Cloud\Video\Stitcher\V1\ListSlatesRequest;
use Google\Cloud\Video\Stitcher\V1\Slate;

/**
 * @param string $formattedParent The project to list slates, in the form of
 *                                `projects/{project_number}/locations/{location}`. Please see
 *                                {@see VideoStitcherServiceClient::locationName()} for help formatting this field.
 */
function list_slates_sample(string $formattedParent): void
{
    // Create a client.
    $videoStitcherServiceClient = new VideoStitcherServiceClient();

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

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

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

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

    list_slates_sample($formattedParent);
}

listVodAdTagDetails

Return the list of ad tag details for the specified VOD session.

The async variant is Google\Cloud\Video\Stitcher\V1\Client\VideoStitcherServiceClient::listVodAdTagDetailsAsync() .

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\ListVodAdTagDetailsRequest

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\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Video\Stitcher\V1\Client\VideoStitcherServiceClient;
use Google\Cloud\Video\Stitcher\V1\ListVodAdTagDetailsRequest;
use Google\Cloud\Video\Stitcher\V1\VodAdTagDetail;

/**
 * @param string $formattedParent The VOD session which the ad tag details belong to, in the form
 *                                of `projects/{project}/locations/{location}/vodSessions/{vod_session_id}`. Please see
 *                                {@see VideoStitcherServiceClient::vodSessionName()} for help formatting this field.
 */
function list_vod_ad_tag_details_sample(string $formattedParent): void
{
    // Create a client.
    $videoStitcherServiceClient = new VideoStitcherServiceClient();

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

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

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

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

    list_vod_ad_tag_details_sample($formattedParent);
}

listVodConfigs

Lists all VOD configs managed by the Video Stitcher API that belong to the specified project and region.

The async variant is Google\Cloud\Video\Stitcher\V1\Client\VideoStitcherServiceClient::listVodConfigsAsync() .

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\ListVodConfigsRequest

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\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Video\Stitcher\V1\Client\VideoStitcherServiceClient;
use Google\Cloud\Video\Stitcher\V1\ListVodConfigsRequest;
use Google\Cloud\Video\Stitcher\V1\VodConfig;

/**
 * @param string $formattedParent The project that contains the list of VOD configs, in the
 *                                form of `projects/{project_number}/locations/{location}`. Please see
 *                                {@see VideoStitcherServiceClient::locationName()} for help formatting this field.
 */
function list_vod_configs_sample(string $formattedParent): void
{
    // Create a client.
    $videoStitcherServiceClient = new VideoStitcherServiceClient();

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

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

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

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

    list_vod_configs_sample($formattedParent);
}

listVodStitchDetails

Returns a list of detailed stitching information of the specified VOD session.

The async variant is Google\Cloud\Video\Stitcher\V1\Client\VideoStitcherServiceClient::listVodStitchDetailsAsync() .

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\ListVodStitchDetailsRequest

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\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Video\Stitcher\V1\Client\VideoStitcherServiceClient;
use Google\Cloud\Video\Stitcher\V1\ListVodStitchDetailsRequest;
use Google\Cloud\Video\Stitcher\V1\VodStitchDetail;

/**
 * @param string $formattedParent The VOD session where the stitch details belong to, in the form
 *                                of `projects/{project}/locations/{location}/vodSessions/{id}`. Please see
 *                                {@see VideoStitcherServiceClient::vodSessionName()} for help formatting this field.
 */
function list_vod_stitch_details_sample(string $formattedParent): void
{
    // Create a client.
    $videoStitcherServiceClient = new VideoStitcherServiceClient();

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

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

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

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

    list_vod_stitch_details_sample($formattedParent);
}

updateCdnKey

Updates the specified CDN key. Only update fields specified in the call method body.

The async variant is Google\Cloud\Video\Stitcher\V1\Client\VideoStitcherServiceClient::updateCdnKeyAsync() .

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\UpdateCdnKeyRequest

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\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Video\Stitcher\V1\CdnKey;
use Google\Cloud\Video\Stitcher\V1\Client\VideoStitcherServiceClient;
use Google\Cloud\Video\Stitcher\V1\UpdateCdnKeyRequest;
use Google\Protobuf\FieldMask;
use Google\Rpc\Status;

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

    // Prepare the request message.
    $cdnKey = new CdnKey();
    $updateMask = new FieldMask();
    $request = (new UpdateCdnKeyRequest())
        ->setCdnKey($cdnKey)
        ->setUpdateMask($updateMask);

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

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

updateLiveConfig

Updates the specified LiveConfig. Only update fields specified in the call method body.

The async variant is Google\Cloud\Video\Stitcher\V1\Client\VideoStitcherServiceClient::updateLiveConfigAsync() .

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\UpdateLiveConfigRequest

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\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Video\Stitcher\V1\AdTracking;
use Google\Cloud\Video\Stitcher\V1\Client\VideoStitcherServiceClient;
use Google\Cloud\Video\Stitcher\V1\LiveConfig;
use Google\Cloud\Video\Stitcher\V1\UpdateLiveConfigRequest;
use Google\Protobuf\FieldMask;
use Google\Rpc\Status;

/**
 * @param string $liveConfigSourceUri  Source URI for the live stream manifest.
 * @param int    $liveConfigAdTracking Determines how the ads are tracked.
 */
function update_live_config_sample(string $liveConfigSourceUri, int $liveConfigAdTracking): void
{
    // Create a client.
    $videoStitcherServiceClient = new VideoStitcherServiceClient();

    // Prepare the request message.
    $liveConfig = (new LiveConfig())
        ->setSourceUri($liveConfigSourceUri)
        ->setAdTracking($liveConfigAdTracking);
    $updateMask = new FieldMask();
    $request = (new UpdateLiveConfigRequest())
        ->setLiveConfig($liveConfig)
        ->setUpdateMask($updateMask);

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

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

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

    update_live_config_sample($liveConfigSourceUri, $liveConfigAdTracking);
}

updateSlate

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\UpdateSlateRequest

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\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Video\Stitcher\V1\Client\VideoStitcherServiceClient;
use Google\Cloud\Video\Stitcher\V1\Slate;
use Google\Cloud\Video\Stitcher\V1\UpdateSlateRequest;
use Google\Protobuf\FieldMask;
use Google\Rpc\Status;

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

    // Prepare the request message.
    $slate = new Slate();
    $updateMask = new FieldMask();
    $request = (new UpdateSlateRequest())
        ->setSlate($slate)
        ->setUpdateMask($updateMask);

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

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

updateVodConfig

Updates the specified VOD config. Only update fields specified in the call method body.

The async variant is Google\Cloud\Video\Stitcher\V1\Client\VideoStitcherServiceClient::updateVodConfigAsync() .

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\UpdateVodConfigRequest

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\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Video\Stitcher\V1\Client\VideoStitcherServiceClient;
use Google\Cloud\Video\Stitcher\V1\UpdateVodConfigRequest;
use Google\Cloud\Video\Stitcher\V1\VodConfig;
use Google\Protobuf\FieldMask;
use Google\Rpc\Status;

/**
 * @param string $vodConfigSourceUri Source URI for the VOD stream manifest.
 * @param string $vodConfigAdTagUri  The default ad tag associated with this VOD config.
 */
function update_vod_config_sample(string $vodConfigSourceUri, string $vodConfigAdTagUri): void
{
    // Create a client.
    $videoStitcherServiceClient = new VideoStitcherServiceClient();

    // Prepare the request message.
    $vodConfig = (new VodConfig())
        ->setSourceUri($vodConfigSourceUri)
        ->setAdTagUri($vodConfigAdTagUri);
    $updateMask = new FieldMask();
    $request = (new UpdateVodConfigRequest())
        ->setVodConfig($vodConfig)
        ->setUpdateMask($updateMask);

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

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

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

    update_vod_config_sample($vodConfigSourceUri, $vodConfigAdTagUri);
}

createCdnKeyAsync

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\CreateCdnKeyRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

createLiveConfigAsync

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\CreateLiveConfigRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

createLiveSessionAsync

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\CreateLiveSessionRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

createSlateAsync

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\CreateSlateRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

createVodConfigAsync

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\CreateVodConfigRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

createVodSessionAsync

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\CreateVodSessionRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

deleteCdnKeyAsync

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\DeleteCdnKeyRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

deleteLiveConfigAsync

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\DeleteLiveConfigRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

deleteSlateAsync

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\DeleteSlateRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

deleteVodConfigAsync

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\DeleteVodConfigRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

getCdnKeyAsync

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\GetCdnKeyRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

getLiveAdTagDetailAsync

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\GetLiveAdTagDetailRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

getLiveConfigAsync

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\GetLiveConfigRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

getLiveSessionAsync

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\GetLiveSessionRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

getSlateAsync

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\GetSlateRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

getVodAdTagDetailAsync

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\GetVodAdTagDetailRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

getVodConfigAsync

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\GetVodConfigRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

getVodSessionAsync

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\GetVodSessionRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

getVodStitchDetailAsync

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\GetVodStitchDetailRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listCdnKeysAsync

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\ListCdnKeysRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listLiveAdTagDetailsAsync

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\ListLiveAdTagDetailsRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listLiveConfigsAsync

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\ListLiveConfigsRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listSlatesAsync

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\ListSlatesRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listVodAdTagDetailsAsync

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\ListVodAdTagDetailsRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listVodConfigsAsync

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\ListVodConfigsRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listVodStitchDetailsAsync

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\ListVodStitchDetailsRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

updateCdnKeyAsync

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\UpdateCdnKeyRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

updateLiveConfigAsync

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\UpdateLiveConfigRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

updateSlateAsync

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\UpdateSlateRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

updateVodConfigAsync

Parameters
Name Description
request Google\Cloud\Video\Stitcher\V1\UpdateVodConfigRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

getOperationsClient

Return an OperationsClient object with the same endpoint as $this.

Returns
Type Description
Google\LongRunning\Client\OperationsClient

resumeOperation

Resume an existing long running operation that was previously started by a long running API method. If $methodName is not provided, or does not match a long running API method, then the operation can still be resumed, but the OperationResponse object will not deserialize the final response.

Parameters
Name Description
operationName string

The name of the long running operation

methodName string

The name of the method used to start the operation

Returns
Type Description
Google\ApiCore\OperationResponse

static::cdnKeyName

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

Parameters
Name Description
project string
location string
cdnKey string
Returns
Type Description
string The formatted cdn_key resource.

static::liveAdTagDetailName

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

Parameters
Name Description
project string
location string
liveSession string
liveAdTagDetail string
Returns
Type Description
string The formatted live_ad_tag_detail resource.

static::liveConfigName

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

Parameters
Name Description
project string
location string
liveConfig string
Returns
Type Description
string The formatted live_config resource.

static::liveSessionName

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

Parameters
Name Description
project string
location string
liveSession string
Returns
Type Description
string The formatted live_session resource.

static::locationName

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

Parameters
Name Description
project string
location string
Returns
Type Description
string The formatted location resource.

static::slateName

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

Parameters
Name Description
project string
location string
slate string
Returns
Type Description
string The formatted slate resource.

static::vodAdTagDetailName

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

Parameters
Name Description
project string
location string
vodSession string
vodAdTagDetail string
Returns
Type Description
string The formatted vod_ad_tag_detail resource.

static::vodConfigName

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

Parameters
Name Description
project string
location string
vodConfig string
Returns
Type Description
string The formatted vod_config resource.

static::vodSessionName

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

Parameters
Name Description
project string
location string
vodSession string
Returns
Type Description
string The formatted vod_session resource.

static::vodStitchDetailName

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

Parameters
Name Description
project string
location string
vodSession string
vodStitchDetail string
Returns
Type Description
string The formatted vod_stitch_detail 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

  • cdnKey: projects/{project}/locations/{location}/cdnKeys/{cdn_key}
  • liveAdTagDetail: projects/{project}/locations/{location}/liveSessions/{live_session}/liveAdTagDetails/{live_ad_tag_detail}
  • liveConfig: projects/{project}/locations/{location}/liveConfigs/{live_config}
  • liveSession: projects/{project}/locations/{location}/liveSessions/{live_session}
  • location: projects/{project}/locations/{location}
  • slate: projects/{project}/locations/{location}/slates/{slate}
  • vodAdTagDetail: projects/{project}/locations/{location}/vodSessions/{vod_session}/vodAdTagDetails/{vod_ad_tag_detail}
  • vodConfig: projects/{project}/locations/{location}/vodConfigs/{vod_config}
  • vodSession: projects/{project}/locations/{location}/vodSessions/{vod_session}
  • vodStitchDetail: projects/{project}/locations/{location}/vodSessions/{vod_session}/vodStitchDetails/{vod_stitch_detail}

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.