Interface IAttachmentControllerApiAsync
Represents a collection of functions to interact with the API endpoints
Inherited Members
Namespace: mailslurp.Api
Assembly: mailslurp.dll
Syntax
public interface IAttachmentControllerApiAsync : IApiAccessor
Methods
View SourceDeleteAllAttachmentsAsync(int, CancellationToken)
Delete all attachments
Declaration
Task DeleteAllAttachmentsAsync(int operationIndex = 0, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | operationIndex | Index associated with the operation. |
CancellationToken | cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Task | Task of void |
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |
DeleteAllAttachmentsWithHttpInfoAsync(int, CancellationToken)
Delete all attachments
Declaration
Task<ApiResponse<object>> DeleteAllAttachmentsWithHttpInfoAsync(int operationIndex = 0, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | operationIndex | Index associated with the operation. |
CancellationToken | cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Task<ApiResponse<object>> | Task of ApiResponse |
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |
DeleteAttachmentAsync(string, int, CancellationToken)
Delete an attachment
Declaration
Task DeleteAttachmentAsync(string attachmentId, int operationIndex = 0, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | attachmentId | ID of attachment |
int | operationIndex | Index associated with the operation. |
CancellationToken | cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Task | Task of void |
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |
DeleteAttachmentWithHttpInfoAsync(string, int, CancellationToken)
Delete an attachment
Declaration
Task<ApiResponse<object>> DeleteAttachmentWithHttpInfoAsync(string attachmentId, int operationIndex = 0, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | attachmentId | ID of attachment |
int | operationIndex | Index associated with the operation. |
CancellationToken | cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Task<ApiResponse<object>> | Task of ApiResponse |
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |
DownloadAttachmentAsBase64EncodedAsync(string, int, CancellationToken)
Get email attachment as base64 encoded string as alternative to binary responses. To read the content decode the Base64 encoded contents.
Declaration
Task<DownloadAttachmentDto> DownloadAttachmentAsBase64EncodedAsync(string attachmentId, int operationIndex = 0, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | attachmentId | ID of attachment |
int | operationIndex | Index associated with the operation. |
CancellationToken | cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Task<DownloadAttachmentDto> | Task of DownloadAttachmentDto |
Remarks
Returns the specified attachment for a given email as a base 64 encoded string. The response type is application/json. This method is similar to the downloadAttachment
method but allows some clients to get around issues with binary responses.
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |
DownloadAttachmentAsBase64EncodedWithHttpInfoAsync(string, int, CancellationToken)
Get email attachment as base64 encoded string as alternative to binary responses. To read the content decode the Base64 encoded contents.
Declaration
Task<ApiResponse<DownloadAttachmentDto>> DownloadAttachmentAsBase64EncodedWithHttpInfoAsync(string attachmentId, int operationIndex = 0, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | attachmentId | ID of attachment |
int | operationIndex | Index associated with the operation. |
CancellationToken | cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Task<ApiResponse<DownloadAttachmentDto>> | Task of ApiResponse (DownloadAttachmentDto) |
Remarks
Returns the specified attachment for a given email as a base 64 encoded string. The response type is application/json. This method is similar to the downloadAttachment
method but allows some clients to get around issues with binary responses.
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |
DownloadAttachmentAsBytesAsync(string, int, CancellationToken)
Download attachments. Get email attachment bytes. If you have trouble with byte responses try the downloadAttachmentBase64
response endpoints.
Declaration
Task<byte[]> DownloadAttachmentAsBytesAsync(string attachmentId, int operationIndex = 0, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | attachmentId | ID of attachment |
int | operationIndex | Index associated with the operation. |
CancellationToken | cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Task<byte[]> | Task of byte[] |
Remarks
Returns the specified attachment for a given email as a stream / array of bytes. You can find attachment ids in email responses endpoint responses. The response type is application/octet-stream.
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |
DownloadAttachmentAsBytesWithHttpInfoAsync(string, int, CancellationToken)
Download attachments. Get email attachment bytes. If you have trouble with byte responses try the downloadAttachmentBase64
response endpoints.
Declaration
Task<ApiResponse<byte[]>> DownloadAttachmentAsBytesWithHttpInfoAsync(string attachmentId, int operationIndex = 0, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | attachmentId | ID of attachment |
int | operationIndex | Index associated with the operation. |
CancellationToken | cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Task<ApiResponse<byte[]>> | Task of ApiResponse (byte[]) |
Remarks
Returns the specified attachment for a given email as a stream / array of bytes. You can find attachment ids in email responses endpoint responses. The response type is application/octet-stream.
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |
GetAttachmentAsync(string, int, CancellationToken)
Get an attachment entity
Declaration
Task<AttachmentEntity> GetAttachmentAsync(string attachmentId, int operationIndex = 0, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | attachmentId | ID of attachment |
int | operationIndex | Index associated with the operation. |
CancellationToken | cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Task<AttachmentEntity> | Task of AttachmentEntity |
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |
GetAttachmentInfoAsync(string, int, CancellationToken)
Get email attachment metadata information
Declaration
Task<AttachmentMetaData> GetAttachmentInfoAsync(string attachmentId, int operationIndex = 0, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | attachmentId | ID of attachment |
int | operationIndex | Index associated with the operation. |
CancellationToken | cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Task<AttachmentMetaData> | Task of AttachmentMetaData |
Remarks
Returns the metadata for an attachment. It is saved separately to the content of the attachment. Contains properties name
and content-type
and content-length
in bytes for a given attachment.
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |
GetAttachmentInfoWithHttpInfoAsync(string, int, CancellationToken)
Get email attachment metadata information
Declaration
Task<ApiResponse<AttachmentMetaData>> GetAttachmentInfoWithHttpInfoAsync(string attachmentId, int operationIndex = 0, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | attachmentId | ID of attachment |
int | operationIndex | Index associated with the operation. |
CancellationToken | cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Task<ApiResponse<AttachmentMetaData>> | Task of ApiResponse (AttachmentMetaData) |
Remarks
Returns the metadata for an attachment. It is saved separately to the content of the attachment. Contains properties name
and content-type
and content-length
in bytes for a given attachment.
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |
GetAttachmentsAsync(int?, int?, string, string, DateTime?, DateTime?, Guid?, int, CancellationToken)
Get email attachments
Declaration
Task<PageAttachmentEntity> GetAttachmentsAsync(int? page = null, int? size = null, string sort = null, string fileNameFilter = null, DateTime? since = null, DateTime? before = null, Guid? inboxId = null, int operationIndex = 0, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int? | page | Optional page index for list pagination (optional, default to 0) |
int? | size | Optional page size for list pagination (optional, default to 20) |
string | sort | Optional createdAt sort direction ASC or DESC (optional, default to ASC) |
string | fileNameFilter | Optional file name and content type search filter (optional) |
DateTime? | since | Filter by created at after the given timestamp (optional) |
DateTime? | before | Filter by created at before the given timestamp (optional) |
System.Guid? | inboxId | Optional inboxId to filter attachments by (optional) |
int | operationIndex | Index associated with the operation. |
CancellationToken | cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Task<PageAttachmentEntity> | Task of PageAttachmentEntity |
Remarks
Get all attachments in paginated response. Each entity contains meta data for the attachment such as name
and content-type
. Use the attachmentId
and the download endpoints to get the file contents.
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |
GetAttachmentsWithHttpInfoAsync(int?, int?, string, string, DateTime?, DateTime?, Guid?, int, CancellationToken)
Get email attachments
Declaration
Task<ApiResponse<PageAttachmentEntity>> GetAttachmentsWithHttpInfoAsync(int? page = null, int? size = null, string sort = null, string fileNameFilter = null, DateTime? since = null, DateTime? before = null, Guid? inboxId = null, int operationIndex = 0, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int? | page | Optional page index for list pagination (optional, default to 0) |
int? | size | Optional page size for list pagination (optional, default to 20) |
string | sort | Optional createdAt sort direction ASC or DESC (optional, default to ASC) |
string | fileNameFilter | Optional file name and content type search filter (optional) |
DateTime? | since | Filter by created at after the given timestamp (optional) |
DateTime? | before | Filter by created at before the given timestamp (optional) |
System.Guid? | inboxId | Optional inboxId to filter attachments by (optional) |
int | operationIndex | Index associated with the operation. |
CancellationToken | cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Task<ApiResponse<PageAttachmentEntity>> | Task of ApiResponse (PageAttachmentEntity) |
Remarks
Get all attachments in paginated response. Each entity contains meta data for the attachment such as name
and content-type
. Use the attachmentId
and the download endpoints to get the file contents.
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |
GetAttachmentWithHttpInfoAsync(string, int, CancellationToken)
Get an attachment entity
Declaration
Task<ApiResponse<AttachmentEntity>> GetAttachmentWithHttpInfoAsync(string attachmentId, int operationIndex = 0, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | attachmentId | ID of attachment |
int | operationIndex | Index associated with the operation. |
CancellationToken | cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Task<ApiResponse<AttachmentEntity>> | Task of ApiResponse (AttachmentEntity) |
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |
UploadAttachmentAsync(UploadAttachmentOptions, int, CancellationToken)
Upload an attachment for sending using base64 file encoding. Returns an array whose first element is the ID of the uploaded attachment.
Declaration
Task<List<string>> UploadAttachmentAsync(UploadAttachmentOptions uploadAttachmentOptions, int operationIndex = 0, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
UploadAttachmentOptions | uploadAttachmentOptions | |
int | operationIndex | Index associated with the operation. |
CancellationToken | cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Task<System.Collections.Generic.List<T><string>> | Task of List<string> |
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |
UploadAttachmentBytesAsync(string, string, string, string, string, int, CancellationToken)
Upload an attachment for sending using file byte stream input octet stream. Returns an array whose first element is the ID of the uploaded attachment.
Declaration
Task<List<string>> UploadAttachmentBytesAsync(string contentType = null, string contentType2 = null, string contentId = null, string filename = null, string filename2 = null, int operationIndex = 0, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | contentType | (optional) |
string | contentType2 | Optional contentType for file. For instance |
string | contentId | Optional content ID (CID) to save upload with (optional) |
string | filename | Optional filename to save upload with (optional) |
string | filename2 | (optional) |
int | operationIndex | Index associated with the operation. |
CancellationToken | cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Task<System.Collections.Generic.List<T><string>> | Task of List<string> |
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |
UploadAttachmentBytesWithHttpInfoAsync(string, string, string, string, string, int, CancellationToken)
Upload an attachment for sending using file byte stream input octet stream. Returns an array whose first element is the ID of the uploaded attachment.
Declaration
Task<ApiResponse<List<string>>> UploadAttachmentBytesWithHttpInfoAsync(string contentType = null, string contentType2 = null, string contentId = null, string filename = null, string filename2 = null, int operationIndex = 0, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | contentType | (optional) |
string | contentType2 | Optional contentType for file. For instance |
string | contentId | Optional content ID (CID) to save upload with (optional) |
string | filename | Optional filename to save upload with (optional) |
string | filename2 | (optional) |
int | operationIndex | Index associated with the operation. |
CancellationToken | cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Task<ApiResponse<System.Collections.Generic.List<T><string>>> | Task of ApiResponse (List<string>) |
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |
UploadAttachmentWithHttpInfoAsync(UploadAttachmentOptions, int, CancellationToken)
Upload an attachment for sending using base64 file encoding. Returns an array whose first element is the ID of the uploaded attachment.
Declaration
Task<ApiResponse<List<string>>> UploadAttachmentWithHttpInfoAsync(UploadAttachmentOptions uploadAttachmentOptions, int operationIndex = 0, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
UploadAttachmentOptions | uploadAttachmentOptions | |
int | operationIndex | Index associated with the operation. |
CancellationToken | cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Task<ApiResponse<System.Collections.Generic.List<T><string>>> | Task of ApiResponse (List<string>) |
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |
UploadMultipartFormAsync(string, string, string, string, UploadMultipartFormRequest, int, CancellationToken)
Upload an attachment for sending using a Multipart Form request. Returns an array whose first element is the ID of the uploaded attachment.
Declaration
Task<List<string>> UploadMultipartFormAsync(string contentId = null, string contentType = null, string filename = null, string xFilename = null, UploadMultipartFormRequest uploadMultipartFormRequest = null, int operationIndex = 0, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | contentId | Optional content ID of attachment (optional) |
string | contentType | Optional content type of attachment (optional) |
string | filename | Optional name of file (optional) |
string | xFilename | Optional content type header of attachment (optional) |
UploadMultipartFormRequest | uploadMultipartFormRequest | (optional) |
int | operationIndex | Index associated with the operation. |
CancellationToken | cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Task<System.Collections.Generic.List<T><string>> | Task of List<string> |
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |
UploadMultipartFormWithHttpInfoAsync(string, string, string, string, UploadMultipartFormRequest, int, CancellationToken)
Upload an attachment for sending using a Multipart Form request. Returns an array whose first element is the ID of the uploaded attachment.
Declaration
Task<ApiResponse<List<string>>> UploadMultipartFormWithHttpInfoAsync(string contentId = null, string contentType = null, string filename = null, string xFilename = null, UploadMultipartFormRequest uploadMultipartFormRequest = null, int operationIndex = 0, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | contentId | Optional content ID of attachment (optional) |
string | contentType | Optional content type of attachment (optional) |
string | filename | Optional name of file (optional) |
string | xFilename | Optional content type header of attachment (optional) |
UploadMultipartFormRequest | uploadMultipartFormRequest | (optional) |
int | operationIndex | Index associated with the operation. |
CancellationToken | cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Task<ApiResponse<System.Collections.Generic.List<T><string>>> | Task of ApiResponse (List<string>) |
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |