Class Attachment (1.59.0)

public final class Attachment extends GeneratedMessageV3 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

Static Fields

ANNOTATIONS_FIELD_NUMBER

public static final int ANNOTATIONS_FIELD_NUMBER
Field Value
TypeDescription
int

ATTACHMENT_NAMESPACE_FIELD_NUMBER

public static final int ATTACHMENT_NAMESPACE_FIELD_NUMBER
Field Value
TypeDescription
int

CREATE_TIME_FIELD_NUMBER

public static final int CREATE_TIME_FIELD_NUMBER
Field Value
TypeDescription
int

FILES_FIELD_NUMBER

public static final int FILES_FIELD_NUMBER
Field Value
TypeDescription
int

NAME_FIELD_NUMBER

public static final int NAME_FIELD_NUMBER
Field Value
TypeDescription
int

OCI_VERSION_NAME_FIELD_NUMBER

public static final int OCI_VERSION_NAME_FIELD_NUMBER
Field Value
TypeDescription
int

TARGET_FIELD_NUMBER

public static final int TARGET_FIELD_NUMBER
Field Value
TypeDescription
int

TYPE_FIELD_NUMBER

public static final int TYPE_FIELD_NUMBER
Field Value
TypeDescription
int

UPDATE_TIME_FIELD_NUMBER

public static final int UPDATE_TIME_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static Attachment getDefaultInstance()
Returns
TypeDescription
Attachment

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

newBuilder()

public static Attachment.Builder newBuilder()
Returns
TypeDescription
Attachment.Builder

newBuilder(Attachment )

public static Attachment.Builder newBuilder(Attachment )
Parameter
NameDescription
Attachment
Returns
TypeDescription
Attachment.Builder

parseDelimitedFrom(InputStream input)

public static Attachment parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
Attachment
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Attachment parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Attachment
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static Attachment parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
Attachment
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Attachment parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Attachment
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Attachment parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
Attachment
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Attachment parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Attachment
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Attachment parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
Attachment
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Attachment parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Attachment
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static Attachment parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
Attachment
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Attachment parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Attachment
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static Attachment parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
Attachment
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Attachment parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Attachment
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<Attachment> parser()
Returns
TypeDescription
Parser<Attachment>

Methods

containsAnnotations(String key)

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];

Parameter
NameDescription
keyString
Returns
TypeDescription
boolean

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getAnnotations() (deprecated)

public Map<String,String> getAnnotations()
Returns
TypeDescription
Map<String,String>

getAnnotationsCount()

public int getAnnotationsCount()

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];

Returns
TypeDescription
int

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];

Returns
TypeDescription
Map<String,String>

getAnnotationsOrDefault(String key, String defaultValue)

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];

Parameters
NameDescription
keyString
defaultValueString
Returns
TypeDescription
String

getAnnotationsOrThrow(String key)

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];

Parameter
NameDescription
keyString
Returns
TypeDescription
String

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;

Returns
TypeDescription
String

The attachmentNamespace.

getAttachmentNamespaceBytes()

public 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;

Returns
TypeDescription
ByteString

The bytes for attachmentNamespace.

getCreateTime()

public Timestamp getCreateTime()

Output only. The time when the attachment was created.

.google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
Timestamp

The createTime.

getCreateTimeOrBuilder()

public TimestampOrBuilder getCreateTimeOrBuilder()

Output only. The time when the attachment was created.

.google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
TimestampOrBuilder

getDefaultInstanceForType()

public Attachment getDefaultInstanceForType()
Returns
TypeDescription
Attachment

getFiles(int index)

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) = { ... }

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
String

The files at the given index.

getFilesBytes(int index)

public 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) = { ... }

Parameter
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
ByteString

The bytes of the files at the given index.

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) = { ... }

Returns
TypeDescription
int

The count of files.

getFilesList()

public 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) = { ... }

Returns
TypeDescription
ProtocolStringList

A list containing the files.

getName()

public String getName()

The name of the attachment. E.g. projects/p1/locations/us/repositories/repo/attachments/sbom.

string name = 1;

Returns
TypeDescription
String

The name.

getNameBytes()

public ByteString getNameBytes()

The name of the attachment. E.g. projects/p1/locations/us/repositories/repo/attachments/sbom.

string name = 1;

Returns
TypeDescription
ByteString

The bytes for name.

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];

Returns
TypeDescription
String

The ociVersionName.

getOciVersionNameBytes()

public 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];

Returns
TypeDescription
ByteString

The bytes for ociVersionName.

getParserForType()

public Parser<Attachment> getParserForType()
Returns
TypeDescription
Parser<Attachment>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

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];

Returns
TypeDescription
String

The target.

getTargetBytes()

public 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];

Returns
TypeDescription
ByteString

The bytes for target.

getType()

public String getType()

Type of attachment. E.g. application/vnd.spdx+json

string type = 3;

Returns
TypeDescription
String

The type.

getTypeBytes()

public ByteString getTypeBytes()

Type of attachment. E.g. application/vnd.spdx+json

string type = 3;

Returns
TypeDescription
ByteString

The bytes for type.

getUpdateTime()

public Timestamp getUpdateTime()

Output only. The time when the attachment was last updated.

.google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
Timestamp

The updateTime.

getUpdateTimeOrBuilder()

public TimestampOrBuilder getUpdateTimeOrBuilder()

Output only. The time when the attachment was last updated.

.google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
TimestampOrBuilder

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];

Returns
TypeDescription
boolean

Whether the createTime field is set.

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];

Returns
TypeDescription
boolean

Whether the updateTime field is set.

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

internalGetMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
Parameter
NameDescription
numberint
Returns
TypeDescription
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.internalGetMapFieldReflection(int)

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public Attachment.Builder newBuilderForType()
Returns
TypeDescription
Attachment.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected Attachment.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
Attachment.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public Attachment.Builder toBuilder()
Returns
TypeDescription
Attachment.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides
Exceptions
TypeDescription
IOException