C# Class Microsoft.AspNet.WebHooks.TrelloWebHookClient

The TrelloWebHookClient provides support for creating and deleting Trello WebHooks programmatically. For more information about Trello WebHooks, please see https://trello.com/docs/gettingstarted/webhooks.html.
Inheritance: IDisposable
Exibir arquivo Open project: aspnet/WebHooks Class Usage Examples

Public Methods

Method Description
CreateAsync ( Uri callback, string modelId, string description ) : Task

Creates a WebHook subscription for Trello to send WebHooks when changes happen to a given modelId. If the operation fails an exception is thrown.

DeleteAsync ( string webHookId ) : Task

Deletes an existing Trello WebHook with a given webHookId.

Dispose ( ) : void
TrelloWebHookClient ( string userToken, string applicationKey ) : System

Initializes a new instance of the TrelloWebHookClient which can be used to create and delete WebHooks with Trello. For more information about Trello WebHooks, please see https://trello.com/docs/gettingstarted/webhooks.html.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Releases the unmanaged resources and optionally releases the managed resources.

Private Methods

Method Description
TrelloWebHookClient ( string userToken, string applicationKey, HttpClient httpClient ) : System

Initializes a new instance of the TrelloWebHookClient with the given httpClient. This constructor is intended for unit testing purposes.

Method Details

CreateAsync() public method

Creates a WebHook subscription for Trello to send WebHooks when changes happen to a given modelId. If the operation fails an exception is thrown.
public CreateAsync ( Uri callback, string modelId, string description ) : Task
callback System.Uri The URI where WebHooks for the given will be received. Typically this will be of the form https://<host>/api/webhooks/incoming/trello
modelId string The ID of a model to watch. This can be the ID of a member, card, board, or anything that actions apply to. Any event involving this model will trigger the WebHook. An example model ID is 4d5ea62fd76aa1136000000c.
description string A description of the WebHook, for example My Trello WebHook!.
return Task

DeleteAsync() public method

Deletes an existing Trello WebHook with a given webHookId.
public DeleteAsync ( string webHookId ) : Task
webHookId string The WebHook ID obtained when creating the WebHook.
return Task

Dispose() public method

public Dispose ( ) : void
return void

Dispose() protected method

Releases the unmanaged resources and optionally releases the managed resources.
protected Dispose ( bool disposing ) : void
disposing bool true to release both managed and unmanaged resources; false to release only unmanaged resources.
return void

TrelloWebHookClient() public method

Initializes a new instance of the TrelloWebHookClient which can be used to create and delete WebHooks with Trello. For more information about Trello WebHooks, please see https://trello.com/docs/gettingstarted/webhooks.html.
public TrelloWebHookClient ( string userToken, string applicationKey ) : System
userToken string The user token obtained when authenticating with Trello. The token can for example /// be obtained using either of the Trello.Net or Owin.Security.Providers.Trello Nuget packages. A sample user token is /// 0d3cce724413cba6d42084bb1c6bd7a285446deccb3ee2259152acd1eb6418a2. Note that the token expires so it must be renewed on a regular basis.
applicationKey string Your Trello application key as obtained from https://trello.com/app-key.
return System