Google Cloud Video Live Stream V1 Client - Class LivestreamServiceClient (0.6.2)

Reference documentation and code samples for the Google Cloud Video Live Stream V1 Client class LivestreamServiceClient.

Service Description: Using Live Stream API, you can generate live streams in the various renditions and streaming formats. The streaming format include HTTP Live Streaming (HLS) and Dynamic Adaptive Streaming over HTTP (DASH). You can send a source stream in the various ways, including Real-Time Messaging Protocol (RTMP) and Secure Reliable Transport (SRT).

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.

This class is currently experimental and may be subject to changes. See Google\Cloud\Video\LiveStream\V1\LivestreamServiceClient for the stable implementation

Namespace

Google \ Cloud \ Video \ LiveStream \ V1 \ Client

Methods

__construct

Constructor.

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

createAsset

Creates a Asset with the provided unique ID in the specified region.

The async variant is Google\Cloud\Video\LiveStream\V1\Client\LivestreamServiceClient::createAssetAsync() .

Parameters
NameDescription
request Google\Cloud\Video\LiveStream\V1\CreateAssetRequest

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
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Video\LiveStream\V1\Asset;
use Google\Cloud\Video\LiveStream\V1\Client\LivestreamServiceClient;
use Google\Cloud\Video\LiveStream\V1\CreateAssetRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedParent The parent location for the resource, in the form of:
 *                                `projects/{project}/locations/{location}`. Please see
 *                                {@see LivestreamServiceClient::locationName()} for help formatting this field.
 * @param string $assetId         The ID of the asset resource to be created.
 *                                This value must be 1-63 characters, begin and end with `[a-z0-9]`,
 *                                could contain dashes (-) in between.
 */
function create_asset_sample(string $formattedParent, string $assetId): void
{
    // Create a client.
    $livestreamServiceClient = new LivestreamServiceClient();

    // Prepare the request message.
    $asset = new Asset();
    $request = (new CreateAssetRequest())
        ->setParent($formattedParent)
        ->setAsset($asset)
        ->setAssetId($assetId);

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

        if ($response->operationSucceeded()) {
            /** @var Asset $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 = LivestreamServiceClient::locationName('[PROJECT]', '[LOCATION]');
    $assetId = '[ASSET_ID]';

    create_asset_sample($formattedParent, $assetId);
}

createChannel

Creates a channel with the provided unique ID in the specified region.

The async variant is Google\Cloud\Video\LiveStream\V1\Client\LivestreamServiceClient::createChannelAsync() .

Parameters
NameDescription
request Google\Cloud\Video\LiveStream\V1\CreateChannelRequest

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
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Video\LiveStream\V1\Channel;
use Google\Cloud\Video\LiveStream\V1\Channel\Output;
use Google\Cloud\Video\LiveStream\V1\Client\LivestreamServiceClient;
use Google\Cloud\Video\LiveStream\V1\CreateChannelRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedParent The parent location for the resource, in the form of:
 *                                `projects/{project}/locations/{location}`. Please see
 *                                {@see LivestreamServiceClient::locationName()} for help formatting this field.
 * @param string $channelId       The ID of the channel resource to be created.
 *                                This value must be 1-63 characters, begin and end with `[a-z0-9]`,
 *                                could contain dashes (-) in between.
 */
function create_channel_sample(string $formattedParent, string $channelId): void
{
    // Create a client.
    $livestreamServiceClient = new LivestreamServiceClient();

    // Prepare the request message.
    $channelOutput = new Output();
    $channel = (new Channel())
        ->setOutput($channelOutput);
    $request = (new CreateChannelRequest())
        ->setParent($formattedParent)
        ->setChannel($channel)
        ->setChannelId($channelId);

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

        if ($response->operationSucceeded()) {
            /** @var Channel $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 = LivestreamServiceClient::locationName('[PROJECT]', '[LOCATION]');
    $channelId = '[CHANNEL_ID]';

    create_channel_sample($formattedParent, $channelId);
}

createEvent

Creates an event with the provided unique ID in the specified channel.

The async variant is Google\Cloud\Video\LiveStream\V1\Client\LivestreamServiceClient::createEventAsync() .

Parameters
NameDescription
request Google\Cloud\Video\LiveStream\V1\CreateEventRequest

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
TypeDescription
Google\Cloud\Video\LiveStream\V1\Event
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Video\LiveStream\V1\Client\LivestreamServiceClient;
use Google\Cloud\Video\LiveStream\V1\CreateEventRequest;
use Google\Cloud\Video\LiveStream\V1\Event;

/**
 * @param string $formattedParent The parent channel for the resource, in the form of:
 *                                `projects/{project}/locations/{location}/channels/{channelId}`. Please see
 *                                {@see LivestreamServiceClient::channelName()} for help formatting this field.
 * @param string $eventId         The ID of the event resource to be created.
 *                                This value must be 1-63 characters, begin and end with `[a-z0-9]`,
 *                                could contain dashes (-) in between.
 */
function create_event_sample(string $formattedParent, string $eventId): void
{
    // Create a client.
    $livestreamServiceClient = new LivestreamServiceClient();

    // Prepare the request message.
    $event = new Event();
    $request = (new CreateEventRequest())
        ->setParent($formattedParent)
        ->setEvent($event)
        ->setEventId($eventId);

    // Call the API and handle any network failures.
    try {
        /** @var Event $response */
        $response = $livestreamServiceClient->createEvent($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 = LivestreamServiceClient::channelName('[PROJECT]', '[LOCATION]', '[CHANNEL]');
    $eventId = '[EVENT_ID]';

    create_event_sample($formattedParent, $eventId);
}

createInput

Creates an input with the provided unique ID in the specified region.

The async variant is Google\Cloud\Video\LiveStream\V1\Client\LivestreamServiceClient::createInputAsync() .

Parameters
NameDescription
request Google\Cloud\Video\LiveStream\V1\CreateInputRequest

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
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Video\LiveStream\V1\Client\LivestreamServiceClient;
use Google\Cloud\Video\LiveStream\V1\CreateInputRequest;
use Google\Cloud\Video\LiveStream\V1\Input;
use Google\Rpc\Status;

/**
 * @param string $formattedParent The parent location for the resource, in the form of:
 *                                `projects/{project}/locations/{location}`. Please see
 *                                {@see LivestreamServiceClient::locationName()} for help formatting this field.
 * @param string $inputId         The ID of the input resource to be created.
 *                                This value must be 1-63 characters, begin and end with `[a-z0-9]`,
 *                                could contain dashes (-) in between.
 */
function create_input_sample(string $formattedParent, string $inputId): void
{
    // Create a client.
    $livestreamServiceClient = new LivestreamServiceClient();

    // Prepare the request message.
    $input = new Input();
    $request = (new CreateInputRequest())
        ->setParent($formattedParent)
        ->setInput($input)
        ->setInputId($inputId);

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

        if ($response->operationSucceeded()) {
            /** @var Input $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 = LivestreamServiceClient::locationName('[PROJECT]', '[LOCATION]');
    $inputId = '[INPUT_ID]';

    create_input_sample($formattedParent, $inputId);
}

deleteAsset

Deletes the specified asset if it is not used.

The async variant is Google\Cloud\Video\LiveStream\V1\Client\LivestreamServiceClient::deleteAssetAsync() .

Parameters
NameDescription
request Google\Cloud\Video\LiveStream\V1\DeleteAssetRequest

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
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Video\LiveStream\V1\Client\LivestreamServiceClient;
use Google\Cloud\Video\LiveStream\V1\DeleteAssetRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedName The name of the asset resource, in the form of:
 *                              `projects/{project}/locations/{location}/assets/{assetId}`. Please see
 *                              {@see LivestreamServiceClient::assetName()} for help formatting this field.
 */
function delete_asset_sample(string $formattedName): void
{
    // Create a client.
    $livestreamServiceClient = new LivestreamServiceClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $livestreamServiceClient->deleteAsset($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 = LivestreamServiceClient::assetName('[PROJECT]', '[LOCATION]', '[ASSET]');

    delete_asset_sample($formattedName);
}

deleteChannel

Parameters
NameDescription
request Google\Cloud\Video\LiveStream\V1\DeleteChannelRequest

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
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Video\LiveStream\V1\Client\LivestreamServiceClient;
use Google\Cloud\Video\LiveStream\V1\DeleteChannelRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedName The name of the channel resource, in the form of:
 *                              `projects/{project}/locations/{location}/channels/{channelId}`. Please see
 *                              {@see LivestreamServiceClient::channelName()} for help formatting this field.
 */
function delete_channel_sample(string $formattedName): void
{
    // Create a client.
    $livestreamServiceClient = new LivestreamServiceClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $livestreamServiceClient->deleteChannel($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 = LivestreamServiceClient::channelName('[PROJECT]', '[LOCATION]', '[CHANNEL]');

    delete_channel_sample($formattedName);
}

deleteEvent

Parameters
NameDescription
request Google\Cloud\Video\LiveStream\V1\DeleteEventRequest

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.

Example
use Google\ApiCore\ApiException;
use Google\Cloud\Video\LiveStream\V1\Client\LivestreamServiceClient;
use Google\Cloud\Video\LiveStream\V1\DeleteEventRequest;

/**
 * @param string $formattedName The name of the event resource, in the form of:
 *                              `projects/{project}/locations/{location}/channels/{channelId}/events/{eventId}`. Please see
 *                              {@see LivestreamServiceClient::eventName()} for help formatting this field.
 */
function delete_event_sample(string $formattedName): void
{
    // Create a client.
    $livestreamServiceClient = new LivestreamServiceClient();

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

    // Call the API and handle any network failures.
    try {
        $livestreamServiceClient->deleteEvent($request);
        printf('Call completed successfully.' . PHP_EOL);
    } 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 = LivestreamServiceClient::eventName(
        '[PROJECT]',
        '[LOCATION]',
        '[CHANNEL]',
        '[EVENT]'
    );

    delete_event_sample($formattedName);
}

deleteInput

Parameters
NameDescription
request Google\Cloud\Video\LiveStream\V1\DeleteInputRequest

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
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Video\LiveStream\V1\Client\LivestreamServiceClient;
use Google\Cloud\Video\LiveStream\V1\DeleteInputRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedName The name of the input resource, in the form of:
 *                              `projects/{project}/locations/{location}/inputs/{inputId}`. Please see
 *                              {@see LivestreamServiceClient::inputName()} for help formatting this field.
 */
function delete_input_sample(string $formattedName): void
{
    // Create a client.
    $livestreamServiceClient = new LivestreamServiceClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $livestreamServiceClient->deleteInput($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 = LivestreamServiceClient::inputName('[PROJECT]', '[LOCATION]', '[INPUT]');

    delete_input_sample($formattedName);
}

getAsset

Parameters
NameDescription
request Google\Cloud\Video\LiveStream\V1\GetAssetRequest

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
TypeDescription
Google\Cloud\Video\LiveStream\V1\Asset
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Video\LiveStream\V1\Asset;
use Google\Cloud\Video\LiveStream\V1\Client\LivestreamServiceClient;
use Google\Cloud\Video\LiveStream\V1\GetAssetRequest;

/**
 * @param string $formattedName Name of the resource, in the following form:
 *                              `projects/{project}/locations/{location}/assets/{asset}`. Please see
 *                              {@see LivestreamServiceClient::assetName()} for help formatting this field.
 */
function get_asset_sample(string $formattedName): void
{
    // Create a client.
    $livestreamServiceClient = new LivestreamServiceClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var Asset $response */
        $response = $livestreamServiceClient->getAsset($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 = LivestreamServiceClient::assetName('[PROJECT]', '[LOCATION]', '[ASSET]');

    get_asset_sample($formattedName);
}

getChannel

Returns the specified channel.

The async variant is Google\Cloud\Video\LiveStream\V1\Client\LivestreamServiceClient::getChannelAsync() .

Parameters
NameDescription
request Google\Cloud\Video\LiveStream\V1\GetChannelRequest

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
TypeDescription
Google\Cloud\Video\LiveStream\V1\Channel
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Video\LiveStream\V1\Channel;
use Google\Cloud\Video\LiveStream\V1\Client\LivestreamServiceClient;
use Google\Cloud\Video\LiveStream\V1\GetChannelRequest;

/**
 * @param string $formattedName The name of the channel resource, in the form of:
 *                              `projects/{project}/locations/{location}/channels/{channelId}`. Please see
 *                              {@see LivestreamServiceClient::channelName()} for help formatting this field.
 */
function get_channel_sample(string $formattedName): void
{
    // Create a client.
    $livestreamServiceClient = new LivestreamServiceClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var Channel $response */
        $response = $livestreamServiceClient->getChannel($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 = LivestreamServiceClient::channelName('[PROJECT]', '[LOCATION]', '[CHANNEL]');

    get_channel_sample($formattedName);
}

getEvent

Parameters
NameDescription
request Google\Cloud\Video\LiveStream\V1\GetEventRequest

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
TypeDescription
Google\Cloud\Video\LiveStream\V1\Event
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Video\LiveStream\V1\Client\LivestreamServiceClient;
use Google\Cloud\Video\LiveStream\V1\Event;
use Google\Cloud\Video\LiveStream\V1\GetEventRequest;

/**
 * @param string $formattedName The name of the event resource, in the form of:
 *                              `projects/{project}/locations/{location}/channels/{channelId}/events/{eventId}`. Please see
 *                              {@see LivestreamServiceClient::eventName()} for help formatting this field.
 */
function get_event_sample(string $formattedName): void
{
    // Create a client.
    $livestreamServiceClient = new LivestreamServiceClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var Event $response */
        $response = $livestreamServiceClient->getEvent($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 = LivestreamServiceClient::eventName(
        '[PROJECT]',
        '[LOCATION]',
        '[CHANNEL]',
        '[EVENT]'
    );

    get_event_sample($formattedName);
}

getInput

Parameters
NameDescription
request Google\Cloud\Video\LiveStream\V1\GetInputRequest

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
TypeDescription
Google\Cloud\Video\LiveStream\V1\Input
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Video\LiveStream\V1\Client\LivestreamServiceClient;
use Google\Cloud\Video\LiveStream\V1\GetInputRequest;
use Google\Cloud\Video\LiveStream\V1\Input;

/**
 * @param string $formattedName The name of the input resource, in the form of:
 *                              `projects/{project}/locations/{location}/inputs/{inputId}`. Please see
 *                              {@see LivestreamServiceClient::inputName()} for help formatting this field.
 */
function get_input_sample(string $formattedName): void
{
    // Create a client.
    $livestreamServiceClient = new LivestreamServiceClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var Input $response */
        $response = $livestreamServiceClient->getInput($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 = LivestreamServiceClient::inputName('[PROJECT]', '[LOCATION]', '[INPUT]');

    get_input_sample($formattedName);
}

getPool

Parameters
NameDescription
request Google\Cloud\Video\LiveStream\V1\GetPoolRequest

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
TypeDescription
Google\Cloud\Video\LiveStream\V1\Pool
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Video\LiveStream\V1\Client\LivestreamServiceClient;
use Google\Cloud\Video\LiveStream\V1\GetPoolRequest;
use Google\Cloud\Video\LiveStream\V1\Pool;

/**
 * @param string $formattedName The name of the pool resource, in the form of:
 *                              `projects/{project}/locations/{location}/pools/{poolId}`. Please see
 *                              {@see LivestreamServiceClient::poolName()} for help formatting this field.
 */
function get_pool_sample(string $formattedName): void
{
    // Create a client.
    $livestreamServiceClient = new LivestreamServiceClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var Pool $response */
        $response = $livestreamServiceClient->getPool($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 = LivestreamServiceClient::poolName('[PROJECT]', '[LOCATION]', '[POOL]');

    get_pool_sample($formattedName);
}

listAssets

Returns a list of all assets in the specified region.

The async variant is Google\Cloud\Video\LiveStream\V1\Client\LivestreamServiceClient::listAssetsAsync() .

Parameters
NameDescription
request Google\Cloud\Video\LiveStream\V1\ListAssetsRequest

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
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Video\LiveStream\V1\Asset;
use Google\Cloud\Video\LiveStream\V1\Client\LivestreamServiceClient;
use Google\Cloud\Video\LiveStream\V1\ListAssetsRequest;

/**
 * @param string $formattedParent The parent location for the resource, in the form of:
 *                                `projects/{project}/locations/{location}`. Please see
 *                                {@see LivestreamServiceClient::locationName()} for help formatting this field.
 */
function list_assets_sample(string $formattedParent): void
{
    // Create a client.
    $livestreamServiceClient = new LivestreamServiceClient();

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

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

        /** @var Asset $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 = LivestreamServiceClient::locationName('[PROJECT]', '[LOCATION]');

    list_assets_sample($formattedParent);
}

listChannels

Returns a list of all channels in the specified region.

The async variant is Google\Cloud\Video\LiveStream\V1\Client\LivestreamServiceClient::listChannelsAsync() .

Parameters
NameDescription
request Google\Cloud\Video\LiveStream\V1\ListChannelsRequest

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
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Video\LiveStream\V1\Channel;
use Google\Cloud\Video\LiveStream\V1\Client\LivestreamServiceClient;
use Google\Cloud\Video\LiveStream\V1\ListChannelsRequest;

/**
 * @param string $formattedParent The parent location for the resource, in the form of:
 *                                `projects/{project}/locations/{location}`. Please see
 *                                {@see LivestreamServiceClient::locationName()} for help formatting this field.
 */
function list_channels_sample(string $formattedParent): void
{
    // Create a client.
    $livestreamServiceClient = new LivestreamServiceClient();

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

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

        /** @var Channel $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 = LivestreamServiceClient::locationName('[PROJECT]', '[LOCATION]');

    list_channels_sample($formattedParent);
}

listEvents

Returns a list of all events in the specified channel.

The async variant is Google\Cloud\Video\LiveStream\V1\Client\LivestreamServiceClient::listEventsAsync() .

Parameters
NameDescription
request Google\Cloud\Video\LiveStream\V1\ListEventsRequest

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
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Video\LiveStream\V1\Client\LivestreamServiceClient;
use Google\Cloud\Video\LiveStream\V1\Event;
use Google\Cloud\Video\LiveStream\V1\ListEventsRequest;

/**
 * @param string $formattedParent The parent channel for the resource, in the form of:
 *                                `projects/{project}/locations/{location}/channels/{channelId}`. Please see
 *                                {@see LivestreamServiceClient::channelName()} for help formatting this field.
 */
function list_events_sample(string $formattedParent): void
{
    // Create a client.
    $livestreamServiceClient = new LivestreamServiceClient();

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

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

        /** @var Event $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 = LivestreamServiceClient::channelName('[PROJECT]', '[LOCATION]', '[CHANNEL]');

    list_events_sample($formattedParent);
}

listInputs

Returns a list of all inputs in the specified region.

The async variant is Google\Cloud\Video\LiveStream\V1\Client\LivestreamServiceClient::listInputsAsync() .

Parameters
NameDescription
request Google\Cloud\Video\LiveStream\V1\ListInputsRequest

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
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Video\LiveStream\V1\Client\LivestreamServiceClient;
use Google\Cloud\Video\LiveStream\V1\Input;
use Google\Cloud\Video\LiveStream\V1\ListInputsRequest;

/**
 * @param string $formattedParent The parent location for the resource, in the form of:
 *                                `projects/{project}/locations/{location}`. Please see
 *                                {@see LivestreamServiceClient::locationName()} for help formatting this field.
 */
function list_inputs_sample(string $formattedParent): void
{
    // Create a client.
    $livestreamServiceClient = new LivestreamServiceClient();

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

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

        /** @var Input $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 = LivestreamServiceClient::locationName('[PROJECT]', '[LOCATION]');

    list_inputs_sample($formattedParent);
}

startChannel

Starts the specified channel. Part of the video pipeline will be created only when the StartChannel request is received by the server.

The async variant is Google\Cloud\Video\LiveStream\V1\Client\LivestreamServiceClient::startChannelAsync() .

Parameters
NameDescription
request Google\Cloud\Video\LiveStream\V1\StartChannelRequest

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
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Video\LiveStream\V1\ChannelOperationResponse;
use Google\Cloud\Video\LiveStream\V1\Client\LivestreamServiceClient;
use Google\Cloud\Video\LiveStream\V1\StartChannelRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedName The name of the channel resource, in the form of:
 *                              `projects/{project}/locations/{location}/channels/{channelId}`. Please see
 *                              {@see LivestreamServiceClient::channelName()} for help formatting this field.
 */
function start_channel_sample(string $formattedName): void
{
    // Create a client.
    $livestreamServiceClient = new LivestreamServiceClient();

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

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

        if ($response->operationSucceeded()) {
            /** @var ChannelOperationResponse $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
{
    $formattedName = LivestreamServiceClient::channelName('[PROJECT]', '[LOCATION]', '[CHANNEL]');

    start_channel_sample($formattedName);
}

stopChannel

Stops the specified channel. Part of the video pipeline will be released when the StopChannel request is received by the server.

The async variant is Google\Cloud\Video\LiveStream\V1\Client\LivestreamServiceClient::stopChannelAsync() .

Parameters
NameDescription
request Google\Cloud\Video\LiveStream\V1\StopChannelRequest

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
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Video\LiveStream\V1\ChannelOperationResponse;
use Google\Cloud\Video\LiveStream\V1\Client\LivestreamServiceClient;
use Google\Cloud\Video\LiveStream\V1\StopChannelRequest;
use Google\Rpc\Status;

/**
 * @param string $formattedName The name of the channel resource, in the form of:
 *                              `projects/{project}/locations/{location}/channels/{channelId}`. Please see
 *                              {@see LivestreamServiceClient::channelName()} for help formatting this field.
 */
function stop_channel_sample(string $formattedName): void
{
    // Create a client.
    $livestreamServiceClient = new LivestreamServiceClient();

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

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

        if ($response->operationSucceeded()) {
            /** @var ChannelOperationResponse $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
{
    $formattedName = LivestreamServiceClient::channelName('[PROJECT]', '[LOCATION]', '[CHANNEL]');

    stop_channel_sample($formattedName);
}

updateChannel

Parameters
NameDescription
request Google\Cloud\Video\LiveStream\V1\UpdateChannelRequest

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
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Video\LiveStream\V1\Channel;
use Google\Cloud\Video\LiveStream\V1\Channel\Output;
use Google\Cloud\Video\LiveStream\V1\Client\LivestreamServiceClient;
use Google\Cloud\Video\LiveStream\V1\UpdateChannelRequest;
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_channel_sample(): void
{
    // Create a client.
    $livestreamServiceClient = new LivestreamServiceClient();

    // Prepare the request message.
    $channelOutput = new Output();
    $channel = (new Channel())
        ->setOutput($channelOutput);
    $request = (new UpdateChannelRequest())
        ->setChannel($channel);

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

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

updateInput

Parameters
NameDescription
request Google\Cloud\Video\LiveStream\V1\UpdateInputRequest

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
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Video\LiveStream\V1\Client\LivestreamServiceClient;
use Google\Cloud\Video\LiveStream\V1\Input;
use Google\Cloud\Video\LiveStream\V1\UpdateInputRequest;
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_input_sample(): void
{
    // Create a client.
    $livestreamServiceClient = new LivestreamServiceClient();

    // Prepare the request message.
    $input = new Input();
    $request = (new UpdateInputRequest())
        ->setInput($input);

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

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

updatePool

Parameters
NameDescription
request Google\Cloud\Video\LiveStream\V1\UpdatePoolRequest

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
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Video\LiveStream\V1\Client\LivestreamServiceClient;
use Google\Cloud\Video\LiveStream\V1\Pool;
use Google\Cloud\Video\LiveStream\V1\UpdatePoolRequest;
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_pool_sample(): void
{
    // Create a client.
    $livestreamServiceClient = new LivestreamServiceClient();

    // Prepare the request message.
    $pool = new Pool();
    $request = (new UpdatePoolRequest())
        ->setPool($pool);

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

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

getLocation

Gets information about a location.

The async variant is Google\Cloud\Video\LiveStream\V1\Client\LivestreamServiceClient::getLocationAsync() .

Parameters
NameDescription
request Google\Cloud\Location\GetLocationRequest

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
TypeDescription
Google\Cloud\Location\Location
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Location\GetLocationRequest;
use Google\Cloud\Location\Location;
use Google\Cloud\Video\LiveStream\V1\Client\LivestreamServiceClient;

/**
 * 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 get_location_sample(): void
{
    // Create a client.
    $livestreamServiceClient = new LivestreamServiceClient();

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

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

listLocations

Lists information about the supported locations for this service.

The async variant is Google\Cloud\Video\LiveStream\V1\Client\LivestreamServiceClient::listLocationsAsync() .

Parameters
NameDescription
request Google\Cloud\Location\ListLocationsRequest

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
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Location\ListLocationsRequest;
use Google\Cloud\Location\Location;
use Google\Cloud\Video\LiveStream\V1\Client\LivestreamServiceClient;

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

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

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

        /** @var Location $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());
    }
}

createAssetAsync

Parameters
NameDescription
request Google\Cloud\Video\LiveStream\V1\CreateAssetRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

createChannelAsync

Parameters
NameDescription
request Google\Cloud\Video\LiveStream\V1\CreateChannelRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

createEventAsync

Parameters
NameDescription
request Google\Cloud\Video\LiveStream\V1\CreateEventRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

createInputAsync

Parameters
NameDescription
request Google\Cloud\Video\LiveStream\V1\CreateInputRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

deleteAssetAsync

Parameters
NameDescription
request Google\Cloud\Video\LiveStream\V1\DeleteAssetRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

deleteChannelAsync

Parameters
NameDescription
request Google\Cloud\Video\LiveStream\V1\DeleteChannelRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

deleteEventAsync

Parameters
NameDescription
request Google\Cloud\Video\LiveStream\V1\DeleteEventRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

deleteInputAsync

Parameters
NameDescription
request Google\Cloud\Video\LiveStream\V1\DeleteInputRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getAssetAsync

Parameters
NameDescription
request Google\Cloud\Video\LiveStream\V1\GetAssetRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getChannelAsync

Parameters
NameDescription
request Google\Cloud\Video\LiveStream\V1\GetChannelRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getEventAsync

Parameters
NameDescription
request Google\Cloud\Video\LiveStream\V1\GetEventRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getInputAsync

Parameters
NameDescription
request Google\Cloud\Video\LiveStream\V1\GetInputRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getPoolAsync

Parameters
NameDescription
request Google\Cloud\Video\LiveStream\V1\GetPoolRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

listAssetsAsync

Parameters
NameDescription
request Google\Cloud\Video\LiveStream\V1\ListAssetsRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

listChannelsAsync

Parameters
NameDescription
request Google\Cloud\Video\LiveStream\V1\ListChannelsRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

listEventsAsync

Parameters
NameDescription
request Google\Cloud\Video\LiveStream\V1\ListEventsRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

listInputsAsync

Parameters
NameDescription
request Google\Cloud\Video\LiveStream\V1\ListInputsRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

startChannelAsync

Parameters
NameDescription
request Google\Cloud\Video\LiveStream\V1\StartChannelRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

stopChannelAsync

Parameters
NameDescription
request Google\Cloud\Video\LiveStream\V1\StopChannelRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

updateChannelAsync

Parameters
NameDescription
request Google\Cloud\Video\LiveStream\V1\UpdateChannelRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

updateInputAsync

Parameters
NameDescription
request Google\Cloud\Video\LiveStream\V1\UpdateInputRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

updatePoolAsync

Parameters
NameDescription
request Google\Cloud\Video\LiveStream\V1\UpdatePoolRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getLocationAsync

Parameters
NameDescription
request Google\Cloud\Location\GetLocationRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

listLocationsAsync

Parameters
NameDescription
request Google\Cloud\Location\ListLocationsRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getOperationsClient

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

Returns
TypeDescription
Google\ApiCore\LongRunning\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
NameDescription
operationName string

The name of the long running operation

methodName string

The name of the method used to start the operation

Returns
TypeDescription
Google\ApiCore\OperationResponse

static::assetName

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

Parameters
NameDescription
project string
location string
asset string
Returns
TypeDescription
stringThe formatted asset resource.

static::channelName

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

Parameters
NameDescription
project string
location string
channel string
Returns
TypeDescription
stringThe formatted channel resource.

static::eventName

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

Parameters
NameDescription
project string
location string
channel string
event string
Returns
TypeDescription
stringThe formatted event resource.

static::inputName

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

Parameters
NameDescription
project string
location string
input string
Returns
TypeDescription
stringThe formatted input resource.

static::locationName

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

Parameters
NameDescription
project string
location string
Returns
TypeDescription
stringThe formatted location resource.

static::networkName

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

Parameters
NameDescription
project string
network string
Returns
TypeDescription
stringThe formatted network resource.

static::poolName

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

Parameters
NameDescription
project string
location string
pool string
Returns
TypeDescription
stringThe formatted pool resource.

static::secretVersionName

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

Parameters
NameDescription
project string
secret string
version string
Returns
TypeDescription
stringThe formatted secret_version 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

  • asset: projects/{project}/locations/{location}/assets/{asset}
  • channel: projects/{project}/locations/{location}/channels/{channel}
  • event: projects/{project}/locations/{location}/channels/{channel}/events/{event}
  • input: projects/{project}/locations/{location}/inputs/{input}
  • location: projects/{project}/locations/{location}
  • network: projects/{project}/global/networks/{network}
  • pool: projects/{project}/locations/{location}/pools/{pool}
  • secretVersion: projects/{project}/secrets/{secret}/versions/{version}

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
NameDescription
formattedName string

The formatted name string

template string

Optional name of template to match

Returns
TypeDescription
arrayAn associative array from name component IDs to component values.