Class Attachment

java.lang.Object
com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessage
com.google.protobuf.GeneratedMessage
com.google.devtools.artifactregistry.v1.Attachment
All Implemented Interfaces:
AttachmentOrBuilder, com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Serializable

@Generated public final class Attachment extends com.google.protobuf.GeneratedMessage implements AttachmentOrBuilder
 An Attachment refers to additional metadata that can be attached to
 artifacts in Artifact Registry. An attachment consists of one or more files.
 
Protobuf type google.devtools.artifactregistry.v1.Attachment
See Also:
  • Field Details

    • NAME_FIELD_NUMBER

      public static final int NAME_FIELD_NUMBER
      See Also:
    • TARGET_FIELD_NUMBER

      public static final int TARGET_FIELD_NUMBER
      See Also:
    • TYPE_FIELD_NUMBER

      public static final int TYPE_FIELD_NUMBER
      See Also:
    • ATTACHMENT_NAMESPACE_FIELD_NUMBER

      public static final int ATTACHMENT_NAMESPACE_FIELD_NUMBER
      See Also:
    • ANNOTATIONS_FIELD_NUMBER

      public static final int ANNOTATIONS_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:
    • FILES_FIELD_NUMBER

      public static final int FILES_FIELD_NUMBER
      See Also:
    • OCI_VERSION_NAME_FIELD_NUMBER

      public static final int OCI_VERSION_NAME_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()
       The name of the attachment. E.g.
       `projects/p1/locations/us/repositories/repo/attachments/sbom`.
       
      string name = 1;
      Specified by:
      getName in interface AttachmentOrBuilder
      Returns:
      The name.
    • getNameBytes

      public com.google.protobuf.ByteString getNameBytes()
       The name of the attachment. E.g.
       `projects/p1/locations/us/repositories/repo/attachments/sbom`.
       
      string name = 1;
      Specified by:
      getNameBytes in interface AttachmentOrBuilder
      Returns:
      The bytes for name.
    • getTarget

      public String getTarget()
       Required. The target the attachment is for, can be a Version, Package or
       Repository. E.g.
       `projects/p1/locations/us-central1/repositories/repo1/packages/p1/versions/v1`.
       
      string target = 2 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getTarget in interface AttachmentOrBuilder
      Returns:
      The target.
    • getTargetBytes

      public com.google.protobuf.ByteString getTargetBytes()
       Required. The target the attachment is for, can be a Version, Package or
       Repository. E.g.
       `projects/p1/locations/us-central1/repositories/repo1/packages/p1/versions/v1`.
       
      string target = 2 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getTargetBytes in interface AttachmentOrBuilder
      Returns:
      The bytes for target.
    • getType

      public String getType()
       Type of attachment.
       E.g. `application/vnd.spdx+json`
       
      string type = 3;
      Specified by:
      getType in interface AttachmentOrBuilder
      Returns:
      The type.
    • getTypeBytes

      public com.google.protobuf.ByteString getTypeBytes()
       Type of attachment.
       E.g. `application/vnd.spdx+json`
       
      string type = 3;
      Specified by:
      getTypeBytes in interface AttachmentOrBuilder
      Returns:
      The bytes for type.
    • getAttachmentNamespace

      public String getAttachmentNamespace()
       The namespace this attachment belongs to.
       E.g. If an attachment is created by artifact analysis, namespace is set
       to `artifactanalysis.googleapis.com`.
       
      string attachment_namespace = 4;
      Specified by:
      getAttachmentNamespace in interface AttachmentOrBuilder
      Returns:
      The attachmentNamespace.
    • getAttachmentNamespaceBytes

      public com.google.protobuf.ByteString getAttachmentNamespaceBytes()
       The namespace this attachment belongs to.
       E.g. If an attachment is created by artifact analysis, namespace is set
       to `artifactanalysis.googleapis.com`.
       
      string attachment_namespace = 4;
      Specified by:
      getAttachmentNamespaceBytes in interface AttachmentOrBuilder
      Returns:
      The bytes for attachmentNamespace.
    • getAnnotationsCount

      public int getAnnotationsCount()
      Description copied from interface: AttachmentOrBuilder
       Optional. User annotations. These attributes can only be set and used by
       the user, and not by Artifact Registry. See
       https://google.aip.dev/128#annotations for more details such as format and
       size limitations.
       
      map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getAnnotationsCount in interface AttachmentOrBuilder
    • containsAnnotations

      public boolean containsAnnotations(String key)
       Optional. User annotations. These attributes can only be set and used by
       the user, and not by Artifact Registry. See
       https://google.aip.dev/128#annotations for more details such as format and
       size limitations.
       
      map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      containsAnnotations in interface AttachmentOrBuilder
    • getAnnotations

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

      public Map<String,String> getAnnotationsMap()
       Optional. User annotations. These attributes can only be set and used by
       the user, and not by Artifact Registry. See
       https://google.aip.dev/128#annotations for more details such as format and
       size limitations.
       
      map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getAnnotationsMap in interface AttachmentOrBuilder
    • getAnnotationsOrDefault

      public String getAnnotationsOrDefault(String key, String defaultValue)
       Optional. User annotations. These attributes can only be set and used by
       the user, and not by Artifact Registry. See
       https://google.aip.dev/128#annotations for more details such as format and
       size limitations.
       
      map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getAnnotationsOrDefault in interface AttachmentOrBuilder
    • getAnnotationsOrThrow

      public String getAnnotationsOrThrow(String key)
       Optional. User annotations. These attributes can only be set and used by
       the user, and not by Artifact Registry. See
       https://google.aip.dev/128#annotations for more details such as format and
       size limitations.
       
      map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getAnnotationsOrThrow in interface AttachmentOrBuilder
    • hasCreateTime

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

      public com.google.protobuf.Timestamp getCreateTime()
       Output only. The time when the attachment was created.
       
      .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getCreateTime in interface AttachmentOrBuilder
      Returns:
      The createTime.
    • getCreateTimeOrBuilder

      public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder()
       Output only. The time when the attachment was created.
       
      .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getCreateTimeOrBuilder in interface AttachmentOrBuilder
    • hasUpdateTime

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

      public com.google.protobuf.Timestamp getUpdateTime()
       Output only. The time when the attachment was last updated.
       
      .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getUpdateTime in interface AttachmentOrBuilder
      Returns:
      The updateTime.
    • getUpdateTimeOrBuilder

      public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder()
       Output only. The time when the attachment was last updated.
       
      .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getUpdateTimeOrBuilder in interface AttachmentOrBuilder
    • getFilesList

      public com.google.protobuf.ProtocolStringList getFilesList()
       Required. The files that belong to this attachment.
       If the file ID part contains slashes, they are escaped. E.g.
       `projects/p1/locations/us-central1/repositories/repo1/files/sha:<sha-of-file>`.
       
      repeated string files = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
      Specified by:
      getFilesList in interface AttachmentOrBuilder
      Returns:
      A list containing the files.
    • getFilesCount

      public int getFilesCount()
       Required. The files that belong to this attachment.
       If the file ID part contains slashes, they are escaped. E.g.
       `projects/p1/locations/us-central1/repositories/repo1/files/sha:<sha-of-file>`.
       
      repeated string files = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
      Specified by:
      getFilesCount in interface AttachmentOrBuilder
      Returns:
      The count of files.
    • getFiles

      public String getFiles(int index)
       Required. The files that belong to this attachment.
       If the file ID part contains slashes, they are escaped. E.g.
       `projects/p1/locations/us-central1/repositories/repo1/files/sha:<sha-of-file>`.
       
      repeated string files = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
      Specified by:
      getFiles in interface AttachmentOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The files at the given index.
    • getFilesBytes

      public com.google.protobuf.ByteString getFilesBytes(int index)
       Required. The files that belong to this attachment.
       If the file ID part contains slashes, they are escaped. E.g.
       `projects/p1/locations/us-central1/repositories/repo1/files/sha:<sha-of-file>`.
       
      repeated string files = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
      Specified by:
      getFilesBytes in interface AttachmentOrBuilder
      Parameters:
      index - The index of the value to return.
      Returns:
      The bytes of the files at the given index.
    • getOciVersionName

      public String getOciVersionName()
       Output only. The name of the OCI version that this attachment created. Only
       populated for Docker attachments. E.g.
       `projects/p1/locations/us-central1/repositories/repo1/packages/p1/versions/v1`.
       
      string oci_version_name = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getOciVersionName in interface AttachmentOrBuilder
      Returns:
      The ociVersionName.
    • getOciVersionNameBytes

      public com.google.protobuf.ByteString getOciVersionNameBytes()
       Output only. The name of the OCI version that this attachment created. Only
       populated for Docker attachments. E.g.
       `projects/p1/locations/us-central1/repositories/repo1/packages/p1/versions/v1`.
       
      string oci_version_name = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getOciVersionNameBytes in interface AttachmentOrBuilder
      Returns:
      The bytes for ociVersionName.
    • 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 Attachment parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

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

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

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

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

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

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

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

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

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

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

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

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

      public static Attachment.Builder newBuilder()
    • newBuilder

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

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

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

      public static Attachment getDefaultInstance()
    • parser

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

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