<?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;

/**
 * Describes an event and a trigger URI.
 *
 * Generated from protobuf message <code>google.cloud.video.stitcher.v1.Event</code>
 */
class Event extends \Google\Protobuf\Internal\Message
{
    /**
     * Describes the event that occurred.
     *
     * Generated from protobuf field <code>.google.cloud.video.stitcher.v1.Event.EventType type = 1;</code>
     */
    private $type = 0;
    /**
     * The URI to trigger for this event.
     *
     * Generated from protobuf field <code>string uri = 2;</code>
     */
    private $uri = '';
    /**
     * The ID of the event.
     *
     * Generated from protobuf field <code>string id = 3;</code>
     */
    private $id = '';
    /**
     * The offset in seconds if the event type is `PROGRESS`.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration offset = 4;</code>
     */
    private $offset = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $type
     *           Describes the event that occurred.
     *     @type string $uri
     *           The URI to trigger for this event.
     *     @type string $id
     *           The ID of the event.
     *     @type \Google\Protobuf\Duration $offset
     *           The offset in seconds if the event type is `PROGRESS`.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Video\Stitcher\V1\Events::initOnce();
        parent::__construct($data);
    }

    /**
     * Describes the event that occurred.
     *
     * Generated from protobuf field <code>.google.cloud.video.stitcher.v1.Event.EventType type = 1;</code>
     * @return int
     */
    public function getType()
    {
        return $this->type;
    }

    /**
     * Describes the event that occurred.
     *
     * Generated from protobuf field <code>.google.cloud.video.stitcher.v1.Event.EventType type = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setType($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Video\Stitcher\V1\Event\EventType::class);
        $this->type = $var;

        return $this;
    }

    /**
     * The URI to trigger for this event.
     *
     * Generated from protobuf field <code>string uri = 2;</code>
     * @return string
     */
    public function getUri()
    {
        return $this->uri;
    }

    /**
     * The URI to trigger for this event.
     *
     * Generated from protobuf field <code>string uri = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setUri($var)
    {
        GPBUtil::checkString($var, True);
        $this->uri = $var;

        return $this;
    }

    /**
     * The ID of the event.
     *
     * Generated from protobuf field <code>string id = 3;</code>
     * @return string
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * The ID of the event.
     *
     * Generated from protobuf field <code>string id = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setId($var)
    {
        GPBUtil::checkString($var, True);
        $this->id = $var;

        return $this;
    }

    /**
     * The offset in seconds if the event type is `PROGRESS`.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration offset = 4;</code>
     * @return \Google\Protobuf\Duration|null
     */
    public function getOffset()
    {
        return $this->offset;
    }

    public function hasOffset()
    {
        return isset($this->offset);
    }

    public function clearOffset()
    {
        unset($this->offset);
    }

    /**
     * The offset in seconds if the event type is `PROGRESS`.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration offset = 4;</code>
     * @param \Google\Protobuf\Duration $var
     * @return $this
     */
    public function setOffset($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
        $this->offset = $var;

        return $this;
    }

}

