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

namespace Google\Cloud\Video\Stitcher\V1;

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

/**
 * Indicates a time in which a list of events should be triggered
 * during media playback.
 *
 * Generated from protobuf message <code>google.cloud.video.stitcher.v1.ProgressEvent</code>
 */
class ProgressEvent extends \Google\Protobuf\Internal\Message
{
    /**
     * The time when the following tracking events occurs. The time is in
     * seconds relative to the start of the VOD asset.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration time_offset = 1;</code>
     */
    private $time_offset = null;
    /**
     * The list of progress tracking events for the ad break. These can be of
     * the following IAB types: `BREAK_START`, `BREAK_END`, `IMPRESSION`,
     * `CREATIVE_VIEW`, `START`, `FIRST_QUARTILE`, `MIDPOINT`, `THIRD_QUARTILE`,
     * `COMPLETE`, `PROGRESS`.
     *
     * Generated from protobuf field <code>repeated .google.cloud.video.stitcher.v1.Event events = 2;</code>
     */
    private $events;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Protobuf\Duration $time_offset
     *           The time when the following tracking events occurs. The time is in
     *           seconds relative to the start of the VOD asset.
     *     @type \Google\Cloud\Video\Stitcher\V1\Event[]|\Google\Protobuf\Internal\RepeatedField $events
     *           The list of progress tracking events for the ad break. These can be of
     *           the following IAB types: `BREAK_START`, `BREAK_END`, `IMPRESSION`,
     *           `CREATIVE_VIEW`, `START`, `FIRST_QUARTILE`, `MIDPOINT`, `THIRD_QUARTILE`,
     *           `COMPLETE`, `PROGRESS`.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Video\Stitcher\V1\Events::initOnce();
        parent::__construct($data);
    }

    /**
     * The time when the following tracking events occurs. The time is in
     * seconds relative to the start of the VOD asset.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration time_offset = 1;</code>
     * @return \Google\Protobuf\Duration|null
     */
    public function getTimeOffset()
    {
        return $this->time_offset;
    }

    public function hasTimeOffset()
    {
        return isset($this->time_offset);
    }

    public function clearTimeOffset()
    {
        unset($this->time_offset);
    }

    /**
     * The time when the following tracking events occurs. The time is in
     * seconds relative to the start of the VOD asset.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration time_offset = 1;</code>
     * @param \Google\Protobuf\Duration $var
     * @return $this
     */
    public function setTimeOffset($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
        $this->time_offset = $var;

        return $this;
    }

    /**
     * The list of progress tracking events for the ad break. These can be of
     * the following IAB types: `BREAK_START`, `BREAK_END`, `IMPRESSION`,
     * `CREATIVE_VIEW`, `START`, `FIRST_QUARTILE`, `MIDPOINT`, `THIRD_QUARTILE`,
     * `COMPLETE`, `PROGRESS`.
     *
     * Generated from protobuf field <code>repeated .google.cloud.video.stitcher.v1.Event events = 2;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getEvents()
    {
        return $this->events;
    }

    /**
     * The list of progress tracking events for the ad break. These can be of
     * the following IAB types: `BREAK_START`, `BREAK_END`, `IMPRESSION`,
     * `CREATIVE_VIEW`, `START`, `FIRST_QUARTILE`, `MIDPOINT`, `THIRD_QUARTILE`,
     * `COMPLETE`, `PROGRESS`.
     *
     * Generated from protobuf field <code>repeated .google.cloud.video.stitcher.v1.Event events = 2;</code>
     * @param \Google\Cloud\Video\Stitcher\V1\Event[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setEvents($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Video\Stitcher\V1\Event::class);
        $this->events = $arr;

        return $this;
    }

}

