Class FileAttachment
Represents an attachment to a GroupMe Message containing an image.
Namespace: GroupMeClientApi.Models.Attachments
Assembly: GroupMeClientApi.dll
Syntax
public class FileAttachment : Attachment
Properties
| Improve this Doc View SourceDefaultUploadBlockSize
Gets the default buffer size, in bytes, used for uploading content.
Declaration
public static int DefaultUploadBlockSize { get; }
Property Value
| Type | Description |
|---|---|
| Int32 |
Id
Gets the URL of the image attachment.
Declaration
public string Id { get; }
Property Value
| Type | Description |
|---|---|
| String |
Type
Gets the attachment type.
Declaration
public override string Type { get; }
Property Value
| Type | Description |
|---|---|
| String |
Overrides
Methods
| Improve this Doc View SourceCreateFileAttachment(String, Byte[], IMessageContainer, CancellationTokenSource, UploadProgress)
Uploads a document to GroupMe and returns the created FileAttachment.
Declaration
public static Task<FileAttachment> CreateFileAttachment(string filename, byte[] document, IMessageContainer messageContainer, CancellationTokenSource cancellationTokenSource = null, UploadProgress uploadProgress = null)
Parameters
| Type | Name | Description |
|---|---|---|
| String | filename | The name of the file being sent. |
| Byte[] | document | The document to upload. |
| IMessageContainer | messageContainer | The IMessageContainer that the message is being sent to. |
| CancellationTokenSource | cancellationTokenSource | The cancellation source to use for the upload operation. |
| UploadProgress | uploadProgress | A monitor that will receive progress updates for the file upload operation. |
Returns
| Type | Description |
|---|---|
| Task<FileAttachment> | An ImageAttachment if uploaded successfully, null otherwise. |
DownloadFileAsync(Message)
Gets a download URL for this FileAttachment.
Declaration
public Task<byte[]> DownloadFileAsync(Message message)
Parameters
| Type | Name | Description |
|---|---|---|
| Message | message | The message that contains the FileAttachment. |
Returns
| Type | Description |
|---|---|
| Task<Byte[]> | A download URL string. |
GetFileData(Message)
Retrieves information about this FileAttachment from GroupMe.
Declaration
public Task<FileAttachment.FileData> GetFileData(Message message)
Parameters
| Type | Name | Description |
|---|---|---|
| Message | message | The Message that the file is contained in. |
Returns
| Type | Description |
|---|---|
| Task<FileAttachment.FileData> | An FileAttachment.FileData if data is retrieved successfully, null otherwise. |