Attachment

Attachment

Represents a file attachment on SMHW.


Constructor

new Attachment(client, response)

Instantiate an attachment object.

Parameters:
Name Type Description
client Client

The client that is instantiating the object.

response object

The data for the object.

Members

(private) _client :Client

The client that instantiated this object.

Type:
  • Client

content_type :String

The type of attachment file content.

Type:
  • String

created_at :Number

The timestamp of when the attachment was created.

Type:
  • Number

file_size :Number

The file size of the attachment in bytes.

Type:
  • Number

file_url :String

The URL of the attachment file.

Type:
  • String

filename :String

The filename of the attachment file.

Type:
  • String

for_logged_in_only :Boolean

Whether or not the attachment is for logged in users only.

Type:
  • Boolean

id :Number

The ID of the attachment.

Type:
  • Number

is_previewable :Boolean

Whether or not the attachment is previewable.

Type:
  • Boolean

preview_url :String

The preview URL of the attachment.

Type:
  • String

third_party_provider :String

The provider of the file if it is hosted on a third party.

Type:
  • String
Type:
  • String

updated_at :Number

The timestamp of when the attachment was last updated.

Type:
  • Number

user_id :Number

The ID of the user who created the attachment.

Type:
  • Number

Methods

getUser() → {Promise.<User>}

Get the user who created the attachment.

Returns:
Type
Promise.<User>