<?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. The session expires 5 minutes after the client
 * stops fetching the session's playlists.
 *
 * 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 = '';
    /**
     * 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;
    /**
     * 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;
    /**
     * This field should be set with appropriate values if GAM is being used for
     * ads.
     *
     * Generated from protobuf field <code>.google.cloud.video.stitcher.v1.LiveSession.GamSettings gam_settings = 15;</code>
     */
    private $gam_settings = null;
    /**
     * Required. The resource name of the live config for this session, in the
     * form of `projects/{project}/locations/{location}/liveConfigs/{id}`.
     *
     * Generated from protobuf field <code>string live_config = 16 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    private $live_config = '';

    /**
     * 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 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 \Google\Cloud\Video\Stitcher\V1\ManifestOptions $manifest_options
     *           Additional options that affect the output of the manifest.
     *     @type \Google\Cloud\Video\Stitcher\V1\LiveSession\GamSettings $gam_settings
     *           This field should be set with appropriate values if GAM is being used for
     *           ads.
     *     @type string $live_config
     *           Required. The resource name of the live config for this session, in the
     *           form of `projects/{project}/locations/{location}/liveConfigs/{id}`.
     * }
     */
    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;
    }

    /**
     * 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;
    }

    /**
     * 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;
    }

    /**
     * This field should be set with appropriate values if GAM is being used for
     * ads.
     *
     * Generated from protobuf field <code>.google.cloud.video.stitcher.v1.LiveSession.GamSettings gam_settings = 15;</code>
     * @return \Google\Cloud\Video\Stitcher\V1\LiveSession\GamSettings|null
     */
    public function getGamSettings()
    {
        return $this->gam_settings;
    }

    public function hasGamSettings()
    {
        return isset($this->gam_settings);
    }

    public function clearGamSettings()
    {
        unset($this->gam_settings);
    }

    /**
     * This field should be set with appropriate values if GAM is being used for
     * ads.
     *
     * Generated from protobuf field <code>.google.cloud.video.stitcher.v1.LiveSession.GamSettings gam_settings = 15;</code>
     * @param \Google\Cloud\Video\Stitcher\V1\LiveSession\GamSettings $var
     * @return $this
     */
    public function setGamSettings($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Video\Stitcher\V1\LiveSession\GamSettings::class);
        $this->gam_settings = $var;

        return $this;
    }

    /**
     * Required. The resource name of the live config for this session, in the
     * form of `projects/{project}/locations/{location}/liveConfigs/{id}`.
     *
     * Generated from protobuf field <code>string live_config = 16 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getLiveConfig()
    {
        return $this->live_config;
    }

    /**
     * Required. The resource name of the live config for this session, in the
     * form of `projects/{project}/locations/{location}/liveConfigs/{id}`.
     *
     * Generated from protobuf field <code>string live_config = 16 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setLiveConfig($var)
    {
        GPBUtil::checkString($var, True);
        $this->live_config = $var;

        return $this;
    }

}

