<?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 an inserted ad break.
 *
 * Generated from protobuf message <code>google.cloud.video.stitcher.v1.VodSessionAdBreak</code>
 */
class VodSessionAdBreak extends \Google\Protobuf\Internal\Message
{
    /**
     * List of events that are expected to be triggered, ordered by time.
     *
     * Generated from protobuf field <code>repeated .google.cloud.video.stitcher.v1.ProgressEvent progress_events = 1;</code>
     */
    private $progress_events;
    /**
     * Ordered list of ads stitched into the ad break.
     *
     * Generated from protobuf field <code>repeated .google.cloud.video.stitcher.v1.VodSessionAd ads = 2;</code>
     */
    private $ads;
    /**
     * Ad break end time in seconds relative to the start of the VOD asset.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration end_time_offset = 3;</code>
     */
    private $end_time_offset = null;
    /**
     * Ad break start time in seconds relative to the start of the VOD asset.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration start_time_offset = 4;</code>
     */
    private $start_time_offset = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type array<\Google\Cloud\Video\Stitcher\V1\ProgressEvent>|\Google\Protobuf\Internal\RepeatedField $progress_events
     *           List of events that are expected to be triggered, ordered by time.
     *     @type array<\Google\Cloud\Video\Stitcher\V1\VodSessionAd>|\Google\Protobuf\Internal\RepeatedField $ads
     *           Ordered list of ads stitched into the ad break.
     *     @type \Google\Protobuf\Duration $end_time_offset
     *           Ad break end time in seconds relative to the start of the VOD asset.
     *     @type \Google\Protobuf\Duration $start_time_offset
     *           Ad break start time in seconds relative to the start of the VOD asset.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Video\Stitcher\V1\Sessions::initOnce();
        parent::__construct($data);
    }

    /**
     * List of events that are expected to be triggered, ordered by time.
     *
     * Generated from protobuf field <code>repeated .google.cloud.video.stitcher.v1.ProgressEvent progress_events = 1;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getProgressEvents()
    {
        return $this->progress_events;
    }

    /**
     * List of events that are expected to be triggered, ordered by time.
     *
     * Generated from protobuf field <code>repeated .google.cloud.video.stitcher.v1.ProgressEvent progress_events = 1;</code>
     * @param array<\Google\Cloud\Video\Stitcher\V1\ProgressEvent>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setProgressEvents($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Video\Stitcher\V1\ProgressEvent::class);
        $this->progress_events = $arr;

        return $this;
    }

    /**
     * Ordered list of ads stitched into the ad break.
     *
     * Generated from protobuf field <code>repeated .google.cloud.video.stitcher.v1.VodSessionAd ads = 2;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getAds()
    {
        return $this->ads;
    }

    /**
     * Ordered list of ads stitched into the ad break.
     *
     * Generated from protobuf field <code>repeated .google.cloud.video.stitcher.v1.VodSessionAd ads = 2;</code>
     * @param array<\Google\Cloud\Video\Stitcher\V1\VodSessionAd>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setAds($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Video\Stitcher\V1\VodSessionAd::class);
        $this->ads = $arr;

        return $this;
    }

    /**
     * Ad break end time in seconds relative to the start of the VOD asset.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration end_time_offset = 3;</code>
     * @return \Google\Protobuf\Duration|null
     */
    public function getEndTimeOffset()
    {
        return $this->end_time_offset;
    }

    public function hasEndTimeOffset()
    {
        return isset($this->end_time_offset);
    }

    public function clearEndTimeOffset()
    {
        unset($this->end_time_offset);
    }

    /**
     * Ad break end time in seconds relative to the start of the VOD asset.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration end_time_offset = 3;</code>
     * @param \Google\Protobuf\Duration $var
     * @return $this
     */
    public function setEndTimeOffset($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
        $this->end_time_offset = $var;

        return $this;
    }

    /**
     * Ad break start time in seconds relative to the start of the VOD asset.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration start_time_offset = 4;</code>
     * @return \Google\Protobuf\Duration|null
     */
    public function getStartTimeOffset()
    {
        return $this->start_time_offset;
    }

    public function hasStartTimeOffset()
    {
        return isset($this->start_time_offset);
    }

    public function clearStartTimeOffset()
    {
        unset($this->start_time_offset);
    }

    /**
     * Ad break start time in seconds relative to the start of the VOD asset.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration start_time_offset = 4;</code>
     * @param \Google\Protobuf\Duration $var
     * @return $this
     */
    public function setStartTimeOffset($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
        $this->start_time_offset = $var;

        return $this;
    }

}

