-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to match recently-changed CloudMQTT API (#2)
* Update to match recently-changed CloudMQTT API * Handle breaking changes in Cake.Docker Update DockerRunSettings class name to DockerContainerRunSettings. * We don't actually need a dictionary for this...
- Loading branch information
1 parent
e880794
commit 521947b
Showing
8 changed files
with
53 additions
and
14 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
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 |
---|---|---|
@@ -1,11 +1,14 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace CloudMQTT.Client | ||
{ | ||
public class Rule | ||
{ | ||
public string Username { get; set; } | ||
public string Topic { get; set; } | ||
[JsonProperty("type")] | ||
public RuleType RuleType { get; set; } | ||
public string User { get; set; } | ||
public string Pattern { get; set; } | ||
public bool Read { get; set; } | ||
public bool Write { get; set; } | ||
|
||
} | ||
} |
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 |
---|---|---|
@@ -1,14 +1,19 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace CloudMQTT.Client | ||
{ | ||
public class RuleReference | ||
{ | ||
public string Username { get; set; } | ||
public string Topic { get; set; } | ||
[JsonProperty("type")] | ||
public RuleType RuleType { get; set; } | ||
public string User { get; set; } | ||
public string Pattern { get; set; } | ||
|
||
public static implicit operator RuleReference(Rule rule) => new RuleReference() | ||
{ | ||
Topic = rule.Topic, | ||
Username = rule.Username, | ||
RuleType = rule.RuleType, | ||
Pattern = rule.Pattern, | ||
User = rule.User, | ||
}; | ||
} | ||
} |
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,16 @@ | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Converters; | ||
using System.Runtime.Serialization; | ||
|
||
namespace CloudMQTT.Client | ||
{ | ||
[JsonConverter(typeof(StringEnumConverter))] | ||
public enum RuleType | ||
{ | ||
[EnumMember(Value = "topic")] | ||
Topic, | ||
|
||
[EnumMember(Value = "pattern")] | ||
Pattern | ||
} | ||
} |
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,9 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace CloudMQTT.Client | ||
{ | ||
public class RulesResponse | ||
{ | ||
public List<Rule> Items { get; set; } | ||
} | ||
} |
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