diff --git a/README.md b/README.md index 704c723..925b7ae 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ # LeanKit.API.Client.Library +### DEPRECATION NOTICE +**This library is deprecated and has been unsupported since January 25, 2019. Additionally, it uses the LeanKit v1 API which is also deprecated. Please [use our v2 API directly](https://success.planview.com/Planview_LeanKit/LeanKit_API/01_v2) instead of this library.** + The **LeanKit.API.Client.Library** namespace provides a wrapper library designed to simplify the integration of external systems and utilities with your LeanKit account. This library exposes mechanisms that support both interactions with LeanKit as well as a strongly-typed object model representing the main entities within LeanKit. This library exposes two primary ways to interact with LeanKit. These are the LeanKitClient and LeanKitIntegration classes. Both of these are explained below. @@ -20,7 +23,7 @@ This class exposes methods that interact directly with LeanKit API. This class e ### Connecting using LeanKitClient -``` +```csharp var leanKitAuth = new LeanKitBasicAuth { Hostname = "MyAccount", @@ -36,7 +39,7 @@ var api = new LeanKitClientFactory().Create(leanKitAuth); To connect to other LeanKit domains, such as LeanKit for Construction [leankit.co](http://leankit.co), use the `UrlTemplateOverride` property. -``` +```csharp var leanKitAuth = new LeanKitBasicAuth { Hostname = "MyAccount", @@ -49,6 +52,91 @@ var leanKitAuth = new LeanKitBasicAuth var api = new LeanKitClientFactory().Create(leanKitAuth); ``` +### Sample Helper Class in C# + +```csharp +using System.Collections.Generic; +using System.Linq; +using LeanKit.API.Client.Library; +using LeanKit.API.Client.Library.TransferObjects; + +namespace CardUpdateTest +{ + public class LeanKitHelper + { + readonly ILeanKitApi _api; + public LeanKitHelper(string hostName, string emailAddress, string password) + { + _api = CreateApiClient(hostName, emailAddress, password); + } + + private ILeanKitApi CreateApiClient(string hostName, string emailAddress, string password) + { + var auth = new LeanKitBasicAuth + { + Hostname = hostName, + Username = emailAddress, + Password = password + }; + + var api = new LeanKitClientFactory().Create(auth); + return api; + } + + public List GetBoards() + { + var boards = _api.GetBoards().ToList(); + return boards; + } + + public Board GetBoard(long boardId) + { + return _api.GetBoard(boardId); + } + + } +} +``` + +### Sample Helper Class in Visual Basic .NET + +```vbnet +Imports LeanKit.API.Client.Library +Imports LeanKit.API.Client.Library.TransferObjects + +Public Class LeanKitHelper + + Dim ReadOnly _api As ILeanKitApi + + Public Sub New(hostName As String, emailAddress As String, password As String) + _api = CreateApiClient(hostName, emailAddress, password) + End Sub + + Private Function CreateApiClient(hostName As String, emailAddress As String, password As String) As ILeanKitApi + Dim auth as LeanKitBasicAuth + auth = New LeanKitBasicAuth() + auth.Hostname = hostName + auth.Username = emailAddress + auth.Password = password + + Dim api as ILeanKitApi + api = new LeanKitClientFactory().Create(auth) + CreateApiClient = api + End Function + + Public Function GetBoards() As List(Of BoardListing) + Dim boards As List(Of BoardListing) + boards = _api.GetBoards() + GetBoards = boards + End Function + + Public Function GetBoard(boardId As Long) As Board + GetBoard = _api.GetBoard(boardId) + End Function + +End Class +``` + ## LeanKitIntegration This class is designed to be used in stateful implementations. This class monitors the changes to a Board, and raises events whenever a board is changed. This library helps reduce the complexity of polling for changes. In addition, this class exposes the same command and query methods that are available in the LeanKitClient class. Leveraging its stateful nature, many of these queries and commands can be optimized, and provide more powerful validation. @@ -57,7 +145,7 @@ This class is designed to retrieve and hold a reference to the board, and theref ### Connecting using LeanKitIntegration -``` +```csharp var leanKitAuth = new LeanKitBasicAuth { Hostname = "MyAccount", @@ -81,7 +169,7 @@ integration.StartWatching(); To connect to the LeanKit API through an HTTP proxy server, you will need to add or update your .NET application's `app.config` or `web.config` file to include a `` section. -``` +```xml @@ -91,7 +179,7 @@ To connect to the LeanKit API through an HTTP proxy server, you will need to add Or, if more granular control of the proxy is required, it could look something like: -``` +```xml @@ -103,7 +191,7 @@ For more help, please review the .NET documentation on [proxy configuration](htt ### LeanKitClient Interface -``` +```csharp IEnumerable GetBoards(); Board GetBoard(long boardId); IEnumerable GetBacklogLanes(long boardId); @@ -139,7 +227,7 @@ long DeleteAttachment(long boardId, long cardId, long attachmentId); ### LeanKitIntegration Interface -``` +```csharp event EventHandler BoardStatusChecked; event EventHandler BoardInfoRefreshed; event EventHandler BoardChanged; @@ -172,7 +260,7 @@ void DeleteAttachment(long cardId, long attachmentId); ### BoardChangedEventArgs Properties -``` +```csharp public List MovedCards { get; set; } public List UpdatedCards { get; set; } public List AddedCards { get; set; } diff --git a/Samples/LeanKitNotifier/LeanKitNotifier.csproj b/Samples/LeanKitNotifier/LeanKitNotifier.csproj index 75283b0..bebc7c2 100644 --- a/Samples/LeanKitNotifier/LeanKitNotifier.csproj +++ b/Samples/LeanKitNotifier/LeanKitNotifier.csproj @@ -79,16 +79,14 @@ - + + PreserveNewest + - - - Always - diff --git a/Samples/LeanKitNotifier/app.ico b/Samples/LeanKitNotifier/app.ico index 87febdb..21da591 100644 Binary files a/Samples/LeanKitNotifier/app.ico and b/Samples/LeanKitNotifier/app.ico differ diff --git a/Samples/LeanKitNotifier/leankit-128x128.ico b/Samples/LeanKitNotifier/leankit-128x128.ico deleted file mode 100644 index 2267d0b..0000000 Binary files a/Samples/LeanKitNotifier/leankit-128x128.ico and /dev/null differ diff --git a/Samples/LeanKitNotifier/leankit-16x16.ico b/Samples/LeanKitNotifier/leankit-16x16.ico deleted file mode 100644 index 7ad5320..0000000 Binary files a/Samples/LeanKitNotifier/leankit-16x16.ico and /dev/null differ diff --git a/Samples/LeanKitNotifier/leankit-32x32.ico b/Samples/LeanKitNotifier/leankit-32x32.ico deleted file mode 100644 index 40a7fb5..0000000 Binary files a/Samples/LeanKitNotifier/leankit-32x32.ico and /dev/null differ diff --git a/Samples/LeanKitNotifier/leankit-64x64.ico b/Samples/LeanKitNotifier/leankit-64x64.ico deleted file mode 100644 index 87febdb..0000000 Binary files a/Samples/LeanKitNotifier/leankit-64x64.ico and /dev/null differ