C# Класс Mondo.MondoClient

An authenticated Mondo API client.
Наследование: IMondoClient
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
AnnotateTransactionAsync ( string transactionId, string>.IDictionary metadata, CancellationToken cancellationToken = default(CancellationToken) ) : Task

You may store your own key-value annotations against a transaction in its metadata.

Metadata is private to your application.

CreateAttachmentAsync ( string externalId, string fileUrl, string fileType, CancellationToken cancellationToken = default(CancellationToken) ) : Task

Once you have obtained a URL for an attachment, either by uploading to the upload_url obtained from the upload endpoint above or by hosting a remote image, this URL can then be registered against a transaction. Once an attachment is registered against a transaction this will be displayed on the detail page of a transaction within the Mondo app.

CreateFeedItemAsync ( string accountId, string type, string>.IDictionary @params, string url = null, CancellationToken cancellationToken = default(CancellationToken) ) : Task

Creates a new feed item on the user’s feed.

CreateWebhookAsync ( string accountId, string url, CancellationToken cancellationToken = default(CancellationToken) ) : Task

Each time a matching event occurs, we will make a POST call to the URL you provide. If the call fails, we will retry up to a maximum of 5 attempts, with exponential backoff.

DeleteAttachmentAsync ( string id, CancellationToken cancellationToken = default(CancellationToken) ) : Task

To remove an attachment, simply deregister this using its id

DeleteWebhookAsync ( string webhookId, CancellationToken cancellationToken = default(CancellationToken) ) : Task

When you delete a web hook, we will no longer send notifications to it.

Dispose ( ) : void

Disposes the underlying HttpClient.

GetAccountsAsync ( ) : Task>

Returns a list of accounts owned by the currently authorised user.

GetBalanceAsync ( string accountId ) : Task

Returns balance information for a specific account.

GetTransactionAsync ( string transactionId, string expand = null ) : Task

Returns an individual transaction, fetched by its id.

GetTransactionsAsync ( string accountId, string expand = null, PaginationOptions paginationOptions = null ) : Task>

Returns a list of transactions on the user’s account.

GetWebhooksAsync ( string accountId ) : Task>

List the web hooks registered on an account.

MondoClient ( string accessToken, string baseUri = "https://api.getmondo.co.uk" ) : System

Initializes a new instance of the MondoClient class.

UploadAttachmentAsync ( string filename, string fileType, string externalId, Stream stream, CancellationToken cancellationToken = default(CancellationToken) ) : Task

Uploads an attachment from a file stream.

Приватные методы

Метод Описание
MondoClient ( HttpClient httpClient, string accessToken ) : System

Описание методов

AnnotateTransactionAsync() публичный Метод

You may store your own key-value annotations against a transaction in its metadata.
Metadata is private to your application.
public AnnotateTransactionAsync ( string transactionId, string>.IDictionary metadata, CancellationToken cancellationToken = default(CancellationToken) ) : Task
transactionId string
metadata string>.IDictionary Include each key you would like to modify. To delete a key, set its value to an empty string.
cancellationToken System.Threading.CancellationToken A cancellation token that can be used by other objects or threads to receive notice of cancellation.
Результат Task

CreateAttachmentAsync() публичный Метод

Once you have obtained a URL for an attachment, either by uploading to the upload_url obtained from the upload endpoint above or by hosting a remote image, this URL can then be registered against a transaction. Once an attachment is registered against a transaction this will be displayed on the detail page of a transaction within the Mondo app.
public CreateAttachmentAsync ( string externalId, string fileUrl, string fileType, CancellationToken cancellationToken = default(CancellationToken) ) : Task
externalId string The id of the transaction to associate the attachment with.
fileUrl string The URL of the uploaded attachment.
fileType string The content type of the attachment.
cancellationToken System.Threading.CancellationToken A cancellation token that can be used by other objects or threads to receive notice of cancellation.
Результат Task

CreateFeedItemAsync() публичный Метод

Creates a new feed item on the user’s feed.
public CreateFeedItemAsync ( string accountId, string type, string>.IDictionary @params, string url = null, CancellationToken cancellationToken = default(CancellationToken) ) : Task
accountId string The account to create feed item for.
type string Type of feed item. Currently only basic is supported.
@params string>.IDictionary
url string A URL to open when the feed item is tapped. If no URL is provided, the app will display a fallback view based on the title & body.
cancellationToken System.Threading.CancellationToken A cancellation token that can be used by other objects or threads to receive notice of cancellation.
Результат Task

CreateWebhookAsync() публичный Метод

Each time a matching event occurs, we will make a POST call to the URL you provide. If the call fails, we will retry up to a maximum of 5 attempts, with exponential backoff.
public CreateWebhookAsync ( string accountId, string url, CancellationToken cancellationToken = default(CancellationToken) ) : Task
accountId string The account to receive notifications for.
url string The URL we will send notifications to.
cancellationToken System.Threading.CancellationToken A cancellation token that can be used by other objects or threads to receive notice of cancellation.
Результат Task

DeleteAttachmentAsync() публичный Метод

To remove an attachment, simply deregister this using its id
public DeleteAttachmentAsync ( string id, CancellationToken cancellationToken = default(CancellationToken) ) : Task
id string The id of the attachment to deregister.
cancellationToken System.Threading.CancellationToken A cancellation token that can be used by other objects or threads to receive notice of cancellation.
Результат Task

DeleteWebhookAsync() публичный Метод

When you delete a web hook, we will no longer send notifications to it.
public DeleteWebhookAsync ( string webhookId, CancellationToken cancellationToken = default(CancellationToken) ) : Task
webhookId string The id of the webhook to delete.
cancellationToken System.Threading.CancellationToken A cancellation token that can be used by other objects or threads to receive notice of cancellation.
Результат Task

Dispose() публичный Метод

Disposes the underlying HttpClient.
public Dispose ( ) : void
Результат void

GetAccountsAsync() публичный Метод

Returns a list of accounts owned by the currently authorised user.
public GetAccountsAsync ( ) : Task>
Результат Task>

GetBalanceAsync() публичный Метод

Returns balance information for a specific account.
public GetBalanceAsync ( string accountId ) : Task
accountId string The id of the account.
Результат Task

GetTransactionAsync() публичный Метод

Returns an individual transaction, fetched by its id.
public GetTransactionAsync ( string transactionId, string expand = null ) : Task
transactionId string The transaction ID.
expand string Can be merchant.
Результат Task

GetTransactionsAsync() публичный Метод

Returns a list of transactions on the user’s account.
public GetTransactionsAsync ( string accountId, string expand = null, PaginationOptions paginationOptions = null ) : Task>
accountId string The account to retrieve transactions from.
expand string Can be merchant.
paginationOptions PaginationOptions This endpoint can be paginated.
Результат Task>

GetWebhooksAsync() публичный Метод

List the web hooks registered on an account.
public GetWebhooksAsync ( string accountId ) : Task>
accountId string The account to list registered web hooks for.
Результат Task>

MondoClient() публичный Метод

Initializes a new instance of the MondoClient class.
public MondoClient ( string accessToken, string baseUri = "https://api.getmondo.co.uk" ) : System
accessToken string Your access token.
baseUri string URL of the Mondo API to use, defaults to production.
Результат System

UploadAttachmentAsync() публичный Метод

Uploads an attachment from a file stream.
public UploadAttachmentAsync ( string filename, string fileType, string externalId, Stream stream, CancellationToken cancellationToken = default(CancellationToken) ) : Task
filename string The name of the file to be uploaded
fileType string The content type of the file
externalId string The id of the transaction to associate the attachment with.
stream Stream The file stream.
cancellationToken System.Threading.CancellationToken A cancellation token that can be used by other objects or threads to receive notice of cancellation.
Результат Task