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

namespace Google\Cloud\ApiHub\V1;

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

/**
 * The metadata associated with a spec of the API version.
 *
 * Generated from protobuf message <code>google.cloud.apihub.v1.SpecMetadata</code>
 */
class SpecMetadata extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The spec resource to be pushed to Hub's collect layer. The ID of
     * the spec will be generated by Hub.
     *
     * Generated from protobuf field <code>.google.cloud.apihub.v1.Spec spec = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $spec = null;
    /**
     * Optional. The unique identifier of the spec in the system where it was
     * originally created.
     *
     * Generated from protobuf field <code>string original_id = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $original_id = '';
    /**
     * Optional. Timestamp indicating when the spec was created at the source.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp original_create_time = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $original_create_time = null;
    /**
     * Required. Timestamp indicating when the spec was last updated at the
     * source.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp original_update_time = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $original_update_time = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\ApiHub\V1\Spec $spec
     *           Required. The spec resource to be pushed to Hub's collect layer. The ID of
     *           the spec will be generated by Hub.
     *     @type string $original_id
     *           Optional. The unique identifier of the spec in the system where it was
     *           originally created.
     *     @type \Google\Protobuf\Timestamp $original_create_time
     *           Optional. Timestamp indicating when the spec was created at the source.
     *     @type \Google\Protobuf\Timestamp $original_update_time
     *           Required. Timestamp indicating when the spec was last updated at the
     *           source.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Apihub\V1\CollectService::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The spec resource to be pushed to Hub's collect layer. The ID of
     * the spec will be generated by Hub.
     *
     * Generated from protobuf field <code>.google.cloud.apihub.v1.Spec spec = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\ApiHub\V1\Spec|null
     */
    public function getSpec()
    {
        return $this->spec;
    }

    public function hasSpec()
    {
        return isset($this->spec);
    }

    public function clearSpec()
    {
        unset($this->spec);
    }

    /**
     * Required. The spec resource to be pushed to Hub's collect layer. The ID of
     * the spec will be generated by Hub.
     *
     * Generated from protobuf field <code>.google.cloud.apihub.v1.Spec spec = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\ApiHub\V1\Spec $var
     * @return $this
     */
    public function setSpec($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\ApiHub\V1\Spec::class);
        $this->spec = $var;

        return $this;
    }

    /**
     * Optional. The unique identifier of the spec in the system where it was
     * originally created.
     *
     * Generated from protobuf field <code>string original_id = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getOriginalId()
    {
        return $this->original_id;
    }

    /**
     * Optional. The unique identifier of the spec in the system where it was
     * originally created.
     *
     * Generated from protobuf field <code>string original_id = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setOriginalId($var)
    {
        GPBUtil::checkString($var, True);
        $this->original_id = $var;

        return $this;
    }

    /**
     * Optional. Timestamp indicating when the spec was created at the source.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp original_create_time = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getOriginalCreateTime()
    {
        return $this->original_create_time;
    }

    public function hasOriginalCreateTime()
    {
        return isset($this->original_create_time);
    }

    public function clearOriginalCreateTime()
    {
        unset($this->original_create_time);
    }

    /**
     * Optional. Timestamp indicating when the spec was created at the source.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp original_create_time = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setOriginalCreateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->original_create_time = $var;

        return $this;
    }

    /**
     * Required. Timestamp indicating when the spec was last updated at the
     * source.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp original_update_time = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getOriginalUpdateTime()
    {
        return $this->original_update_time;
    }

    public function hasOriginalUpdateTime()
    {
        return isset($this->original_update_time);
    }

    public function clearOriginalUpdateTime()
    {
        unset($this->original_update_time);
    }

    /**
     * Required. Timestamp indicating when the spec was last updated at the
     * source.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp original_update_time = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setOriginalUpdateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->original_update_time = $var;

        return $this;
    }

}

