Class Attachment.Builder (0.1.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
TypeDescription
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public Attachment.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
Attachment.Builder
Overrides

build()

public Attachment build()
Returns
TypeDescription
Attachment

buildPartial()

public Attachment buildPartial()
Returns
TypeDescription
Attachment

clear()

public Attachment.Builder clear()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
Attachment.Builder

This builder for chaining.

clearDataRef()

public Attachment.Builder clearDataRef()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
Attachment.Builder

clearField(Descriptors.FieldDescriptor field)

public Attachment.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
Attachment.Builder
Overrides

clearName()

public Attachment.Builder clearName()

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

string name = 1;

Returns
TypeDescription
Attachment.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public Attachment.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
Attachment.Builder

This builder for chaining.

clone()

public Attachment.Builder clone()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
ByteString

The bytes for contentType.

getDataRefCase()

public Attachment.DataRefCase getDataRefCase()
Returns
TypeDescription
Attachment.DataRefCase

getDefaultInstanceForType()

public Attachment getDefaultInstanceForType()
Returns
TypeDescription
Attachment

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
DriveDataRefOrBuilder

getName()

public String getName()

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

string name = 1;

Returns
TypeDescription
String

The name.

getNameBytes()

public ByteString getNameBytes()

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

string name = 1;

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
boolean

Whether the driveDataRef field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
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
NameDescription
valueAttachmentDataRef
Returns
TypeDescription
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
NameDescription
valueDriveDataRef
Returns
TypeDescription
Attachment.Builder

mergeFrom(Attachment other)

public Attachment.Builder mergeFrom(Attachment other)
Parameter
NameDescription
otherAttachment
Returns
TypeDescription
Attachment.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public Attachment.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Attachment.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public Attachment.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
Attachment.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final Attachment.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
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
NameDescription
valueAttachmentDataRef
Returns
TypeDescription
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
NameDescription
builderForValueAttachmentDataRef.Builder
Returns
TypeDescription
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
NameDescription
valueString

The contentName to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for contentName to set.

Returns
TypeDescription
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
NameDescription
valueString

The contentType to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for contentType to set.

Returns
TypeDescription
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
NameDescription
valueString

The downloadUri to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for downloadUri to set.

Returns
TypeDescription
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
NameDescription
valueDriveDataRef
Returns
TypeDescription
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
NameDescription
builderForValueDriveDataRef.Builder
Returns
TypeDescription
Attachment.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public Attachment.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
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
NameDescription
valueString

The name to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for name to set.

Returns
TypeDescription
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
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
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
NameDescription
valueAttachment.Source

The source to set.

Returns
TypeDescription
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
NameDescription
valueint

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

Returns
TypeDescription
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
NameDescription
valueString

The thumbnailUri to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for thumbnailUri to set.

Returns
TypeDescription
Attachment.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final Attachment.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
Attachment.Builder
Overrides