-
Notifications
You must be signed in to change notification settings - Fork 436
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: LRO changes for CdnKey and Slate methods, VodSession changes fo…
…r ad tracking, and LiveSession changes for live config (#5997) PiperOrigin-RevId: 519189362 Source-Link: googleapis/googleapis@a917ece Source-Link: googleapis/googleapis-gen@ae5539d Copy-Tag: eyJwIjoiVmlkZW9TdGl0Y2hlci8uT3dsQm90LnlhbWwiLCJoIjoiYWU1NTM5ZGYxZDgxNTA0ZjgwZGU5OGY4MGNhOWRhOWZiOWMzMTAzOSJ9
- Loading branch information
1 parent
db1a4f0
commit 1019bf0
Showing
59 changed files
with
4,958 additions
and
611 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
107 changes: 107 additions & 0 deletions
107
VideoStitcher/samples/V1/VideoStitcherServiceClient/create_live_config.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
<?php | ||
/* | ||
* Copyright 2023 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
/* | ||
* GENERATED CODE WARNING | ||
* This file was automatically generated - do not edit! | ||
*/ | ||
|
||
require_once __DIR__ . '/../../../vendor/autoload.php'; | ||
|
||
// [START videostitcher_v1_generated_VideoStitcherService_CreateLiveConfig_sync] | ||
use Google\ApiCore\ApiException; | ||
use Google\ApiCore\OperationResponse; | ||
use Google\Cloud\Video\Stitcher\V1\AdTracking; | ||
use Google\Cloud\Video\Stitcher\V1\LiveConfig; | ||
use Google\Cloud\Video\Stitcher\V1\VideoStitcherServiceClient; | ||
use Google\Rpc\Status; | ||
|
||
/** | ||
* Registers the live config with the provided unique ID in | ||
* the specified region. | ||
* | ||
* @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 should be tracked. If | ||
* [gam_live_config][google.cloud.video.stitcher.v1.LiveConfig.gam_live_config] | ||
* is set, the value must be `CLIENT` because the IMA SDK handles ad tracking. | ||
*/ | ||
function create_live_config_sample( | ||
string $formattedParent, | ||
string $liveConfigId, | ||
string $liveConfigSourceUri, | ||
int $liveConfigAdTracking | ||
): void { | ||
// Create a client. | ||
$videoStitcherServiceClient = new VideoStitcherServiceClient(); | ||
|
||
// Prepare any non-scalar elements to be passed along with the request. | ||
$liveConfig = (new LiveConfig()) | ||
->setSourceUri($liveConfigSourceUri) | ||
->setAdTracking($liveConfigAdTracking); | ||
|
||
// Call the API and handle any network failures. | ||
try { | ||
/** @var OperationResponse $response */ | ||
$response = $videoStitcherServiceClient->createLiveConfig( | ||
$formattedParent, | ||
$liveConfigId, | ||
$liveConfig | ||
); | ||
$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 | ||
); | ||
} | ||
// [END videostitcher_v1_generated_VideoStitcherService_CreateLiveConfig_sync] |
Oops, something went wrong.