diff --git a/VideoLiveStream/metadata/V1/Outputs.php b/VideoLiveStream/metadata/V1/Outputs.php index 8c3df68c32c..8a26de1c866 100644 Binary files a/VideoLiveStream/metadata/V1/Outputs.php and b/VideoLiveStream/metadata/V1/Outputs.php differ diff --git a/VideoLiveStream/metadata/V1/Resources.php b/VideoLiveStream/metadata/V1/Resources.php index ebf510dc88c..dee3a328b2b 100644 Binary files a/VideoLiveStream/metadata/V1/Resources.php and b/VideoLiveStream/metadata/V1/Resources.php differ diff --git a/VideoLiveStream/metadata/V1/Service.php b/VideoLiveStream/metadata/V1/Service.php index 60eed2e0a3a..8dde8ea46e7 100644 --- a/VideoLiveStream/metadata/V1/Service.php +++ b/VideoLiveStream/metadata/V1/Service.php @@ -25,7 +25,7 @@ public static function initOnce() { \GPBMetadata\Google\Protobuf\Timestamp::initOnce(); $pool->internalAddGeneratedFile( ' -¿3 +¦4 .google/cloud/video/livestream/v1/service.proto google.cloud.video.livestream.v1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto0google/cloud/video/livestream/v1/resources.proto#google/longrunning/operations.protogoogle/protobuf/empty.proto google/protobuf/field_mask.protogoogle/protobuf/timestamp.proto"¿ CreateChannelRequest9 parent ( B)àAúA#!livestream.googleapis.com/Channel? @@ -159,8 +159,9 @@ public static function initOnce() { ListEvents3.google.cloud.video.livestream.v1.ListEventsRequest4.google.cloud.video.livestream.v1.ListEventsResponse"F‚Óä“75/v1/{parent=projects/*/locations/*/channels/*}/eventsÚAparent¬ GetEvent1.google.cloud.video.livestream.v1.GetEventRequest\'.google.cloud.video.livestream.v1.Event"D‚Óä“75/v1/{name=projects/*/locations/*/channels/*/events/*}ÚAname¡ - DeleteEvent4.google.cloud.video.livestream.v1.DeleteEventRequest.google.protobuf.Empty"D‚Óä“7*5/v1/{name=projects/*/locations/*/channels/*/events/*}ÚAnameMÊAlivestream.googleapis.comÒA.https://www.googleapis.com/auth/cloud-platformBé -$com.google.cloud.video.livestream.v1B ServiceProtoPZDcloud.google.com/go/video/livestream/apiv1/livestreampb;livestreampbª Google.Cloud.Video.LiveStream.V1Ê Google\\Cloud\\Video\\LiveStream\\V1ê$Google::Cloud::Video::LiveStream::V1bproto3' + DeleteEvent4.google.cloud.video.livestream.v1.DeleteEventRequest.google.protobuf.Empty"D‚Óä“7*5/v1/{name=projects/*/locations/*/channels/*/events/*}ÚAnameMÊAlivestream.googleapis.comÒA.https://www.googleapis.com/auth/cloud-platformBÐ +$com.google.cloud.video.livestream.v1B ServiceProtoPZDcloud.google.com/go/video/livestream/apiv1/livestreampb;livestreampbª Google.Cloud.Video.LiveStream.V1Ê Google\\Cloud\\Video\\LiveStream\\V1ê$Google::Cloud::Video::LiveStream::V1êAd +*secretmanager.googleapis.com/SecretVersion6projects/{project}/secrets/{secret}/versions/{version}bproto3' , true); static::$is_initialized = true; diff --git a/VideoLiveStream/samples/V1/LivestreamServiceClient/create_event.php b/VideoLiveStream/samples/V1/LivestreamServiceClient/create_event.php index 385a5093b10..3c0e0cdabba 100644 --- a/VideoLiveStream/samples/V1/LivestreamServiceClient/create_event.php +++ b/VideoLiveStream/samples/V1/LivestreamServiceClient/create_event.php @@ -25,7 +25,7 @@ // [START livestream_v1_generated_LivestreamService_CreateEvent_sync] use Google\ApiCore\ApiException; use Google\Cloud\Video\LiveStream\V1\Event; -use Google\Cloud\Video\LiveStream\V1\Event\AdBreakTask; +use Google\Cloud\Video\LiveStream\V1\Event\InputSwitchTask; use Google\Cloud\Video\LiveStream\V1\LivestreamServiceClient; /** @@ -44,9 +44,9 @@ function create_event_sample(string $formattedParent, string $eventId): void $livestreamServiceClient = new LivestreamServiceClient(); // Prepare any non-scalar elements to be passed along with the request. - $eventAdBreak = new AdBreakTask(); + $eventInputSwitch = new InputSwitchTask(); $event = (new Event()) - ->setAdBreak($eventAdBreak); + ->setInputSwitch($eventInputSwitch); // Call the API and handle any network failures. try { diff --git a/VideoLiveStream/samples/V1/LivestreamServiceClient/get_location.php b/VideoLiveStream/samples/V1/LivestreamServiceClient/get_location.php new file mode 100644 index 00000000000..875c398c2ff --- /dev/null +++ b/VideoLiveStream/samples/V1/LivestreamServiceClient/get_location.php @@ -0,0 +1,53 @@ +getLocation(); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END livestream_v1_generated_LivestreamService_GetLocation_sync] diff --git a/VideoLiveStream/samples/V1/LivestreamServiceClient/list_locations.php b/VideoLiveStream/samples/V1/LivestreamServiceClient/list_locations.php new file mode 100644 index 00000000000..651fafa24f2 --- /dev/null +++ b/VideoLiveStream/samples/V1/LivestreamServiceClient/list_locations.php @@ -0,0 +1,58 @@ +listLocations(); + + /** @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()); + } +} +// [END livestream_v1_generated_LivestreamService_ListLocations_sync] diff --git a/VideoLiveStream/src/V1/AudioStream.php b/VideoLiveStream/src/V1/AudioStream.php index 197b00c817e..0fd16fd9256 100644 --- a/VideoLiveStream/src/V1/AudioStream.php +++ b/VideoLiveStream/src/V1/AudioStream.php @@ -32,7 +32,8 @@ class AudioStream extends \Google\Protobuf\Internal\Message */ private $codec = ''; /** - * Required. Audio bitrate in bits per second. Must be between 1 and 10,000,000. + * Required. Audio bitrate in bits per second. Must be between 1 and + * 10,000,000. * * Generated from protobuf field int32 bitrate_bps = 2 [(.google.api.field_behavior) = REQUIRED]; */ @@ -86,7 +87,8 @@ class AudioStream extends \Google\Protobuf\Internal\Message * Supported audio codecs: * - `aac` * @type int $bitrate_bps - * Required. Audio bitrate in bits per second. Must be between 1 and 10,000,000. + * Required. Audio bitrate in bits per second. Must be between 1 and + * 10,000,000. * @type int $channel_count * Number of audio channels. Must be between 1 and 6. The default is 2. * @type array|\Google\Protobuf\Internal\RepeatedField $channel_layout @@ -172,7 +174,8 @@ public function setCodec($var) } /** - * Required. Audio bitrate in bits per second. Must be between 1 and 10,000,000. + * Required. Audio bitrate in bits per second. Must be between 1 and + * 10,000,000. * * Generated from protobuf field int32 bitrate_bps = 2 [(.google.api.field_behavior) = REQUIRED]; * @return int @@ -183,7 +186,8 @@ public function getBitrateBps() } /** - * Required. Audio bitrate in bits per second. Must be between 1 and 10,000,000. + * Required. Audio bitrate in bits per second. Must be between 1 and + * 10,000,000. * * Generated from protobuf field int32 bitrate_bps = 2 [(.google.api.field_behavior) = REQUIRED]; * @param int $var diff --git a/VideoLiveStream/src/V1/AudioStream/AudioMapping.php b/VideoLiveStream/src/V1/AudioStream/AudioMapping.php index 3c198873826..971b7822987 100644 --- a/VideoLiveStream/src/V1/AudioStream/AudioMapping.php +++ b/VideoLiveStream/src/V1/AudioStream/AudioMapping.php @@ -16,17 +16,20 @@ class AudioMapping extends \Google\Protobuf\Internal\Message { /** - * Required. The `Channel` [InputAttachment.key][google.cloud.video.livestream.v1.InputAttachment.key] that identifies the input that this - * audio mapping applies to. If an active input doesn't have an audio - * mapping, the primary audio track in the input stream will be selected. + * Required. The `Channel` + * [InputAttachment.key][google.cloud.video.livestream.v1.InputAttachment.key] + * that identifies the input that this audio mapping applies to. If an + * active input doesn't have an audio mapping, the primary audio track in + * the input stream will be selected. * * Generated from protobuf field string input_key = 6 [(.google.api.field_behavior) = REQUIRED]; */ private $input_key = ''; /** * Required. The zero-based index of the track in the input stream. - * All [mapping][google.cloud.video.livestream.v1.AudioStream.mapping]s in the same [AudioStream][google.cloud.video.livestream.v1.AudioStream] - * must have the same input track. + * All [mapping][google.cloud.video.livestream.v1.AudioStream.mapping]s in + * the same [AudioStream][google.cloud.video.livestream.v1.AudioStream] must + * have the same input track. * * Generated from protobuf field int32 input_track = 2 [(.google.api.field_behavior) = REQUIRED]; */ @@ -39,11 +42,19 @@ class AudioMapping extends \Google\Protobuf\Internal\Message private $input_channel = 0; /** * Required. The zero-based index of the channel in the output audio stream. - * Must be consistent with the [input_channel][google.cloud.video.livestream.v1.AudioStream.AudioMapping.input_channel]. + * Must be consistent with the + * [input_channel][google.cloud.video.livestream.v1.AudioStream.AudioMapping.input_channel]. * * Generated from protobuf field int32 output_channel = 4 [(.google.api.field_behavior) = REQUIRED]; */ private $output_channel = 0; + /** + * Audio volume control in dB. Negative values decrease volume, + * positive values increase. The default is 0. + * + * Generated from protobuf field double gain_db = 5; + */ + private $gain_db = 0.0; /** * Constructor. @@ -52,18 +63,25 @@ class AudioMapping extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $input_key - * Required. The `Channel` [InputAttachment.key][google.cloud.video.livestream.v1.InputAttachment.key] that identifies the input that this - * audio mapping applies to. If an active input doesn't have an audio - * mapping, the primary audio track in the input stream will be selected. + * Required. The `Channel` + * [InputAttachment.key][google.cloud.video.livestream.v1.InputAttachment.key] + * that identifies the input that this audio mapping applies to. If an + * active input doesn't have an audio mapping, the primary audio track in + * the input stream will be selected. * @type int $input_track * Required. The zero-based index of the track in the input stream. - * All [mapping][google.cloud.video.livestream.v1.AudioStream.mapping]s in the same [AudioStream][google.cloud.video.livestream.v1.AudioStream] - * must have the same input track. + * All [mapping][google.cloud.video.livestream.v1.AudioStream.mapping]s in + * the same [AudioStream][google.cloud.video.livestream.v1.AudioStream] must + * have the same input track. * @type int $input_channel * Required. The zero-based index of the channel in the input stream. * @type int $output_channel * Required. The zero-based index of the channel in the output audio stream. - * Must be consistent with the [input_channel][google.cloud.video.livestream.v1.AudioStream.AudioMapping.input_channel]. + * Must be consistent with the + * [input_channel][google.cloud.video.livestream.v1.AudioStream.AudioMapping.input_channel]. + * @type float $gain_db + * Audio volume control in dB. Negative values decrease volume, + * positive values increase. The default is 0. * } */ public function __construct($data = NULL) { @@ -72,9 +90,11 @@ public function __construct($data = NULL) { } /** - * Required. The `Channel` [InputAttachment.key][google.cloud.video.livestream.v1.InputAttachment.key] that identifies the input that this - * audio mapping applies to. If an active input doesn't have an audio - * mapping, the primary audio track in the input stream will be selected. + * Required. The `Channel` + * [InputAttachment.key][google.cloud.video.livestream.v1.InputAttachment.key] + * that identifies the input that this audio mapping applies to. If an + * active input doesn't have an audio mapping, the primary audio track in + * the input stream will be selected. * * Generated from protobuf field string input_key = 6 [(.google.api.field_behavior) = REQUIRED]; * @return string @@ -85,9 +105,11 @@ public function getInputKey() } /** - * Required. The `Channel` [InputAttachment.key][google.cloud.video.livestream.v1.InputAttachment.key] that identifies the input that this - * audio mapping applies to. If an active input doesn't have an audio - * mapping, the primary audio track in the input stream will be selected. + * Required. The `Channel` + * [InputAttachment.key][google.cloud.video.livestream.v1.InputAttachment.key] + * that identifies the input that this audio mapping applies to. If an + * active input doesn't have an audio mapping, the primary audio track in + * the input stream will be selected. * * Generated from protobuf field string input_key = 6 [(.google.api.field_behavior) = REQUIRED]; * @param string $var @@ -103,8 +125,9 @@ public function setInputKey($var) /** * Required. The zero-based index of the track in the input stream. - * All [mapping][google.cloud.video.livestream.v1.AudioStream.mapping]s in the same [AudioStream][google.cloud.video.livestream.v1.AudioStream] - * must have the same input track. + * All [mapping][google.cloud.video.livestream.v1.AudioStream.mapping]s in + * the same [AudioStream][google.cloud.video.livestream.v1.AudioStream] must + * have the same input track. * * Generated from protobuf field int32 input_track = 2 [(.google.api.field_behavior) = REQUIRED]; * @return int @@ -116,8 +139,9 @@ public function getInputTrack() /** * Required. The zero-based index of the track in the input stream. - * All [mapping][google.cloud.video.livestream.v1.AudioStream.mapping]s in the same [AudioStream][google.cloud.video.livestream.v1.AudioStream] - * must have the same input track. + * All [mapping][google.cloud.video.livestream.v1.AudioStream.mapping]s in + * the same [AudioStream][google.cloud.video.livestream.v1.AudioStream] must + * have the same input track. * * Generated from protobuf field int32 input_track = 2 [(.google.api.field_behavior) = REQUIRED]; * @param int $var @@ -159,7 +183,8 @@ public function setInputChannel($var) /** * Required. The zero-based index of the channel in the output audio stream. - * Must be consistent with the [input_channel][google.cloud.video.livestream.v1.AudioStream.AudioMapping.input_channel]. + * Must be consistent with the + * [input_channel][google.cloud.video.livestream.v1.AudioStream.AudioMapping.input_channel]. * * Generated from protobuf field int32 output_channel = 4 [(.google.api.field_behavior) = REQUIRED]; * @return int @@ -171,7 +196,8 @@ public function getOutputChannel() /** * Required. The zero-based index of the channel in the output audio stream. - * Must be consistent with the [input_channel][google.cloud.video.livestream.v1.AudioStream.AudioMapping.input_channel]. + * Must be consistent with the + * [input_channel][google.cloud.video.livestream.v1.AudioStream.AudioMapping.input_channel]. * * Generated from protobuf field int32 output_channel = 4 [(.google.api.field_behavior) = REQUIRED]; * @param int $var @@ -185,6 +211,34 @@ public function setOutputChannel($var) return $this; } + /** + * Audio volume control in dB. Negative values decrease volume, + * positive values increase. The default is 0. + * + * Generated from protobuf field double gain_db = 5; + * @return float + */ + public function getGainDb() + { + return $this->gain_db; + } + + /** + * Audio volume control in dB. Negative values decrease volume, + * positive values increase. The default is 0. + * + * Generated from protobuf field double gain_db = 5; + * @param float $var + * @return $this + */ + public function setGainDb($var) + { + GPBUtil::checkDouble($var); + $this->gain_db = $var; + + return $this; + } + } diff --git a/VideoLiveStream/src/V1/Channel.php b/VideoLiveStream/src/V1/Channel.php index 08f8b7f8cc8..96679a910c9 100644 --- a/VideoLiveStream/src/V1/Channel.php +++ b/VideoLiveStream/src/V1/Channel.php @@ -53,15 +53,18 @@ class Channel extends \Google\Protobuf\Internal\Message */ private $input_attachments; /** - * Output only. The [InputAttachment.key][google.cloud.video.livestream.v1.InputAttachment.key] that serves as the current input source. The - * first input in the [input_attachments][google.cloud.video.livestream.v1.Channel.input_attachments] is the initial input source. + * Output only. The + * [InputAttachment.key][google.cloud.video.livestream.v1.InputAttachment.key] + * that serves as the current input source. The first input in the + * [input_attachments][google.cloud.video.livestream.v1.Channel.input_attachments] + * is the initial input source. * * Generated from protobuf field string active_input = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ private $active_input = ''; /** - * Required. Information about the output (that is, the Cloud Storage bucket to store - * the generated live stream). + * Required. Information about the output (that is, the Cloud Storage bucket + * to store the generated live stream). * * Generated from protobuf field .google.cloud.video.livestream.v1.Channel.Output output = 9 [(.google.api.field_behavior) = REQUIRED]; */ @@ -97,8 +100,10 @@ class Channel extends \Google\Protobuf\Internal\Message */ private $streaming_state = 0; /** - * Output only. A description of the reason for the streaming error. This property is - * always present when [streaming_state][google.cloud.video.livestream.v1.Channel.streaming_state] is + * Output only. A description of the reason for the streaming error. This + * property is always present when + * [streaming_state][google.cloud.video.livestream.v1.Channel.streaming_state] + * is * [STREAMING_ERROR][google.cloud.video.livestream.v1.Channel.StreamingState.STREAMING_ERROR]. * * Generated from protobuf field .google.rpc.Status streaming_error = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -110,6 +115,27 @@ class Channel extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.video.livestream.v1.LogConfig log_config = 19; */ private $log_config = null; + /** + * Configuration of timecode for this channel. + * + * Generated from protobuf field .google.cloud.video.livestream.v1.TimecodeConfig timecode_config = 21; + */ + private $timecode_config = null; + /** + * Encryption configurations for this channel. Each configuration has an ID + * which is referred to by each MuxStream to indicate which configuration is + * used for that output. + * + * Generated from protobuf field repeated .google.cloud.video.livestream.v1.Encryption encryptions = 24; + */ + private $encryptions; + /** + * The configuration for input sources defined in + * [input_attachments][google.cloud.video.livestream.v1.Channel.input_attachments]. + * + * Generated from protobuf field .google.cloud.video.livestream.v1.InputConfig input_config = 25; + */ + private $input_config = null; /** * Constructor. @@ -131,11 +157,14 @@ class Channel extends \Google\Protobuf\Internal\Message * One channel can have multiple inputs as the input sources. Only one * input can be selected as the input source at one time. * @type string $active_input - * Output only. The [InputAttachment.key][google.cloud.video.livestream.v1.InputAttachment.key] that serves as the current input source. The - * first input in the [input_attachments][google.cloud.video.livestream.v1.Channel.input_attachments] is the initial input source. + * Output only. The + * [InputAttachment.key][google.cloud.video.livestream.v1.InputAttachment.key] + * that serves as the current input source. The first input in the + * [input_attachments][google.cloud.video.livestream.v1.Channel.input_attachments] + * is the initial input source. * @type \Google\Cloud\Video\LiveStream\V1\Channel\Output $output - * Required. Information about the output (that is, the Cloud Storage bucket to store - * the generated live stream). + * Required. Information about the output (that is, the Cloud Storage bucket + * to store the generated live stream). * @type array<\Google\Cloud\Video\LiveStream\V1\ElementaryStream>|\Google\Protobuf\Internal\RepeatedField $elementary_streams * List of elementary streams. * @type array<\Google\Cloud\Video\LiveStream\V1\MuxStream>|\Google\Protobuf\Internal\RepeatedField $mux_streams @@ -147,11 +176,22 @@ class Channel extends \Google\Protobuf\Internal\Message * @type int $streaming_state * Output only. State of the streaming operation. * @type \Google\Rpc\Status $streaming_error - * Output only. A description of the reason for the streaming error. This property is - * always present when [streaming_state][google.cloud.video.livestream.v1.Channel.streaming_state] is + * Output only. A description of the reason for the streaming error. This + * property is always present when + * [streaming_state][google.cloud.video.livestream.v1.Channel.streaming_state] + * is * [STREAMING_ERROR][google.cloud.video.livestream.v1.Channel.StreamingState.STREAMING_ERROR]. * @type \Google\Cloud\Video\LiveStream\V1\LogConfig $log_config * Configuration of platform logs for this channel. + * @type \Google\Cloud\Video\LiveStream\V1\TimecodeConfig $timecode_config + * Configuration of timecode for this channel. + * @type array<\Google\Cloud\Video\LiveStream\V1\Encryption>|\Google\Protobuf\Internal\RepeatedField $encryptions + * Encryption configurations for this channel. Each configuration has an ID + * which is referred to by each MuxStream to indicate which configuration is + * used for that output. + * @type \Google\Cloud\Video\LiveStream\V1\InputConfig $input_config + * The configuration for input sources defined in + * [input_attachments][google.cloud.video.livestream.v1.Channel.input_attachments]. * } */ public function __construct($data = NULL) { @@ -316,8 +356,11 @@ public function setInputAttachments($var) } /** - * Output only. The [InputAttachment.key][google.cloud.video.livestream.v1.InputAttachment.key] that serves as the current input source. The - * first input in the [input_attachments][google.cloud.video.livestream.v1.Channel.input_attachments] is the initial input source. + * Output only. The + * [InputAttachment.key][google.cloud.video.livestream.v1.InputAttachment.key] + * that serves as the current input source. The first input in the + * [input_attachments][google.cloud.video.livestream.v1.Channel.input_attachments] + * is the initial input source. * * Generated from protobuf field string active_input = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @return string @@ -328,8 +371,11 @@ public function getActiveInput() } /** - * Output only. The [InputAttachment.key][google.cloud.video.livestream.v1.InputAttachment.key] that serves as the current input source. The - * first input in the [input_attachments][google.cloud.video.livestream.v1.Channel.input_attachments] is the initial input source. + * Output only. The + * [InputAttachment.key][google.cloud.video.livestream.v1.InputAttachment.key] + * that serves as the current input source. The first input in the + * [input_attachments][google.cloud.video.livestream.v1.Channel.input_attachments] + * is the initial input source. * * Generated from protobuf field string active_input = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @param string $var @@ -344,8 +390,8 @@ public function setActiveInput($var) } /** - * Required. Information about the output (that is, the Cloud Storage bucket to store - * the generated live stream). + * Required. Information about the output (that is, the Cloud Storage bucket + * to store the generated live stream). * * Generated from protobuf field .google.cloud.video.livestream.v1.Channel.Output output = 9 [(.google.api.field_behavior) = REQUIRED]; * @return \Google\Cloud\Video\LiveStream\V1\Channel\Output|null @@ -366,8 +412,8 @@ public function clearOutput() } /** - * Required. Information about the output (that is, the Cloud Storage bucket to store - * the generated live stream). + * Required. Information about the output (that is, the Cloud Storage bucket + * to store the generated live stream). * * Generated from protobuf field .google.cloud.video.livestream.v1.Channel.Output output = 9 [(.google.api.field_behavior) = REQUIRED]; * @param \Google\Cloud\Video\LiveStream\V1\Channel\Output $var @@ -512,8 +558,10 @@ public function setStreamingState($var) } /** - * Output only. A description of the reason for the streaming error. This property is - * always present when [streaming_state][google.cloud.video.livestream.v1.Channel.streaming_state] is + * Output only. A description of the reason for the streaming error. This + * property is always present when + * [streaming_state][google.cloud.video.livestream.v1.Channel.streaming_state] + * is * [STREAMING_ERROR][google.cloud.video.livestream.v1.Channel.StreamingState.STREAMING_ERROR]. * * Generated from protobuf field .google.rpc.Status streaming_error = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -535,8 +583,10 @@ public function clearStreamingError() } /** - * Output only. A description of the reason for the streaming error. This property is - * always present when [streaming_state][google.cloud.video.livestream.v1.Channel.streaming_state] is + * Output only. A description of the reason for the streaming error. This + * property is always present when + * [streaming_state][google.cloud.video.livestream.v1.Channel.streaming_state] + * is * [STREAMING_ERROR][google.cloud.video.livestream.v1.Channel.StreamingState.STREAMING_ERROR]. * * Generated from protobuf field .google.rpc.Status streaming_error = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -587,5 +637,109 @@ public function setLogConfig($var) return $this; } + /** + * Configuration of timecode for this channel. + * + * Generated from protobuf field .google.cloud.video.livestream.v1.TimecodeConfig timecode_config = 21; + * @return \Google\Cloud\Video\LiveStream\V1\TimecodeConfig|null + */ + public function getTimecodeConfig() + { + return $this->timecode_config; + } + + public function hasTimecodeConfig() + { + return isset($this->timecode_config); + } + + public function clearTimecodeConfig() + { + unset($this->timecode_config); + } + + /** + * Configuration of timecode for this channel. + * + * Generated from protobuf field .google.cloud.video.livestream.v1.TimecodeConfig timecode_config = 21; + * @param \Google\Cloud\Video\LiveStream\V1\TimecodeConfig $var + * @return $this + */ + public function setTimecodeConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Video\LiveStream\V1\TimecodeConfig::class); + $this->timecode_config = $var; + + return $this; + } + + /** + * Encryption configurations for this channel. Each configuration has an ID + * which is referred to by each MuxStream to indicate which configuration is + * used for that output. + * + * Generated from protobuf field repeated .google.cloud.video.livestream.v1.Encryption encryptions = 24; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEncryptions() + { + return $this->encryptions; + } + + /** + * Encryption configurations for this channel. Each configuration has an ID + * which is referred to by each MuxStream to indicate which configuration is + * used for that output. + * + * Generated from protobuf field repeated .google.cloud.video.livestream.v1.Encryption encryptions = 24; + * @param array<\Google\Cloud\Video\LiveStream\V1\Encryption>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEncryptions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Video\LiveStream\V1\Encryption::class); + $this->encryptions = $arr; + + return $this; + } + + /** + * The configuration for input sources defined in + * [input_attachments][google.cloud.video.livestream.v1.Channel.input_attachments]. + * + * Generated from protobuf field .google.cloud.video.livestream.v1.InputConfig input_config = 25; + * @return \Google\Cloud\Video\LiveStream\V1\InputConfig|null + */ + public function getInputConfig() + { + return $this->input_config; + } + + public function hasInputConfig() + { + return isset($this->input_config); + } + + public function clearInputConfig() + { + unset($this->input_config); + } + + /** + * The configuration for input sources defined in + * [input_attachments][google.cloud.video.livestream.v1.Channel.input_attachments]. + * + * Generated from protobuf field .google.cloud.video.livestream.v1.InputConfig input_config = 25; + * @param \Google\Cloud\Video\LiveStream\V1\InputConfig $var + * @return $this + */ + public function setInputConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Video\LiveStream\V1\InputConfig::class); + $this->input_config = $var; + + return $this; + } + } diff --git a/VideoLiveStream/src/V1/Encryption.php b/VideoLiveStream/src/V1/Encryption.php new file mode 100644 index 00000000000..6f607eafdc8 --- /dev/null +++ b/VideoLiveStream/src/V1/Encryption.php @@ -0,0 +1,261 @@ +google.cloud.video.livestream.v1.Encryption + */ +class Encryption extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Identifier for this set of encryption options. + * + * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $id = ''; + /** + * Required. Configuration for DRM systems. + * + * Generated from protobuf field .google.cloud.video.livestream.v1.Encryption.DrmSystems drm_systems = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + private $drm_systems = null; + protected $secret_source; + protected $encryption_mode; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $id + * Required. Identifier for this set of encryption options. + * @type \Google\Cloud\Video\LiveStream\V1\Encryption\SecretManagerSource $secret_manager_key_source + * For keys stored in Google Secret Manager. + * @type \Google\Cloud\Video\LiveStream\V1\Encryption\DrmSystems $drm_systems + * Required. Configuration for DRM systems. + * @type \Google\Cloud\Video\LiveStream\V1\Encryption\Aes128Encryption $aes128 + * Configuration for HLS AES-128 encryption. + * @type \Google\Cloud\Video\LiveStream\V1\Encryption\SampleAesEncryption $sample_aes + * Configuration for HLS SAMPLE-AES encryption. + * @type \Google\Cloud\Video\LiveStream\V1\Encryption\MpegCommonEncryption $mpeg_cenc + * Configuration for MPEG-Dash Common Encryption (MPEG-CENC). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Video\Livestream\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Required. Identifier for this set of encryption options. + * + * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * Required. Identifier for this set of encryption options. + * + * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkString($var, True); + $this->id = $var; + + return $this; + } + + /** + * For keys stored in Google Secret Manager. + * + * Generated from protobuf field .google.cloud.video.livestream.v1.Encryption.SecretManagerSource secret_manager_key_source = 7; + * @return \Google\Cloud\Video\LiveStream\V1\Encryption\SecretManagerSource|null + */ + public function getSecretManagerKeySource() + { + return $this->readOneof(7); + } + + public function hasSecretManagerKeySource() + { + return $this->hasOneof(7); + } + + /** + * For keys stored in Google Secret Manager. + * + * Generated from protobuf field .google.cloud.video.livestream.v1.Encryption.SecretManagerSource secret_manager_key_source = 7; + * @param \Google\Cloud\Video\LiveStream\V1\Encryption\SecretManagerSource $var + * @return $this + */ + public function setSecretManagerKeySource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Video\LiveStream\V1\Encryption\SecretManagerSource::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * Required. Configuration for DRM systems. + * + * Generated from protobuf field .google.cloud.video.livestream.v1.Encryption.DrmSystems drm_systems = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Video\LiveStream\V1\Encryption\DrmSystems|null + */ + public function getDrmSystems() + { + return $this->drm_systems; + } + + public function hasDrmSystems() + { + return isset($this->drm_systems); + } + + public function clearDrmSystems() + { + unset($this->drm_systems); + } + + /** + * Required. Configuration for DRM systems. + * + * Generated from protobuf field .google.cloud.video.livestream.v1.Encryption.DrmSystems drm_systems = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Video\LiveStream\V1\Encryption\DrmSystems $var + * @return $this + */ + public function setDrmSystems($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Video\LiveStream\V1\Encryption\DrmSystems::class); + $this->drm_systems = $var; + + return $this; + } + + /** + * Configuration for HLS AES-128 encryption. + * + * Generated from protobuf field .google.cloud.video.livestream.v1.Encryption.Aes128Encryption aes128 = 4; + * @return \Google\Cloud\Video\LiveStream\V1\Encryption\Aes128Encryption|null + */ + public function getAes128() + { + return $this->readOneof(4); + } + + public function hasAes128() + { + return $this->hasOneof(4); + } + + /** + * Configuration for HLS AES-128 encryption. + * + * Generated from protobuf field .google.cloud.video.livestream.v1.Encryption.Aes128Encryption aes128 = 4; + * @param \Google\Cloud\Video\LiveStream\V1\Encryption\Aes128Encryption $var + * @return $this + */ + public function setAes128($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Video\LiveStream\V1\Encryption\Aes128Encryption::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Configuration for HLS SAMPLE-AES encryption. + * + * Generated from protobuf field .google.cloud.video.livestream.v1.Encryption.SampleAesEncryption sample_aes = 5; + * @return \Google\Cloud\Video\LiveStream\V1\Encryption\SampleAesEncryption|null + */ + public function getSampleAes() + { + return $this->readOneof(5); + } + + public function hasSampleAes() + { + return $this->hasOneof(5); + } + + /** + * Configuration for HLS SAMPLE-AES encryption. + * + * Generated from protobuf field .google.cloud.video.livestream.v1.Encryption.SampleAesEncryption sample_aes = 5; + * @param \Google\Cloud\Video\LiveStream\V1\Encryption\SampleAesEncryption $var + * @return $this + */ + public function setSampleAes($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Video\LiveStream\V1\Encryption\SampleAesEncryption::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Configuration for MPEG-Dash Common Encryption (MPEG-CENC). + * + * Generated from protobuf field .google.cloud.video.livestream.v1.Encryption.MpegCommonEncryption mpeg_cenc = 6; + * @return \Google\Cloud\Video\LiveStream\V1\Encryption\MpegCommonEncryption|null + */ + public function getMpegCenc() + { + return $this->readOneof(6); + } + + public function hasMpegCenc() + { + return $this->hasOneof(6); + } + + /** + * Configuration for MPEG-Dash Common Encryption (MPEG-CENC). + * + * Generated from protobuf field .google.cloud.video.livestream.v1.Encryption.MpegCommonEncryption mpeg_cenc = 6; + * @param \Google\Cloud\Video\LiveStream\V1\Encryption\MpegCommonEncryption $var + * @return $this + */ + public function setMpegCenc($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Video\LiveStream\V1\Encryption\MpegCommonEncryption::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * @return string + */ + public function getSecretSource() + { + return $this->whichOneof("secret_source"); + } + + /** + * @return string + */ + public function getEncryptionMode() + { + return $this->whichOneof("encryption_mode"); + } + +} + diff --git a/VideoLiveStream/src/V1/Encryption/Aes128Encryption.php b/VideoLiveStream/src/V1/Encryption/Aes128Encryption.php new file mode 100644 index 00000000000..6e0a9052a46 --- /dev/null +++ b/VideoLiveStream/src/V1/Encryption/Aes128Encryption.php @@ -0,0 +1,34 @@ +google.cloud.video.livestream.v1.Encryption.Aes128Encryption + */ +class Aes128Encryption extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Video\Livestream\V1\Resources::initOnce(); + parent::__construct($data); + } + +} + + diff --git a/VideoLiveStream/src/V1/Encryption/Clearkey.php b/VideoLiveStream/src/V1/Encryption/Clearkey.php new file mode 100644 index 00000000000..629ce8a66d1 --- /dev/null +++ b/VideoLiveStream/src/V1/Encryption/Clearkey.php @@ -0,0 +1,34 @@ +google.cloud.video.livestream.v1.Encryption.Clearkey + */ +class Clearkey extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Video\Livestream\V1\Resources::initOnce(); + parent::__construct($data); + } + +} + + diff --git a/VideoLiveStream/src/V1/Encryption/DrmSystems.php b/VideoLiveStream/src/V1/Encryption/DrmSystems.php new file mode 100644 index 00000000000..9b999c2305a --- /dev/null +++ b/VideoLiveStream/src/V1/Encryption/DrmSystems.php @@ -0,0 +1,211 @@ +google.cloud.video.livestream.v1.Encryption.DrmSystems + */ +class DrmSystems extends \Google\Protobuf\Internal\Message +{ + /** + * Widevine configuration. + * + * Generated from protobuf field .google.cloud.video.livestream.v1.Encryption.Widevine widevine = 1; + */ + private $widevine = null; + /** + * Fairplay configuration. + * + * Generated from protobuf field .google.cloud.video.livestream.v1.Encryption.Fairplay fairplay = 2; + */ + private $fairplay = null; + /** + * Playready configuration. + * + * Generated from protobuf field .google.cloud.video.livestream.v1.Encryption.Playready playready = 3; + */ + private $playready = null; + /** + * Clearkey configuration. + * + * Generated from protobuf field .google.cloud.video.livestream.v1.Encryption.Clearkey clearkey = 4; + */ + private $clearkey = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Video\LiveStream\V1\Encryption\Widevine $widevine + * Widevine configuration. + * @type \Google\Cloud\Video\LiveStream\V1\Encryption\Fairplay $fairplay + * Fairplay configuration. + * @type \Google\Cloud\Video\LiveStream\V1\Encryption\Playready $playready + * Playready configuration. + * @type \Google\Cloud\Video\LiveStream\V1\Encryption\Clearkey $clearkey + * Clearkey configuration. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Video\Livestream\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Widevine configuration. + * + * Generated from protobuf field .google.cloud.video.livestream.v1.Encryption.Widevine widevine = 1; + * @return \Google\Cloud\Video\LiveStream\V1\Encryption\Widevine|null + */ + public function getWidevine() + { + return $this->widevine; + } + + public function hasWidevine() + { + return isset($this->widevine); + } + + public function clearWidevine() + { + unset($this->widevine); + } + + /** + * Widevine configuration. + * + * Generated from protobuf field .google.cloud.video.livestream.v1.Encryption.Widevine widevine = 1; + * @param \Google\Cloud\Video\LiveStream\V1\Encryption\Widevine $var + * @return $this + */ + public function setWidevine($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Video\LiveStream\V1\Encryption\Widevine::class); + $this->widevine = $var; + + return $this; + } + + /** + * Fairplay configuration. + * + * Generated from protobuf field .google.cloud.video.livestream.v1.Encryption.Fairplay fairplay = 2; + * @return \Google\Cloud\Video\LiveStream\V1\Encryption\Fairplay|null + */ + public function getFairplay() + { + return $this->fairplay; + } + + public function hasFairplay() + { + return isset($this->fairplay); + } + + public function clearFairplay() + { + unset($this->fairplay); + } + + /** + * Fairplay configuration. + * + * Generated from protobuf field .google.cloud.video.livestream.v1.Encryption.Fairplay fairplay = 2; + * @param \Google\Cloud\Video\LiveStream\V1\Encryption\Fairplay $var + * @return $this + */ + public function setFairplay($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Video\LiveStream\V1\Encryption\Fairplay::class); + $this->fairplay = $var; + + return $this; + } + + /** + * Playready configuration. + * + * Generated from protobuf field .google.cloud.video.livestream.v1.Encryption.Playready playready = 3; + * @return \Google\Cloud\Video\LiveStream\V1\Encryption\Playready|null + */ + public function getPlayready() + { + return $this->playready; + } + + public function hasPlayready() + { + return isset($this->playready); + } + + public function clearPlayready() + { + unset($this->playready); + } + + /** + * Playready configuration. + * + * Generated from protobuf field .google.cloud.video.livestream.v1.Encryption.Playready playready = 3; + * @param \Google\Cloud\Video\LiveStream\V1\Encryption\Playready $var + * @return $this + */ + public function setPlayready($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Video\LiveStream\V1\Encryption\Playready::class); + $this->playready = $var; + + return $this; + } + + /** + * Clearkey configuration. + * + * Generated from protobuf field .google.cloud.video.livestream.v1.Encryption.Clearkey clearkey = 4; + * @return \Google\Cloud\Video\LiveStream\V1\Encryption\Clearkey|null + */ + public function getClearkey() + { + return $this->clearkey; + } + + public function hasClearkey() + { + return isset($this->clearkey); + } + + public function clearClearkey() + { + unset($this->clearkey); + } + + /** + * Clearkey configuration. + * + * Generated from protobuf field .google.cloud.video.livestream.v1.Encryption.Clearkey clearkey = 4; + * @param \Google\Cloud\Video\LiveStream\V1\Encryption\Clearkey $var + * @return $this + */ + public function setClearkey($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Video\LiveStream\V1\Encryption\Clearkey::class); + $this->clearkey = $var; + + return $this; + } + +} + + diff --git a/VideoLiveStream/src/V1/Encryption/Fairplay.php b/VideoLiveStream/src/V1/Encryption/Fairplay.php new file mode 100644 index 00000000000..53d722795d8 --- /dev/null +++ b/VideoLiveStream/src/V1/Encryption/Fairplay.php @@ -0,0 +1,34 @@ +google.cloud.video.livestream.v1.Encryption.Fairplay + */ +class Fairplay extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Video\Livestream\V1\Resources::initOnce(); + parent::__construct($data); + } + +} + + diff --git a/VideoLiveStream/src/V1/Encryption/MpegCommonEncryption.php b/VideoLiveStream/src/V1/Encryption/MpegCommonEncryption.php new file mode 100644 index 00000000000..d807c925918 --- /dev/null +++ b/VideoLiveStream/src/V1/Encryption/MpegCommonEncryption.php @@ -0,0 +1,76 @@ +google.cloud.video.livestream.v1.Encryption.MpegCommonEncryption + */ +class MpegCommonEncryption extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Specify the encryption scheme, supported schemes: + * - `cenc` - AES-CTR subsample + * - `cbcs`- AES-CBC subsample pattern + * + * Generated from protobuf field string scheme = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $scheme = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $scheme + * Required. Specify the encryption scheme, supported schemes: + * - `cenc` - AES-CTR subsample + * - `cbcs`- AES-CBC subsample pattern + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Video\Livestream\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Required. Specify the encryption scheme, supported schemes: + * - `cenc` - AES-CTR subsample + * - `cbcs`- AES-CBC subsample pattern + * + * Generated from protobuf field string scheme = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getScheme() + { + return $this->scheme; + } + + /** + * Required. Specify the encryption scheme, supported schemes: + * - `cenc` - AES-CTR subsample + * - `cbcs`- AES-CBC subsample pattern + * + * Generated from protobuf field string scheme = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setScheme($var) + { + GPBUtil::checkString($var, True); + $this->scheme = $var; + + return $this; + } + +} + + diff --git a/VideoLiveStream/src/V1/Encryption/Playready.php b/VideoLiveStream/src/V1/Encryption/Playready.php new file mode 100644 index 00000000000..34e499e630d --- /dev/null +++ b/VideoLiveStream/src/V1/Encryption/Playready.php @@ -0,0 +1,34 @@ +google.cloud.video.livestream.v1.Encryption.Playready + */ +class Playready extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Video\Livestream\V1\Resources::initOnce(); + parent::__construct($data); + } + +} + + diff --git a/VideoLiveStream/src/V1/Encryption/SampleAesEncryption.php b/VideoLiveStream/src/V1/Encryption/SampleAesEncryption.php new file mode 100644 index 00000000000..09658a70c0f --- /dev/null +++ b/VideoLiveStream/src/V1/Encryption/SampleAesEncryption.php @@ -0,0 +1,34 @@ +google.cloud.video.livestream.v1.Encryption.SampleAesEncryption + */ +class SampleAesEncryption extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Video\Livestream\V1\Resources::initOnce(); + parent::__construct($data); + } + +} + + diff --git a/VideoLiveStream/src/V1/Encryption/SecretManagerSource.php b/VideoLiveStream/src/V1/Encryption/SecretManagerSource.php new file mode 100644 index 00000000000..760dad08661 --- /dev/null +++ b/VideoLiveStream/src/V1/Encryption/SecretManagerSource.php @@ -0,0 +1,72 @@ +google.cloud.video.livestream.v1.Encryption.SecretManagerSource + */ +class SecretManagerSource extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the Secret Version containing the encryption key. + * `projects/{project}/secrets/{secret_id}/versions/{version_number}` + * + * Generated from protobuf field string secret_version = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $secret_version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $secret_version + * Required. The name of the Secret Version containing the encryption key. + * `projects/{project}/secrets/{secret_id}/versions/{version_number}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Video\Livestream\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the Secret Version containing the encryption key. + * `projects/{project}/secrets/{secret_id}/versions/{version_number}` + * + * Generated from protobuf field string secret_version = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getSecretVersion() + { + return $this->secret_version; + } + + /** + * Required. The name of the Secret Version containing the encryption key. + * `projects/{project}/secrets/{secret_id}/versions/{version_number}` + * + * Generated from protobuf field string secret_version = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setSecretVersion($var) + { + GPBUtil::checkString($var, True); + $this->secret_version = $var; + + return $this; + } + +} + + diff --git a/VideoLiveStream/src/V1/Encryption/Widevine.php b/VideoLiveStream/src/V1/Encryption/Widevine.php new file mode 100644 index 00000000000..a567eba715b --- /dev/null +++ b/VideoLiveStream/src/V1/Encryption/Widevine.php @@ -0,0 +1,34 @@ +google.cloud.video.livestream.v1.Encryption.Widevine + */ +class Widevine extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Video\Livestream\V1\Resources::initOnce(); + parent::__construct($data); + } + +} + + diff --git a/VideoLiveStream/src/V1/Event.php b/VideoLiveStream/src/V1/Event.php index 1da2cf6a17a..3e5ec1c44be 100644 --- a/VideoLiveStream/src/V1/Event.php +++ b/VideoLiveStream/src/V1/Event.php @@ -43,16 +43,22 @@ class Event extends \Google\Protobuf\Internal\Message private $labels; /** * When this field is set to true, the event will be executed at the earliest - * time that the server can schedule the event and [execution_time][google.cloud.video.livestream.v1.Event.execution_time] will be - * populated with the time that the server actually schedules the event. + * time that the server can schedule the event and + * [execution_time][google.cloud.video.livestream.v1.Event.execution_time] + * will be populated with the time that the server actually schedules the + * event. * * Generated from protobuf field bool execute_now = 9; */ private $execute_now = false; /** - * The time when the event should be executed. When [execute_now][google.cloud.video.livestream.v1.Event.execute_now] is set to - * `true`, this field should not be set in `CreateEvent` request and will be - * populated with the time that the server schedules the event. + * The time to execute the event. If you set + * [execute_now][google.cloud.video.livestream.v1.Event.execute_now] to + * `true`, then do not set this field in the `CreateEvent` request. In + * this case, the server schedules the event and populates this field. If you + * set [execute_now][google.cloud.video.livestream.v1.Event.execute_now] to + * `false`, then you must set this field to at least 10 seconds in the future + * or else the event can't be created. * * Generated from protobuf field .google.protobuf.Timestamp execution_time = 10; */ @@ -87,16 +93,30 @@ class Event extends \Google\Protobuf\Internal\Message * Output only. The update time. * @type array|\Google\Protobuf\Internal\MapField $labels * User-defined key/value metadata. + * @type \Google\Cloud\Video\LiveStream\V1\Event\InputSwitchTask $input_switch + * Required. Switches to another input stream. * @type \Google\Cloud\Video\LiveStream\V1\Event\AdBreakTask $ad_break * Required. Inserts a new ad opportunity. + * @type \Google\Cloud\Video\LiveStream\V1\Event\ReturnToProgramTask $return_to_program + * Required. Stops any running ad break. + * @type \Google\Cloud\Video\LiveStream\V1\Event\MuteTask $mute + * Required. Mutes the stream. + * @type \Google\Cloud\Video\LiveStream\V1\Event\UnmuteTask $unmute + * Required. Unmutes the stream. * @type bool $execute_now * When this field is set to true, the event will be executed at the earliest - * time that the server can schedule the event and [execution_time][google.cloud.video.livestream.v1.Event.execution_time] will be - * populated with the time that the server actually schedules the event. + * time that the server can schedule the event and + * [execution_time][google.cloud.video.livestream.v1.Event.execution_time] + * will be populated with the time that the server actually schedules the + * event. * @type \Google\Protobuf\Timestamp $execution_time - * The time when the event should be executed. When [execute_now][google.cloud.video.livestream.v1.Event.execute_now] is set to - * `true`, this field should not be set in `CreateEvent` request and will be - * populated with the time that the server schedules the event. + * The time to execute the event. If you set + * [execute_now][google.cloud.video.livestream.v1.Event.execute_now] to + * `true`, then do not set this field in the `CreateEvent` request. In + * this case, the server schedules the event and populates this field. If you + * set [execute_now][google.cloud.video.livestream.v1.Event.execute_now] to + * `false`, then you must set this field to at least 10 seconds in the future + * or else the event can't be created. * @type int $state * Output only. The state of the event. * @type \Google\Rpc\Status $error @@ -235,6 +255,37 @@ public function setLabels($var) return $this; } + /** + * Required. Switches to another input stream. + * + * Generated from protobuf field .google.cloud.video.livestream.v1.Event.InputSwitchTask input_switch = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Video\LiveStream\V1\Event\InputSwitchTask|null + */ + public function getInputSwitch() + { + return $this->readOneof(5); + } + + public function hasInputSwitch() + { + return $this->hasOneof(5); + } + + /** + * Required. Switches to another input stream. + * + * Generated from protobuf field .google.cloud.video.livestream.v1.Event.InputSwitchTask input_switch = 5 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Video\LiveStream\V1\Event\InputSwitchTask $var + * @return $this + */ + public function setInputSwitch($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Video\LiveStream\V1\Event\InputSwitchTask::class); + $this->writeOneof(5, $var); + + return $this; + } + /** * Required. Inserts a new ad opportunity. * @@ -266,10 +317,105 @@ public function setAdBreak($var) return $this; } + /** + * Required. Stops any running ad break. + * + * Generated from protobuf field .google.cloud.video.livestream.v1.Event.ReturnToProgramTask return_to_program = 13 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Video\LiveStream\V1\Event\ReturnToProgramTask|null + */ + public function getReturnToProgram() + { + return $this->readOneof(13); + } + + public function hasReturnToProgram() + { + return $this->hasOneof(13); + } + + /** + * Required. Stops any running ad break. + * + * Generated from protobuf field .google.cloud.video.livestream.v1.Event.ReturnToProgramTask return_to_program = 13 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Video\LiveStream\V1\Event\ReturnToProgramTask $var + * @return $this + */ + public function setReturnToProgram($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Video\LiveStream\V1\Event\ReturnToProgramTask::class); + $this->writeOneof(13, $var); + + return $this; + } + + /** + * Required. Mutes the stream. + * + * Generated from protobuf field .google.cloud.video.livestream.v1.Event.MuteTask mute = 15 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Video\LiveStream\V1\Event\MuteTask|null + */ + public function getMute() + { + return $this->readOneof(15); + } + + public function hasMute() + { + return $this->hasOneof(15); + } + + /** + * Required. Mutes the stream. + * + * Generated from protobuf field .google.cloud.video.livestream.v1.Event.MuteTask mute = 15 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Video\LiveStream\V1\Event\MuteTask $var + * @return $this + */ + public function setMute($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Video\LiveStream\V1\Event\MuteTask::class); + $this->writeOneof(15, $var); + + return $this; + } + + /** + * Required. Unmutes the stream. + * + * Generated from protobuf field .google.cloud.video.livestream.v1.Event.UnmuteTask unmute = 16 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Video\LiveStream\V1\Event\UnmuteTask|null + */ + public function getUnmute() + { + return $this->readOneof(16); + } + + public function hasUnmute() + { + return $this->hasOneof(16); + } + + /** + * Required. Unmutes the stream. + * + * Generated from protobuf field .google.cloud.video.livestream.v1.Event.UnmuteTask unmute = 16 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Video\LiveStream\V1\Event\UnmuteTask $var + * @return $this + */ + public function setUnmute($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Video\LiveStream\V1\Event\UnmuteTask::class); + $this->writeOneof(16, $var); + + return $this; + } + /** * When this field is set to true, the event will be executed at the earliest - * time that the server can schedule the event and [execution_time][google.cloud.video.livestream.v1.Event.execution_time] will be - * populated with the time that the server actually schedules the event. + * time that the server can schedule the event and + * [execution_time][google.cloud.video.livestream.v1.Event.execution_time] + * will be populated with the time that the server actually schedules the + * event. * * Generated from protobuf field bool execute_now = 9; * @return bool @@ -281,8 +427,10 @@ public function getExecuteNow() /** * When this field is set to true, the event will be executed at the earliest - * time that the server can schedule the event and [execution_time][google.cloud.video.livestream.v1.Event.execution_time] will be - * populated with the time that the server actually schedules the event. + * time that the server can schedule the event and + * [execution_time][google.cloud.video.livestream.v1.Event.execution_time] + * will be populated with the time that the server actually schedules the + * event. * * Generated from protobuf field bool execute_now = 9; * @param bool $var @@ -297,9 +445,13 @@ public function setExecuteNow($var) } /** - * The time when the event should be executed. When [execute_now][google.cloud.video.livestream.v1.Event.execute_now] is set to - * `true`, this field should not be set in `CreateEvent` request and will be - * populated with the time that the server schedules the event. + * The time to execute the event. If you set + * [execute_now][google.cloud.video.livestream.v1.Event.execute_now] to + * `true`, then do not set this field in the `CreateEvent` request. In + * this case, the server schedules the event and populates this field. If you + * set [execute_now][google.cloud.video.livestream.v1.Event.execute_now] to + * `false`, then you must set this field to at least 10 seconds in the future + * or else the event can't be created. * * Generated from protobuf field .google.protobuf.Timestamp execution_time = 10; * @return \Google\Protobuf\Timestamp|null @@ -320,9 +472,13 @@ public function clearExecutionTime() } /** - * The time when the event should be executed. When [execute_now][google.cloud.video.livestream.v1.Event.execute_now] is set to - * `true`, this field should not be set in `CreateEvent` request and will be - * populated with the time that the server schedules the event. + * The time to execute the event. If you set + * [execute_now][google.cloud.video.livestream.v1.Event.execute_now] to + * `true`, then do not set this field in the `CreateEvent` request. In + * this case, the server schedules the event and populates this field. If you + * set [execute_now][google.cloud.video.livestream.v1.Event.execute_now] to + * `false`, then you must set this field to at least 10 seconds in the future + * or else the event can't be created. * * Generated from protobuf field .google.protobuf.Timestamp execution_time = 10; * @param \Google\Protobuf\Timestamp $var diff --git a/VideoLiveStream/src/V1/Event/InputSwitchTask.php b/VideoLiveStream/src/V1/Event/InputSwitchTask.php new file mode 100644 index 00000000000..435b19de6fe --- /dev/null +++ b/VideoLiveStream/src/V1/Event/InputSwitchTask.php @@ -0,0 +1,76 @@ +google.cloud.video.livestream.v1.Event.InputSwitchTask + */ +class InputSwitchTask extends \Google\Protobuf\Internal\Message +{ + /** + * The + * [InputAttachment.key][google.cloud.video.livestream.v1.InputAttachment.key] + * of the input to switch to. + * + * Generated from protobuf field string input_key = 1; + */ + private $input_key = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $input_key + * The + * [InputAttachment.key][google.cloud.video.livestream.v1.InputAttachment.key] + * of the input to switch to. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Video\Livestream\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * The + * [InputAttachment.key][google.cloud.video.livestream.v1.InputAttachment.key] + * of the input to switch to. + * + * Generated from protobuf field string input_key = 1; + * @return string + */ + public function getInputKey() + { + return $this->input_key; + } + + /** + * The + * [InputAttachment.key][google.cloud.video.livestream.v1.InputAttachment.key] + * of the input to switch to. + * + * Generated from protobuf field string input_key = 1; + * @param string $var + * @return $this + */ + public function setInputKey($var) + { + GPBUtil::checkString($var, True); + $this->input_key = $var; + + return $this; + } + +} + + diff --git a/VideoLiveStream/src/V1/Event/MuteTask.php b/VideoLiveStream/src/V1/Event/MuteTask.php new file mode 100644 index 00000000000..ad0b55f4ca3 --- /dev/null +++ b/VideoLiveStream/src/V1/Event/MuteTask.php @@ -0,0 +1,82 @@ +google.cloud.video.livestream.v1.Event.MuteTask + */ +class MuteTask extends \Google\Protobuf\Internal\Message +{ + /** + * Duration for which the stream should be muted. If omitted, the stream + * will be muted until an UnmuteTask event is sent. + * + * Generated from protobuf field .google.protobuf.Duration duration = 1; + */ + private $duration = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Duration $duration + * Duration for which the stream should be muted. If omitted, the stream + * will be muted until an UnmuteTask event is sent. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Video\Livestream\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Duration for which the stream should be muted. If omitted, the stream + * will be muted until an UnmuteTask event is sent. + * + * Generated from protobuf field .google.protobuf.Duration duration = 1; + * @return \Google\Protobuf\Duration|null + */ + public function getDuration() + { + return $this->duration; + } + + public function hasDuration() + { + return isset($this->duration); + } + + public function clearDuration() + { + unset($this->duration); + } + + /** + * Duration for which the stream should be muted. If omitted, the stream + * will be muted until an UnmuteTask event is sent. + * + * Generated from protobuf field .google.protobuf.Duration duration = 1; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->duration = $var; + + return $this; + } + +} + + diff --git a/VideoLiveStream/src/V1/Event/ReturnToProgramTask.php b/VideoLiveStream/src/V1/Event/ReturnToProgramTask.php new file mode 100644 index 00000000000..c39cff2adac --- /dev/null +++ b/VideoLiveStream/src/V1/Event/ReturnToProgramTask.php @@ -0,0 +1,35 @@ +google.cloud.video.livestream.v1.Event.ReturnToProgramTask + */ +class ReturnToProgramTask extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Video\Livestream\V1\Resources::initOnce(); + parent::__construct($data); + } + +} + + diff --git a/VideoLiveStream/src/V1/Event/UnmuteTask.php b/VideoLiveStream/src/V1/Event/UnmuteTask.php new file mode 100644 index 00000000000..382423288ac --- /dev/null +++ b/VideoLiveStream/src/V1/Event/UnmuteTask.php @@ -0,0 +1,35 @@ +google.cloud.video.livestream.v1.Event.UnmuteTask + */ +class UnmuteTask extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Video\Livestream\V1\Resources::initOnce(); + parent::__construct($data); + } + +} + + diff --git a/VideoLiveStream/src/V1/Gapic/LivestreamServiceGapicClient.php b/VideoLiveStream/src/V1/Gapic/LivestreamServiceGapicClient.php index a12bf637b45..f13531ee949 100644 --- a/VideoLiveStream/src/V1/Gapic/LivestreamServiceGapicClient.php +++ b/VideoLiveStream/src/V1/Gapic/LivestreamServiceGapicClient.php @@ -25,6 +25,7 @@ namespace Google\Cloud\Video\LiveStream\V1\Gapic; use Google\ApiCore\ApiException; +use Google\ApiCore\Call; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; use Google\ApiCore\LongRunning\OperationsClient; @@ -35,6 +36,10 @@ use Google\ApiCore\Transport\TransportInterface; use Google\ApiCore\ValidationException; use Google\Auth\FetchAuthTokenInterface; +use Google\Cloud\Location\GetLocationRequest; +use Google\Cloud\Location\ListLocationsRequest; +use Google\Cloud\Location\ListLocationsResponse; +use Google\Cloud\Location\Location; use Google\Cloud\Video\LiveStream\V1\Channel; use Google\Cloud\Video\LiveStream\V1\CreateChannelRequest; use Google\Cloud\Video\LiveStream\V1\CreateEventRequest; @@ -1646,14 +1651,22 @@ public function stopChannel($name, array $optionalArgs = []) * resource by the update. You can only update the following fields: * * * [`inputAttachments`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#inputattachment) + * * [`inputConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#inputconfig) * * [`output`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#output) - * * [`elementaryStreams`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#ElementaryStream) + * * [`elementaryStreams`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#elementarystream) * * [`muxStreams`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#muxstream) - * * [`manifests`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#Manifest) - * * [`spritesheets`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#spritesheet) + * * [`manifests`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#manifest) + * * [`spriteSheets`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#spritesheet) + * * [`logConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#logconfig) + * * [`timecodeConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#timecodeconfig) + * * [`encryptions`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#encryption) * * The fields specified in the update_mask are relative to the resource, not * the full request. A field will be overwritten if it is in the mask. + * + * If the mask is not present, then each field from the list above is updated + * if the field appears in the request payload. To unset a field, add the + * field to the update mask and remove it from the request payload. * @type string $requestId * A request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore @@ -1758,6 +1771,10 @@ public function updateChannel($channel, array $optionalArgs = []) * * The fields specified in the update_mask are relative to the resource, not * the full request. A field will be overwritten if it is in the mask. + * + * If the mask is not present, then each field from the list above is updated + * if the field appears in the request payload. To unset a field, add the + * field to the update mask and remove it from the request payload. * @type string $requestId * A request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore @@ -1809,4 +1826,144 @@ public function updateInput($input, array $optionalArgs = []) $this->getOperationsClient() )->wait(); } + + /** + * Gets information about a location. + * + * Sample code: + * ``` + * $livestreamServiceClient = new LivestreamServiceClient(); + * try { + * $response = $livestreamServiceClient->getLocation(); + * } finally { + * $livestreamServiceClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * Resource name for the location. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Location\Location + * + * @throws ApiException if the remote call fails + */ + public function getLocation(array $optionalArgs = []) + { + $request = new GetLocationRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->startCall( + 'GetLocation', + Location::class, + $optionalArgs, + $request, + Call::UNARY_CALL, + 'google.cloud.location.Locations' + )->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * Sample code: + * ``` + * $livestreamServiceClient = new LivestreamServiceClient(); + * try { + * // Iterate over pages of elements + * $pagedResponse = $livestreamServiceClient->listLocations(); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $livestreamServiceClient->listLocations(); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $livestreamServiceClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * The resource that owns the locations collection, if applicable. + * @type string $filter + * The standard list filter. + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listLocations(array $optionalArgs = []) + { + $request = new ListLocationsRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->getPagedListResponse( + 'ListLocations', + $optionalArgs, + ListLocationsResponse::class, + $request, + 'google.cloud.location.Locations' + ); + } } diff --git a/VideoLiveStream/src/V1/Input.php b/VideoLiveStream/src/V1/Input.php index ce265d55b47..4c0b5b50425 100644 --- a/VideoLiveStream/src/V1/Input.php +++ b/VideoLiveStream/src/V1/Input.php @@ -58,7 +58,8 @@ class Input extends \Google\Protobuf\Internal\Message private $tier = 0; /** * Output only. URI to push the input stream to. - * Its format depends on the input [type][google.cloud.video.livestream.v1.Input.type], for example: + * Its format depends on the input + * [type][google.cloud.video.livestream.v1.Input.type], for example: * * `RTMP_PUSH`: `rtmp://1.2.3.4/live/{STREAM-ID}` * * `SRT_PUSH`: `srt://1.2.3.4:4201?streamid={STREAM-ID}` * @@ -78,8 +79,8 @@ class Input extends \Google\Protobuf\Internal\Message */ private $security_rules = null; /** - * Output only. The information for the input stream. This field will be present only when - * this input receives the input stream. + * Output only. The information for the input stream. This field will be + * present only when this input receives the input stream. * * Generated from protobuf field .google.cloud.video.livestream.v1.InputStreamProperty input_stream_property = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ @@ -109,7 +110,8 @@ class Input extends \Google\Protobuf\Internal\Message * The default is `HD`. * @type string $uri * Output only. URI to push the input stream to. - * Its format depends on the input [type][google.cloud.video.livestream.v1.Input.type], for example: + * Its format depends on the input + * [type][google.cloud.video.livestream.v1.Input.type], for example: * * `RTMP_PUSH`: `rtmp://1.2.3.4/live/{STREAM-ID}` * * `SRT_PUSH`: `srt://1.2.3.4:4201?streamid={STREAM-ID}` * @type \Google\Cloud\Video\LiveStream\V1\PreprocessingConfig $preprocessing_config @@ -117,8 +119,8 @@ class Input extends \Google\Protobuf\Internal\Message * @type \Google\Cloud\Video\LiveStream\V1\Input\SecurityRule $security_rules * Security rule for access control. * @type \Google\Cloud\Video\LiveStream\V1\InputStreamProperty $input_stream_property - * Output only. The information for the input stream. This field will be present only when - * this input receives the input stream. + * Output only. The information for the input stream. This field will be + * present only when this input receives the input stream. * } */ public function __construct($data = NULL) { @@ -312,7 +314,8 @@ public function setTier($var) /** * Output only. URI to push the input stream to. - * Its format depends on the input [type][google.cloud.video.livestream.v1.Input.type], for example: + * Its format depends on the input + * [type][google.cloud.video.livestream.v1.Input.type], for example: * * `RTMP_PUSH`: `rtmp://1.2.3.4/live/{STREAM-ID}` * * `SRT_PUSH`: `srt://1.2.3.4:4201?streamid={STREAM-ID}` * @@ -326,7 +329,8 @@ public function getUri() /** * Output only. URI to push the input stream to. - * Its format depends on the input [type][google.cloud.video.livestream.v1.Input.type], for example: + * Its format depends on the input + * [type][google.cloud.video.livestream.v1.Input.type], for example: * * `RTMP_PUSH`: `rtmp://1.2.3.4/live/{STREAM-ID}` * * `SRT_PUSH`: `srt://1.2.3.4:4201?streamid={STREAM-ID}` * @@ -415,8 +419,8 @@ public function setSecurityRules($var) } /** - * Output only. The information for the input stream. This field will be present only when - * this input receives the input stream. + * Output only. The information for the input stream. This field will be + * present only when this input receives the input stream. * * Generated from protobuf field .google.cloud.video.livestream.v1.InputStreamProperty input_stream_property = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @return \Google\Cloud\Video\LiveStream\V1\InputStreamProperty|null @@ -437,8 +441,8 @@ public function clearInputStreamProperty() } /** - * Output only. The information for the input stream. This field will be present only when - * this input receives the input stream. + * Output only. The information for the input stream. This field will be + * present only when this input receives the input stream. * * Generated from protobuf field .google.cloud.video.livestream.v1.InputStreamProperty input_stream_property = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @param \Google\Cloud\Video\LiveStream\V1\InputStreamProperty $var diff --git a/VideoLiveStream/src/V1/InputAttachment/AutomaticFailover.php b/VideoLiveStream/src/V1/InputAttachment/AutomaticFailover.php index cac0eeec641..afcda01be85 100644 --- a/VideoLiveStream/src/V1/InputAttachment/AutomaticFailover.php +++ b/VideoLiveStream/src/V1/InputAttachment/AutomaticFailover.php @@ -16,8 +16,10 @@ class AutomaticFailover extends \Google\Protobuf\Internal\Message { /** - * The [InputAttachment.key][google.cloud.video.livestream.v1.InputAttachment.key]s of inputs to failover to when this input is - * disconnected. Currently, only up to one backup input is supported. + * The + * [InputAttachment.key][google.cloud.video.livestream.v1.InputAttachment.key]s + * of inputs to failover to when this input is disconnected. Currently, only + * up to one backup input is supported. * * Generated from protobuf field repeated string input_keys = 1; */ @@ -30,8 +32,10 @@ class AutomaticFailover extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type array|\Google\Protobuf\Internal\RepeatedField $input_keys - * The [InputAttachment.key][google.cloud.video.livestream.v1.InputAttachment.key]s of inputs to failover to when this input is - * disconnected. Currently, only up to one backup input is supported. + * The + * [InputAttachment.key][google.cloud.video.livestream.v1.InputAttachment.key]s + * of inputs to failover to when this input is disconnected. Currently, only + * up to one backup input is supported. * } */ public function __construct($data = NULL) { @@ -40,8 +44,10 @@ public function __construct($data = NULL) { } /** - * The [InputAttachment.key][google.cloud.video.livestream.v1.InputAttachment.key]s of inputs to failover to when this input is - * disconnected. Currently, only up to one backup input is supported. + * The + * [InputAttachment.key][google.cloud.video.livestream.v1.InputAttachment.key]s + * of inputs to failover to when this input is disconnected. Currently, only + * up to one backup input is supported. * * Generated from protobuf field repeated string input_keys = 1; * @return \Google\Protobuf\Internal\RepeatedField @@ -52,8 +58,10 @@ public function getInputKeys() } /** - * The [InputAttachment.key][google.cloud.video.livestream.v1.InputAttachment.key]s of inputs to failover to when this input is - * disconnected. Currently, only up to one backup input is supported. + * The + * [InputAttachment.key][google.cloud.video.livestream.v1.InputAttachment.key]s + * of inputs to failover to when this input is disconnected. Currently, only + * up to one backup input is supported. * * Generated from protobuf field repeated string input_keys = 1; * @param array|\Google\Protobuf\Internal\RepeatedField $var diff --git a/VideoLiveStream/src/V1/InputConfig.php b/VideoLiveStream/src/V1/InputConfig.php new file mode 100644 index 00000000000..195bf13537c --- /dev/null +++ b/VideoLiveStream/src/V1/InputConfig.php @@ -0,0 +1,67 @@ +google.cloud.video.livestream.v1.InputConfig + */ +class InputConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Input switch mode. Default mode is `FAILOVER_PREFER_PRIMARY`. + * + * Generated from protobuf field .google.cloud.video.livestream.v1.InputConfig.InputSwitchMode input_switch_mode = 1; + */ + private $input_switch_mode = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $input_switch_mode + * Input switch mode. Default mode is `FAILOVER_PREFER_PRIMARY`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Video\Livestream\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Input switch mode. Default mode is `FAILOVER_PREFER_PRIMARY`. + * + * Generated from protobuf field .google.cloud.video.livestream.v1.InputConfig.InputSwitchMode input_switch_mode = 1; + * @return int + */ + public function getInputSwitchMode() + { + return $this->input_switch_mode; + } + + /** + * Input switch mode. Default mode is `FAILOVER_PREFER_PRIMARY`. + * + * Generated from protobuf field .google.cloud.video.livestream.v1.InputConfig.InputSwitchMode input_switch_mode = 1; + * @param int $var + * @return $this + */ + public function setInputSwitchMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Video\LiveStream\V1\InputConfig\InputSwitchMode::class); + $this->input_switch_mode = $var; + + return $this; + } + +} + diff --git a/VideoLiveStream/src/V1/InputConfig/InputSwitchMode.php b/VideoLiveStream/src/V1/InputConfig/InputSwitchMode.php new file mode 100644 index 00000000000..85b3ebf77ee --- /dev/null +++ b/VideoLiveStream/src/V1/InputConfig/InputSwitchMode.php @@ -0,0 +1,70 @@ +google.cloud.video.livestream.v1.InputConfig.InputSwitchMode + */ +class InputSwitchMode +{ + /** + * The input switch mode is not specified. + * + * Generated from protobuf enum INPUT_SWITCH_MODE_UNSPECIFIED = 0; + */ + const INPUT_SWITCH_MODE_UNSPECIFIED = 0; + /** + * Automatic failover is enabled. The primary input stream is always + * preferred over its backup input streams configured using the + * [AutomaticFailover][google.cloud.video.livestream.v1.InputAttachment.AutomaticFailover] + * field. + * + * Generated from protobuf enum FAILOVER_PREFER_PRIMARY = 1; + */ + const FAILOVER_PREFER_PRIMARY = 1; + /** + * Automatic failover is disabled. You must use the + * [inputSwitch][google.cloud.video.livestream.v1.Event.input_switch] event + * to switch the active input source for the channel to stream from. When + * this mode is chosen, the + * [AutomaticFailover][google.cloud.video.livestream.v1.InputAttachment.AutomaticFailover] + * field is ignored. + * + * Generated from protobuf enum MANUAL = 3; + */ + const MANUAL = 3; + + private static $valueToName = [ + self::INPUT_SWITCH_MODE_UNSPECIFIED => 'INPUT_SWITCH_MODE_UNSPECIFIED', + self::FAILOVER_PREFER_PRIMARY => 'FAILOVER_PREFER_PRIMARY', + self::MANUAL => 'MANUAL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/VideoLiveStream/src/V1/ListChannelsRequest.php b/VideoLiveStream/src/V1/ListChannelsRequest.php index 3e0aa5ae60c..f8de1adebe9 100644 --- a/VideoLiveStream/src/V1/ListChannelsRequest.php +++ b/VideoLiveStream/src/V1/ListChannelsRequest.php @@ -26,8 +26,8 @@ class ListChannelsRequest extends \Google\Protobuf\Internal\Message * The maximum number of items to return. If unspecified, server * will pick an appropriate default. Server may return fewer items than * requested. A caller should only rely on response's - * [next_page_token][google.cloud.video.livestream.v1.ListChannelsResponse.next_page_token] to - * determine if there are more items left to be queried. + * [next_page_token][google.cloud.video.livestream.v1.ListChannelsResponse.next_page_token] + * to determine if there are more items left to be queried. * * Generated from protobuf field int32 page_size = 2; */ @@ -65,8 +65,8 @@ class ListChannelsRequest extends \Google\Protobuf\Internal\Message * The maximum number of items to return. If unspecified, server * will pick an appropriate default. Server may return fewer items than * requested. A caller should only rely on response's - * [next_page_token][google.cloud.video.livestream.v1.ListChannelsResponse.next_page_token] to - * determine if there are more items left to be queried. + * [next_page_token][google.cloud.video.livestream.v1.ListChannelsResponse.next_page_token] + * to determine if there are more items left to be queried. * @type string $page_token * The next_page_token value returned from a previous List request, if any. * @type string $filter @@ -113,8 +113,8 @@ public function setParent($var) * The maximum number of items to return. If unspecified, server * will pick an appropriate default. Server may return fewer items than * requested. A caller should only rely on response's - * [next_page_token][google.cloud.video.livestream.v1.ListChannelsResponse.next_page_token] to - * determine if there are more items left to be queried. + * [next_page_token][google.cloud.video.livestream.v1.ListChannelsResponse.next_page_token] + * to determine if there are more items left to be queried. * * Generated from protobuf field int32 page_size = 2; * @return int @@ -128,8 +128,8 @@ public function getPageSize() * The maximum number of items to return. If unspecified, server * will pick an appropriate default. Server may return fewer items than * requested. A caller should only rely on response's - * [next_page_token][google.cloud.video.livestream.v1.ListChannelsResponse.next_page_token] to - * determine if there are more items left to be queried. + * [next_page_token][google.cloud.video.livestream.v1.ListChannelsResponse.next_page_token] + * to determine if there are more items left to be queried. * * Generated from protobuf field int32 page_size = 2; * @param int $var diff --git a/VideoLiveStream/src/V1/ListEventsRequest.php b/VideoLiveStream/src/V1/ListEventsRequest.php index 68ca51a41e4..fc63e092433 100644 --- a/VideoLiveStream/src/V1/ListEventsRequest.php +++ b/VideoLiveStream/src/V1/ListEventsRequest.php @@ -26,8 +26,8 @@ class ListEventsRequest extends \Google\Protobuf\Internal\Message * The maximum number of items to return. If unspecified, server * will pick an appropriate default. Server may return fewer items than * requested. A caller should only rely on response's - * [next_page_token][google.cloud.video.livestream.v1.ListEventsResponse.next_page_token] to - * determine if there are more items left to be queried. + * [next_page_token][google.cloud.video.livestream.v1.ListEventsResponse.next_page_token] + * to determine if there are more items left to be queried. * * Generated from protobuf field int32 page_size = 2; */ @@ -65,8 +65,8 @@ class ListEventsRequest extends \Google\Protobuf\Internal\Message * The maximum number of items to return. If unspecified, server * will pick an appropriate default. Server may return fewer items than * requested. A caller should only rely on response's - * [next_page_token][google.cloud.video.livestream.v1.ListEventsResponse.next_page_token] to - * determine if there are more items left to be queried. + * [next_page_token][google.cloud.video.livestream.v1.ListEventsResponse.next_page_token] + * to determine if there are more items left to be queried. * @type string $page_token * The next_page_token value returned from a previous List request, if any. * @type string $filter @@ -113,8 +113,8 @@ public function setParent($var) * The maximum number of items to return. If unspecified, server * will pick an appropriate default. Server may return fewer items than * requested. A caller should only rely on response's - * [next_page_token][google.cloud.video.livestream.v1.ListEventsResponse.next_page_token] to - * determine if there are more items left to be queried. + * [next_page_token][google.cloud.video.livestream.v1.ListEventsResponse.next_page_token] + * to determine if there are more items left to be queried. * * Generated from protobuf field int32 page_size = 2; * @return int @@ -128,8 +128,8 @@ public function getPageSize() * The maximum number of items to return. If unspecified, server * will pick an appropriate default. Server may return fewer items than * requested. A caller should only rely on response's - * [next_page_token][google.cloud.video.livestream.v1.ListEventsResponse.next_page_token] to - * determine if there are more items left to be queried. + * [next_page_token][google.cloud.video.livestream.v1.ListEventsResponse.next_page_token] + * to determine if there are more items left to be queried. * * Generated from protobuf field int32 page_size = 2; * @param int $var diff --git a/VideoLiveStream/src/V1/ListInputsRequest.php b/VideoLiveStream/src/V1/ListInputsRequest.php index af4b334607c..8735e785b54 100644 --- a/VideoLiveStream/src/V1/ListInputsRequest.php +++ b/VideoLiveStream/src/V1/ListInputsRequest.php @@ -26,8 +26,8 @@ class ListInputsRequest extends \Google\Protobuf\Internal\Message * The maximum number of items to return. If unspecified, server * will pick an appropriate default. Server may return fewer items than * requested. A caller should only rely on response's - * [next_page_token][google.cloud.video.livestream.v1.ListInputsResponse.next_page_token] to - * determine if there are more items left to be queried. + * [next_page_token][google.cloud.video.livestream.v1.ListInputsResponse.next_page_token] + * to determine if there are more items left to be queried. * * Generated from protobuf field int32 page_size = 2; */ @@ -65,8 +65,8 @@ class ListInputsRequest extends \Google\Protobuf\Internal\Message * The maximum number of items to return. If unspecified, server * will pick an appropriate default. Server may return fewer items than * requested. A caller should only rely on response's - * [next_page_token][google.cloud.video.livestream.v1.ListInputsResponse.next_page_token] to - * determine if there are more items left to be queried. + * [next_page_token][google.cloud.video.livestream.v1.ListInputsResponse.next_page_token] + * to determine if there are more items left to be queried. * @type string $page_token * The next_page_token value returned from a previous List request, if any. * @type string $filter @@ -113,8 +113,8 @@ public function setParent($var) * The maximum number of items to return. If unspecified, server * will pick an appropriate default. Server may return fewer items than * requested. A caller should only rely on response's - * [next_page_token][google.cloud.video.livestream.v1.ListInputsResponse.next_page_token] to - * determine if there are more items left to be queried. + * [next_page_token][google.cloud.video.livestream.v1.ListInputsResponse.next_page_token] + * to determine if there are more items left to be queried. * * Generated from protobuf field int32 page_size = 2; * @return int @@ -128,8 +128,8 @@ public function getPageSize() * The maximum number of items to return. If unspecified, server * will pick an appropriate default. Server may return fewer items than * requested. A caller should only rely on response's - * [next_page_token][google.cloud.video.livestream.v1.ListInputsResponse.next_page_token] to - * determine if there are more items left to be queried. + * [next_page_token][google.cloud.video.livestream.v1.ListInputsResponse.next_page_token] + * to determine if there are more items left to be queried. * * Generated from protobuf field int32 page_size = 2; * @param int $var diff --git a/VideoLiveStream/src/V1/Manifest.php b/VideoLiveStream/src/V1/Manifest.php index cd4fd399de8..d6ac8069e49 100644 --- a/VideoLiveStream/src/V1/Manifest.php +++ b/VideoLiveStream/src/V1/Manifest.php @@ -17,7 +17,8 @@ class Manifest extends \Google\Protobuf\Internal\Message { /** * The name of the generated file. The default is `manifest` with the - * extension suffix corresponding to the `Manifest` [type][google.cloud.video.livestream.v1.Manifest.type]. If multiple + * extension suffix corresponding to the `Manifest` + * [type][google.cloud.video.livestream.v1.Manifest.type]. If multiple * manifests are added to the channel, each must have a unique file name. * * Generated from protobuf field string file_name = 1; @@ -30,8 +31,9 @@ class Manifest extends \Google\Protobuf\Internal\Message */ private $type = 0; /** - * Required. List of `MuxStream` [key][google.cloud.video.livestream.v1.MuxStream.key]s that should appear in this - * manifest. + * Required. List of `MuxStream` + * [key][google.cloud.video.livestream.v1.MuxStream.key]s that should appear + * in this manifest. * - For HLS, either `fmp4` or `ts` mux streams can be specified but not * mixed. * - For DASH, only `fmp4` mux streams can be specified. @@ -59,6 +61,16 @@ class Manifest extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.protobuf.Duration segment_keep_duration = 5; */ private $segment_keep_duration = null; + /** + * Whether to use the timecode, as specified in timecode config, when setting: + * - `availabilityStartTime` attribute in DASH manifests. + * - `#EXT-X-PROGRAM-DATE-TIME` tag in HLS manifests. + * If false, ignore the input timecode and use the time from system clock + * when the manifest is first generated. This is the default behavior. + * + * Generated from protobuf field bool use_timecode_as_timeline = 6; + */ + private $use_timecode_as_timeline = false; /** * Constructor. @@ -68,13 +80,15 @@ class Manifest extends \Google\Protobuf\Internal\Message * * @type string $file_name * The name of the generated file. The default is `manifest` with the - * extension suffix corresponding to the `Manifest` [type][google.cloud.video.livestream.v1.Manifest.type]. If multiple + * extension suffix corresponding to the `Manifest` + * [type][google.cloud.video.livestream.v1.Manifest.type]. If multiple * manifests are added to the channel, each must have a unique file name. * @type int $type * Required. Type of the manifest, can be `HLS` or `DASH`. * @type array|\Google\Protobuf\Internal\RepeatedField $mux_streams - * Required. List of `MuxStream` [key][google.cloud.video.livestream.v1.MuxStream.key]s that should appear in this - * manifest. + * Required. List of `MuxStream` + * [key][google.cloud.video.livestream.v1.MuxStream.key]s that should appear + * in this manifest. * - For HLS, either `fmp4` or `ts` mux streams can be specified but not * mixed. * - For DASH, only `fmp4` mux streams can be specified. @@ -90,6 +104,12 @@ class Manifest extends \Google\Protobuf\Internal\Message * errors while accessing segments which are listed in the manifest that the * player has, but were already deleted from the output Google Cloud Storage * bucket. Default value is `60s`. + * @type bool $use_timecode_as_timeline + * Whether to use the timecode, as specified in timecode config, when setting: + * - `availabilityStartTime` attribute in DASH manifests. + * - `#EXT-X-PROGRAM-DATE-TIME` tag in HLS manifests. + * If false, ignore the input timecode and use the time from system clock + * when the manifest is first generated. This is the default behavior. * } */ public function __construct($data = NULL) { @@ -99,7 +119,8 @@ public function __construct($data = NULL) { /** * The name of the generated file. The default is `manifest` with the - * extension suffix corresponding to the `Manifest` [type][google.cloud.video.livestream.v1.Manifest.type]. If multiple + * extension suffix corresponding to the `Manifest` + * [type][google.cloud.video.livestream.v1.Manifest.type]. If multiple * manifests are added to the channel, each must have a unique file name. * * Generated from protobuf field string file_name = 1; @@ -112,7 +133,8 @@ public function getFileName() /** * The name of the generated file. The default is `manifest` with the - * extension suffix corresponding to the `Manifest` [type][google.cloud.video.livestream.v1.Manifest.type]. If multiple + * extension suffix corresponding to the `Manifest` + * [type][google.cloud.video.livestream.v1.Manifest.type]. If multiple * manifests are added to the channel, each must have a unique file name. * * Generated from protobuf field string file_name = 1; @@ -154,8 +176,9 @@ public function setType($var) } /** - * Required. List of `MuxStream` [key][google.cloud.video.livestream.v1.MuxStream.key]s that should appear in this - * manifest. + * Required. List of `MuxStream` + * [key][google.cloud.video.livestream.v1.MuxStream.key]s that should appear + * in this manifest. * - For HLS, either `fmp4` or `ts` mux streams can be specified but not * mixed. * - For DASH, only `fmp4` mux streams can be specified. @@ -169,8 +192,9 @@ public function getMuxStreams() } /** - * Required. List of `MuxStream` [key][google.cloud.video.livestream.v1.MuxStream.key]s that should appear in this - * manifest. + * Required. List of `MuxStream` + * [key][google.cloud.video.livestream.v1.MuxStream.key]s that should appear + * in this manifest. * - For HLS, either `fmp4` or `ts` mux streams can be specified but not * mixed. * - For DASH, only `fmp4` mux streams can be specified. @@ -265,5 +289,39 @@ public function setSegmentKeepDuration($var) return $this; } + /** + * Whether to use the timecode, as specified in timecode config, when setting: + * - `availabilityStartTime` attribute in DASH manifests. + * - `#EXT-X-PROGRAM-DATE-TIME` tag in HLS manifests. + * If false, ignore the input timecode and use the time from system clock + * when the manifest is first generated. This is the default behavior. + * + * Generated from protobuf field bool use_timecode_as_timeline = 6; + * @return bool + */ + public function getUseTimecodeAsTimeline() + { + return $this->use_timecode_as_timeline; + } + + /** + * Whether to use the timecode, as specified in timecode config, when setting: + * - `availabilityStartTime` attribute in DASH manifests. + * - `#EXT-X-PROGRAM-DATE-TIME` tag in HLS manifests. + * If false, ignore the input timecode and use the time from system clock + * when the manifest is first generated. This is the default behavior. + * + * Generated from protobuf field bool use_timecode_as_timeline = 6; + * @param bool $var + * @return $this + */ + public function setUseTimecodeAsTimeline($var) + { + GPBUtil::checkBool($var); + $this->use_timecode_as_timeline = $var; + + return $this; + } + } diff --git a/VideoLiveStream/src/V1/MuxStream.php b/VideoLiveStream/src/V1/MuxStream.php index 640deafc722..521b7a70259 100644 --- a/VideoLiveStream/src/V1/MuxStream.php +++ b/VideoLiveStream/src/V1/MuxStream.php @@ -31,8 +31,9 @@ class MuxStream extends \Google\Protobuf\Internal\Message */ private $container = ''; /** - * List of `ElementaryStream` [key][google.cloud.video.livestream.v1.ElementaryStream.key]s multiplexed in this - * stream. + * List of `ElementaryStream` + * [key][google.cloud.video.livestream.v1.ElementaryStream.key]s multiplexed + * in this stream. * - For `fmp4` container, must contain either one video or one audio stream. * - For `ts` container, must contain exactly one audio stream and up to one * video stream. @@ -46,6 +47,13 @@ class MuxStream extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.video.livestream.v1.SegmentSettings segment_settings = 5; */ private $segment_settings = null; + /** + * Identifier of the encryption configuration to use. If omitted, output + * will be unencrypted. + * + * Generated from protobuf field string encryption_id = 6; + */ + private $encryption_id = ''; /** * Constructor. @@ -61,13 +69,17 @@ class MuxStream extends \Google\Protobuf\Internal\Message * - `fmp4` - the corresponding file extension is `.m4s` * - `ts` - the corresponding file extension is `.ts` * @type array|\Google\Protobuf\Internal\RepeatedField $elementary_streams - * List of `ElementaryStream` [key][google.cloud.video.livestream.v1.ElementaryStream.key]s multiplexed in this - * stream. + * List of `ElementaryStream` + * [key][google.cloud.video.livestream.v1.ElementaryStream.key]s multiplexed + * in this stream. * - For `fmp4` container, must contain either one video or one audio stream. * - For `ts` container, must contain exactly one audio stream and up to one * video stream. * @type \Google\Cloud\Video\LiveStream\V1\SegmentSettings $segment_settings * Segment settings for `fmp4` and `ts`. + * @type string $encryption_id + * Identifier of the encryption configuration to use. If omitted, output + * will be unencrypted. * } */ public function __construct($data = NULL) { @@ -134,8 +146,9 @@ public function setContainer($var) } /** - * List of `ElementaryStream` [key][google.cloud.video.livestream.v1.ElementaryStream.key]s multiplexed in this - * stream. + * List of `ElementaryStream` + * [key][google.cloud.video.livestream.v1.ElementaryStream.key]s multiplexed + * in this stream. * - For `fmp4` container, must contain either one video or one audio stream. * - For `ts` container, must contain exactly one audio stream and up to one * video stream. @@ -149,8 +162,9 @@ public function getElementaryStreams() } /** - * List of `ElementaryStream` [key][google.cloud.video.livestream.v1.ElementaryStream.key]s multiplexed in this - * stream. + * List of `ElementaryStream` + * [key][google.cloud.video.livestream.v1.ElementaryStream.key]s multiplexed + * in this stream. * - For `fmp4` container, must contain either one video or one audio stream. * - For `ts` container, must contain exactly one audio stream and up to one * video stream. @@ -203,5 +217,33 @@ public function setSegmentSettings($var) return $this; } + /** + * Identifier of the encryption configuration to use. If omitted, output + * will be unencrypted. + * + * Generated from protobuf field string encryption_id = 6; + * @return string + */ + public function getEncryptionId() + { + return $this->encryption_id; + } + + /** + * Identifier of the encryption configuration to use. If omitted, output + * will be unencrypted. + * + * Generated from protobuf field string encryption_id = 6; + * @param string $var + * @return $this + */ + public function setEncryptionId($var) + { + GPBUtil::checkString($var, True); + $this->encryption_id = $var; + + return $this; + } + } diff --git a/VideoLiveStream/src/V1/PreprocessingConfig.php b/VideoLiveStream/src/V1/PreprocessingConfig.php index cfe0978cb3c..e9855b5b02e 100644 --- a/VideoLiveStream/src/V1/PreprocessingConfig.php +++ b/VideoLiveStream/src/V1/PreprocessingConfig.php @@ -15,6 +15,12 @@ */ class PreprocessingConfig extends \Google\Protobuf\Internal\Message { + /** + * Audio preprocessing configuration. + * + * Generated from protobuf field .google.cloud.video.livestream.v1.PreprocessingConfig.Audio audio = 1; + */ + private $audio = null; /** * Specify the video cropping configuration. * @@ -34,6 +40,8 @@ class PreprocessingConfig extends \Google\Protobuf\Internal\Message * @param array $data { * Optional. Data for populating the Message object. * + * @type \Google\Cloud\Video\LiveStream\V1\PreprocessingConfig\Audio $audio + * Audio preprocessing configuration. * @type \Google\Cloud\Video\LiveStream\V1\PreprocessingConfig\Crop $crop * Specify the video cropping configuration. * @type \Google\Cloud\Video\LiveStream\V1\PreprocessingConfig\Pad $pad @@ -45,6 +53,42 @@ public function __construct($data = NULL) { parent::__construct($data); } + /** + * Audio preprocessing configuration. + * + * Generated from protobuf field .google.cloud.video.livestream.v1.PreprocessingConfig.Audio audio = 1; + * @return \Google\Cloud\Video\LiveStream\V1\PreprocessingConfig\Audio|null + */ + public function getAudio() + { + return $this->audio; + } + + public function hasAudio() + { + return isset($this->audio); + } + + public function clearAudio() + { + unset($this->audio); + } + + /** + * Audio preprocessing configuration. + * + * Generated from protobuf field .google.cloud.video.livestream.v1.PreprocessingConfig.Audio audio = 1; + * @param \Google\Cloud\Video\LiveStream\V1\PreprocessingConfig\Audio $var + * @return $this + */ + public function setAudio($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Video\LiveStream\V1\PreprocessingConfig\Audio::class); + $this->audio = $var; + + return $this; + } + /** * Specify the video cropping configuration. * diff --git a/VideoLiveStream/src/V1/PreprocessingConfig/Audio.php b/VideoLiveStream/src/V1/PreprocessingConfig/Audio.php new file mode 100644 index 00000000000..16553fb75b1 --- /dev/null +++ b/VideoLiveStream/src/V1/PreprocessingConfig/Audio.php @@ -0,0 +1,104 @@ +google.cloud.video.livestream.v1.PreprocessingConfig.Audio + */ +class Audio extends \Google\Protobuf\Internal\Message +{ + /** + * Specify audio loudness normalization in loudness units relative to full + * scale (LUFS). Enter a value between -24 and 0 according to the following: + * - -24 is the Advanced Television Systems Committee (ATSC A/85) + * - -23 is the EU R128 broadcast standard + * - -19 is the prior standard for online mono audio + * - -18 is the ReplayGain standard + * - -16 is the prior standard for stereo audio + * - -14 is the new online audio standard recommended by Spotify, as well as + * Amazon Echo + * - 0 disables normalization. The default is 0. + * + * Generated from protobuf field double lufs = 1; + */ + private $lufs = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $lufs + * Specify audio loudness normalization in loudness units relative to full + * scale (LUFS). Enter a value between -24 and 0 according to the following: + * - -24 is the Advanced Television Systems Committee (ATSC A/85) + * - -23 is the EU R128 broadcast standard + * - -19 is the prior standard for online mono audio + * - -18 is the ReplayGain standard + * - -16 is the prior standard for stereo audio + * - -14 is the new online audio standard recommended by Spotify, as well as + * Amazon Echo + * - 0 disables normalization. The default is 0. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Video\Livestream\V1\Outputs::initOnce(); + parent::__construct($data); + } + + /** + * Specify audio loudness normalization in loudness units relative to full + * scale (LUFS). Enter a value between -24 and 0 according to the following: + * - -24 is the Advanced Television Systems Committee (ATSC A/85) + * - -23 is the EU R128 broadcast standard + * - -19 is the prior standard for online mono audio + * - -18 is the ReplayGain standard + * - -16 is the prior standard for stereo audio + * - -14 is the new online audio standard recommended by Spotify, as well as + * Amazon Echo + * - 0 disables normalization. The default is 0. + * + * Generated from protobuf field double lufs = 1; + * @return float + */ + public function getLufs() + { + return $this->lufs; + } + + /** + * Specify audio loudness normalization in loudness units relative to full + * scale (LUFS). Enter a value between -24 and 0 according to the following: + * - -24 is the Advanced Television Systems Committee (ATSC A/85) + * - -23 is the EU R128 broadcast standard + * - -19 is the prior standard for online mono audio + * - -18 is the ReplayGain standard + * - -16 is the prior standard for stereo audio + * - -14 is the new online audio standard recommended by Spotify, as well as + * Amazon Echo + * - 0 disables normalization. The default is 0. + * + * Generated from protobuf field double lufs = 1; + * @param float $var + * @return $this + */ + public function setLufs($var) + { + GPBUtil::checkDouble($var); + $this->lufs = $var; + + return $this; + } + +} + + diff --git a/VideoLiveStream/src/V1/SegmentSettings.php b/VideoLiveStream/src/V1/SegmentSettings.php index f87df46cf67..591f3ed6ce5 100644 --- a/VideoLiveStream/src/V1/SegmentSettings.php +++ b/VideoLiveStream/src/V1/SegmentSettings.php @@ -18,12 +18,12 @@ class SegmentSettings extends \Google\Protobuf\Internal\Message /** * Duration of the segments in seconds. The default is `6s`. Note that * `segmentDuration` must be greater than or equal to - * [gop_duration][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.gop_duration], and - * `segmentDuration` must be divisible by + * [gop_duration][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.gop_duration], + * and `segmentDuration` must be divisible by * [gop_duration][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.gop_duration]. * Valid range is [2s, 20s]. - * All [mux_streams][google.cloud.video.livestream.v1.Manifest.mux_streams] in the same manifest must have the - * same segment duration. + * All [mux_streams][google.cloud.video.livestream.v1.Manifest.mux_streams] in + * the same manifest must have the same segment duration. * * Generated from protobuf field .google.protobuf.Duration segment_duration = 1; */ @@ -38,12 +38,12 @@ class SegmentSettings extends \Google\Protobuf\Internal\Message * @type \Google\Protobuf\Duration $segment_duration * Duration of the segments in seconds. The default is `6s`. Note that * `segmentDuration` must be greater than or equal to - * [gop_duration][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.gop_duration], and - * `segmentDuration` must be divisible by + * [gop_duration][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.gop_duration], + * and `segmentDuration` must be divisible by * [gop_duration][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.gop_duration]. * Valid range is [2s, 20s]. - * All [mux_streams][google.cloud.video.livestream.v1.Manifest.mux_streams] in the same manifest must have the - * same segment duration. + * All [mux_streams][google.cloud.video.livestream.v1.Manifest.mux_streams] in + * the same manifest must have the same segment duration. * } */ public function __construct($data = NULL) { @@ -54,12 +54,12 @@ public function __construct($data = NULL) { /** * Duration of the segments in seconds. The default is `6s`. Note that * `segmentDuration` must be greater than or equal to - * [gop_duration][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.gop_duration], and - * `segmentDuration` must be divisible by + * [gop_duration][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.gop_duration], + * and `segmentDuration` must be divisible by * [gop_duration][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.gop_duration]. * Valid range is [2s, 20s]. - * All [mux_streams][google.cloud.video.livestream.v1.Manifest.mux_streams] in the same manifest must have the - * same segment duration. + * All [mux_streams][google.cloud.video.livestream.v1.Manifest.mux_streams] in + * the same manifest must have the same segment duration. * * Generated from protobuf field .google.protobuf.Duration segment_duration = 1; * @return \Google\Protobuf\Duration|null @@ -82,12 +82,12 @@ public function clearSegmentDuration() /** * Duration of the segments in seconds. The default is `6s`. Note that * `segmentDuration` must be greater than or equal to - * [gop_duration][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.gop_duration], and - * `segmentDuration` must be divisible by + * [gop_duration][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.gop_duration], + * and `segmentDuration` must be divisible by * [gop_duration][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.gop_duration]. * Valid range is [2s, 20s]. - * All [mux_streams][google.cloud.video.livestream.v1.Manifest.mux_streams] in the same manifest must have the - * same segment duration. + * All [mux_streams][google.cloud.video.livestream.v1.Manifest.mux_streams] in + * the same manifest must have the same segment duration. * * Generated from protobuf field .google.protobuf.Duration segment_duration = 1; * @param \Google\Protobuf\Duration $var diff --git a/VideoLiveStream/src/V1/TimecodeConfig.php b/VideoLiveStream/src/V1/TimecodeConfig.php new file mode 100644 index 00000000000..9f278315c03 --- /dev/null +++ b/VideoLiveStream/src/V1/TimecodeConfig.php @@ -0,0 +1,150 @@ +google.cloud.video.livestream.v1.TimecodeConfig + */ +class TimecodeConfig extends \Google\Protobuf\Internal\Message +{ + /** + * The source of the timecode that will later be used in outputs/manifests. + * It determines the initial timecode/timestamp (first frame) of output + * streams. + * + * Generated from protobuf field .google.cloud.video.livestream.v1.TimecodeConfig.TimecodeSource source = 1; + */ + private $source = 0; + protected $time_offset; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $source + * The source of the timecode that will later be used in outputs/manifests. + * It determines the initial timecode/timestamp (first frame) of output + * streams. + * @type \Google\Protobuf\Duration $utc_offset + * UTC offset. Must be whole seconds, between -18 hours and +18 hours. + * @type \Google\Type\TimeZone $time_zone + * Time zone e.g. "America/Los_Angeles". + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Video\Livestream\V1\Outputs::initOnce(); + parent::__construct($data); + } + + /** + * The source of the timecode that will later be used in outputs/manifests. + * It determines the initial timecode/timestamp (first frame) of output + * streams. + * + * Generated from protobuf field .google.cloud.video.livestream.v1.TimecodeConfig.TimecodeSource source = 1; + * @return int + */ + public function getSource() + { + return $this->source; + } + + /** + * The source of the timecode that will later be used in outputs/manifests. + * It determines the initial timecode/timestamp (first frame) of output + * streams. + * + * Generated from protobuf field .google.cloud.video.livestream.v1.TimecodeConfig.TimecodeSource source = 1; + * @param int $var + * @return $this + */ + public function setSource($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Video\LiveStream\V1\TimecodeConfig\TimecodeSource::class); + $this->source = $var; + + return $this; + } + + /** + * UTC offset. Must be whole seconds, between -18 hours and +18 hours. + * + * Generated from protobuf field .google.protobuf.Duration utc_offset = 2; + * @return \Google\Protobuf\Duration|null + */ + public function getUtcOffset() + { + return $this->readOneof(2); + } + + public function hasUtcOffset() + { + return $this->hasOneof(2); + } + + /** + * UTC offset. Must be whole seconds, between -18 hours and +18 hours. + * + * Generated from protobuf field .google.protobuf.Duration utc_offset = 2; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setUtcOffset($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Time zone e.g. "America/Los_Angeles". + * + * Generated from protobuf field .google.type.TimeZone time_zone = 3; + * @return \Google\Type\TimeZone|null + */ + public function getTimeZone() + { + return $this->readOneof(3); + } + + public function hasTimeZone() + { + return $this->hasOneof(3); + } + + /** + * Time zone e.g. "America/Los_Angeles". + * + * Generated from protobuf field .google.type.TimeZone time_zone = 3; + * @param \Google\Type\TimeZone $var + * @return $this + */ + public function setTimeZone($var) + { + GPBUtil::checkMessage($var, \Google\Type\TimeZone::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getTimeOffset() + { + return $this->whichOneof("time_offset"); + } + +} + diff --git a/VideoLiveStream/src/V1/TimecodeConfig/TimecodeSource.php b/VideoLiveStream/src/V1/TimecodeConfig/TimecodeSource.php new file mode 100644 index 00000000000..bf55bfd1fd8 --- /dev/null +++ b/VideoLiveStream/src/V1/TimecodeConfig/TimecodeSource.php @@ -0,0 +1,62 @@ +google.cloud.video.livestream.v1.TimecodeConfig.TimecodeSource + */ +class TimecodeSource +{ + /** + * The timecode source is not specified. + * + * Generated from protobuf enum TIMECODE_SOURCE_UNSPECIFIED = 0; + */ + const TIMECODE_SOURCE_UNSPECIFIED = 0; + /** + * Use input media timestamp. + * + * Generated from protobuf enum MEDIA_TIMESTAMP = 1; + */ + const MEDIA_TIMESTAMP = 1; + /** + * Use input embedded timecode e.g. picture timing SEI message. + * + * Generated from protobuf enum EMBEDDED_TIMECODE = 2; + */ + const EMBEDDED_TIMECODE = 2; + + private static $valueToName = [ + self::TIMECODE_SOURCE_UNSPECIFIED => 'TIMECODE_SOURCE_UNSPECIFIED', + self::MEDIA_TIMESTAMP => 'MEDIA_TIMESTAMP', + self::EMBEDDED_TIMECODE => 'EMBEDDED_TIMECODE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/VideoLiveStream/src/V1/UpdateChannelRequest.php b/VideoLiveStream/src/V1/UpdateChannelRequest.php index 4828786a69e..ad8aa133e56 100644 --- a/VideoLiveStream/src/V1/UpdateChannelRequest.php +++ b/VideoLiveStream/src/V1/UpdateChannelRequest.php @@ -19,13 +19,20 @@ class UpdateChannelRequest extends \Google\Protobuf\Internal\Message * Field mask is used to specify the fields to be overwritten in the Channel * resource by the update. You can only update the following fields: * * [`inputAttachments`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#inputattachment) + * * [`inputConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#inputconfig) * * [`output`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#output) - * * [`elementaryStreams`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#ElementaryStream) + * * [`elementaryStreams`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#elementarystream) * * [`muxStreams`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#muxstream) - * * [`manifests`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#Manifest) - * * [`spritesheets`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#spritesheet) + * * [`manifests`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#manifest) + * * [`spriteSheets`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#spritesheet) + * * [`logConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#logconfig) + * * [`timecodeConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#timecodeconfig) + * * [`encryptions`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#encryption) * The fields specified in the update_mask are relative to the resource, not * the full request. A field will be overwritten if it is in the mask. + * If the mask is not present, then each field from the list above is updated + * if the field appears in the request payload. To unset a field, add the + * field to the update mask and remove it from the request payload. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1; */ @@ -63,13 +70,20 @@ class UpdateChannelRequest extends \Google\Protobuf\Internal\Message * Field mask is used to specify the fields to be overwritten in the Channel * resource by the update. You can only update the following fields: * * [`inputAttachments`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#inputattachment) + * * [`inputConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#inputconfig) * * [`output`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#output) - * * [`elementaryStreams`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#ElementaryStream) + * * [`elementaryStreams`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#elementarystream) * * [`muxStreams`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#muxstream) - * * [`manifests`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#Manifest) - * * [`spritesheets`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#spritesheet) + * * [`manifests`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#manifest) + * * [`spriteSheets`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#spritesheet) + * * [`logConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#logconfig) + * * [`timecodeConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#timecodeconfig) + * * [`encryptions`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#encryption) * The fields specified in the update_mask are relative to the resource, not * the full request. A field will be overwritten if it is in the mask. + * If the mask is not present, then each field from the list above is updated + * if the field appears in the request payload. To unset a field, add the + * field to the update mask and remove it from the request payload. * @type \Google\Cloud\Video\LiveStream\V1\Channel $channel * Required. The channel resource to be updated. * @type string $request_id @@ -95,13 +109,20 @@ public function __construct($data = NULL) { * Field mask is used to specify the fields to be overwritten in the Channel * resource by the update. You can only update the following fields: * * [`inputAttachments`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#inputattachment) + * * [`inputConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#inputconfig) * * [`output`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#output) - * * [`elementaryStreams`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#ElementaryStream) + * * [`elementaryStreams`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#elementarystream) * * [`muxStreams`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#muxstream) - * * [`manifests`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#Manifest) - * * [`spritesheets`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#spritesheet) + * * [`manifests`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#manifest) + * * [`spriteSheets`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#spritesheet) + * * [`logConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#logconfig) + * * [`timecodeConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#timecodeconfig) + * * [`encryptions`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#encryption) * The fields specified in the update_mask are relative to the resource, not * the full request. A field will be overwritten if it is in the mask. + * If the mask is not present, then each field from the list above is updated + * if the field appears in the request payload. To unset a field, add the + * field to the update mask and remove it from the request payload. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1; * @return \Google\Protobuf\FieldMask|null @@ -125,13 +146,20 @@ public function clearUpdateMask() * Field mask is used to specify the fields to be overwritten in the Channel * resource by the update. You can only update the following fields: * * [`inputAttachments`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#inputattachment) + * * [`inputConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#inputconfig) * * [`output`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#output) - * * [`elementaryStreams`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#ElementaryStream) + * * [`elementaryStreams`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#elementarystream) * * [`muxStreams`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#muxstream) - * * [`manifests`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#Manifest) - * * [`spritesheets`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#spritesheet) + * * [`manifests`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#manifest) + * * [`spriteSheets`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#spritesheet) + * * [`logConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#logconfig) + * * [`timecodeConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#timecodeconfig) + * * [`encryptions`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#encryption) * The fields specified in the update_mask are relative to the resource, not * the full request. A field will be overwritten if it is in the mask. + * If the mask is not present, then each field from the list above is updated + * if the field appears in the request payload. To unset a field, add the + * field to the update mask and remove it from the request payload. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1; * @param \Google\Protobuf\FieldMask $var diff --git a/VideoLiveStream/src/V1/UpdateInputRequest.php b/VideoLiveStream/src/V1/UpdateInputRequest.php index b5af437dc62..c5b9d452c98 100644 --- a/VideoLiveStream/src/V1/UpdateInputRequest.php +++ b/VideoLiveStream/src/V1/UpdateInputRequest.php @@ -22,6 +22,9 @@ class UpdateInputRequest extends \Google\Protobuf\Internal\Message * * [`securityRules`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.inputs#SecurityRule) * The fields specified in the update_mask are relative to the resource, not * the full request. A field will be overwritten if it is in the mask. + * If the mask is not present, then each field from the list above is updated + * if the field appears in the request payload. To unset a field, add the + * field to the update mask and remove it from the request payload. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1; */ @@ -62,6 +65,9 @@ class UpdateInputRequest extends \Google\Protobuf\Internal\Message * * [`securityRules`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.inputs#SecurityRule) * The fields specified in the update_mask are relative to the resource, not * the full request. A field will be overwritten if it is in the mask. + * If the mask is not present, then each field from the list above is updated + * if the field appears in the request payload. To unset a field, add the + * field to the update mask and remove it from the request payload. * @type \Google\Cloud\Video\LiveStream\V1\Input $input * Required. The input resource to be updated. * @type string $request_id @@ -90,6 +96,9 @@ public function __construct($data = NULL) { * * [`securityRules`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.inputs#SecurityRule) * The fields specified in the update_mask are relative to the resource, not * the full request. A field will be overwritten if it is in the mask. + * If the mask is not present, then each field from the list above is updated + * if the field appears in the request payload. To unset a field, add the + * field to the update mask and remove it from the request payload. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1; * @return \Google\Protobuf\FieldMask|null @@ -116,6 +125,9 @@ public function clearUpdateMask() * * [`securityRules`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.inputs#SecurityRule) * The fields specified in the update_mask are relative to the resource, not * the full request. A field will be overwritten if it is in the mask. + * If the mask is not present, then each field from the list above is updated + * if the field appears in the request payload. To unset a field, add the + * field to the update mask and remove it from the request payload. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1; * @param \Google\Protobuf\FieldMask $var diff --git a/VideoLiveStream/src/V1/VideoStream/H264CodecSettings.php b/VideoLiveStream/src/V1/VideoStream/H264CodecSettings.php index 80417b5d4b4..f64e936007f 100644 --- a/VideoLiveStream/src/V1/VideoStream/H264CodecSettings.php +++ b/VideoLiveStream/src/V1/VideoStream/H264CodecSettings.php @@ -30,8 +30,8 @@ class H264CodecSettings extends \Google\Protobuf\Internal\Message */ private $height_pixels = 0; /** - * Required. The target video frame rate in frames per second (FPS). Must be less - * than or equal to 60. Will default to the input frame rate if larger + * Required. The target video frame rate in frames per second (FPS). Must be + * less than or equal to 60. Will default to the input frame rate if larger * than the input frame rate. The API will generate an output FPS that is * divisible by the input FPS, and smaller or equal to the target FPS. See * [Calculating frame @@ -58,7 +58,8 @@ class H264CodecSettings extends \Google\Protobuf\Internal\Message private $allow_open_gop = false; /** * Size of the Video Buffering Verifier (VBV) buffer in bits. Must be - * greater than zero. The default is equal to [bitrate_bps][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.bitrate_bps]. + * greater than zero. The default is equal to + * [bitrate_bps][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.bitrate_bps]. * * Generated from protobuf field int32 vbv_size_bits = 9; */ @@ -89,8 +90,9 @@ class H264CodecSettings extends \Google\Protobuf\Internal\Message private $b_pyramid = false; /** * The number of consecutive B-frames. Must be greater than or equal to - * zero. Must be less than [gop_frame_count][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.gop_frame_count] if set. The default - * is 0. + * zero. Must be less than + * [gop_frame_count][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.gop_frame_count] + * if set. The default is 0. * * Generated from protobuf field int32 b_frame_count = 13; */ @@ -112,7 +114,8 @@ class H264CodecSettings extends \Google\Protobuf\Internal\Message * The available options are [FFmpeg-compatible Profile * Options](https://trac.ffmpeg.org/wiki/Encode/H.264#Profile). * Note that certain values for this field may cause the - * transcoder to override other fields you set in the [H264CodecSettings][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings] + * transcoder to override other fields you set in the + * [H264CodecSettings][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings] * message. * * Generated from protobuf field string profile = 15; @@ -123,7 +126,9 @@ class H264CodecSettings extends \Google\Protobuf\Internal\Message * [FFmpeg-compatible Encode * Options](https://trac.ffmpeg.org/wiki/Encode/H.264#Tune) * Note that certain values for this field may cause the transcoder to - * override other fields you set in the [H264CodecSettings][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings] message. + * override other fields you set in the + * [H264CodecSettings][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings] + * message. * * Generated from protobuf field string tune = 16; */ @@ -143,8 +148,8 @@ class H264CodecSettings extends \Google\Protobuf\Internal\Message * Required. The height of the video in pixels. Must be an even integer. * Valid range is [180, 1080]. * @type float $frame_rate - * Required. The target video frame rate in frames per second (FPS). Must be less - * than or equal to 60. Will default to the input frame rate if larger + * Required. The target video frame rate in frames per second (FPS). Must be + * less than or equal to 60. Will default to the input frame rate if larger * than the input frame rate. The API will generate an output FPS that is * divisible by the input FPS, and smaller or equal to the target FPS. See * [Calculating frame @@ -166,13 +171,15 @@ class H264CodecSettings extends \Google\Protobuf\Internal\Message * @type \Google\Protobuf\Duration $gop_duration * Select the GOP size based on the specified duration. The default is * `2s`. Note that `gopDuration` must be less than or equal to - * [segment_duration][google.cloud.video.livestream.v1.SegmentSettings.segment_duration], and - * [segment_duration][google.cloud.video.livestream.v1.SegmentSettings.segment_duration] must be divisible - * by `gopDuration`. Valid range is [2s, 20s]. + * [segment_duration][google.cloud.video.livestream.v1.SegmentSettings.segment_duration], + * and + * [segment_duration][google.cloud.video.livestream.v1.SegmentSettings.segment_duration] + * must be divisible by `gopDuration`. Valid range is [2s, 20s]. * All video streams in the same channel must have the same GOP size. * @type int $vbv_size_bits * Size of the Video Buffering Verifier (VBV) buffer in bits. Must be - * greater than zero. The default is equal to [bitrate_bps][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.bitrate_bps]. + * greater than zero. The default is equal to + * [bitrate_bps][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.bitrate_bps]. * @type int $vbv_fullness_bits * Initial fullness of the Video Buffering Verifier (VBV) buffer in bits. * Must be greater than zero. The default is equal to 90% of @@ -187,8 +194,9 @@ class H264CodecSettings extends \Google\Protobuf\Internal\Message * on all decoders. The default is `false`. * @type int $b_frame_count * The number of consecutive B-frames. Must be greater than or equal to - * zero. Must be less than [gop_frame_count][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.gop_frame_count] if set. The default - * is 0. + * zero. Must be less than + * [gop_frame_count][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.gop_frame_count] + * if set. The default is 0. * @type float $aq_strength * Specify the intensity of the adaptive quantizer (AQ). Must be between 0 * and 1, where 0 disables the quantizer and 1 maximizes the quantizer. A @@ -202,14 +210,17 @@ class H264CodecSettings extends \Google\Protobuf\Internal\Message * The available options are [FFmpeg-compatible Profile * Options](https://trac.ffmpeg.org/wiki/Encode/H.264#Profile). * Note that certain values for this field may cause the - * transcoder to override other fields you set in the [H264CodecSettings][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings] + * transcoder to override other fields you set in the + * [H264CodecSettings][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings] * message. * @type string $tune * Enforces the specified codec tune. The available options are * [FFmpeg-compatible Encode * Options](https://trac.ffmpeg.org/wiki/Encode/H.264#Tune) * Note that certain values for this field may cause the transcoder to - * override other fields you set in the [H264CodecSettings][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings] message. + * override other fields you set in the + * [H264CodecSettings][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings] + * message. * } */ public function __construct($data = NULL) { @@ -274,8 +285,8 @@ public function setHeightPixels($var) } /** - * Required. The target video frame rate in frames per second (FPS). Must be less - * than or equal to 60. Will default to the input frame rate if larger + * Required. The target video frame rate in frames per second (FPS). Must be + * less than or equal to 60. Will default to the input frame rate if larger * than the input frame rate. The API will generate an output FPS that is * divisible by the input FPS, and smaller or equal to the target FPS. See * [Calculating frame @@ -291,8 +302,8 @@ public function getFrameRate() } /** - * Required. The target video frame rate in frames per second (FPS). Must be less - * than or equal to 60. Will default to the input frame rate if larger + * Required. The target video frame rate in frames per second (FPS). Must be + * less than or equal to 60. Will default to the input frame rate if larger * than the input frame rate. The API will generate an output FPS that is * divisible by the input FPS, and smaller or equal to the target FPS. See * [Calculating frame @@ -411,9 +422,10 @@ public function setGopFrameCount($var) /** * Select the GOP size based on the specified duration. The default is * `2s`. Note that `gopDuration` must be less than or equal to - * [segment_duration][google.cloud.video.livestream.v1.SegmentSettings.segment_duration], and - * [segment_duration][google.cloud.video.livestream.v1.SegmentSettings.segment_duration] must be divisible - * by `gopDuration`. Valid range is [2s, 20s]. + * [segment_duration][google.cloud.video.livestream.v1.SegmentSettings.segment_duration], + * and + * [segment_duration][google.cloud.video.livestream.v1.SegmentSettings.segment_duration] + * must be divisible by `gopDuration`. Valid range is [2s, 20s]. * All video streams in the same channel must have the same GOP size. * * Generated from protobuf field .google.protobuf.Duration gop_duration = 8; @@ -432,9 +444,10 @@ public function hasGopDuration() /** * Select the GOP size based on the specified duration. The default is * `2s`. Note that `gopDuration` must be less than or equal to - * [segment_duration][google.cloud.video.livestream.v1.SegmentSettings.segment_duration], and - * [segment_duration][google.cloud.video.livestream.v1.SegmentSettings.segment_duration] must be divisible - * by `gopDuration`. Valid range is [2s, 20s]. + * [segment_duration][google.cloud.video.livestream.v1.SegmentSettings.segment_duration], + * and + * [segment_duration][google.cloud.video.livestream.v1.SegmentSettings.segment_duration] + * must be divisible by `gopDuration`. Valid range is [2s, 20s]. * All video streams in the same channel must have the same GOP size. * * Generated from protobuf field .google.protobuf.Duration gop_duration = 8; @@ -451,7 +464,8 @@ public function setGopDuration($var) /** * Size of the Video Buffering Verifier (VBV) buffer in bits. Must be - * greater than zero. The default is equal to [bitrate_bps][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.bitrate_bps]. + * greater than zero. The default is equal to + * [bitrate_bps][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.bitrate_bps]. * * Generated from protobuf field int32 vbv_size_bits = 9; * @return int @@ -463,7 +477,8 @@ public function getVbvSizeBits() /** * Size of the Video Buffering Verifier (VBV) buffer in bits. Must be - * greater than zero. The default is equal to [bitrate_bps][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.bitrate_bps]. + * greater than zero. The default is equal to + * [bitrate_bps][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.bitrate_bps]. * * Generated from protobuf field int32 vbv_size_bits = 9; * @param int $var @@ -569,8 +584,9 @@ public function setBPyramid($var) /** * The number of consecutive B-frames. Must be greater than or equal to - * zero. Must be less than [gop_frame_count][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.gop_frame_count] if set. The default - * is 0. + * zero. Must be less than + * [gop_frame_count][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.gop_frame_count] + * if set. The default is 0. * * Generated from protobuf field int32 b_frame_count = 13; * @return int @@ -582,8 +598,9 @@ public function getBFrameCount() /** * The number of consecutive B-frames. Must be greater than or equal to - * zero. Must be less than [gop_frame_count][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.gop_frame_count] if set. The default - * is 0. + * zero. Must be less than + * [gop_frame_count][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.gop_frame_count] + * if set. The default is 0. * * Generated from protobuf field int32 b_frame_count = 13; * @param int $var @@ -636,7 +653,8 @@ public function setAqStrength($var) * The available options are [FFmpeg-compatible Profile * Options](https://trac.ffmpeg.org/wiki/Encode/H.264#Profile). * Note that certain values for this field may cause the - * transcoder to override other fields you set in the [H264CodecSettings][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings] + * transcoder to override other fields you set in the + * [H264CodecSettings][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings] * message. * * Generated from protobuf field string profile = 15; @@ -656,7 +674,8 @@ public function getProfile() * The available options are [FFmpeg-compatible Profile * Options](https://trac.ffmpeg.org/wiki/Encode/H.264#Profile). * Note that certain values for this field may cause the - * transcoder to override other fields you set in the [H264CodecSettings][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings] + * transcoder to override other fields you set in the + * [H264CodecSettings][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings] * message. * * Generated from protobuf field string profile = 15; @@ -676,7 +695,9 @@ public function setProfile($var) * [FFmpeg-compatible Encode * Options](https://trac.ffmpeg.org/wiki/Encode/H.264#Tune) * Note that certain values for this field may cause the transcoder to - * override other fields you set in the [H264CodecSettings][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings] message. + * override other fields you set in the + * [H264CodecSettings][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings] + * message. * * Generated from protobuf field string tune = 16; * @return string @@ -691,7 +712,9 @@ public function getTune() * [FFmpeg-compatible Encode * Options](https://trac.ffmpeg.org/wiki/Encode/H.264#Tune) * Note that certain values for this field may cause the transcoder to - * override other fields you set in the [H264CodecSettings][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings] message. + * override other fields you set in the + * [H264CodecSettings][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings] + * message. * * Generated from protobuf field string tune = 16; * @param string $var diff --git a/VideoLiveStream/src/V1/gapic_metadata.json b/VideoLiveStream/src/V1/gapic_metadata.json index dbc3130b145..e47c86e9324 100644 --- a/VideoLiveStream/src/V1/gapic_metadata.json +++ b/VideoLiveStream/src/V1/gapic_metadata.json @@ -89,6 +89,16 @@ "methods": [ "updateInput" ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] } } } diff --git a/VideoLiveStream/src/V1/resources/livestream_service_client_config.json b/VideoLiveStream/src/V1/resources/livestream_service_client_config.json index 893176f16e9..6b94ba43685 100644 --- a/VideoLiveStream/src/V1/resources/livestream_service_client_config.json +++ b/VideoLiveStream/src/V1/resources/livestream_service_client_config.json @@ -117,6 +117,16 @@ "timeout_millis": 60000, "retry_codes_name": "no_retry_1_codes", "retry_params_name": "no_retry_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" } } } diff --git a/VideoLiveStream/src/V1/resources/livestream_service_descriptor_config.php b/VideoLiveStream/src/V1/resources/livestream_service_descriptor_config.php index da9b416fb6c..10948466f20 100644 --- a/VideoLiveStream/src/V1/resources/livestream_service_descriptor_config.php +++ b/VideoLiveStream/src/V1/resources/livestream_service_descriptor_config.php @@ -113,6 +113,16 @@ 'resourcesGetMethod' => 'getInputs', ], ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + ], ], ], ]; diff --git a/VideoLiveStream/tests/Unit/V1/LivestreamServiceClientTest.php b/VideoLiveStream/tests/Unit/V1/LivestreamServiceClientTest.php index 1624b811bc0..d2be273f584 100644 --- a/VideoLiveStream/tests/Unit/V1/LivestreamServiceClientTest.php +++ b/VideoLiveStream/tests/Unit/V1/LivestreamServiceClientTest.php @@ -27,11 +27,13 @@ use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; +use Google\Cloud\Location\ListLocationsResponse; +use Google\Cloud\Location\Location; use Google\Cloud\Video\LiveStream\V1\Channel; use Google\Cloud\Video\LiveStream\V1\ChannelOperationResponse; use Google\Cloud\Video\LiveStream\V1\Channel\Output; use Google\Cloud\Video\LiveStream\V1\Event; -use Google\Cloud\Video\LiveStream\V1\Event\AdBreakTask; +use Google\Cloud\Video\LiveStream\V1\Event\InputSwitchTask; use Google\Cloud\Video\LiveStream\V1\Input; use Google\Cloud\Video\LiveStream\V1\ListChannelsResponse; use Google\Cloud\Video\LiveStream\V1\ListEventsResponse; @@ -223,8 +225,8 @@ public function createEventTest() // Mock request $formattedParent = $gapicClient->channelName('[PROJECT]', '[LOCATION]', '[CHANNEL]'); $event = new Event(); - $eventAdBreak = new AdBreakTask(); - $event->setAdBreak($eventAdBreak); + $eventInputSwitch = new InputSwitchTask(); + $event->setInputSwitch($eventInputSwitch); $eventId = 'eventId278118624'; $response = $gapicClient->createEvent($formattedParent, $event, $eventId); $this->assertEquals($expectedResponse, $response); @@ -263,8 +265,8 @@ public function createEventExceptionTest() // Mock request $formattedParent = $gapicClient->channelName('[PROJECT]', '[LOCATION]', '[CHANNEL]'); $event = new Event(); - $eventAdBreak = new AdBreakTask(); - $event->setAdBreak($eventAdBreak); + $eventInputSwitch = new InputSwitchTask(); + $event->setInputSwitch($eventInputSwitch); $eventId = 'eventId278118624'; try { $gapicClient->createEvent($formattedParent, $event, $eventId); @@ -1568,4 +1570,124 @@ public function updateInputExceptionTest() $this->assertTrue($transport->isExhausted()); $this->assertTrue($operationsTransport->isExhausted()); } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $response = $gapicClient->getLocation(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + try { + $gapicClient->getLocation(); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $response = $gapicClient->listLocations(); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + try { + $gapicClient->listLocations(); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } }