<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: grafeas/v1/package.proto

namespace Grafeas\V1;

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

/**
 * Version contains structured information about the version of a package.
 *
 * Generated from protobuf message <code>grafeas.v1.Version</code>
 */
class Version extends \Google\Protobuf\Internal\Message
{
    /**
     * Used to correct mistakes in the version numbering scheme.
     *
     * Generated from protobuf field <code>int32 epoch = 1;</code>
     */
    private $epoch = 0;
    /**
     * Required only when version kind is NORMAL. The main part of the version
     * name.
     *
     * Generated from protobuf field <code>string name = 2;</code>
     */
    private $name = '';
    /**
     * The iteration of the package build from the above version.
     *
     * Generated from protobuf field <code>string revision = 3;</code>
     */
    private $revision = '';
    /**
     * Whether this version is specifying part of an inclusive range. Grafeas
     * does not have the capability to specify version ranges; instead we have
     * fields that specify start version and end versions. At times this is
     * insufficient - we also need to specify whether the version is included in
     * the range or is excluded from the range. This boolean is expected to be set
     * to true when the version is included in a range.
     *
     * Generated from protobuf field <code>bool inclusive = 6;</code>
     */
    private $inclusive = false;
    /**
     * Required. Distinguishes between sentinel MIN/MAX versions and normal
     * versions.
     *
     * Generated from protobuf field <code>.grafeas.v1.Version.VersionKind kind = 4;</code>
     */
    private $kind = 0;
    /**
     * Human readable version string. This string is of the form
     * <epoch>:<name>-<revision> and is only set when kind is NORMAL.
     *
     * Generated from protobuf field <code>string full_name = 5;</code>
     */
    private $full_name = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $epoch
     *           Used to correct mistakes in the version numbering scheme.
     *     @type string $name
     *           Required only when version kind is NORMAL. The main part of the version
     *           name.
     *     @type string $revision
     *           The iteration of the package build from the above version.
     *     @type bool $inclusive
     *           Whether this version is specifying part of an inclusive range. Grafeas
     *           does not have the capability to specify version ranges; instead we have
     *           fields that specify start version and end versions. At times this is
     *           insufficient - we also need to specify whether the version is included in
     *           the range or is excluded from the range. This boolean is expected to be set
     *           to true when the version is included in a range.
     *     @type int $kind
     *           Required. Distinguishes between sentinel MIN/MAX versions and normal
     *           versions.
     *     @type string $full_name
     *           Human readable version string. This string is of the form
     *           <epoch>:<name>-<revision> and is only set when kind is NORMAL.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Grafeas\V1\Package::initOnce();
        parent::__construct($data);
    }

    /**
     * Used to correct mistakes in the version numbering scheme.
     *
     * Generated from protobuf field <code>int32 epoch = 1;</code>
     * @return int
     */
    public function getEpoch()
    {
        return $this->epoch;
    }

    /**
     * Used to correct mistakes in the version numbering scheme.
     *
     * Generated from protobuf field <code>int32 epoch = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setEpoch($var)
    {
        GPBUtil::checkInt32($var);
        $this->epoch = $var;

        return $this;
    }

    /**
     * Required only when version kind is NORMAL. The main part of the version
     * name.
     *
     * Generated from protobuf field <code>string name = 2;</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Required only when version kind is NORMAL. The main part of the version
     * name.
     *
     * Generated from protobuf field <code>string name = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * The iteration of the package build from the above version.
     *
     * Generated from protobuf field <code>string revision = 3;</code>
     * @return string
     */
    public function getRevision()
    {
        return $this->revision;
    }

    /**
     * The iteration of the package build from the above version.
     *
     * Generated from protobuf field <code>string revision = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setRevision($var)
    {
        GPBUtil::checkString($var, True);
        $this->revision = $var;

        return $this;
    }

    /**
     * Whether this version is specifying part of an inclusive range. Grafeas
     * does not have the capability to specify version ranges; instead we have
     * fields that specify start version and end versions. At times this is
     * insufficient - we also need to specify whether the version is included in
     * the range or is excluded from the range. This boolean is expected to be set
     * to true when the version is included in a range.
     *
     * Generated from protobuf field <code>bool inclusive = 6;</code>
     * @return bool
     */
    public function getInclusive()
    {
        return $this->inclusive;
    }

    /**
     * Whether this version is specifying part of an inclusive range. Grafeas
     * does not have the capability to specify version ranges; instead we have
     * fields that specify start version and end versions. At times this is
     * insufficient - we also need to specify whether the version is included in
     * the range or is excluded from the range. This boolean is expected to be set
     * to true when the version is included in a range.
     *
     * Generated from protobuf field <code>bool inclusive = 6;</code>
     * @param bool $var
     * @return $this
     */
    public function setInclusive($var)
    {
        GPBUtil::checkBool($var);
        $this->inclusive = $var;

        return $this;
    }

    /**
     * Required. Distinguishes between sentinel MIN/MAX versions and normal
     * versions.
     *
     * Generated from protobuf field <code>.grafeas.v1.Version.VersionKind kind = 4;</code>
     * @return int
     */
    public function getKind()
    {
        return $this->kind;
    }

    /**
     * Required. Distinguishes between sentinel MIN/MAX versions and normal
     * versions.
     *
     * Generated from protobuf field <code>.grafeas.v1.Version.VersionKind kind = 4;</code>
     * @param int $var
     * @return $this
     */
    public function setKind($var)
    {
        GPBUtil::checkEnum($var, \Grafeas\V1\Version\VersionKind::class);
        $this->kind = $var;

        return $this;
    }

    /**
     * Human readable version string. This string is of the form
     * <epoch>:<name>-<revision> and is only set when kind is NORMAL.
     *
     * Generated from protobuf field <code>string full_name = 5;</code>
     * @return string
     */
    public function getFullName()
    {
        return $this->full_name;
    }

    /**
     * Human readable version string. This string is of the form
     * <epoch>:<name>-<revision> and is only set when kind is NORMAL.
     *
     * Generated from protobuf field <code>string full_name = 5;</code>
     * @param string $var
     * @return $this
     */
    public function setFullName($var)
    {
        GPBUtil::checkString($var, True);
        $this->full_name = $var;

        return $this;
    }

}

