Skip to content

Commit

Permalink
Merge pull request daltskin#4 from daltskin/rules_models
Browse files Browse the repository at this point in the history
Changes to support view/edit/delete rules
  • Loading branch information
daltskin committed Jul 8, 2020
2 parents 0f4431c + a350e6f commit 1606e9c
Show file tree
Hide file tree
Showing 11 changed files with 167 additions and 2 deletions.
2 changes: 1 addition & 1 deletion GitVersion.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
mode: Mainline
next-version: 0.2.0
next-version: 0.3.0
assembly-versioning-scheme: MajorMinorPatch
assembly-file-versioning-format: '{Major}.{Minor}.{Patch}'
assembly-informational-format: '{FullBuildMetaData}'
Expand Down
6 changes: 5 additions & 1 deletion src/Model/Action.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ public partial class Action : IEquatable<Action>, IValidatableObject
this.Every = every;
this.Location = location;
}


[DataMember(Name = "if", EmitDefaultValue = false)]
public If _if { get; set; }

/// <summary>
/// Gets or Sets Sleep
/// </summary>
Expand Down Expand Up @@ -78,6 +81,7 @@ public override string ToString()
{
var sb = new StringBuilder();
sb.Append("class Action {\n");
sb.Append(" If: ").Append(_if).Append("\n");
sb.Append(" Sleep: ").Append(Sleep).Append("\n");
sb.Append(" Command: ").Append(Command).Append("\n");
sb.Append(" Every: ").Append(Every).Append("\n");
Expand Down
13 changes: 13 additions & 0 deletions src/Model/Else.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Text;

namespace SmartThingsNet.Model
{
public class Else
{
[DataMember(Name = "command", EmitDefaultValue = false)]
public CommandAction command { get; set; }
}
}
16 changes: 16 additions & 0 deletions src/Model/Greater_Than.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Text;

namespace SmartThingsNet.Model
{
public class Greater_Than
{
[DataMember(Name = "right", EmitDefaultValue = false)]
public Right right { get; set; }

[DataMember(Name = "left", EmitDefaultValue = false)]
public Left left { get; set; }
}
}
27 changes: 27 additions & 0 deletions src/Model/If.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

using Newtonsoft.Json;
using System.Runtime.Serialization;

namespace SmartThingsNet.Model
{
public class If
{
[JsonProperty("equals")]
[DataMember(Name = "equals", EmitDefaultValue = false)]
public _Equals _equals { get; set; }

[JsonProperty("then")]
[DataMember(Name = "then", EmitDefaultValue = false)]
public Then[] _then { get; set; }

[JsonProperty("else")]
[DataMember(Name = "else", EmitDefaultValue = false)]
public Else[] _else { get; set; }

[DataMember(Name = "less_than", EmitDefaultValue = false)]
public Less_Than less_than { get; set; }

[DataMember(Name = "greater_than", EmitDefaultValue = false)]
public Greater_Than greater_than { get; set; }
}
}
25 changes: 25 additions & 0 deletions src/Model/Left.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Text;

namespace SmartThingsNet.Model
{
public class Left
{
[JsonProperty("string")]
[DataMember(Name = "string", EmitDefaultValue = false)]
public string _string { get; set; }

[DataMember(Name = "location", EmitDefaultValue = false)]
public Location? location { get; set; }

[DataMember(Name = "device", EmitDefaultValue = false)]
public Device device { get; set; }

[JsonProperty("integer")]
[DataMember(Name = "integer", EmitDefaultValue = false)]
public int? _integer { get; set; }
}
}
16 changes: 16 additions & 0 deletions src/Model/Less_than.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Text;

namespace SmartThingsNet.Model
{
public class Less_Than
{
[DataMember(Name = "right", EmitDefaultValue = false)]
public Right right { get; set; }

[DataMember(Name = "left", EmitDefaultValue = false)]
public Left left { get; set; }
}
}
7 changes: 7 additions & 0 deletions src/Model/Location.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ public partial class Location : IEquatable<Location>, IValidatableObject
[DataMember(Name="name", EmitDefaultValue=false)]
public string Name { get; set; }

/// <summary>
/// location attribute mode
/// </summary>
/// <value>attribute mode</value>
[DataMember(Name = "attribute", EmitDefaultValue = false)]
public string attribute { get; set; }

/// <summary>
/// An ISO Alpha-3 country code. (i.e. GBR, USA)
/// </summary>
Expand Down
25 changes: 25 additions & 0 deletions src/Model/Right.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Text;

namespace SmartThingsNet.Model
{
public class Right
{
[JsonProperty("string")]
[DataMember(Name = "string", EmitDefaultValue = false)]
public string _string { get; set; }

[DataMember(Name = "location", EmitDefaultValue = false)]
public Location? location { get; set; }

[DataMember(Name = "device", EmitDefaultValue = false)]
public Device device { get; set; }

[JsonProperty("integer")]
[DataMember(Name = "integer", EmitDefaultValue = false)]
public int? _integer { get; set; }
}
}
16 changes: 16 additions & 0 deletions src/Model/Then.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Text;

namespace SmartThingsNet.Model
{
public class Then
{
[DataMember(Name = "command", EmitDefaultValue = false)]
public CommandAction command { get; set; }

[DataMember(Name = "sleep", EmitDefaultValue = false)]
public SleepAction sleep { get; set; }
}
}
16 changes: 16 additions & 0 deletions src/Model/_equals.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Text;

namespace SmartThingsNet.Model
{
public class _Equals
{
[DataMember(Name = "left", EmitDefaultValue = false)]
public Left left { get; set; }

[DataMember(Name = "right", EmitDefaultValue = false)]
public Right right { get; set; }
}
}

0 comments on commit 1606e9c

Please sign in to comment.