Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds Integration information in Actions response #740

Merged
merged 1 commit into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/Auth0.ManagementApi/Models/Actions/Action.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,21 @@ public class Action : ActionBase
/// </summary>
[JsonProperty("supported_triggers")]
public IList<ActionSupportedTrigger> SupportedTriggers { get; set; }

/// <summary>
/// The fk reference to InstalledIntegration entity.
/// </summary>
[JsonProperty("installed_integration_id")]
public string InstalledIntegrationId { get; set; }

/// <inheritdoc cref="Auth0.ManagementApi.Models.Actions.Integration"/>
[JsonProperty("integration")]
public Integration Integration { get; set; }

/// <summary>
/// The time when this action was built successfully.
/// </summary>
[JsonProperty("built_at")]
public DateTime BuiltAt { get; set; }
}
}
6 changes: 6 additions & 0 deletions src/Auth0.ManagementApi/Models/Actions/ActionDependency.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,11 @@ public class ActionDependency
/// </summary>
[JsonProperty("version")]
public string Version { get; set; }

/// <summary>
/// Optional value used primarily for private non registries.
/// </summary>
[JsonProperty("registry_url")]
public string RegistryUrl { get; set; }
}
}
22 changes: 22 additions & 0 deletions src/Auth0.ManagementApi/Models/Actions/ActionOption.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using Newtonsoft.Json;

namespace Auth0.ManagementApi.Models.Actions
{
/// <summary>
/// Allowable options for this param.
/// </summary>
public class ActionOption
{
/// <summary>
/// The value of an option that will be used within the application.
/// </summary>
[JsonProperty("value")]
public string Value { get; set; }

/// <summary>
/// The display value for an option that will be used within the application.
/// </summary>
[JsonProperty("label")]
public string Label { get; set; }
}
}
61 changes: 61 additions & 0 deletions src/Auth0.ManagementApi/Models/Actions/ActionRequiredBase.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
using System.Collections;
using System.Collections.Generic;
using Newtonsoft.Json;

namespace Auth0.ManagementApi.Models.Actions
{
public class ActionRequiredBase
{
/// <summary>
/// Possible values: [UNSPECIFIED, STRING]
/// </summary>
[JsonProperty("type")]
public string Type { get; set; }

/// <summary>
/// Name of the parameter
/// </summary>
[JsonProperty("name")]
public string Name { get; set; }

/// <summary>
/// Flag for if this parameter is required
/// </summary>
[JsonProperty("required")]
public bool? Required { get; set; }

/// <summary>
/// The temp flag for if this parameter is required(experimental; for Labs use only)
/// </summary>
[JsonProperty("optional")]
public bool? Optional { get; set; }

/// <summary>
/// Short label for this parameter
/// </summary>
[JsonProperty("label")]
public string Label { get; set; }

/// <summary>
/// Lengthier description for this parameter
/// </summary>
[JsonProperty("description")]
public string Description { get; set; }

/// <summary>
/// Default value for this parameter
/// </summary>
[JsonProperty("default_value")]
public string DefaultValue { get; set; }

/// <summary>
/// Placeholder text for this parameter
/// </summary>
[JsonProperty("placeholder")]
public string Placeholder { get; set; }

/// <inheritdoc cref="Auth0.ManagementApi.Models.Actions.ActionOption"/>
[JsonProperty("options")]
public IList<ActionOption> Options { get; set; }
}
}
22 changes: 22 additions & 0 deletions src/Auth0.ManagementApi/Models/Actions/ActionSemVer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using Newtonsoft.Json;

namespace Auth0.ManagementApi.Models.Actions
{
/// <summary>
/// Denotes the major.minor version of an integration release
/// </summary>
public class ActionSemVer
{
/// <summary>
/// Major version of the semver
/// </summary>
[JsonProperty("major")]
public int Major { get; set; }

/// <summary>
/// Minor version of the semver
/// </summary>
[JsonProperty("minor")]
public int Minor { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
using Newtonsoft.Json;
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;

namespace Auth0.ManagementApi.Models.Actions
{
Expand All @@ -15,5 +20,32 @@ public class ActionSupportedTrigger
/// </summary>
[JsonProperty("version")]
public string Version { get; set; }

/// <summary>
/// Points to the trigger status.
/// </summary>
[JsonProperty("status")]
public string Status { get; set; }

/// <summary>
/// Runtimes supported by the trigger.
/// </summary>
[JsonProperty("runtimes")]
public string[] Runtimes { get; set; }

/// <summary>
/// Runtime that will be used when none is specified when creating an action.
/// </summary>
[JsonProperty("default_runtime")]
public string DefaultRuntime { get; set; }

/// <inheritdoc cref="Auth0.ManagementApi.Models.Actions.CompatibleTrigger"/>
[JsonProperty("compatible_triggers")]
public IList<CompatibleTrigger> CompatibleTrigger { get; set; }

/// <inheritdoc cref="Auth0.ManagementApi.Models.Actions.BindingPolicy"/>
[JsonProperty("binding_policy")]
[JsonConverter(typeof(StringEnumConverter))]
public BindingPolicy BindingPolicy { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace Auth0.ManagementApi.Models.Actions
{
/// <summary>
/// Declares all the necessary configuration fields for an integration to work.
/// </summary>
public class ActionsRequiredConfiguration : ActionRequiredBase
{

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace Auth0.ManagementApi.Models.Actions
{
/// <summary>
/// Declares all the necessary secrets for an integration to work.
/// </summary>
public class ActionsRequiredSecrets : ActionRequiredBase
{

}
}
18 changes: 18 additions & 0 deletions src/Auth0.ManagementApi/Models/Actions/BindingPolicy.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System.Runtime.Serialization;

namespace Auth0.ManagementApi.Models.Actions
{
/// <summary>
/// In order to execute an Action, it must be bound to a trigger using a binding. trigger-bound means that
/// bindings are managed by the tenant. entity-bound means that the bindings are automatically managed by Auth0
/// and other internal resources will control those bindings. Tenants cannot manage entity-bound bindings.
/// </summary>
public enum BindingPolicy
{
[EnumMember(Value = "trigger-bound")]
TriggerBound,

[EnumMember(Value = "entity-bound")]
EntityBound
}
}
26 changes: 26 additions & 0 deletions src/Auth0.ManagementApi/Models/Actions/CompatibleTrigger.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using Newtonsoft.Json;

namespace Auth0.ManagementApi.Models.Actions
{
/// <summary>
/// Informs which other trigger supports the same event and api.
/// </summary>
public class CompatibleTrigger
{
/// <summary>
/// Possible values: [post-login, credentials-exchange, pre-user-registration, post-user-registration,
/// post-change-password, send-phone-message, custom-phone-provider, custom-email-provider, iga-approval,
/// iga-certification, iga-fulfillment-assignment, iga-fulfillment-execution,
/// password-reset-post-challenge, custom-token-exchange-beta]
/// An actions extensibility point.
/// </summary>
[JsonProperty("id")]
public string Id { get; set; }

/// <summary>
/// The version of a trigger. v1, v2, etc
/// </summary>
[JsonProperty("version")]
public string Version { get; set; }
}
}
30 changes: 30 additions & 0 deletions src/Auth0.ManagementApi/Models/Actions/CurrentRelease.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using System.Collections.Generic;
using Newtonsoft.Json;

namespace Auth0.ManagementApi.Models.Actions
{
public class CurrentRelease
{
/// <summary>
/// Id of the associated IntegrationRelease.
/// </summary>
[JsonProperty("id")]
public string Id { get; set; }

/// <inheritdoc cref="Auth0.ManagementApi.Models.Actions.Trigger"/>
[JsonProperty("trigger")]
public Trigger Trigger { get; set; }

/// <inheritdoc cref="Auth0.ManagementApi.Models.Actions.ActionSemVer"/>
[JsonProperty("semver")]
public ActionSemVer SemVer { get; set; }

/// <inheritdoc cref="Auth0.ManagementApi.Models.Actions.ActionsRequiredSecrets"/>
[JsonProperty("required_secrets")]
public IList<ActionsRequiredSecrets> RequiredSecrets { get; set; }

/// <inheritdoc cref="Auth0.ManagementApi.Models.Actions.ActionsRequiredConfiguration"/>
[JsonProperty("required_configuration")]
public IList<ActionsRequiredConfiguration> RequiredConfigurations { get; set; }
}
}
28 changes: 28 additions & 0 deletions src/Auth0.ManagementApi/Models/Actions/FeatureType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System.Runtime.Serialization;

namespace Auth0.ManagementApi.Models.Actions
{
/// <summary>
/// Represents the type of the integration.
/// </summary>
public enum FeatureType
{
[EnumMember(Value = "unspecified")]
Unspecified,

[EnumMember(Value = "action")]
Action,

[EnumMember(Value = "social_connection")]
SocialConnection,

[EnumMember(Value = "log_stream")]
LogStream,

[EnumMember(Value = "sso_integration")]
SsoIntegration,

[EnumMember(Value = "sms_provider")]
SmsProvider,
}
}
Loading
Loading