GuerrillaMailApi class

the client for Guerrilla Mail

Constructors

GuerrillaMailApi({Uri? apiEndpoint, String locale = 'en', String? sessionId})

Properties

apiEndpoint Uri
the endpoint to access the API at default to the official Guerrilla Mail endpoint
latefinal
hashCode int
The hash code for this object.
no setterinherited
locale String
the locale to use default to en must be one of GuerrillaMailApi.locales
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

checkEmail(int sequenceNumber) Future<CheckEmailResponse>
Check for new email on the server. Returns a list of the newest messages. The maximum size of the list is 20 items.
deleteEmail(List<int> emailIds) Future<DeleteEmailResponse>
Delete the emails from the server
fetchEmail(int id) Future<Message>
Get the contents of an email.
forgetMe(String emailAddress) Future<bool?>
Forget the current email address. This will not stop the session, the existing session will be maintained. A subsequent call to get_email_address will fetch a new email address or the client can call set_email_user to set a new address. Typically, a user would want to set a new address manually after clicking the ‘forget me’ button.
getEmailAddress() Future<GetEmailAddressResponse>
The function is used to initialize a session and set the client with an email address. If the session already exists, then it will return the email address details of the existing session. If a new session needs to be created, then it will create new email address randomly. The function will return a number of arguments for the client to remember, including the ‘sid_token’. The ‘sid_token’ is passed to each subsequent API call to maintain state.
getEmailList({int offset = 0, int? sequenceNumber}) Future<CheckEmailResponse>
Gets a maximum of 20 messages from the specified offset. Offset of 0 will fetch a list of the first 10 emails, offset of 10 will fetch a list of the next 10, and so on.
getOlderList(int sequence, int limit) Future<GetEmailAddressResponse>
The idea of this function is to get some emails that are older (lower ID) than ‘seq’. How can this be useful? Say we have more than 1 page of emails. Then, we delete some emails from the first page, so we are left with some empty slots at the bottom. Instead of calling fetch_email_list, we call this to be more efficient and get exactly the number of email we need to fill.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setEmailUser(String emailUser) Future<SetEmailUserResponse>
Set the email address to a different email address. If the email has already been set, it will be given additional 60 minutes. Otherwise, a new email address will be generated if the email address is not in the database.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

errorCodes → const Map<String, String>
locales → const List<String>
the locales officially supported by Guerrilla Mail