-
Notifications
You must be signed in to change notification settings - Fork 428
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add apis for Create, Read, Update, Delete for VODConfigs (#7332)
feat: allowed usage for VODConfigs in VODSession feat: added token config for MediaCdnKey feat: added targetting parameter support to Livesession feat: added adtracking to Livesession feat: added fetchoptions with custom headers for Live and VODConfigs docs: Added apis for Create, Read, Update, Delete For VODConfigs. Added vodConfig usage in VODSession. Added TokenConfig for MediaCdnKey. Added targeting_parameter and ad_tracking for Livesession. Added FetchOptions for Live and VOD configs. PiperOrigin-RevId: 636368401 Source-Link: googleapis/googleapis@30717c0 Source-Link: googleapis/googleapis-gen@cc30711 Copy-Tag: eyJwIjoiVmlkZW9TdGl0Y2hlci8uT3dsQm90LnlhbWwiLCJoIjoiY2MzMDcxMWVmOGUxNmQ0ODg3ZDE5ZjY3N2I5MzgyZGYwYWU2MGVkOCJ9
- Loading branch information
1 parent
4210698
commit 2758508
Showing
41 changed files
with
4,894 additions
and
206 deletions.
There are no files selected for viewing
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.
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.
Binary file not shown.
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
100 changes: 100 additions & 0 deletions
100
VideoStitcher/samples/V1/VideoStitcherServiceClient/create_vod_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,100 @@ | ||
<?php | ||
/* | ||
* Copyright 2024 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_CreateVodConfig_sync] | ||
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; | ||
|
||
/** | ||
* Registers the VOD config with the provided unique ID in | ||
* the specified region. | ||
* | ||
* @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); | ||
} | ||
// [END videostitcher_v1_generated_VideoStitcherService_CreateVodConfig_sync] |
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
85 changes: 85 additions & 0 deletions
85
VideoStitcher/samples/V1/VideoStitcherServiceClient/delete_vod_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,85 @@ | ||
<?php | ||
/* | ||
* Copyright 2024 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_DeleteVodConfig_sync] | ||
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; | ||
|
||
/** | ||
* Deletes the specified VOD config. | ||
* | ||
* @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); | ||
} | ||
// [END videostitcher_v1_generated_VideoStitcherService_DeleteVodConfig_sync] |
Oops, something went wrong.