Class Attachment.Builder (0.8.0)

public static final class Attachment.Builder extends GeneratedMessageV3.Builder<Attachment.Builder> implements AttachmentOrBuilder

An attachment in Google Chat.

Protobuf type google.chat.v1.Attachment

Implements

AttachmentOrBuilder

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public Attachment.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
Attachment.Builder
Overrides

build()

public Attachment build()
Returns
Type Description
Attachment

buildPartial()

public Attachment buildPartial()
Returns
Type Description
Attachment

clear()

public Attachment.Builder clear()
Returns
Type Description
Attachment.Builder
Overrides

clearAttachmentDataRef()

public Attachment.Builder clearAttachmentDataRef()

A reference to the attachment data. This field is used with the media API to download the attachment data.

.google.chat.v1.AttachmentDataRef attachment_data_ref = 4;

Returns
Type Description
Attachment.Builder

clearContentName()

public Attachment.Builder clearContentName()

Output only. The original file name for the content, not the full path.

string content_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Attachment.Builder

This builder for chaining.

clearContentType()

public Attachment.Builder clearContentType()

Output only. The content type (MIME type) of the file.

string content_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Attachment.Builder

This builder for chaining.

clearDataRef()

public Attachment.Builder clearDataRef()
Returns
Type Description
Attachment.Builder

clearDownloadUri()

public Attachment.Builder clearDownloadUri()

Output only. The download URL which should be used to allow a human user to download the attachment. Chat apps shouldn't use this URL to download attachment content.

string download_uri = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Attachment.Builder

This builder for chaining.

clearDriveDataRef()

public Attachment.Builder clearDriveDataRef()

Output only. A reference to the Google Drive attachment. This field is used with the Google Drive API.

.google.chat.v1.DriveDataRef drive_data_ref = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Attachment.Builder

clearField(Descriptors.FieldDescriptor field)

public Attachment.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
Attachment.Builder
Overrides

clearName()

public Attachment.Builder clearName()

Resource name of the attachment, in the form spaces/*/messages/*/attachments/*.

string name = 1;

Returns
Type Description
Attachment.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public Attachment.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
Attachment.Builder
Overrides

clearSource()

public Attachment.Builder clearSource()

Output only. The source of the attachment.

.google.chat.v1.Attachment.Source source = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Attachment.Builder

This builder for chaining.

clearThumbnailUri()

public Attachment.Builder clearThumbnailUri()

Output only. The thumbnail URL which should be used to preview the attachment to a human user. Chat apps shouldn't use this URL to download attachment content.

string thumbnail_uri = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Attachment.Builder

This builder for chaining.

clone()

public Attachment.Builder clone()
Returns
Type Description
Attachment.Builder
Overrides

getAttachmentDataRef()

public AttachmentDataRef getAttachmentDataRef()

A reference to the attachment data. This field is used with the media API to download the attachment data.

.google.chat.v1.AttachmentDataRef attachment_data_ref = 4;

Returns
Type Description
AttachmentDataRef

The attachmentDataRef.

getAttachmentDataRefBuilder()

public AttachmentDataRef.Builder getAttachmentDataRefBuilder()

A reference to the attachment data. This field is used with the media API to download the attachment data.

.google.chat.v1.AttachmentDataRef attachment_data_ref = 4;

Returns
Type Description
AttachmentDataRef.Builder

getAttachmentDataRefOrBuilder()

public AttachmentDataRefOrBuilder getAttachmentDataRefOrBuilder()

A reference to the attachment data. This field is used with the media API to download the attachment data.

.google.chat.v1.AttachmentDataRef attachment_data_ref = 4;

Returns
Type Description
AttachmentDataRefOrBuilder

getContentName()

public String getContentName()

Output only. The original file name for the content, not the full path.

string content_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
String

The contentName.

getContentNameBytes()

public ByteString getContentNameBytes()

Output only. The original file name for the content, not the full path.

string content_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
ByteString

The bytes for contentName.

getContentType()

public String getContentType()

Output only. The content type (MIME type) of the file.

string content_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
String

The contentType.

getContentTypeBytes()

public ByteString getContentTypeBytes()

Output only. The content type (MIME type) of the file.

string content_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
ByteString

The bytes for contentType.

getDataRefCase()

public Attachment.DataRefCase getDataRefCase()
Returns
Type Description
Attachment.DataRefCase

getDefaultInstanceForType()

public Attachment getDefaultInstanceForType()
Returns
Type Description
Attachment

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getDownloadUri()

public String getDownloadUri()

Output only. The download URL which should be used to allow a human user to download the attachment. Chat apps shouldn't use this URL to download attachment content.

string download_uri = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
String

The downloadUri.

getDownloadUriBytes()

public ByteString getDownloadUriBytes()

Output only. The download URL which should be used to allow a human user to download the attachment. Chat apps shouldn't use this URL to download attachment content.

string download_uri = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
ByteString

The bytes for downloadUri.

getDriveDataRef()

public DriveDataRef getDriveDataRef()

Output only. A reference to the Google Drive attachment. This field is used with the Google Drive API.

.google.chat.v1.DriveDataRef drive_data_ref = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
DriveDataRef

The driveDataRef.

getDriveDataRefBuilder()

public DriveDataRef.Builder getDriveDataRefBuilder()

Output only. A reference to the Google Drive attachment. This field is used with the Google Drive API.

.google.chat.v1.DriveDataRef drive_data_ref = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
DriveDataRef.Builder

getDriveDataRefOrBuilder()

public DriveDataRefOrBuilder getDriveDataRefOrBuilder()

Output only. A reference to the Google Drive attachment. This field is used with the Google Drive API.

.google.chat.v1.DriveDataRef drive_data_ref = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
DriveDataRefOrBuilder

getName()

public String getName()

Resource name of the attachment, in the form spaces/*/messages/*/attachments/*.

string name = 1;

Returns
Type Description
String

The name.

getNameBytes()

public ByteString getNameBytes()

Resource name of the attachment, in the form spaces/*/messages/*/attachments/*.

string name = 1;

Returns
Type Description
ByteString

The bytes for name.

getSource()

public Attachment.Source getSource()

Output only. The source of the attachment.

.google.chat.v1.Attachment.Source source = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Attachment.Source

The source.

getSourceValue()

public int getSourceValue()

Output only. The source of the attachment.

.google.chat.v1.Attachment.Source source = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
int

The enum numeric value on the wire for source.

getThumbnailUri()

public String getThumbnailUri()

Output only. The thumbnail URL which should be used to preview the attachment to a human user. Chat apps shouldn't use this URL to download attachment content.

string thumbnail_uri = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
String

The thumbnailUri.

getThumbnailUriBytes()

public ByteString getThumbnailUriBytes()

Output only. The thumbnail URL which should be used to preview the attachment to a human user. Chat apps shouldn't use this URL to download attachment content.

string thumbnail_uri = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
ByteString

The bytes for thumbnailUri.

hasAttachmentDataRef()

public boolean hasAttachmentDataRef()

A reference to the attachment data. This field is used with the media API to download the attachment data.

.google.chat.v1.AttachmentDataRef attachment_data_ref = 4;

Returns
Type Description
boolean

Whether the attachmentDataRef field is set.

hasDriveDataRef()

public boolean hasDriveDataRef()

Output only. A reference to the Google Drive attachment. This field is used with the Google Drive API.

.google.chat.v1.DriveDataRef drive_data_ref = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the driveDataRef field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeAttachmentDataRef(AttachmentDataRef value)

public Attachment.Builder mergeAttachmentDataRef(AttachmentDataRef value)

A reference to the attachment data. This field is used with the media API to download the attachment data.

.google.chat.v1.AttachmentDataRef attachment_data_ref = 4;

Parameter
Name Description
value AttachmentDataRef
Returns
Type Description
Attachment.Builder

mergeDriveDataRef(DriveDataRef value)

public Attachment.Builder mergeDriveDataRef(DriveDataRef value)

Output only. A reference to the Google Drive attachment. This field is used with the Google Drive API.

.google.chat.v1.DriveDataRef drive_data_ref = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value DriveDataRef
Returns
Type Description
Attachment.Builder

mergeFrom(Attachment other)

public Attachment.Builder mergeFrom(Attachment other)
Parameter
Name Description
other Attachment
Returns
Type Description
Attachment.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public Attachment.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Attachment.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public Attachment.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
Attachment.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final Attachment.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
Attachment.Builder
Overrides

setAttachmentDataRef(AttachmentDataRef value)

public Attachment.Builder setAttachmentDataRef(AttachmentDataRef value)

A reference to the attachment data. This field is used with the media API to download the attachment data.

.google.chat.v1.AttachmentDataRef attachment_data_ref = 4;

Parameter
Name Description
value AttachmentDataRef
Returns
Type Description
Attachment.Builder

setAttachmentDataRef(AttachmentDataRef.Builder builderForValue)

public Attachment.Builder setAttachmentDataRef(AttachmentDataRef.Builder builderForValue)

A reference to the attachment data. This field is used with the media API to download the attachment data.

.google.chat.v1.AttachmentDataRef attachment_data_ref = 4;

Parameter
Name Description
builderForValue AttachmentDataRef.Builder
Returns
Type Description
Attachment.Builder

setContentName(String value)

public Attachment.Builder setContentName(String value)

Output only. The original file name for the content, not the full path.

string content_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value String

The contentName to set.

Returns
Type Description
Attachment.Builder

This builder for chaining.

setContentNameBytes(ByteString value)

public Attachment.Builder setContentNameBytes(ByteString value)

Output only. The original file name for the content, not the full path.

string content_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value ByteString

The bytes for contentName to set.

Returns
Type Description
Attachment.Builder

This builder for chaining.

setContentType(String value)

public Attachment.Builder setContentType(String value)

Output only. The content type (MIME type) of the file.

string content_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value String

The contentType to set.

Returns
Type Description
Attachment.Builder

This builder for chaining.

setContentTypeBytes(ByteString value)

public Attachment.Builder setContentTypeBytes(ByteString value)

Output only. The content type (MIME type) of the file.

string content_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value ByteString

The bytes for contentType to set.

Returns
Type Description
Attachment.Builder

This builder for chaining.

setDownloadUri(String value)

public Attachment.Builder setDownloadUri(String value)

Output only. The download URL which should be used to allow a human user to download the attachment. Chat apps shouldn't use this URL to download attachment content.

string download_uri = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value String

The downloadUri to set.

Returns
Type Description
Attachment.Builder

This builder for chaining.

setDownloadUriBytes(ByteString value)

public Attachment.Builder setDownloadUriBytes(ByteString value)

Output only. The download URL which should be used to allow a human user to download the attachment. Chat apps shouldn't use this URL to download attachment content.

string download_uri = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value ByteString

The bytes for downloadUri to set.

Returns
Type Description
Attachment.Builder

This builder for chaining.

setDriveDataRef(DriveDataRef value)

public Attachment.Builder setDriveDataRef(DriveDataRef value)

Output only. A reference to the Google Drive attachment. This field is used with the Google Drive API.

.google.chat.v1.DriveDataRef drive_data_ref = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value DriveDataRef
Returns
Type Description
Attachment.Builder

setDriveDataRef(DriveDataRef.Builder builderForValue)

public Attachment.Builder setDriveDataRef(DriveDataRef.Builder builderForValue)

Output only. A reference to the Google Drive attachment. This field is used with the Google Drive API.

.google.chat.v1.DriveDataRef drive_data_ref = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
builderForValue DriveDataRef.Builder
Returns
Type Description
Attachment.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public Attachment.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
Attachment.Builder
Overrides

setName(String value)

public Attachment.Builder setName(String value)

Resource name of the attachment, in the form spaces/*/messages/*/attachments/*.

string name = 1;

Parameter
Name Description
value String

The name to set.

Returns
Type Description
Attachment.Builder

This builder for chaining.

setNameBytes(ByteString value)

public Attachment.Builder setNameBytes(ByteString value)

Resource name of the attachment, in the form spaces/*/messages/*/attachments/*.

string name = 1;

Parameter
Name Description
value ByteString

The bytes for name to set.

Returns
Type Description
Attachment.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public Attachment.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
Attachment.Builder
Overrides

setSource(Attachment.Source value)

public Attachment.Builder setSource(Attachment.Source value)

Output only. The source of the attachment.

.google.chat.v1.Attachment.Source source = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value Attachment.Source

The source to set.

Returns
Type Description
Attachment.Builder

This builder for chaining.

setSourceValue(int value)

public Attachment.Builder setSourceValue(int value)

Output only. The source of the attachment.

.google.chat.v1.Attachment.Source source = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value int

The enum numeric value on the wire for source to set.

Returns
Type Description
Attachment.Builder

This builder for chaining.

setThumbnailUri(String value)

public Attachment.Builder setThumbnailUri(String value)

Output only. The thumbnail URL which should be used to preview the attachment to a human user. Chat apps shouldn't use this URL to download attachment content.

string thumbnail_uri = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value String

The thumbnailUri to set.

Returns
Type Description
Attachment.Builder

This builder for chaining.

setThumbnailUriBytes(ByteString value)

public Attachment.Builder setThumbnailUriBytes(ByteString value)

Output only. The thumbnail URL which should be used to preview the attachment to a human user. Chat apps shouldn't use this URL to download attachment content.

string thumbnail_uri = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value ByteString

The bytes for thumbnailUri to set.

Returns
Type Description
Attachment.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final Attachment.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
Attachment.Builder
Overrides