new Attachment(jmap, blobId, optsopt)
This class represents a JMAP Attachment.
An Attachment object holds all information of a given attachment of a Message.
Parameters:
Name | Type | Attributes | Description | |||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
jmap |
Client | The Client instance that created the parent Message. |
||||||||||||||||||||||||||||||||||||||||||||||
blobId |
String | The id of the binary data. |
||||||||||||||||||||||||||||||||||||||||||||||
opts |
Object |
<optional> |
The optional properties of this Attachment. Properties
|
- Source:
- See:
Extends
Methods
(static) fromJSONObject(jmap, object) → {Attachment}
Creates an Attachment from its JSON representation.
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
jmap |
Client | |||||||
object |
Object | The JSON representation of the Attachment, as a Javascript object. Properties
|
- Source:
Returns:
- Type
- Attachment
getSignedDownloadUrl() → {Promise}
Gets a signed download URL for this Attachment.
Details of this process can be found in the spec.
This mandates that url
is defined on this Attachment instance, otherwise we cannot get a signed URL.
- Source:
Throws:
-
If this
Attachment
instance has no URL available. - Type
- Error
Returns:
A Promise eventually resolving to the signed download URL.
- Type
- Promise
toJSONObject()
Creates a JSON representation from this model.
- Source:
Returns:
JSON object with only owned properties and non default values.