Table of Contents

Interface IInboxResource

Namespace
Mailtrap.Inboxes
Assembly
Mailtrap.Abstractions.dll

Represents inbox resource.

public interface IInboxResource : IRestResource
Inherited Members

Methods

Clean(CancellationToken)

Delete all messages (emails) from the inbox, represented by the current resource instance.

Task<Inbox> Clean(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken
Token to control operation cancellation.

Returns

Task<Inbox>

Affected inbox details.

Delete(CancellationToken)

Deletes the inbox, represented by the current resource instance, with all its emails.

Task<Inbox> Delete(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken
Token to control operation cancellation.

Returns

Task<Inbox>

Deleted inbox details.

Remarks

All emails in the inbox will be deleted as well.

After deletion of the inbox, represented by the current resource instance, it will be no longer available.
Thus any further operations on it will result in an error.

GetDetails(CancellationToken)

Gets details of the inbox, represented by the current resource instance.

Task<Inbox> GetDetails(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Token to control operation cancellation.

Returns

Task<Inbox>

Requested inbox details.

MarkAsRead(CancellationToken)

Marks all messages (emails) in the inbox, represented by the current resource instance, as read.

Task<Inbox> MarkAsRead(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken
Token to control operation cancellation.

Returns

Task<Inbox>

Affected inbox details.

Message(long)

Gets resource for specific testing message, identified by messageId, in the inbox, represented by this resource instance.

ITestingMessageResource Message(long messageId)

Parameters

messageId long

ID of message to get resource for.

Returns

ITestingMessageResource

Resource for the testing message with specified ID.

Exceptions

ArgumentOutOfRangeException

When messageId is less than or equal to zero.

Messages()

Gets testing message collection resource for the inbox, represented by this resource instance.

ITestingMessageCollectionResource Messages()

Returns

ITestingMessageCollectionResource

Testing message collection resource for the inbox, represented by this resource instance.

ResetCredentials(CancellationToken)

Resets SMTP credentials of the inbox, represented by the current resource instance.

Task<Inbox> ResetCredentials(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken
Token to control operation cancellation.

Returns

Task<Inbox>

Affected inbox details.

ResetEmailAddress(CancellationToken)

Resets username of email address of the inbox, represented by the current resource instance.

Task<Inbox> ResetEmailAddress(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken
Token to control operation cancellation.

Returns

Task<Inbox>

Affected inbox details.

ToggleEmailAddress(CancellationToken)

Turns the email address of the inbox, represented by the current resource instance, ON or OFF.

Task<Inbox> ToggleEmailAddress(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken
Token to control operation cancellation.

Returns

Task<Inbox>

Affected inbox details.

Update(UpdateInboxRequest, CancellationToken)

Updates the inbox, represented by the current resource instance, with details specified by request.

Task<Inbox> Update(UpdateInboxRequest request, CancellationToken cancellationToken = default)

Parameters

request UpdateInboxRequest

Inbox details for update.

cancellationToken CancellationToken
Token to control operation cancellation.

Returns

Task<Inbox>

Updated inbox details.