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

namespace Google\Cloud\ApigeeRegistry\V1;

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

/**
 * Describes a version of an API in a structured way.
 * ApiSpecs provide formal descriptions that consumers can use to use a version.
 * ApiSpec resources are intended to be fully-resolved descriptions of an
 * ApiVersion. When specs consist of multiple files, these should be bundled
 * together (e.g., in a zip archive) and stored as a unit. Multiple specs can
 * exist to provide representations in different API description formats.
 * Synchronization of these representations would be provided by tooling and
 * background services.
 *
 * Generated from protobuf message <code>google.cloud.apigeeregistry.v1.ApiSpec</code>
 */
class ApiSpec extends \Google\Protobuf\Internal\Message
{
    /**
     * Resource name.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     */
    private $name = '';
    /**
     * A possibly-hierarchical name used to refer to the spec from other specs.
     *
     * Generated from protobuf field <code>string filename = 2;</code>
     */
    private $filename = '';
    /**
     * A detailed description.
     *
     * Generated from protobuf field <code>string description = 3;</code>
     */
    private $description = '';
    /**
     * Output only. Immutable. The revision ID of the spec.
     * A new revision is committed whenever the spec contents are changed.
     * The format is an 8-character hexadecimal string.
     *
     * Generated from protobuf field <code>string revision_id = 4 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $revision_id = '';
    /**
     * Output only. Creation timestamp; when the spec resource was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $create_time = null;
    /**
     * Output only. Revision creation timestamp; when the represented revision was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp revision_create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $revision_create_time = null;
    /**
     * Output only. Last update timestamp: when the represented revision was last modified.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp revision_update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $revision_update_time = null;
    /**
     * A style (format) descriptor for this spec that is specified as a Media Type
     * (https://en.wikipedia.org/wiki/Media_type). Possible values include
     * `application/vnd.apigee.proto`, `application/vnd.apigee.openapi`, and
     * `application/vnd.apigee.graphql`, with possible suffixes representing
     * compression types. These hypothetical names are defined in the vendor tree
     * defined in RFC6838 (https://tools.ietf.org/html/rfc6838) and are not final.
     * Content types can specify compression. Currently only GZip compression is
     * supported (indicated with "+gzip").
     *
     * Generated from protobuf field <code>string mime_type = 8;</code>
     */
    private $mime_type = '';
    /**
     * Output only. The size of the spec file in bytes. If the spec is gzipped, this is the
     * size of the uncompressed spec.
     *
     * Generated from protobuf field <code>int32 size_bytes = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $size_bytes = 0;
    /**
     * Output only. A SHA-256 hash of the spec's contents. If the spec is gzipped, this is
     * the hash of the uncompressed spec.
     *
     * Generated from protobuf field <code>string hash = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $hash = '';
    /**
     * The original source URI of the spec (if one exists).
     * This is an external location that can be used for reference purposes
     * but which may not be authoritative since this external resource may
     * change after the spec is retrieved.
     *
     * Generated from protobuf field <code>string source_uri = 11;</code>
     */
    private $source_uri = '';
    /**
     * Input only. The contents of the spec.
     * Provided by API callers when specs are created or updated.
     * To access the contents of a spec, use GetApiSpecContents.
     *
     * Generated from protobuf field <code>bytes contents = 12 [(.google.api.field_behavior) = INPUT_ONLY];</code>
     */
    private $contents = '';
    /**
     * Labels attach identifying metadata to resources. Identifying metadata can
     * be used to filter list operations.
     * Label keys and values can be no longer than 64 characters
     * (Unicode codepoints), can only contain lowercase letters, numeric
     * characters, underscores and dashes. International characters are allowed.
     * No more than 64 user labels can be associated with one resource (System
     * labels are excluded).
     * See https://goo.gl/xmQnxf for more information and examples of labels.
     * System reserved label keys are prefixed with
     * `apigeeregistry.googleapis.com/` and cannot be changed.
     *
     * Generated from protobuf field <code>map<string, string> labels = 14;</code>
     */
    private $labels;
    /**
     * Annotations attach non-identifying metadata to resources.
     * Annotation keys and values are less restricted than those of labels, but
     * should be generally used for small values of broad interest. Larger, topic-
     * specific metadata should be stored in Artifacts.
     *
     * Generated from protobuf field <code>map<string, string> annotations = 15;</code>
     */
    private $annotations;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Resource name.
     *     @type string $filename
     *           A possibly-hierarchical name used to refer to the spec from other specs.
     *     @type string $description
     *           A detailed description.
     *     @type string $revision_id
     *           Output only. Immutable. The revision ID of the spec.
     *           A new revision is committed whenever the spec contents are changed.
     *           The format is an 8-character hexadecimal string.
     *     @type \Google\Protobuf\Timestamp $create_time
     *           Output only. Creation timestamp; when the spec resource was created.
     *     @type \Google\Protobuf\Timestamp $revision_create_time
     *           Output only. Revision creation timestamp; when the represented revision was created.
     *     @type \Google\Protobuf\Timestamp $revision_update_time
     *           Output only. Last update timestamp: when the represented revision was last modified.
     *     @type string $mime_type
     *           A style (format) descriptor for this spec that is specified as a Media Type
     *           (https://en.wikipedia.org/wiki/Media_type). Possible values include
     *           `application/vnd.apigee.proto`, `application/vnd.apigee.openapi`, and
     *           `application/vnd.apigee.graphql`, with possible suffixes representing
     *           compression types. These hypothetical names are defined in the vendor tree
     *           defined in RFC6838 (https://tools.ietf.org/html/rfc6838) and are not final.
     *           Content types can specify compression. Currently only GZip compression is
     *           supported (indicated with "+gzip").
     *     @type int $size_bytes
     *           Output only. The size of the spec file in bytes. If the spec is gzipped, this is the
     *           size of the uncompressed spec.
     *     @type string $hash
     *           Output only. A SHA-256 hash of the spec's contents. If the spec is gzipped, this is
     *           the hash of the uncompressed spec.
     *     @type string $source_uri
     *           The original source URI of the spec (if one exists).
     *           This is an external location that can be used for reference purposes
     *           but which may not be authoritative since this external resource may
     *           change after the spec is retrieved.
     *     @type string $contents
     *           Input only. The contents of the spec.
     *           Provided by API callers when specs are created or updated.
     *           To access the contents of a spec, use GetApiSpecContents.
     *     @type array|\Google\Protobuf\Internal\MapField $labels
     *           Labels attach identifying metadata to resources. Identifying metadata can
     *           be used to filter list operations.
     *           Label keys and values can be no longer than 64 characters
     *           (Unicode codepoints), can only contain lowercase letters, numeric
     *           characters, underscores and dashes. International characters are allowed.
     *           No more than 64 user labels can be associated with one resource (System
     *           labels are excluded).
     *           See https://goo.gl/xmQnxf for more information and examples of labels.
     *           System reserved label keys are prefixed with
     *           `apigeeregistry.googleapis.com/` and cannot be changed.
     *     @type array|\Google\Protobuf\Internal\MapField $annotations
     *           Annotations attach non-identifying metadata to resources.
     *           Annotation keys and values are less restricted than those of labels, but
     *           should be generally used for small values of broad interest. Larger, topic-
     *           specific metadata should be stored in Artifacts.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Apigeeregistry\V1\RegistryModels::initOnce();
        parent::__construct($data);
    }

    /**
     * Resource name.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Resource name.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * A possibly-hierarchical name used to refer to the spec from other specs.
     *
     * Generated from protobuf field <code>string filename = 2;</code>
     * @return string
     */
    public function getFilename()
    {
        return $this->filename;
    }

    /**
     * A possibly-hierarchical name used to refer to the spec from other specs.
     *
     * Generated from protobuf field <code>string filename = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setFilename($var)
    {
        GPBUtil::checkString($var, True);
        $this->filename = $var;

        return $this;
    }

    /**
     * A detailed description.
     *
     * Generated from protobuf field <code>string description = 3;</code>
     * @return string
     */
    public function getDescription()
    {
        return $this->description;
    }

    /**
     * A detailed description.
     *
     * Generated from protobuf field <code>string description = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setDescription($var)
    {
        GPBUtil::checkString($var, True);
        $this->description = $var;

        return $this;
    }

    /**
     * Output only. Immutable. The revision ID of the spec.
     * A new revision is committed whenever the spec contents are changed.
     * The format is an 8-character hexadecimal string.
     *
     * Generated from protobuf field <code>string revision_id = 4 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getRevisionId()
    {
        return $this->revision_id;
    }

    /**
     * Output only. Immutable. The revision ID of the spec.
     * A new revision is committed whenever the spec contents are changed.
     * The format is an 8-character hexadecimal string.
     *
     * Generated from protobuf field <code>string revision_id = 4 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setRevisionId($var)
    {
        GPBUtil::checkString($var, True);
        $this->revision_id = $var;

        return $this;
    }

    /**
     * Output only. Creation timestamp; when the spec resource was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getCreateTime()
    {
        return $this->create_time;
    }

    public function hasCreateTime()
    {
        return isset($this->create_time);
    }

    public function clearCreateTime()
    {
        unset($this->create_time);
    }

    /**
     * Output only. Creation timestamp; when the spec resource was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setCreateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->create_time = $var;

        return $this;
    }

    /**
     * Output only. Revision creation timestamp; when the represented revision was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp revision_create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getRevisionCreateTime()
    {
        return $this->revision_create_time;
    }

    public function hasRevisionCreateTime()
    {
        return isset($this->revision_create_time);
    }

    public function clearRevisionCreateTime()
    {
        unset($this->revision_create_time);
    }

    /**
     * Output only. Revision creation timestamp; when the represented revision was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp revision_create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setRevisionCreateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->revision_create_time = $var;

        return $this;
    }

    /**
     * Output only. Last update timestamp: when the represented revision was last modified.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp revision_update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getRevisionUpdateTime()
    {
        return $this->revision_update_time;
    }

    public function hasRevisionUpdateTime()
    {
        return isset($this->revision_update_time);
    }

    public function clearRevisionUpdateTime()
    {
        unset($this->revision_update_time);
    }

    /**
     * Output only. Last update timestamp: when the represented revision was last modified.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp revision_update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setRevisionUpdateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->revision_update_time = $var;

        return $this;
    }

    /**
     * A style (format) descriptor for this spec that is specified as a Media Type
     * (https://en.wikipedia.org/wiki/Media_type). Possible values include
     * `application/vnd.apigee.proto`, `application/vnd.apigee.openapi`, and
     * `application/vnd.apigee.graphql`, with possible suffixes representing
     * compression types. These hypothetical names are defined in the vendor tree
     * defined in RFC6838 (https://tools.ietf.org/html/rfc6838) and are not final.
     * Content types can specify compression. Currently only GZip compression is
     * supported (indicated with "+gzip").
     *
     * Generated from protobuf field <code>string mime_type = 8;</code>
     * @return string
     */
    public function getMimeType()
    {
        return $this->mime_type;
    }

    /**
     * A style (format) descriptor for this spec that is specified as a Media Type
     * (https://en.wikipedia.org/wiki/Media_type). Possible values include
     * `application/vnd.apigee.proto`, `application/vnd.apigee.openapi`, and
     * `application/vnd.apigee.graphql`, with possible suffixes representing
     * compression types. These hypothetical names are defined in the vendor tree
     * defined in RFC6838 (https://tools.ietf.org/html/rfc6838) and are not final.
     * Content types can specify compression. Currently only GZip compression is
     * supported (indicated with "+gzip").
     *
     * Generated from protobuf field <code>string mime_type = 8;</code>
     * @param string $var
     * @return $this
     */
    public function setMimeType($var)
    {
        GPBUtil::checkString($var, True);
        $this->mime_type = $var;

        return $this;
    }

    /**
     * Output only. The size of the spec file in bytes. If the spec is gzipped, this is the
     * size of the uncompressed spec.
     *
     * Generated from protobuf field <code>int32 size_bytes = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int
     */
    public function getSizeBytes()
    {
        return $this->size_bytes;
    }

    /**
     * Output only. The size of the spec file in bytes. If the spec is gzipped, this is the
     * size of the uncompressed spec.
     *
     * Generated from protobuf field <code>int32 size_bytes = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int $var
     * @return $this
     */
    public function setSizeBytes($var)
    {
        GPBUtil::checkInt32($var);
        $this->size_bytes = $var;

        return $this;
    }

    /**
     * Output only. A SHA-256 hash of the spec's contents. If the spec is gzipped, this is
     * the hash of the uncompressed spec.
     *
     * Generated from protobuf field <code>string hash = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getHash()
    {
        return $this->hash;
    }

    /**
     * Output only. A SHA-256 hash of the spec's contents. If the spec is gzipped, this is
     * the hash of the uncompressed spec.
     *
     * Generated from protobuf field <code>string hash = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setHash($var)
    {
        GPBUtil::checkString($var, True);
        $this->hash = $var;

        return $this;
    }

    /**
     * The original source URI of the spec (if one exists).
     * This is an external location that can be used for reference purposes
     * but which may not be authoritative since this external resource may
     * change after the spec is retrieved.
     *
     * Generated from protobuf field <code>string source_uri = 11;</code>
     * @return string
     */
    public function getSourceUri()
    {
        return $this->source_uri;
    }

    /**
     * The original source URI of the spec (if one exists).
     * This is an external location that can be used for reference purposes
     * but which may not be authoritative since this external resource may
     * change after the spec is retrieved.
     *
     * Generated from protobuf field <code>string source_uri = 11;</code>
     * @param string $var
     * @return $this
     */
    public function setSourceUri($var)
    {
        GPBUtil::checkString($var, True);
        $this->source_uri = $var;

        return $this;
    }

    /**
     * Input only. The contents of the spec.
     * Provided by API callers when specs are created or updated.
     * To access the contents of a spec, use GetApiSpecContents.
     *
     * Generated from protobuf field <code>bytes contents = 12 [(.google.api.field_behavior) = INPUT_ONLY];</code>
     * @return string
     */
    public function getContents()
    {
        return $this->contents;
    }

    /**
     * Input only. The contents of the spec.
     * Provided by API callers when specs are created or updated.
     * To access the contents of a spec, use GetApiSpecContents.
     *
     * Generated from protobuf field <code>bytes contents = 12 [(.google.api.field_behavior) = INPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setContents($var)
    {
        GPBUtil::checkString($var, False);
        $this->contents = $var;

        return $this;
    }

    /**
     * Labels attach identifying metadata to resources. Identifying metadata can
     * be used to filter list operations.
     * Label keys and values can be no longer than 64 characters
     * (Unicode codepoints), can only contain lowercase letters, numeric
     * characters, underscores and dashes. International characters are allowed.
     * No more than 64 user labels can be associated with one resource (System
     * labels are excluded).
     * See https://goo.gl/xmQnxf for more information and examples of labels.
     * System reserved label keys are prefixed with
     * `apigeeregistry.googleapis.com/` and cannot be changed.
     *
     * Generated from protobuf field <code>map<string, string> labels = 14;</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getLabels()
    {
        return $this->labels;
    }

    /**
     * Labels attach identifying metadata to resources. Identifying metadata can
     * be used to filter list operations.
     * Label keys and values can be no longer than 64 characters
     * (Unicode codepoints), can only contain lowercase letters, numeric
     * characters, underscores and dashes. International characters are allowed.
     * No more than 64 user labels can be associated with one resource (System
     * labels are excluded).
     * See https://goo.gl/xmQnxf for more information and examples of labels.
     * System reserved label keys are prefixed with
     * `apigeeregistry.googleapis.com/` and cannot be changed.
     *
     * Generated from protobuf field <code>map<string, string> labels = 14;</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setLabels($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING);
        $this->labels = $arr;

        return $this;
    }

    /**
     * Annotations attach non-identifying metadata to resources.
     * Annotation keys and values are less restricted than those of labels, but
     * should be generally used for small values of broad interest. Larger, topic-
     * specific metadata should be stored in Artifacts.
     *
     * Generated from protobuf field <code>map<string, string> annotations = 15;</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getAnnotations()
    {
        return $this->annotations;
    }

    /**
     * Annotations attach non-identifying metadata to resources.
     * Annotation keys and values are less restricted than those of labels, but
     * should be generally used for small values of broad interest. Larger, topic-
     * specific metadata should be stored in Artifacts.
     *
     * Generated from protobuf field <code>map<string, string> annotations = 15;</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setAnnotations($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING);
        $this->annotations = $arr;

        return $this;
    }

}

