Class Attachment

Attachment

Represents an attachment created by an add-on. This can be used within the context of different Google extensibility products to generate new attachments, such as for Calendar events.

 const 
  
 attachment 
  
 = 
  
 CardService 
 . 
 newAttachment 
 () 
  
 . 
 setResourceUrl 
 ( 
 'https://fakeresourceurl.com' 
 ) 
  
 . 
 setTitle 
 ( 
 'Attachment title' 
 ) 
  
 . 
 setMimeType 
 ( 
 'text/html' 
 ) 
  
 . 
 setIconUrl 
 ( 
 'https://fakeresourceurl.com/iconurl.png' 
 ); 

Methods

Method Return type Brief description
Attachment Sets the icon URL for the attachment.
Attachment Sets the MIME type for the attachment.
Attachment Sets the resource URL for the attachment.
Attachment Sets the title for the attachment.

Detailed documentation

set Icon Url(iconUrl)

Sets the icon URL for the attachment.

Parameters

Name Type Description
icon Url
String The URL address of the attachment icon.

Return

Attachment — This object, for chaining.


set Mime Type(mimeType)

Sets the MIME type for the attachment.

Parameters

Name Type Description
mime Type
String The MIME type of the content in the attachment resource.

Return

Attachment — This object, for chaining.


set Resource Url(resourceUrl)

Sets the resource URL for the attachment.

Parameters

Name Type Description
resource Url
String The URL address of a resource.

Return

Attachment — This object, for chaining.


set Title(title)

Sets the title for the attachment.

Parameters

Name Type Description
title
String The title of the attachment.

Return

Attachment — This object, for chaining.

Design a Mobile Site
View Site in Mobile | Classic
Share by: