-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1.11.2: Added TrelloPlan Info and Bump of System.Text.Json
- Loading branch information
Showing
11 changed files
with
154 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
src/TrelloDotNet/Model/Options/GetBoardOptions/GetBoardOptionsFilter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
src/TrelloDotNet/Model/Options/GetLabelOptions/GetLabelOptions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
namespace TrelloDotNet.Model | ||
{ | ||
/// <summary> | ||
/// What Trello Plan a Board/Workspace is using (https://trello.com/pricing) | ||
/// </summary> | ||
public enum TrelloPlan | ||
{ | ||
/// <summary> | ||
/// The Plan could not be determined | ||
/// </summary> | ||
Unknown, | ||
|
||
/// <summary> | ||
/// The Free Plan | ||
/// </summary> | ||
Free, | ||
|
||
/// <summary> | ||
/// The Standard Plan | ||
/// </summary> | ||
Standard, | ||
|
||
/// <summary> | ||
/// The Premium Plan | ||
/// </summary> | ||
Premium, | ||
|
||
/// <summary> | ||
/// The Enterprise Plan | ||
/// </summary> | ||
Enterprise | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
using System.Collections.Generic; | ||
using System.Text.Json.Serialization; | ||
|
||
// ReSharper disable UnusedMember.Global | ||
|
||
namespace TrelloDotNet.Model | ||
{ | ||
/// <summary> | ||
/// Contains what Trello Plan a Board/Workspace is using (Free, Standard, Premium, Enterprise) and thereby what features are supported | ||
/// </summary> | ||
public class TrelloPlanInformation | ||
{ | ||
/// <summary> | ||
/// Id of the Board/Workspace | ||
/// </summary> | ||
[JsonPropertyName("id")] | ||
[JsonInclude] | ||
public string Id { get; set; } | ||
|
||
/// <summary> | ||
/// Name of the Board/Workspace | ||
/// </summary> | ||
[JsonPropertyName("name")] | ||
[JsonInclude] | ||
public string Name { get; set; } | ||
|
||
/// <summary> | ||
/// What subscription plan (Free, Standard, Premium or Enterprise) | ||
/// </summary> | ||
public TrelloPlan Plan | ||
{ | ||
get | ||
{ | ||
if (Features == null || Features.Count == 0) | ||
{ | ||
return TrelloPlan.Unknown; | ||
} | ||
|
||
if (Features.Contains("isEnterprise")) | ||
{ | ||
return TrelloPlan.Enterprise; | ||
} | ||
|
||
if (Features.Contains("isPremium")) | ||
{ | ||
return TrelloPlan.Premium; | ||
} | ||
|
||
if (Features.Contains("isStandard")) | ||
{ | ||
return TrelloPlan.Standard; | ||
} | ||
|
||
return TrelloPlan.Free; | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// List of Features for the Board/Workspace | ||
/// </summary> | ||
[JsonPropertyName("premiumFeatures")] | ||
[JsonInclude] | ||
public List<string> Features { get; private set; } | ||
|
||
/// <summary> | ||
/// If this board support Custom Fields (Only populated if GetBoardOptions.CardFields include 'premiumFeatures') | ||
/// </summary> | ||
// ReSharper disable once UnusedMember.Global | ||
public bool IsCustomFieldsSupported => Plan == TrelloPlan.Standard || Plan == TrelloPlan.Premium || Plan == TrelloPlan.Enterprise; | ||
|
||
/// <summary> | ||
/// If this board support Advanced Checklists (Only populated if GetBoardOptions.CardFields include 'premiumFeatures') | ||
/// </summary> | ||
// ReSharper disable once UnusedMember.Global | ||
public bool IsAdvancedChecklistsSupported => Plan == TrelloPlan.Standard || Plan == TrelloPlan.Premium || Plan == TrelloPlan.Enterprise; | ||
|
||
/// <summary> | ||
/// If this board support List Colors (Only populated if GetBoardOptions.CardFields include 'premiumFeatures') | ||
/// </summary> | ||
public bool IsListColorsSupported => Plan == TrelloPlan.Standard || Plan == TrelloPlan.Premium || Plan == TrelloPlan.Enterprise; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters