Table of Contents

Interface IContactCollectionResource

Namespace
Mailtrap.Contacts
Assembly
Mailtrap.Abstractions.dll

Represents Contact collection resource.

public interface IContactCollectionResource : IRestResource
Inherited Members

Methods

Create(CreateContactRequest, CancellationToken)

Creates a new contact with details specified by request.

Task<CreateContactResponse> Create(CreateContactRequest request, CancellationToken cancellationToken = default)

Parameters

request CreateContactRequest

Request containing contact details for creation.

cancellationToken CancellationToken
Token to control operation cancellation.

Returns

Task<CreateContactResponse>

Created contact details.

Events(string)

Gets contact event collection resource for the account, represented by this resource instance.

IContactEventCollectionResource Events(string contactId)

Parameters

contactId string

Unique Contact ID to get resource for.

Returns

IContactEventCollectionResource

IContactEventCollectionResource for the account, represented by this resource instance.

Field(long)

Gets resource for a specific contact field identified by fieldId.

IContactFieldResource Field(long fieldId)

Parameters

fieldId long

Unique Contact Field ID to get resource for.

Returns

IContactFieldResource

IContactFieldResource for the contact field with the specified ID.

Exceptions

ArgumentOutOfRangeException

When fieldId is less than or equal to zero.

Fields()

Gets contact field collection resource for the account, represented by this resource instance.

IContactFieldCollectionResource Fields()

Returns

IContactFieldCollectionResource

IContactFieldCollectionResource for the account, represented by this resource instance.

GetAll(CancellationToken)

Gets collection of contact details.

Task<IList<Contact>> GetAll(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Token to control operation cancellation.

Returns

Task<IList<Contact>>

Collection of contact details.

Import(long)

Gets resource for a specific contact import identified by importId.

IContactImportResource Import(long importId)

Parameters

importId long

Unique Contact Import ID to get resource for.

Returns

IContactImportResource

IContactImportResource for the contact import with the specified ID.

Exceptions

ArgumentOutOfRangeException

When importId is less than or equal to zero.

Imports()

Gets contact import collection resource for the account, represented by this resource instance.

IContactImportCollectionResource Imports()

Returns

IContactImportCollectionResource

IContactImportCollectionResource for the account, represented by this resource instance.

List(long)

Gets resource for a specific contact list identified by listId.

IContactListResource List(long listId)

Parameters

listId long

Unique Contact List ID to get resource for.

Returns

IContactListResource

IContactListResource for the contact list with the specified ID.

Exceptions

ArgumentOutOfRangeException

When listId is less than or equal to zero.

Lists()

Gets contact list collection resource for the account, represented by this resource instance.

IContactListCollectionResource Lists()

Returns

IContactListCollectionResource

IContactListCollectionResource for the account, represented by this resource instance.