forked from auth0/auth0.net
-
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.
- Loading branch information
1 parent
9f385dd
commit c64534b
Showing
10 changed files
with
240 additions
and
75 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,57 @@ | ||
using System; | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Serialization; | ||
|
||
namespace Auth0.ManagementApi.Models.Actions | ||
{ | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
[JsonObject(NamingStrategyType = typeof(SnakeCaseNamingStrategy))] | ||
public class ActionSecret | ||
{ | ||
|
||
#region Public Properties | ||
|
||
/// <summary> | ||
/// The name of the particular secret, e.g. API_KEY. | ||
/// </summary> | ||
[JsonProperty("name")] | ||
public string Name { get; set; } | ||
|
||
/// <summary> | ||
/// The time when the secret was last updated. | ||
/// </summary> | ||
[JsonProperty("updated_at")] | ||
public DateTime UpdatedAt { get; private set; } | ||
|
||
/// <summary> | ||
/// The value of the particular secret, e.g. secret123. A secret's value can only be set upon creation. A secret's value will never be returned by the API. | ||
/// </summary> | ||
[JsonProperty("value")] | ||
public string Value { get; set; } | ||
|
||
#endregion | ||
|
||
#region Constructors | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
public ActionSecret() | ||
{ | ||
} | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
/// <param name="name"></param> | ||
/// <param name="value"></param> | ||
public ActionSecret(string name, string value) | ||
{ | ||
Name = name; | ||
Value = value; | ||
} | ||
|
||
#endregion | ||
|
||
} | ||
} |
63 changes: 63 additions & 0 deletions
63
src/Auth0.ManagementApi/Models/Actions/Requests/UpdateTriggerBindingEntry.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Serialization; | ||
using System.Collections.Generic; | ||
|
||
namespace Auth0.ManagementApi.Models.Actions | ||
{ | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
[JsonObject(NamingStrategyType = typeof(SnakeCaseNamingStrategy))] | ||
public class UpdateTriggerBindingEntry | ||
{ | ||
|
||
/// <summary> | ||
/// The name of the binding. | ||
/// </summary> | ||
public string DisplayName { get; set; } | ||
|
||
/// <summary> | ||
/// A reference to an action. An action can be referred to by <see cref="TriggerReferenceType.ActionId" />, | ||
/// <see cref="TriggerReferenceType.ActionName" />, or <see cref="TriggerReferenceType.BindingId" />. | ||
/// </summary> | ||
[JsonProperty("ref")] | ||
public TriggerBindingReference Reference { get; set; } | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
public IList<ActionSecret> Secrets { get; set; } | ||
|
||
#region Constructors | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
public UpdateTriggerBindingEntry() | ||
{ | ||
Reference = new TriggerBindingReference() | ||
{ | ||
Type = TriggerReferenceType.ActionId | ||
}; | ||
Secrets = []; | ||
} | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
/// <param name="displayName"></param> | ||
/// <param name="referenceType"></param> | ||
/// <param name="referenceValue"></param> | ||
public UpdateTriggerBindingEntry(string displayName, TriggerReferenceType referenceType, string referenceValue) : this() | ||
{ | ||
DisplayName = displayName; | ||
Reference.Type = referenceType; | ||
Reference.Value = referenceValue; | ||
} | ||
|
||
#endregion | ||
|
||
} | ||
|
||
} |
28 changes: 25 additions & 3 deletions
28
src/Auth0.ManagementApi/Models/Actions/Requests/UpdateTriggerBindingsRequest.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,39 @@ | ||
using System.Collections.Generic; | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Serialization; | ||
using System.Collections.Generic; | ||
|
||
namespace Auth0.ManagementApi.Models.Actions | ||
{ | ||
|
||
/// <summary> | ||
/// Request configuration to update the actions that are bound (i.e. attached) to a trigger. | ||
/// </summary> | ||
[JsonObject(NamingStrategyType = typeof(SnakeCaseNamingStrategy))] | ||
|
||
public class UpdateTriggerBindingsRequest | ||
{ | ||
|
||
#region Public Properties | ||
|
||
/// <summary> | ||
/// The actions that will be bound to this trigger. The order in which they are included will be the order in which they are executed. | ||
/// </summary> | ||
[JsonProperty("bindings")] | ||
public IList<UpdateTriggerBindingEntry> Bindings { get; set; } | ||
|
||
#endregion | ||
|
||
#region Constructors | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
public UpdateTriggerBindingsRequest() | ||
{ | ||
Bindings = []; | ||
} | ||
|
||
#endregion | ||
|
||
} | ||
|
||
} |
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
16 changes: 8 additions & 8 deletions
16
src/Auth0.ManagementApi/Models/Actions/Triggers/TriggerBinding.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,47 @@ | ||
using System; | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Serialization; | ||
|
||
namespace Auth0.ManagementApi.Models.Actions | ||
{ | ||
|
||
/// <summary> | ||
/// Represents a Trigger Binding in Auth0 | ||
/// </summary> | ||
[JsonObject(NamingStrategyType = typeof(SnakeCaseNamingStrategy))] | ||
public class TriggerBinding | ||
{ | ||
|
||
/// <summary> | ||
/// The unique ID of this binding. | ||
/// </summary> | ||
[JsonProperty("id")] | ||
public string Id { get; set; } | ||
public Guid Id { get; set; } | ||
|
||
/// <summary> | ||
/// The actions extensibility point. | ||
/// </summary> | ||
[JsonProperty("trigger_id")] | ||
public string TriggerId { get; set; } | ||
public TriggerType TriggerId { get; set; } | ||
|
||
/// <summary> | ||
/// The connected action. | ||
/// </summary> | ||
[JsonProperty("action")] | ||
public CodeAction Action { get; set; } | ||
|
||
/// <summary> | ||
/// The time when the binding was created. | ||
/// </summary> | ||
[JsonProperty("created_at")] | ||
public DateTime CreatedAt { get; set; } | ||
|
||
/// <summary> | ||
/// The time when the binding was updated. | ||
/// </summary> | ||
[JsonProperty("updated_at")] | ||
public DateTime UpdatedAt { get; set; } | ||
|
||
/// <summary> | ||
/// The name of the binding. | ||
/// </summary> | ||
[JsonProperty("display_name")] | ||
public string DisplayName { get; set; } | ||
|
||
} | ||
|
||
} |
26 changes: 26 additions & 0 deletions
26
src/Auth0.ManagementApi/Models/Actions/Triggers/TriggerBindingReference.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Serialization; | ||
|
||
namespace Auth0.ManagementApi.Models.Actions | ||
{ | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
[JsonObject(NamingStrategyType = typeof(SnakeCaseNamingStrategy))] | ||
public class TriggerBindingReference | ||
{ | ||
|
||
/// <summary> | ||
/// How the action is being referred to. | ||
/// </summary> | ||
public TriggerReferenceType Type { get; set; } | ||
|
||
/// <summary> | ||
/// The value to ude to look up the binding, based on the <see cref="Type" />. | ||
/// </summary> | ||
public string Value { get; set; } | ||
|
||
} | ||
|
||
} |
32 changes: 32 additions & 0 deletions
32
src/Auth0.ManagementApi/Models/Actions/Triggers/TriggerReferenceType.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using Newtonsoft.Json.Converters; | ||
using Newtonsoft.Json.Serialization; | ||
using Newtonsoft.Json; | ||
|
||
namespace Auth0.ManagementApi.Models.Actions | ||
{ | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
[JsonConverter(typeof(StringEnumConverter), typeof(SnakeCaseNamingStrategy))] | ||
public enum TriggerReferenceType | ||
{ | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
ActionId, | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
ActionName, | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
BindingId | ||
|
||
} | ||
|
||
} |
Oops, something went wrong.