<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/video/stitcher/v1/sessions.proto

namespace Google\Cloud\Video\Stitcher\V1;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * Metadata for a live session.
 *
 * Generated from protobuf message <code>google.cloud.video.stitcher.v1.LiveSession</code>
 */
class LiveSession extends \Google\Protobuf\Internal\Message
{
    /**
     * Output only. The name of the live session, in the form of
     * `projects/{project}/locations/{location}/liveSessions/{id}`.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $name = '';
    /**
     * Output only. The URI to play the live session's ad-stitched stream.
     *
     * Generated from protobuf field <code>string play_uri = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $play_uri = '';
    /**
     * The URI of the live session's source stream.
     *
     * Generated from protobuf field <code>string source_uri = 3;</code>
     */
    private $source_uri = '';
    /**
     * The default ad tag to use when no ad tag ids are specified in an ad break's
     * SCTE-35 message.
     * default_ad_tag_id is necessary when `adTagMap` has more than one key. Its
     * value must be present in the `adTagMap`.
     *
     * Generated from protobuf field <code>string default_ad_tag_id = 4;</code>
     */
    private $default_ad_tag_id = '';
    /**
     * Key value pairs for ad tags. Ads parsed from ad tags must be MP4 videos
     * each with at least one audio track.
     *
     * Generated from protobuf field <code>map<string, .google.cloud.video.stitcher.v1.AdTag> ad_tag_map = 5;</code>
     */
    private $ad_tag_map;
    /**
     * Key value pairs for ad tag macro replacement. If the
     * specified ad tag URI has macros, this field provides the mapping
     * to the value that will replace the macro in the ad tag URI.
     * Macros are designated by square brackets.
     * For example:
     *   Ad tag URI: "https://doubleclick.google.com/ad/1?geo_id=[geoId]"
     *   Ad tag macros: `{"geoId": "123"}`
     *   Fully qualified ad tag:
     *   `"https://doubleclick.google.com/ad/1?geo_id=123"`
     *
     * Generated from protobuf field <code>map<string, string> ad_tag_macros = 6;</code>
     */
    private $ad_tag_macros;
    /**
     * Whether client side ad tracking is enabled. If enabled, the client player
     * is expected to trigger playback and activity events itself. Otherwise,
     * server side ad tracking is enabled and the Video Stitcher API will trigger
     * playback events on behalf of the client player.
     *
     * Generated from protobuf field <code>bool client_ad_tracking = 7;</code>
     */
    private $client_ad_tracking = false;
    /**
     * The default slate to use when no slates are specified in an ad break's
     * SCTE-35 message. When specified, this value must match the ID for a slate
     * that has already been created via the
     * [CreateSlate](projects.locations.slates/create) method.
     *
     * Generated from protobuf field <code>string default_slate_id = 8;</code>
     */
    private $default_slate_id = '';
    /**
     * Defines the stitcher behavior in case an ad does not align exactly with
     * the ad break boundaries. If not specified, the default is `COMPLETE_AD`.
     *
     * Generated from protobuf field <code>.google.cloud.video.stitcher.v1.LiveSession.StitchingPolicy stitching_policy = 9;</code>
     */
    private $stitching_policy = 0;
    /**
     * Additional options that affect the output of the manifest.
     *
     * Generated from protobuf field <code>.google.cloud.video.stitcher.v1.ManifestOptions manifest_options = 10;</code>
     */
    private $manifest_options = null;
    /**
     * Output only. The generated ID of the LiveSession's source stream.
     *
     * Generated from protobuf field <code>string stream_id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $stream_id = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Output only. The name of the live session, in the form of
     *           `projects/{project}/locations/{location}/liveSessions/{id}`.
     *     @type string $play_uri
     *           Output only. The URI to play the live session's ad-stitched stream.
     *     @type string $source_uri
     *           The URI of the live session's source stream.
     *     @type string $default_ad_tag_id
     *           The default ad tag to use when no ad tag ids are specified in an ad break's
     *           SCTE-35 message.
     *           default_ad_tag_id is necessary when `adTagMap` has more than one key. Its
     *           value must be present in the `adTagMap`.
     *     @type array|\Google\Protobuf\Internal\MapField $ad_tag_map
     *           Key value pairs for ad tags. Ads parsed from ad tags must be MP4 videos
     *           each with at least one audio track.
     *     @type array|\Google\Protobuf\Internal\MapField $ad_tag_macros
     *           Key value pairs for ad tag macro replacement. If the
     *           specified ad tag URI has macros, this field provides the mapping
     *           to the value that will replace the macro in the ad tag URI.
     *           Macros are designated by square brackets.
     *           For example:
     *             Ad tag URI: "https://doubleclick.google.com/ad/1?geo_id=[geoId]"
     *             Ad tag macros: `{"geoId": "123"}`
     *             Fully qualified ad tag:
     *             `"https://doubleclick.google.com/ad/1?geo_id=123"`
     *     @type bool $client_ad_tracking
     *           Whether client side ad tracking is enabled. If enabled, the client player
     *           is expected to trigger playback and activity events itself. Otherwise,
     *           server side ad tracking is enabled and the Video Stitcher API will trigger
     *           playback events on behalf of the client player.
     *     @type string $default_slate_id
     *           The default slate to use when no slates are specified in an ad break's
     *           SCTE-35 message. When specified, this value must match the ID for a slate
     *           that has already been created via the
     *           [CreateSlate](projects.locations.slates/create) method.
     *     @type int $stitching_policy
     *           Defines the stitcher behavior in case an ad does not align exactly with
     *           the ad break boundaries. If not specified, the default is `COMPLETE_AD`.
     *     @type \Google\Cloud\Video\Stitcher\V1\ManifestOptions $manifest_options
     *           Additional options that affect the output of the manifest.
     *     @type string $stream_id
     *           Output only. The generated ID of the LiveSession's source stream.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Video\Stitcher\V1\Sessions::initOnce();
        parent::__construct($data);
    }

    /**
     * Output only. The name of the live session, in the form of
     * `projects/{project}/locations/{location}/liveSessions/{id}`.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Output only. The name of the live session, in the form of
     * `projects/{project}/locations/{location}/liveSessions/{id}`.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Output only. The URI to play the live session's ad-stitched stream.
     *
     * Generated from protobuf field <code>string play_uri = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getPlayUri()
    {
        return $this->play_uri;
    }

    /**
     * Output only. The URI to play the live session's ad-stitched stream.
     *
     * Generated from protobuf field <code>string play_uri = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setPlayUri($var)
    {
        GPBUtil::checkString($var, True);
        $this->play_uri = $var;

        return $this;
    }

    /**
     * The URI of the live session's source stream.
     *
     * Generated from protobuf field <code>string source_uri = 3;</code>
     * @return string
     */
    public function getSourceUri()
    {
        return $this->source_uri;
    }

    /**
     * The URI of the live session's source stream.
     *
     * Generated from protobuf field <code>string source_uri = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setSourceUri($var)
    {
        GPBUtil::checkString($var, True);
        $this->source_uri = $var;

        return $this;
    }

    /**
     * The default ad tag to use when no ad tag ids are specified in an ad break's
     * SCTE-35 message.
     * default_ad_tag_id is necessary when `adTagMap` has more than one key. Its
     * value must be present in the `adTagMap`.
     *
     * Generated from protobuf field <code>string default_ad_tag_id = 4;</code>
     * @return string
     */
    public function getDefaultAdTagId()
    {
        return $this->default_ad_tag_id;
    }

    /**
     * The default ad tag to use when no ad tag ids are specified in an ad break's
     * SCTE-35 message.
     * default_ad_tag_id is necessary when `adTagMap` has more than one key. Its
     * value must be present in the `adTagMap`.
     *
     * Generated from protobuf field <code>string default_ad_tag_id = 4;</code>
     * @param string $var
     * @return $this
     */
    public function setDefaultAdTagId($var)
    {
        GPBUtil::checkString($var, True);
        $this->default_ad_tag_id = $var;

        return $this;
    }

    /**
     * Key value pairs for ad tags. Ads parsed from ad tags must be MP4 videos
     * each with at least one audio track.
     *
     * Generated from protobuf field <code>map<string, .google.cloud.video.stitcher.v1.AdTag> ad_tag_map = 5;</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getAdTagMap()
    {
        return $this->ad_tag_map;
    }

    /**
     * Key value pairs for ad tags. Ads parsed from ad tags must be MP4 videos
     * each with at least one audio track.
     *
     * Generated from protobuf field <code>map<string, .google.cloud.video.stitcher.v1.AdTag> ad_tag_map = 5;</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setAdTagMap($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Video\Stitcher\V1\AdTag::class);
        $this->ad_tag_map = $arr;

        return $this;
    }

    /**
     * Key value pairs for ad tag macro replacement. If the
     * specified ad tag URI has macros, this field provides the mapping
     * to the value that will replace the macro in the ad tag URI.
     * Macros are designated by square brackets.
     * For example:
     *   Ad tag URI: "https://doubleclick.google.com/ad/1?geo_id=[geoId]"
     *   Ad tag macros: `{"geoId": "123"}`
     *   Fully qualified ad tag:
     *   `"https://doubleclick.google.com/ad/1?geo_id=123"`
     *
     * Generated from protobuf field <code>map<string, string> ad_tag_macros = 6;</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getAdTagMacros()
    {
        return $this->ad_tag_macros;
    }

    /**
     * Key value pairs for ad tag macro replacement. If the
     * specified ad tag URI has macros, this field provides the mapping
     * to the value that will replace the macro in the ad tag URI.
     * Macros are designated by square brackets.
     * For example:
     *   Ad tag URI: "https://doubleclick.google.com/ad/1?geo_id=[geoId]"
     *   Ad tag macros: `{"geoId": "123"}`
     *   Fully qualified ad tag:
     *   `"https://doubleclick.google.com/ad/1?geo_id=123"`
     *
     * Generated from protobuf field <code>map<string, string> ad_tag_macros = 6;</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setAdTagMacros($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING);
        $this->ad_tag_macros = $arr;

        return $this;
    }

    /**
     * Whether client side ad tracking is enabled. If enabled, the client player
     * is expected to trigger playback and activity events itself. Otherwise,
     * server side ad tracking is enabled and the Video Stitcher API will trigger
     * playback events on behalf of the client player.
     *
     * Generated from protobuf field <code>bool client_ad_tracking = 7;</code>
     * @return bool
     */
    public function getClientAdTracking()
    {
        return $this->client_ad_tracking;
    }

    /**
     * Whether client side ad tracking is enabled. If enabled, the client player
     * is expected to trigger playback and activity events itself. Otherwise,
     * server side ad tracking is enabled and the Video Stitcher API will trigger
     * playback events on behalf of the client player.
     *
     * Generated from protobuf field <code>bool client_ad_tracking = 7;</code>
     * @param bool $var
     * @return $this
     */
    public function setClientAdTracking($var)
    {
        GPBUtil::checkBool($var);
        $this->client_ad_tracking = $var;

        return $this;
    }

    /**
     * The default slate to use when no slates are specified in an ad break's
     * SCTE-35 message. When specified, this value must match the ID for a slate
     * that has already been created via the
     * [CreateSlate](projects.locations.slates/create) method.
     *
     * Generated from protobuf field <code>string default_slate_id = 8;</code>
     * @return string
     */
    public function getDefaultSlateId()
    {
        return $this->default_slate_id;
    }

    /**
     * The default slate to use when no slates are specified in an ad break's
     * SCTE-35 message. When specified, this value must match the ID for a slate
     * that has already been created via the
     * [CreateSlate](projects.locations.slates/create) method.
     *
     * Generated from protobuf field <code>string default_slate_id = 8;</code>
     * @param string $var
     * @return $this
     */
    public function setDefaultSlateId($var)
    {
        GPBUtil::checkString($var, True);
        $this->default_slate_id = $var;

        return $this;
    }

    /**
     * Defines the stitcher behavior in case an ad does not align exactly with
     * the ad break boundaries. If not specified, the default is `COMPLETE_AD`.
     *
     * Generated from protobuf field <code>.google.cloud.video.stitcher.v1.LiveSession.StitchingPolicy stitching_policy = 9;</code>
     * @return int
     */
    public function getStitchingPolicy()
    {
        return $this->stitching_policy;
    }

    /**
     * Defines the stitcher behavior in case an ad does not align exactly with
     * the ad break boundaries. If not specified, the default is `COMPLETE_AD`.
     *
     * Generated from protobuf field <code>.google.cloud.video.stitcher.v1.LiveSession.StitchingPolicy stitching_policy = 9;</code>
     * @param int $var
     * @return $this
     */
    public function setStitchingPolicy($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Video\Stitcher\V1\LiveSession\StitchingPolicy::class);
        $this->stitching_policy = $var;

        return $this;
    }

    /**
     * Additional options that affect the output of the manifest.
     *
     * Generated from protobuf field <code>.google.cloud.video.stitcher.v1.ManifestOptions manifest_options = 10;</code>
     * @return \Google\Cloud\Video\Stitcher\V1\ManifestOptions|null
     */
    public function getManifestOptions()
    {
        return $this->manifest_options;
    }

    public function hasManifestOptions()
    {
        return isset($this->manifest_options);
    }

    public function clearManifestOptions()
    {
        unset($this->manifest_options);
    }

    /**
     * Additional options that affect the output of the manifest.
     *
     * Generated from protobuf field <code>.google.cloud.video.stitcher.v1.ManifestOptions manifest_options = 10;</code>
     * @param \Google\Cloud\Video\Stitcher\V1\ManifestOptions $var
     * @return $this
     */
    public function setManifestOptions($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Video\Stitcher\V1\ManifestOptions::class);
        $this->manifest_options = $var;

        return $this;
    }

    /**
     * Output only. The generated ID of the LiveSession's source stream.
     *
     * Generated from protobuf field <code>string stream_id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getStreamId()
    {
        return $this->stream_id;
    }

    /**
     * Output only. The generated ID of the LiveSession's source stream.
     *
     * Generated from protobuf field <code>string stream_id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setStreamId($var)
    {
        GPBUtil::checkString($var, True);
        $this->stream_id = $var;

        return $this;
    }

}

