Class Spec

java.lang.Object
com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessage
com.google.protobuf.GeneratedMessage
com.google.cloud.apihub.v1.Spec
All Implemented Interfaces:
SpecOrBuilder, com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Serializable

@Generated public final class Spec extends com.google.protobuf.GeneratedMessage implements SpecOrBuilder
 Represents a spec associated with an API version in the API
 Hub. Note that specs of various types can be uploaded, however
 parsing of details is supported for OpenAPI spec currently.
 
Protobuf type google.cloud.apihub.v1.Spec
See Also:
  • Field Details

    • NAME_FIELD_NUMBER

      public static final int NAME_FIELD_NUMBER
      See Also:
    • DISPLAY_NAME_FIELD_NUMBER

      public static final int DISPLAY_NAME_FIELD_NUMBER
      See Also:
    • SPEC_TYPE_FIELD_NUMBER

      public static final int SPEC_TYPE_FIELD_NUMBER
      See Also:
    • CONTENTS_FIELD_NUMBER

      public static final int CONTENTS_FIELD_NUMBER
      See Also:
    • DETAILS_FIELD_NUMBER

      public static final int DETAILS_FIELD_NUMBER
      See Also:
    • SOURCE_URI_FIELD_NUMBER

      public static final int SOURCE_URI_FIELD_NUMBER
      See Also:
    • CREATE_TIME_FIELD_NUMBER

      public static final int CREATE_TIME_FIELD_NUMBER
      See Also:
    • UPDATE_TIME_FIELD_NUMBER

      public static final int UPDATE_TIME_FIELD_NUMBER
      See Also:
    • LINT_RESPONSE_FIELD_NUMBER

      public static final int LINT_RESPONSE_FIELD_NUMBER
      See Also:
    • ATTRIBUTES_FIELD_NUMBER

      public static final int ATTRIBUTES_FIELD_NUMBER
      See Also:
    • DOCUMENTATION_FIELD_NUMBER

      public static final int DOCUMENTATION_FIELD_NUMBER
      See Also:
    • PARSING_MODE_FIELD_NUMBER

      public static final int PARSING_MODE_FIELD_NUMBER
      See Also:
    • SOURCE_METADATA_FIELD_NUMBER

      public static final int SOURCE_METADATA_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()
       Identifier. The name of the spec.
      
       Format:
       `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
       
      string name = 1 [(.google.api.field_behavior) = IDENTIFIER];
      Specified by:
      getName in interface SpecOrBuilder
      Returns:
      The name.
    • getNameBytes

      public com.google.protobuf.ByteString getNameBytes()
       Identifier. The name of the spec.
      
       Format:
       `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
       
      string name = 1 [(.google.api.field_behavior) = IDENTIFIER];
      Specified by:
      getNameBytes in interface SpecOrBuilder
      Returns:
      The bytes for name.
    • getDisplayName

      public String getDisplayName()
       Required. The display name of the spec.
       This can contain the file name of the spec.
       
      string display_name = 2 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getDisplayName in interface SpecOrBuilder
      Returns:
      The displayName.
    • getDisplayNameBytes

      public com.google.protobuf.ByteString getDisplayNameBytes()
       Required. The display name of the spec.
       This can contain the file name of the spec.
       
      string display_name = 2 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getDisplayNameBytes in interface SpecOrBuilder
      Returns:
      The bytes for displayName.
    • hasSpecType

      public boolean hasSpecType()
       Required. The type of spec.
       The value should be one of the allowed values defined for
       `projects/{project}/locations/{location}/attributes/system-spec-type`
       attribute.
       The number of values for this attribute will be based on the
       cardinality of the attribute. The same can be retrieved via GetAttribute
       API.
      
       Note, this field is mandatory if content is provided.
       
      .google.cloud.apihub.v1.AttributeValues spec_type = 3 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      hasSpecType in interface SpecOrBuilder
      Returns:
      Whether the specType field is set.
    • getSpecType

      public AttributeValues getSpecType()
       Required. The type of spec.
       The value should be one of the allowed values defined for
       `projects/{project}/locations/{location}/attributes/system-spec-type`
       attribute.
       The number of values for this attribute will be based on the
       cardinality of the attribute. The same can be retrieved via GetAttribute
       API.
      
       Note, this field is mandatory if content is provided.
       
      .google.cloud.apihub.v1.AttributeValues spec_type = 3 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getSpecType in interface SpecOrBuilder
      Returns:
      The specType.
    • getSpecTypeOrBuilder

      public AttributeValuesOrBuilder getSpecTypeOrBuilder()
       Required. The type of spec.
       The value should be one of the allowed values defined for
       `projects/{project}/locations/{location}/attributes/system-spec-type`
       attribute.
       The number of values for this attribute will be based on the
       cardinality of the attribute. The same can be retrieved via GetAttribute
       API.
      
       Note, this field is mandatory if content is provided.
       
      .google.cloud.apihub.v1.AttributeValues spec_type = 3 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getSpecTypeOrBuilder in interface SpecOrBuilder
    • hasContents

      public boolean hasContents()
       Optional. Input only. The contents of the uploaded spec.
       
      .google.cloud.apihub.v1.SpecContents contents = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = INPUT_ONLY];
      Specified by:
      hasContents in interface SpecOrBuilder
      Returns:
      Whether the contents field is set.
    • getContents

      public SpecContents getContents()
       Optional. Input only. The contents of the uploaded spec.
       
      .google.cloud.apihub.v1.SpecContents contents = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = INPUT_ONLY];
      Specified by:
      getContents in interface SpecOrBuilder
      Returns:
      The contents.
    • getContentsOrBuilder

      public SpecContentsOrBuilder getContentsOrBuilder()
       Optional. Input only. The contents of the uploaded spec.
       
      .google.cloud.apihub.v1.SpecContents contents = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = INPUT_ONLY];
      Specified by:
      getContentsOrBuilder in interface SpecOrBuilder
    • hasDetails

      public boolean hasDetails()
       Output only. Details parsed from the spec.
       
      .google.cloud.apihub.v1.SpecDetails details = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      hasDetails in interface SpecOrBuilder
      Returns:
      Whether the details field is set.
    • getDetails

      public SpecDetails getDetails()
       Output only. Details parsed from the spec.
       
      .google.cloud.apihub.v1.SpecDetails details = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getDetails in interface SpecOrBuilder
      Returns:
      The details.
    • getDetailsOrBuilder

      public SpecDetailsOrBuilder getDetailsOrBuilder()
       Output only. Details parsed from the spec.
       
      .google.cloud.apihub.v1.SpecDetails details = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getDetailsOrBuilder in interface SpecOrBuilder
    • getSourceUri

      public String getSourceUri()
       Optional. The URI of the spec source in case file is uploaded
       from an external version control system.
       
      string source_uri = 6 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getSourceUri in interface SpecOrBuilder
      Returns:
      The sourceUri.
    • getSourceUriBytes

      public com.google.protobuf.ByteString getSourceUriBytes()
       Optional. The URI of the spec source in case file is uploaded
       from an external version control system.
       
      string source_uri = 6 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getSourceUriBytes in interface SpecOrBuilder
      Returns:
      The bytes for sourceUri.
    • hasCreateTime

      public boolean hasCreateTime()
       Output only. The time at which the spec was created.
       
      .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      hasCreateTime in interface SpecOrBuilder
      Returns:
      Whether the createTime field is set.
    • getCreateTime

      public com.google.protobuf.Timestamp getCreateTime()
       Output only. The time at which the spec was created.
       
      .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getCreateTime in interface SpecOrBuilder
      Returns:
      The createTime.
    • getCreateTimeOrBuilder

      public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder()
       Output only. The time at which the spec was created.
       
      .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getCreateTimeOrBuilder in interface SpecOrBuilder
    • hasUpdateTime

      public boolean hasUpdateTime()
       Output only. The time at which the spec was last updated.
       
      .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      hasUpdateTime in interface SpecOrBuilder
      Returns:
      Whether the updateTime field is set.
    • getUpdateTime

      public com.google.protobuf.Timestamp getUpdateTime()
       Output only. The time at which the spec was last updated.
       
      .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getUpdateTime in interface SpecOrBuilder
      Returns:
      The updateTime.
    • getUpdateTimeOrBuilder

      public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder()
       Output only. The time at which the spec was last updated.
       
      .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getUpdateTimeOrBuilder in interface SpecOrBuilder
    • hasLintResponse

      public boolean hasLintResponse()
       Optional. The lint response for the spec.
       
      .google.cloud.apihub.v1.LintResponse lint_response = 9 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      hasLintResponse in interface SpecOrBuilder
      Returns:
      Whether the lintResponse field is set.
    • getLintResponse

      public LintResponse getLintResponse()
       Optional. The lint response for the spec.
       
      .google.cloud.apihub.v1.LintResponse lint_response = 9 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getLintResponse in interface SpecOrBuilder
      Returns:
      The lintResponse.
    • getLintResponseOrBuilder

      public LintResponseOrBuilder getLintResponseOrBuilder()
       Optional. The lint response for the spec.
       
      .google.cloud.apihub.v1.LintResponse lint_response = 9 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getLintResponseOrBuilder in interface SpecOrBuilder
    • getAttributesCount

      public int getAttributesCount()
      Description copied from interface: SpecOrBuilder
       Optional. The list of user defined attributes associated with the spec.
       The key is the attribute name. It will be of the format:
       `projects/{project}/locations/{location}/attributes/{attribute}`.
       The value is the attribute values associated with the resource.
       
      map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 10 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getAttributesCount in interface SpecOrBuilder
    • containsAttributes

      public boolean containsAttributes(String key)
       Optional. The list of user defined attributes associated with the spec.
       The key is the attribute name. It will be of the format:
       `projects/{project}/locations/{location}/attributes/{attribute}`.
       The value is the attribute values associated with the resource.
       
      map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 10 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      containsAttributes in interface SpecOrBuilder
    • getAttributes

      @Deprecated public Map<String,AttributeValues> getAttributes()
      Deprecated.
      Use getAttributesMap() instead.
      Specified by:
      getAttributes in interface SpecOrBuilder
    • getAttributesMap

      public Map<String,AttributeValues> getAttributesMap()
       Optional. The list of user defined attributes associated with the spec.
       The key is the attribute name. It will be of the format:
       `projects/{project}/locations/{location}/attributes/{attribute}`.
       The value is the attribute values associated with the resource.
       
      map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 10 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getAttributesMap in interface SpecOrBuilder
    • getAttributesOrDefault

      public AttributeValues getAttributesOrDefault(String key, AttributeValues defaultValue)
       Optional. The list of user defined attributes associated with the spec.
       The key is the attribute name. It will be of the format:
       `projects/{project}/locations/{location}/attributes/{attribute}`.
       The value is the attribute values associated with the resource.
       
      map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 10 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getAttributesOrDefault in interface SpecOrBuilder
    • getAttributesOrThrow

      public AttributeValues getAttributesOrThrow(String key)
       Optional. The list of user defined attributes associated with the spec.
       The key is the attribute name. It will be of the format:
       `projects/{project}/locations/{location}/attributes/{attribute}`.
       The value is the attribute values associated with the resource.
       
      map<string, .google.cloud.apihub.v1.AttributeValues> attributes = 10 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getAttributesOrThrow in interface SpecOrBuilder
    • hasDocumentation

      public boolean hasDocumentation()
       Optional. The documentation of the spec.
       For OpenAPI spec, this will be populated from `externalDocs` in OpenAPI
       spec.
       
      .google.cloud.apihub.v1.Documentation documentation = 11 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      hasDocumentation in interface SpecOrBuilder
      Returns:
      Whether the documentation field is set.
    • getDocumentation

      public Documentation getDocumentation()
       Optional. The documentation of the spec.
       For OpenAPI spec, this will be populated from `externalDocs` in OpenAPI
       spec.
       
      .google.cloud.apihub.v1.Documentation documentation = 11 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getDocumentation in interface SpecOrBuilder
      Returns:
      The documentation.
    • getDocumentationOrBuilder

      public DocumentationOrBuilder getDocumentationOrBuilder()
       Optional. The documentation of the spec.
       For OpenAPI spec, this will be populated from `externalDocs` in OpenAPI
       spec.
       
      .google.cloud.apihub.v1.Documentation documentation = 11 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getDocumentationOrBuilder in interface SpecOrBuilder
    • getParsingModeValue

      public int getParsingModeValue()
       Optional. Input only. Enum specifying the parsing mode for OpenAPI
       Specification (OAS) parsing.
       
      .google.cloud.apihub.v1.Spec.ParsingMode parsing_mode = 12 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = INPUT_ONLY];
      Specified by:
      getParsingModeValue in interface SpecOrBuilder
      Returns:
      The enum numeric value on the wire for parsingMode.
    • getParsingMode

      public Spec.ParsingMode getParsingMode()
       Optional. Input only. Enum specifying the parsing mode for OpenAPI
       Specification (OAS) parsing.
       
      .google.cloud.apihub.v1.Spec.ParsingMode parsing_mode = 12 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = INPUT_ONLY];
      Specified by:
      getParsingMode in interface SpecOrBuilder
      Returns:
      The parsingMode.
    • getSourceMetadataList

      public List<SourceMetadata> getSourceMetadataList()
       Output only. The list of sources and metadata from the sources of the spec.
       
      repeated .google.cloud.apihub.v1.SourceMetadata source_metadata = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getSourceMetadataList in interface SpecOrBuilder
    • getSourceMetadataOrBuilderList

      public List<? extends SourceMetadataOrBuilder> getSourceMetadataOrBuilderList()
       Output only. The list of sources and metadata from the sources of the spec.
       
      repeated .google.cloud.apihub.v1.SourceMetadata source_metadata = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getSourceMetadataOrBuilderList in interface SpecOrBuilder
    • getSourceMetadataCount

      public int getSourceMetadataCount()
       Output only. The list of sources and metadata from the sources of the spec.
       
      repeated .google.cloud.apihub.v1.SourceMetadata source_metadata = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getSourceMetadataCount in interface SpecOrBuilder
    • getSourceMetadata

      public SourceMetadata getSourceMetadata(int index)
       Output only. The list of sources and metadata from the sources of the spec.
       
      repeated .google.cloud.apihub.v1.SourceMetadata source_metadata = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getSourceMetadata in interface SpecOrBuilder
    • getSourceMetadataOrBuilder

      public SourceMetadataOrBuilder getSourceMetadataOrBuilder(int index)
       Output only. The list of sources and metadata from the sources of the spec.
       
      repeated .google.cloud.apihub.v1.SourceMetadata source_metadata = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getSourceMetadataOrBuilder in interface SpecOrBuilder
    • 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 Spec parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

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

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

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

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

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

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

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

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

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

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

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

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

      public static Spec.Builder newBuilder()
    • newBuilder

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

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

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

      public static Spec getDefaultInstance()
    • parser

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

      public com.google.protobuf.Parser<Spec> 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 Spec getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder