Class ApiSpec

java.lang.Object
com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessage
com.google.protobuf.GeneratedMessage
com.google.cloud.apigeeregistry.v1.ApiSpec
All Implemented Interfaces:
ApiSpecOrBuilder, com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Serializable

@Generated public final class ApiSpec extends com.google.protobuf.GeneratedMessage implements ApiSpecOrBuilder
 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.
 
Protobuf type google.cloud.apigeeregistry.v1.ApiSpec
See Also:
  • Field Details

    • NAME_FIELD_NUMBER

      public static final int NAME_FIELD_NUMBER
      See Also:
    • FILENAME_FIELD_NUMBER

      public static final int FILENAME_FIELD_NUMBER
      See Also:
    • DESCRIPTION_FIELD_NUMBER

      public static final int DESCRIPTION_FIELD_NUMBER
      See Also:
    • REVISION_ID_FIELD_NUMBER

      public static final int REVISION_ID_FIELD_NUMBER
      See Also:
    • CREATE_TIME_FIELD_NUMBER

      public static final int CREATE_TIME_FIELD_NUMBER
      See Also:
    • REVISION_CREATE_TIME_FIELD_NUMBER

      public static final int REVISION_CREATE_TIME_FIELD_NUMBER
      See Also:
    • REVISION_UPDATE_TIME_FIELD_NUMBER

      public static final int REVISION_UPDATE_TIME_FIELD_NUMBER
      See Also:
    • MIME_TYPE_FIELD_NUMBER

      public static final int MIME_TYPE_FIELD_NUMBER
      See Also:
    • SIZE_BYTES_FIELD_NUMBER

      public static final int SIZE_BYTES_FIELD_NUMBER
      See Also:
    • HASH_FIELD_NUMBER

      public static final int HASH_FIELD_NUMBER
      See Also:
    • SOURCE_URI_FIELD_NUMBER

      public static final int SOURCE_URI_FIELD_NUMBER
      See Also:
    • CONTENTS_FIELD_NUMBER

      public static final int CONTENTS_FIELD_NUMBER
      See Also:
    • LABELS_FIELD_NUMBER

      public static final int LABELS_FIELD_NUMBER
      See Also:
    • ANNOTATIONS_FIELD_NUMBER

      public static final int ANNOTATIONS_FIELD_NUMBER
      See Also:
  • Method Details

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetMapFieldReflection

      protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
      Overrides:
      internalGetMapFieldReflection in class com.google.protobuf.GeneratedMessage
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage
    • getName

      public String getName()
       Resource name.
       
      string name = 1;
      Specified by:
      getName in interface ApiSpecOrBuilder
      Returns:
      The name.
    • getNameBytes

      public com.google.protobuf.ByteString getNameBytes()
       Resource name.
       
      string name = 1;
      Specified by:
      getNameBytes in interface ApiSpecOrBuilder
      Returns:
      The bytes for name.
    • getFilename

      public String getFilename()
       A possibly-hierarchical name used to refer to the spec from other specs.
       
      string filename = 2;
      Specified by:
      getFilename in interface ApiSpecOrBuilder
      Returns:
      The filename.
    • getFilenameBytes

      public com.google.protobuf.ByteString getFilenameBytes()
       A possibly-hierarchical name used to refer to the spec from other specs.
       
      string filename = 2;
      Specified by:
      getFilenameBytes in interface ApiSpecOrBuilder
      Returns:
      The bytes for filename.
    • getDescription

      public String getDescription()
       A detailed description.
       
      string description = 3;
      Specified by:
      getDescription in interface ApiSpecOrBuilder
      Returns:
      The description.
    • getDescriptionBytes

      public com.google.protobuf.ByteString getDescriptionBytes()
       A detailed description.
       
      string description = 3;
      Specified by:
      getDescriptionBytes in interface ApiSpecOrBuilder
      Returns:
      The bytes for description.
    • getRevisionId

      public String getRevisionId()
       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.
       
      string revision_id = 4 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getRevisionId in interface ApiSpecOrBuilder
      Returns:
      The revisionId.
    • getRevisionIdBytes

      public com.google.protobuf.ByteString getRevisionIdBytes()
       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.
       
      string revision_id = 4 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getRevisionIdBytes in interface ApiSpecOrBuilder
      Returns:
      The bytes for revisionId.
    • hasCreateTime

      public boolean hasCreateTime()
       Output only. Creation timestamp; when the spec resource was created.
       
      .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      hasCreateTime in interface ApiSpecOrBuilder
      Returns:
      Whether the createTime field is set.
    • getCreateTime

      public com.google.protobuf.Timestamp getCreateTime()
       Output only. Creation timestamp; when the spec resource was created.
       
      .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getCreateTime in interface ApiSpecOrBuilder
      Returns:
      The createTime.
    • getCreateTimeOrBuilder

      public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder()
       Output only. Creation timestamp; when the spec resource was created.
       
      .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getCreateTimeOrBuilder in interface ApiSpecOrBuilder
    • hasRevisionCreateTime

      public boolean hasRevisionCreateTime()
       Output only. Revision creation timestamp; when the represented revision was created.
       
      .google.protobuf.Timestamp revision_create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      hasRevisionCreateTime in interface ApiSpecOrBuilder
      Returns:
      Whether the revisionCreateTime field is set.
    • getRevisionCreateTime

      public com.google.protobuf.Timestamp getRevisionCreateTime()
       Output only. Revision creation timestamp; when the represented revision was created.
       
      .google.protobuf.Timestamp revision_create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getRevisionCreateTime in interface ApiSpecOrBuilder
      Returns:
      The revisionCreateTime.
    • getRevisionCreateTimeOrBuilder

      public com.google.protobuf.TimestampOrBuilder getRevisionCreateTimeOrBuilder()
       Output only. Revision creation timestamp; when the represented revision was created.
       
      .google.protobuf.Timestamp revision_create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getRevisionCreateTimeOrBuilder in interface ApiSpecOrBuilder
    • hasRevisionUpdateTime

      public boolean hasRevisionUpdateTime()
       Output only. Last update timestamp: when the represented revision was last modified.
       
      .google.protobuf.Timestamp revision_update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      hasRevisionUpdateTime in interface ApiSpecOrBuilder
      Returns:
      Whether the revisionUpdateTime field is set.
    • getRevisionUpdateTime

      public com.google.protobuf.Timestamp getRevisionUpdateTime()
       Output only. Last update timestamp: when the represented revision was last modified.
       
      .google.protobuf.Timestamp revision_update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getRevisionUpdateTime in interface ApiSpecOrBuilder
      Returns:
      The revisionUpdateTime.
    • getRevisionUpdateTimeOrBuilder

      public com.google.protobuf.TimestampOrBuilder getRevisionUpdateTimeOrBuilder()
       Output only. Last update timestamp: when the represented revision was last modified.
       
      .google.protobuf.Timestamp revision_update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getRevisionUpdateTimeOrBuilder in interface ApiSpecOrBuilder
    • getMimeType

      public String getMimeType()
       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").
       
      string mime_type = 8;
      Specified by:
      getMimeType in interface ApiSpecOrBuilder
      Returns:
      The mimeType.
    • getMimeTypeBytes

      public com.google.protobuf.ByteString getMimeTypeBytes()
       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").
       
      string mime_type = 8;
      Specified by:
      getMimeTypeBytes in interface ApiSpecOrBuilder
      Returns:
      The bytes for mimeType.
    • getSizeBytes

      public int getSizeBytes()
       Output only. The size of the spec file in bytes. If the spec is gzipped, this is the
       size of the uncompressed spec.
       
      int32 size_bytes = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getSizeBytes in interface ApiSpecOrBuilder
      Returns:
      The sizeBytes.
    • getHash

      public String getHash()
       Output only. A SHA-256 hash of the spec's contents. If the spec is gzipped, this is
       the hash of the uncompressed spec.
       
      string hash = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getHash in interface ApiSpecOrBuilder
      Returns:
      The hash.
    • getHashBytes

      public com.google.protobuf.ByteString getHashBytes()
       Output only. A SHA-256 hash of the spec's contents. If the spec is gzipped, this is
       the hash of the uncompressed spec.
       
      string hash = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getHashBytes in interface ApiSpecOrBuilder
      Returns:
      The bytes for hash.
    • getSourceUri

      public String getSourceUri()
       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.
       
      string source_uri = 11;
      Specified by:
      getSourceUri in interface ApiSpecOrBuilder
      Returns:
      The sourceUri.
    • getSourceUriBytes

      public com.google.protobuf.ByteString getSourceUriBytes()
       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.
       
      string source_uri = 11;
      Specified by:
      getSourceUriBytes in interface ApiSpecOrBuilder
      Returns:
      The bytes for sourceUri.
    • getContents

      public com.google.protobuf.ByteString getContents()
       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.
       
      bytes contents = 12 [(.google.api.field_behavior) = INPUT_ONLY];
      Specified by:
      getContents in interface ApiSpecOrBuilder
      Returns:
      The contents.
    • getLabelsCount

      public int getLabelsCount()
      Description copied from interface: ApiSpecOrBuilder
       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.
       
      map<string, string> labels = 14;
      Specified by:
      getLabelsCount in interface ApiSpecOrBuilder
    • containsLabels

      public boolean containsLabels(String key)
       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.
       
      map<string, string> labels = 14;
      Specified by:
      containsLabels in interface ApiSpecOrBuilder
    • getLabels

      @Deprecated public Map<String,String> getLabels()
      Deprecated.
      Use getLabelsMap() instead.
      Specified by:
      getLabels in interface ApiSpecOrBuilder
    • getLabelsMap

      public Map<String,String> getLabelsMap()
       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.
       
      map<string, string> labels = 14;
      Specified by:
      getLabelsMap in interface ApiSpecOrBuilder
    • getLabelsOrDefault

      public String getLabelsOrDefault(String key, String defaultValue)
       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.
       
      map<string, string> labels = 14;
      Specified by:
      getLabelsOrDefault in interface ApiSpecOrBuilder
    • getLabelsOrThrow

      public String getLabelsOrThrow(String key)
       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.
       
      map<string, string> labels = 14;
      Specified by:
      getLabelsOrThrow in interface ApiSpecOrBuilder
    • getAnnotationsCount

      public int getAnnotationsCount()
      Description copied from interface: ApiSpecOrBuilder
       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.
       
      map<string, string> annotations = 15;
      Specified by:
      getAnnotationsCount in interface ApiSpecOrBuilder
    • containsAnnotations

      public boolean containsAnnotations(String key)
       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.
       
      map<string, string> annotations = 15;
      Specified by:
      containsAnnotations in interface ApiSpecOrBuilder
    • getAnnotations

      @Deprecated public Map<String,String> getAnnotations()
      Deprecated.
      Use getAnnotationsMap() instead.
      Specified by:
      getAnnotations in interface ApiSpecOrBuilder
    • getAnnotationsMap

      public Map<String,String> getAnnotationsMap()
       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.
       
      map<string, string> annotations = 15;
      Specified by:
      getAnnotationsMap in interface ApiSpecOrBuilder
    • getAnnotationsOrDefault

      public String getAnnotationsOrDefault(String key, String defaultValue)
       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.
       
      map<string, string> annotations = 15;
      Specified by:
      getAnnotationsOrDefault in interface ApiSpecOrBuilder
    • getAnnotationsOrThrow

      public String getAnnotationsOrThrow(String key)
       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.
       
      map<string, string> annotations = 15;
      Specified by:
      getAnnotationsOrThrow in interface ApiSpecOrBuilder
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessage
    • writeTo

      public void writeTo(com.google.protobuf.CodedOutputStream output) throws IOException
      Specified by:
      writeTo in interface com.google.protobuf.MessageLite
      Overrides:
      writeTo in class com.google.protobuf.GeneratedMessage
      Throws:
      IOException
    • getSerializedSize

      public int getSerializedSize()
      Specified by:
      getSerializedSize in interface com.google.protobuf.MessageLite
      Overrides:
      getSerializedSize in class com.google.protobuf.GeneratedMessage
    • equals

      public boolean equals(Object obj)
      Specified by:
      equals in interface com.google.protobuf.Message
      Overrides:
      equals in class com.google.protobuf.AbstractMessage
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface com.google.protobuf.Message
      Overrides:
      hashCode in class com.google.protobuf.AbstractMessage
    • parseFrom

      public static ApiSpec parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static ApiSpec parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static ApiSpec parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static ApiSpec parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static ApiSpec parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static ApiSpec parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static ApiSpec parseFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static ApiSpec parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static ApiSpec parseDelimitedFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static ApiSpec parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseFrom

      public static ApiSpec parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static ApiSpec parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • newBuilderForType

      public ApiSpec.Builder newBuilderForType()
      Specified by:
      newBuilderForType in interface com.google.protobuf.Message
      Specified by:
      newBuilderForType in interface com.google.protobuf.MessageLite
    • newBuilder

      public static ApiSpec.Builder newBuilder()
    • newBuilder

      public static ApiSpec.Builder newBuilder(ApiSpec prototype)
    • toBuilder

      public ApiSpec.Builder toBuilder()
      Specified by:
      toBuilder in interface com.google.protobuf.Message
      Specified by:
      toBuilder in interface com.google.protobuf.MessageLite
    • newBuilderForType

      protected ApiSpec.Builder newBuilderForType(com.google.protobuf.AbstractMessage.BuilderParent parent)
      Overrides:
      newBuilderForType in class com.google.protobuf.AbstractMessage
    • getDefaultInstance

      public static ApiSpec getDefaultInstance()
    • parser

      public static com.google.protobuf.Parser<ApiSpec> parser()
    • getParserForType

      public com.google.protobuf.Parser<ApiSpec> getParserForType()
      Specified by:
      getParserForType in interface com.google.protobuf.Message
      Specified by:
      getParserForType in interface com.google.protobuf.MessageLite
      Overrides:
      getParserForType in class com.google.protobuf.GeneratedMessage
    • getDefaultInstanceForType

      public ApiSpec getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder