From 1ebb447bc31ceea027d464708dd5dc03eb2dc027 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 14 Jul 2026 15:56:49 +0000 Subject: [PATCH 1/3] [fern-generated] Update SDK Generated by Fern CLI Version: unknown Generators: - fernapi/fern-csharp-sdk: 2.72.1 --- reference.md | 103 ------ .../Core/JsonConfiguration.cs | 1 - ...sionTransferDelegationDeviceBindingEnum.cs | 4 - ...nectionFederatedConnectionsAccessTokens.cs | 35 -- .../Types/ConnectionOptionsAzureAd.cs | 4 - .../Types/ConnectionOptionsCommonOidc.cs | 4 - .../Types/ConnectionOptionsGoogleApps.cs | 4 - .../Types/ConnectionOptionsOidc.cs | 4 - .../Types/ConnectionOptionsOkta.cs | 4 - .../Types/ConnectionPropertiesOptions.cs | 4 - .../Types/FederatedConnectionTokenSet.cs | 51 --- .../Types/NetworkAclMatch.cs | 4 + src/Auth0.ManagementApi/Types/OauthScope.cs | 25 -- .../Types/UpdateConnectionOptions.cs | 4 - .../FederatedConnectionsTokensetsClient.cs | 307 ------------------ .../IFederatedConnectionsTokensetsClient.cs | 22 -- src/Auth0.ManagementApi/Users/IUsersClient.cs | 1 - src/Auth0.ManagementApi/Users/UsersClient.cs | 3 - .../Auth0.ManagementApi.Test.csproj | 2 +- .../Unit/MockServer/NetworkAcls/GetTest.cs | 6 + .../Unit/MockServer/NetworkAcls/SetTest.cs | 6 + .../Unit/MockServer/NetworkAcls/UpdateTest.cs | 6 + .../DeleteTest.cs | 26 -- .../FederatedConnectionsTokensets/ListTest.cs | 44 --- 24 files changed, 23 insertions(+), 651 deletions(-) delete mode 100644 src/Auth0.ManagementApi/Types/ConnectionFederatedConnectionsAccessTokens.cs delete mode 100644 src/Auth0.ManagementApi/Types/FederatedConnectionTokenSet.cs delete mode 100644 src/Auth0.ManagementApi/Users/FederatedConnectionsTokensets/FederatedConnectionsTokensetsClient.cs delete mode 100644 src/Auth0.ManagementApi/Users/FederatedConnectionsTokensets/IFederatedConnectionsTokensetsClient.cs delete mode 100644 tests/Auth0.ManagementApi.Test/Unit/MockServer/Users/FederatedConnectionsTokensets/DeleteTest.cs delete mode 100644 tests/Auth0.ManagementApi.Test/Unit/MockServer/Users/FederatedConnectionsTokensets/ListTest.cs diff --git a/reference.md b/reference.md index 17c3252fc..69220296b 100644 --- a/reference.md +++ b/reference.md @@ -24079,109 +24079,6 @@ await client.Users.Enrollments.GetAsync("id"); - - - - -## Users FederatedConnectionsTokensets -
client.Users.FederatedConnectionsTokensets.ListAsync(id) -> WithRawResponseTask<IEnumerable<FederatedConnectionTokenSet>> -
-
- -#### 📝 Description - -
-
- -
-
- -List active federated connections tokensets for a provided user -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```csharp -await client.Users.FederatedConnectionsTokensets.ListAsync("id"); -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `string` — User identifier - -
-
-
-
- - -
-
-
- -
client.Users.FederatedConnectionsTokensets.DeleteAsync(id, tokensetId) -> WithRawResponseTask -
-
- -#### 🔌 Usage - -
-
- -
-
- -```csharp -await client.Users.FederatedConnectionsTokensets.DeleteAsync("id", "tokenset_id"); -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `string` — Id of the user that owns the tokenset - -
-
- -
-
- -**tokensetId:** `string` — The tokenset id - -
-
-
-
- -
diff --git a/src/Auth0.ManagementApi/Core/JsonConfiguration.cs b/src/Auth0.ManagementApi/Core/JsonConfiguration.cs index 7588e83c1..2ef97a37a 100644 --- a/src/Auth0.ManagementApi/Core/JsonConfiguration.cs +++ b/src/Auth0.ManagementApi/Core/JsonConfiguration.cs @@ -17,7 +17,6 @@ static JsonOptions() var options = new JsonSerializerOptions { Converters = { new DateTimeSerializer(), - new BooleanStringConverter(), #if USE_PORTABLE_DATE_ONLY new DateOnlyConverter(), #endif diff --git a/src/Auth0.ManagementApi/Types/ClientSessionTransferDelegationDeviceBindingEnum.cs b/src/Auth0.ManagementApi/Types/ClientSessionTransferDelegationDeviceBindingEnum.cs index 7c5bb0575..ff3be600e 100644 --- a/src/Auth0.ManagementApi/Types/ClientSessionTransferDelegationDeviceBindingEnum.cs +++ b/src/Auth0.ManagementApi/Types/ClientSessionTransferDelegationDeviceBindingEnum.cs @@ -12,8 +12,6 @@ namespace Auth0.ManagementApi; { public static readonly ClientSessionTransferDelegationDeviceBindingEnum Ip = new(Values.Ip); - public static readonly ClientSessionTransferDelegationDeviceBindingEnum Asn = new(Values.Asn); - public ClientSessionTransferDelegationDeviceBindingEnum(string value) { Value = value; @@ -120,7 +118,5 @@ JsonSerializerOptions options public static class Values { public const string Ip = "ip"; - - public const string Asn = "asn"; } } diff --git a/src/Auth0.ManagementApi/Types/ConnectionFederatedConnectionsAccessTokens.cs b/src/Auth0.ManagementApi/Types/ConnectionFederatedConnectionsAccessTokens.cs deleted file mode 100644 index fd96beed7..000000000 --- a/src/Auth0.ManagementApi/Types/ConnectionFederatedConnectionsAccessTokens.cs +++ /dev/null @@ -1,35 +0,0 @@ -using Auth0.ManagementApi.Core; -using global::System.Text.Json; -using global::System.Text.Json.Serialization; - -namespace Auth0.ManagementApi; - -/// -/// Federated Connections Access Tokens -/// -[Serializable] -public record ConnectionFederatedConnectionsAccessTokens : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// Enables refresh tokens and access tokens collection for federated connections - /// - [Optional] - [JsonPropertyName("active")] - public bool? Active { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Auth0.ManagementApi/Types/ConnectionOptionsAzureAd.cs b/src/Auth0.ManagementApi/Types/ConnectionOptionsAzureAd.cs index 25917a6c8..50f3d0bde 100644 --- a/src/Auth0.ManagementApi/Types/ConnectionOptionsAzureAd.cs +++ b/src/Auth0.ManagementApi/Types/ConnectionOptionsAzureAd.cs @@ -339,10 +339,6 @@ public record ConnectionOptionsAzureAd : IJsonOnDeserialized, IJsonOnSerializing [JsonPropertyName("ext_user_id")] public bool? ExtUserId { get; set; } - [Nullable, Optional] - [JsonPropertyName("federated_connections_access_tokens")] - public Optional FederatedConnectionsAccessTokens { get; set; } - /// /// Indicates whether admin consent has been granted for the required Azure AD permissions. Read-only status field managed by Auth0 during the OAuth authorization flow. /// diff --git a/src/Auth0.ManagementApi/Types/ConnectionOptionsCommonOidc.cs b/src/Auth0.ManagementApi/Types/ConnectionOptionsCommonOidc.cs index f05eb5e42..2c5188ee8 100644 --- a/src/Auth0.ManagementApi/Types/ConnectionOptionsCommonOidc.cs +++ b/src/Auth0.ManagementApi/Types/ConnectionOptionsCommonOidc.cs @@ -36,10 +36,6 @@ public record ConnectionOptionsCommonOidc : IJsonOnDeserialized, IJsonOnSerializ [JsonPropertyName("dpop_signing_alg")] public ConnectionDpopSigningAlgEnum? DpopSigningAlg { get; set; } - [Nullable, Optional] - [JsonPropertyName("federated_connections_access_tokens")] - public Optional FederatedConnectionsAccessTokens { get; set; } - [Optional] [JsonPropertyName("icon_url")] public string? IconUrl { get; set; } diff --git a/src/Auth0.ManagementApi/Types/ConnectionOptionsGoogleApps.cs b/src/Auth0.ManagementApi/Types/ConnectionOptionsGoogleApps.cs index 30c2723cf..6ca146cee 100644 --- a/src/Auth0.ManagementApi/Types/ConnectionOptionsGoogleApps.cs +++ b/src/Auth0.ManagementApi/Types/ConnectionOptionsGoogleApps.cs @@ -85,10 +85,6 @@ public record ConnectionOptionsGoogleApps : IJsonOnDeserialized, IJsonOnSerializ [JsonPropertyName("ext_is_suspended")] public bool? ExtIsSuspended { get; set; } - [Nullable, Optional] - [JsonPropertyName("federated_connections_access_tokens")] - public Optional FederatedConnectionsAccessTokens { get; set; } - [Optional] [JsonPropertyName("handle_login_from_social")] public bool? HandleLoginFromSocial { get; set; } diff --git a/src/Auth0.ManagementApi/Types/ConnectionOptionsOidc.cs b/src/Auth0.ManagementApi/Types/ConnectionOptionsOidc.cs index 7169fc3c1..42f0164c0 100644 --- a/src/Auth0.ManagementApi/Types/ConnectionOptionsOidc.cs +++ b/src/Auth0.ManagementApi/Types/ConnectionOptionsOidc.cs @@ -48,10 +48,6 @@ public record ConnectionOptionsOidc : IJsonOnDeserialized, IJsonOnSerializing [JsonPropertyName("dpop_signing_alg")] public ConnectionDpopSigningAlgEnum? DpopSigningAlg { get; set; } - [Nullable, Optional] - [JsonPropertyName("federated_connections_access_tokens")] - public Optional FederatedConnectionsAccessTokens { get; set; } - [Optional] [JsonPropertyName("icon_url")] public string? IconUrl { get; set; } diff --git a/src/Auth0.ManagementApi/Types/ConnectionOptionsOkta.cs b/src/Auth0.ManagementApi/Types/ConnectionOptionsOkta.cs index 3205e8092..ea514aee6 100644 --- a/src/Auth0.ManagementApi/Types/ConnectionOptionsOkta.cs +++ b/src/Auth0.ManagementApi/Types/ConnectionOptionsOkta.cs @@ -52,10 +52,6 @@ public record ConnectionOptionsOkta : IJsonOnDeserialized, IJsonOnSerializing [JsonPropertyName("dpop_signing_alg")] public ConnectionDpopSigningAlgEnum? DpopSigningAlg { get; set; } - [Nullable, Optional] - [JsonPropertyName("federated_connections_access_tokens")] - public Optional FederatedConnectionsAccessTokens { get; set; } - [Optional] [JsonPropertyName("icon_url")] public string? IconUrl { get; set; } diff --git a/src/Auth0.ManagementApi/Types/ConnectionPropertiesOptions.cs b/src/Auth0.ManagementApi/Types/ConnectionPropertiesOptions.cs index fdda884e0..02ab04181 100644 --- a/src/Auth0.ManagementApi/Types/ConnectionPropertiesOptions.cs +++ b/src/Auth0.ManagementApi/Types/ConnectionPropertiesOptions.cs @@ -150,10 +150,6 @@ public Optional GatewayAuthentication { get; set; } - [Nullable, Optional] - [JsonPropertyName("federated_connections_access_tokens")] - public Optional FederatedConnectionsAccessTokens { get; set; } - [Optional] [JsonPropertyName("password_options")] public ConnectionPasswordOptions? PasswordOptions { get; set; } diff --git a/src/Auth0.ManagementApi/Types/FederatedConnectionTokenSet.cs b/src/Auth0.ManagementApi/Types/FederatedConnectionTokenSet.cs deleted file mode 100644 index fc7e0ec59..000000000 --- a/src/Auth0.ManagementApi/Types/FederatedConnectionTokenSet.cs +++ /dev/null @@ -1,51 +0,0 @@ -using Auth0.ManagementApi.Core; -using global::System.Text.Json.Serialization; - -namespace Auth0.ManagementApi; - -[Serializable] -public record FederatedConnectionTokenSet : IJsonOnDeserialized, IJsonOnSerializing -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - [Optional] - [JsonPropertyName("id")] - public string? Id { get; set; } - - [Optional] - [JsonPropertyName("connection")] - public string? Connection { get; set; } - - [Optional] - [JsonPropertyName("scope")] - public string? Scope { get; set; } - - [Nullable, Optional] - [JsonPropertyName("expires_at")] - public Optional ExpiresAt { get; set; } - - [Optional] - [JsonPropertyName("issued_at")] - public DateTime? IssuedAt { get; set; } - - [Nullable, Optional] - [JsonPropertyName("last_used_at")] - public Optional LastUsedAt { get; set; } - - [JsonIgnore] - public AdditionalProperties AdditionalProperties { get; set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - void IJsonOnSerializing.OnSerializing() => - AdditionalProperties.CopyToExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Auth0.ManagementApi/Types/NetworkAclMatch.cs b/src/Auth0.ManagementApi/Types/NetworkAclMatch.cs index 0ce291e53..2d914e27a 100644 --- a/src/Auth0.ManagementApi/Types/NetworkAclMatch.cs +++ b/src/Auth0.ManagementApi/Types/NetworkAclMatch.cs @@ -15,6 +15,10 @@ public record NetworkAclMatch : IJsonOnDeserialized [JsonPropertyName("asns")] public IEnumerable? Asns { get; set; } + [Optional] + [JsonPropertyName("auth0_managed")] + public IEnumerable? Auth0Managed { get; set; } + [Optional] [JsonPropertyName("geo_country_codes")] public IEnumerable? GeoCountryCodes { get; set; } diff --git a/src/Auth0.ManagementApi/Types/OauthScope.cs b/src/Auth0.ManagementApi/Types/OauthScope.cs index 15d954be3..cdf313780 100644 --- a/src/Auth0.ManagementApi/Types/OauthScope.cs +++ b/src/Auth0.ManagementApi/Types/OauthScope.cs @@ -440,20 +440,6 @@ namespace Auth0.ManagementApi; /// public static readonly OauthScope ReadEvents = new(Values.ReadEvents); - /// - /// Read Federated Connections Tokens - /// - public static readonly OauthScope ReadFederatedConnectionsTokens = new( - Values.ReadFederatedConnectionsTokens - ); - - /// - /// Delete Federated Connections Tokens - /// - public static readonly OauthScope DeleteFederatedConnectionsTokens = new( - Values.DeleteFederatedConnectionsTokens - ); - /// /// Create Flows /// @@ -1826,17 +1812,6 @@ public static class Values /// public const string ReadEvents = "read:events"; - /// - /// Read Federated Connections Tokens - /// - public const string ReadFederatedConnectionsTokens = "read:federated_connections_tokens"; - - /// - /// Delete Federated Connections Tokens - /// - public const string DeleteFederatedConnectionsTokens = - "delete:federated_connections_tokens"; - /// /// Create Flows /// diff --git a/src/Auth0.ManagementApi/Types/UpdateConnectionOptions.cs b/src/Auth0.ManagementApi/Types/UpdateConnectionOptions.cs index 6831fbe6b..2cd5b4b0d 100644 --- a/src/Auth0.ManagementApi/Types/UpdateConnectionOptions.cs +++ b/src/Auth0.ManagementApi/Types/UpdateConnectionOptions.cs @@ -150,10 +150,6 @@ public Optional GatewayAuthentication { get; set; } - [Nullable, Optional] - [JsonPropertyName("federated_connections_access_tokens")] - public Optional FederatedConnectionsAccessTokens { get; set; } - [Optional] [JsonPropertyName("password_options")] public ConnectionPasswordOptions? PasswordOptions { get; set; } diff --git a/src/Auth0.ManagementApi/Users/FederatedConnectionsTokensets/FederatedConnectionsTokensetsClient.cs b/src/Auth0.ManagementApi/Users/FederatedConnectionsTokensets/FederatedConnectionsTokensetsClient.cs deleted file mode 100644 index 7a40872f2..000000000 --- a/src/Auth0.ManagementApi/Users/FederatedConnectionsTokensets/FederatedConnectionsTokensetsClient.cs +++ /dev/null @@ -1,307 +0,0 @@ -using Auth0.ManagementApi; -using Auth0.ManagementApi.Core; -using global::System.Text.Json; - -namespace Auth0.ManagementApi.Users; - -public partial class FederatedConnectionsTokensetsClient : IFederatedConnectionsTokensetsClient -{ - private readonly RawClient _client; - - internal FederatedConnectionsTokensetsClient(RawClient client) - { - _client = client; - } - - private async Task>> ListAsyncCore( - string id, - RequestOptions? options = null, - CancellationToken cancellationToken = default - ) - { - var _queryString = new Auth0.ManagementApi.Core.QueryStringBuilder.Builder(capacity: 0) - .MergeAdditional(options?.AdditionalQueryParameters) - .Build(); - var _headers = await new Auth0.ManagementApi.Core.HeadersBuilder.Builder() - .Add(_client.Options.Headers) - .Add(_client.Options.AdditionalHeaders) - .Add(options?.AdditionalHeaders) - .BuildAsync() - .ConfigureAwait(false); - var response = await _client - .SendRequestAsync( - new JsonRequest - { - Method = HttpMethod.Get, - Path = string.Format( - "users/{0}/federated-connections-tokensets", - ValueConvert.ToPathParameterString(id) - ), - QueryString = _queryString, - Headers = _headers, - Options = options, - }, - cancellationToken - ) - .ConfigureAwait(false); - if (response.StatusCode is >= 200 and < 400) - { - var responseBody = await response - .Raw.Content.ReadAsStringAsync(cancellationToken) - .ConfigureAwait(false); - try - { - var responseData = JsonUtils.Deserialize>( - responseBody - )!; - return new WithRawResponse>() - { - Data = responseData, - RawResponse = new Auth0.ManagementApi.RawResponse() - { - StatusCode = response.Raw.StatusCode, - Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), - Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), - }, - }; - } - catch (JsonException e) - { - throw new ManagementApiException( - "Failed to deserialize response", - response.StatusCode, - null, - e, - rawResponse: new Auth0.ManagementApi.RawResponse() - { - StatusCode = response.Raw.StatusCode, - Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), - Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), - } - ); - } - } - { - var responseBody = await response - .Raw.Content.ReadAsStringAsync(cancellationToken) - .ConfigureAwait(false); - try - { - switch (response.StatusCode) - { - case 401: - throw new UnauthorizedError( - JsonUtils.Deserialize(responseBody), - rawResponse: new Auth0.ManagementApi.RawResponse() - { - StatusCode = response.Raw.StatusCode, - Url = - response.Raw.RequestMessage?.RequestUri - ?? new Uri("about:blank"), - Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), - } - ); - case 403: - throw new ForbiddenError( - JsonUtils.Deserialize(responseBody), - rawResponse: new Auth0.ManagementApi.RawResponse() - { - StatusCode = response.Raw.StatusCode, - Url = - response.Raw.RequestMessage?.RequestUri - ?? new Uri("about:blank"), - Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), - } - ); - case 404: - throw new NotFoundError( - JsonUtils.Deserialize(responseBody), - rawResponse: new Auth0.ManagementApi.RawResponse() - { - StatusCode = response.Raw.StatusCode, - Url = - response.Raw.RequestMessage?.RequestUri - ?? new Uri("about:blank"), - Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), - } - ); - case 429: - throw new TooManyRequestsError( - JsonUtils.Deserialize(responseBody), - rawResponse: new Auth0.ManagementApi.RawResponse() - { - StatusCode = response.Raw.StatusCode, - Url = - response.Raw.RequestMessage?.RequestUri - ?? new Uri("about:blank"), - Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), - } - ); - } - } - catch (JsonException) - { - // unable to map error response, throwing generic error - } - throw new ManagementApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody, - rawResponse: new Auth0.ManagementApi.RawResponse() - { - StatusCode = response.Raw.StatusCode, - Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), - Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), - } - ); - } - } - - private async Task DeleteAsyncCore( - string id, - string tokensetId, - RequestOptions? options = null, - CancellationToken cancellationToken = default - ) - { - var _queryString = new Auth0.ManagementApi.Core.QueryStringBuilder.Builder(capacity: 0) - .MergeAdditional(options?.AdditionalQueryParameters) - .Build(); - var _headers = await new Auth0.ManagementApi.Core.HeadersBuilder.Builder() - .Add(_client.Options.Headers) - .Add(_client.Options.AdditionalHeaders) - .Add(options?.AdditionalHeaders) - .BuildAsync() - .ConfigureAwait(false); - var response = await _client - .SendRequestAsync( - new JsonRequest - { - Method = HttpMethod.Delete, - Path = string.Format( - "users/{0}/federated-connections-tokensets/{1}", - ValueConvert.ToPathParameterString(id), - ValueConvert.ToPathParameterString(tokensetId) - ), - QueryString = _queryString, - Headers = _headers, - Options = options, - }, - cancellationToken - ) - .ConfigureAwait(false); - if (response.StatusCode is >= 200 and < 400) - { - return new Auth0.ManagementApi.RawResponse() - { - StatusCode = response.Raw.StatusCode, - Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), - Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), - }; - } - { - var responseBody = await response - .Raw.Content.ReadAsStringAsync(cancellationToken) - .ConfigureAwait(false); - try - { - switch (response.StatusCode) - { - case 400: - throw new BadRequestError( - JsonUtils.Deserialize(responseBody), - rawResponse: new Auth0.ManagementApi.RawResponse() - { - StatusCode = response.Raw.StatusCode, - Url = - response.Raw.RequestMessage?.RequestUri - ?? new Uri("about:blank"), - Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), - } - ); - case 401: - throw new UnauthorizedError( - JsonUtils.Deserialize(responseBody), - rawResponse: new Auth0.ManagementApi.RawResponse() - { - StatusCode = response.Raw.StatusCode, - Url = - response.Raw.RequestMessage?.RequestUri - ?? new Uri("about:blank"), - Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), - } - ); - case 403: - throw new ForbiddenError( - JsonUtils.Deserialize(responseBody), - rawResponse: new Auth0.ManagementApi.RawResponse() - { - StatusCode = response.Raw.StatusCode, - Url = - response.Raw.RequestMessage?.RequestUri - ?? new Uri("about:blank"), - Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), - } - ); - case 429: - throw new TooManyRequestsError( - JsonUtils.Deserialize(responseBody), - rawResponse: new Auth0.ManagementApi.RawResponse() - { - StatusCode = response.Raw.StatusCode, - Url = - response.Raw.RequestMessage?.RequestUri - ?? new Uri("about:blank"), - Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), - } - ); - } - } - catch (JsonException) - { - // unable to map error response, throwing generic error - } - throw new ManagementApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody, - rawResponse: new Auth0.ManagementApi.RawResponse() - { - StatusCode = response.Raw.StatusCode, - Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), - Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), - } - ); - } - } - - /// - /// List active federated connections tokensets for a provided user - /// - /// - /// await client.Users.FederatedConnectionsTokensets.ListAsync("id"); - /// - public WithRawResponseTask> ListAsync( - string id, - RequestOptions? options = null, - CancellationToken cancellationToken = default - ) - { - return new WithRawResponseTask>( - ListAsyncCore(id, options, cancellationToken) - ); - } - - /// - /// await client.Users.FederatedConnectionsTokensets.DeleteAsync("id", "tokenset_id"); - /// - public WithRawResponseTask DeleteAsync( - string id, - string tokensetId, - RequestOptions? options = null, - CancellationToken cancellationToken = default - ) - { - return new WithRawResponseTask(DeleteAsyncCore(id, tokensetId, options, cancellationToken)); - } -} diff --git a/src/Auth0.ManagementApi/Users/FederatedConnectionsTokensets/IFederatedConnectionsTokensetsClient.cs b/src/Auth0.ManagementApi/Users/FederatedConnectionsTokensets/IFederatedConnectionsTokensetsClient.cs deleted file mode 100644 index b48f53329..000000000 --- a/src/Auth0.ManagementApi/Users/FederatedConnectionsTokensets/IFederatedConnectionsTokensetsClient.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Auth0.ManagementApi; - -namespace Auth0.ManagementApi.Users; - -public partial interface IFederatedConnectionsTokensetsClient -{ - /// - /// List active federated connections tokensets for a provided user - /// - WithRawResponseTask> ListAsync( - string id, - RequestOptions? options = null, - CancellationToken cancellationToken = default - ); - - WithRawResponseTask DeleteAsync( - string id, - string tokensetId, - RequestOptions? options = null, - CancellationToken cancellationToken = default - ); -} diff --git a/src/Auth0.ManagementApi/Users/IUsersClient.cs b/src/Auth0.ManagementApi/Users/IUsersClient.cs index c8ef67a0a..10e91d946 100644 --- a/src/Auth0.ManagementApi/Users/IUsersClient.cs +++ b/src/Auth0.ManagementApi/Users/IUsersClient.cs @@ -11,7 +11,6 @@ public partial interface IUsersClient public IEffectivePermissionsClient EffectivePermissions { get; } public Auth0.ManagementApi.Users.IEffectiveRolesClient EffectiveRoles { get; } public Auth0.ManagementApi.Users.IEnrollmentsClient Enrollments { get; } - public IFederatedConnectionsTokensetsClient FederatedConnectionsTokensets { get; } public Auth0.ManagementApi.Users.IGroupsClient Groups { get; } public IIdentitiesClient Identities { get; } public Auth0.ManagementApi.Users.ILogsClient Logs { get; } diff --git a/src/Auth0.ManagementApi/Users/UsersClient.cs b/src/Auth0.ManagementApi/Users/UsersClient.cs index c4ea10fdb..752f7afbb 100644 --- a/src/Auth0.ManagementApi/Users/UsersClient.cs +++ b/src/Auth0.ManagementApi/Users/UsersClient.cs @@ -17,7 +17,6 @@ internal UsersClient(RawClient client) EffectivePermissions = new EffectivePermissionsClient(_client); EffectiveRoles = new Auth0.ManagementApi.Users.EffectiveRolesClient(_client); Enrollments = new Auth0.ManagementApi.Users.EnrollmentsClient(_client); - FederatedConnectionsTokensets = new FederatedConnectionsTokensetsClient(_client); Groups = new Auth0.ManagementApi.Users.GroupsClient(_client); Identities = new IdentitiesClient(_client); Logs = new Auth0.ManagementApi.Users.LogsClient(_client); @@ -42,8 +41,6 @@ internal UsersClient(RawClient client) public Auth0.ManagementApi.Users.IEnrollmentsClient Enrollments { get; } - public IFederatedConnectionsTokensetsClient FederatedConnectionsTokensets { get; } - public Auth0.ManagementApi.Users.IGroupsClient Groups { get; } public IIdentitiesClient Identities { get; } diff --git a/tests/Auth0.ManagementApi.Test/Auth0.ManagementApi.Test.csproj b/tests/Auth0.ManagementApi.Test/Auth0.ManagementApi.Test.csproj index 63c4abb22..ab18c1f30 100644 --- a/tests/Auth0.ManagementApi.Test/Auth0.ManagementApi.Test.csproj +++ b/tests/Auth0.ManagementApi.Test/Auth0.ManagementApi.Test.csproj @@ -25,7 +25,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/tests/Auth0.ManagementApi.Test/Unit/MockServer/NetworkAcls/GetTest.cs b/tests/Auth0.ManagementApi.Test/Unit/MockServer/NetworkAcls/GetTest.cs index e2fe733a0..79e2535b8 100644 --- a/tests/Auth0.ManagementApi.Test/Unit/MockServer/NetworkAcls/GetTest.cs +++ b/tests/Auth0.ManagementApi.Test/Unit/MockServer/NetworkAcls/GetTest.cs @@ -29,6 +29,9 @@ public async Task MockServerTest() "asns": [ 1 ], + "auth0_managed": [ + "auth0_managed" + ], "geo_country_codes": [ "geo_country_codes" ], @@ -64,6 +67,9 @@ public async Task MockServerTest() "asns": [ 1 ], + "auth0_managed": [ + "auth0_managed" + ], "geo_country_codes": [ "geo_country_codes" ], diff --git a/tests/Auth0.ManagementApi.Test/Unit/MockServer/NetworkAcls/SetTest.cs b/tests/Auth0.ManagementApi.Test/Unit/MockServer/NetworkAcls/SetTest.cs index 468934281..858ddda38 100644 --- a/tests/Auth0.ManagementApi.Test/Unit/MockServer/NetworkAcls/SetTest.cs +++ b/tests/Auth0.ManagementApi.Test/Unit/MockServer/NetworkAcls/SetTest.cs @@ -41,6 +41,9 @@ public async Task MockServerTest() "asns": [ 1 ], + "auth0_managed": [ + "auth0_managed" + ], "geo_country_codes": [ "geo_country_codes" ], @@ -76,6 +79,9 @@ public async Task MockServerTest() "asns": [ 1 ], + "auth0_managed": [ + "auth0_managed" + ], "geo_country_codes": [ "geo_country_codes" ], diff --git a/tests/Auth0.ManagementApi.Test/Unit/MockServer/NetworkAcls/UpdateTest.cs b/tests/Auth0.ManagementApi.Test/Unit/MockServer/NetworkAcls/UpdateTest.cs index 0838c2c7d..3b87fc6ae 100644 --- a/tests/Auth0.ManagementApi.Test/Unit/MockServer/NetworkAcls/UpdateTest.cs +++ b/tests/Auth0.ManagementApi.Test/Unit/MockServer/NetworkAcls/UpdateTest.cs @@ -34,6 +34,9 @@ public async Task MockServerTest() "asns": [ 1 ], + "auth0_managed": [ + "auth0_managed" + ], "geo_country_codes": [ "geo_country_codes" ], @@ -69,6 +72,9 @@ public async Task MockServerTest() "asns": [ 1 ], + "auth0_managed": [ + "auth0_managed" + ], "geo_country_codes": [ "geo_country_codes" ], diff --git a/tests/Auth0.ManagementApi.Test/Unit/MockServer/Users/FederatedConnectionsTokensets/DeleteTest.cs b/tests/Auth0.ManagementApi.Test/Unit/MockServer/Users/FederatedConnectionsTokensets/DeleteTest.cs deleted file mode 100644 index 77d063e92..000000000 --- a/tests/Auth0.ManagementApi.Test/Unit/MockServer/Users/FederatedConnectionsTokensets/DeleteTest.cs +++ /dev/null @@ -1,26 +0,0 @@ -using Auth0.ManagementApi.Test.Unit.MockServer; -using NUnit.Framework; - -namespace Auth0.ManagementApi.Test.Unit.MockServer.Users.FederatedConnectionsTokensets; - -[TestFixture] -[Parallelizable(ParallelScope.Self)] -public class DeleteTest : BaseMockServerTest -{ - [NUnit.Framework.Test] - public void MockServerTest() - { - Server - .Given( - WireMock - .RequestBuilders.Request.Create() - .WithPath("/users/id/federated-connections-tokensets/tokenset_id") - .UsingDelete() - ) - .RespondWith(WireMock.ResponseBuilders.Response.Create().WithStatusCode(200)); - - Assert.DoesNotThrowAsync(async () => - await Client.Users.FederatedConnectionsTokensets.DeleteAsync("id", "tokenset_id") - ); - } -} diff --git a/tests/Auth0.ManagementApi.Test/Unit/MockServer/Users/FederatedConnectionsTokensets/ListTest.cs b/tests/Auth0.ManagementApi.Test/Unit/MockServer/Users/FederatedConnectionsTokensets/ListTest.cs deleted file mode 100644 index 95d133497..000000000 --- a/tests/Auth0.ManagementApi.Test/Unit/MockServer/Users/FederatedConnectionsTokensets/ListTest.cs +++ /dev/null @@ -1,44 +0,0 @@ -using Auth0.ManagementApi.Test.Unit.MockServer; -using Auth0.ManagementApi.Test.Utils; -using NUnit.Framework; - -namespace Auth0.ManagementApi.Test.Unit.MockServer.Users.FederatedConnectionsTokensets; - -[TestFixture] -[Parallelizable(ParallelScope.Self)] -public class ListTest : BaseMockServerTest -{ - [NUnit.Framework.Test] - public async Task MockServerTest() - { - const string mockResponse = """ - [ - { - "id": "id", - "connection": "connection", - "scope": "scope", - "expires_at": "2024-01-15T09:30:00.000Z", - "issued_at": "2024-01-15T09:30:00.000Z", - "last_used_at": "2024-01-15T09:30:00.000Z" - } - ] - """; - - Server - .Given( - WireMock - .RequestBuilders.Request.Create() - .WithPath("/users/id/federated-connections-tokensets") - .UsingGet() - ) - .RespondWith( - WireMock - .ResponseBuilders.Response.Create() - .WithStatusCode(200) - .WithBody(mockResponse) - ); - - var response = await Client.Users.FederatedConnectionsTokensets.ListAsync("id"); - JsonAssert.AreEqual(response, mockResponse); - } -} From 9dbc7829dd93d8ae2d963c672301710b8a3551ea Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 14 Jul 2026 15:56:49 +0000 Subject: [PATCH 2/3] [fern-replay] Applied customizations Patches applied (2): - patch-4a7a2c3e: Adds extension to convert UserDateSchema to DateTime - patch-composite-f898e213: Customer customizations (composite) --- .fern/replay.lock | 12 ++- .../Core/JsonConfiguration.cs | 1 + .../Auth0.ManagementApi.Test.csproj | 2 +- .../UserDateSchemaExtensionsTest.cs | 95 +++++++++++++++++++ 4 files changed, 106 insertions(+), 4 deletions(-) create mode 100644 tests/Auth0.ManagementApi.Test/Unit/Extensions/UserDateSchemaExtensionsTest.cs diff --git a/.fern/replay.lock b/.fern/replay.lock index 6c36b8793..b5d010560 100644 --- a/.fern/replay.lock +++ b/.fern/replay.lock @@ -30,14 +30,20 @@ generations: cli_version: unknown generator_versions: fernapi/fern-csharp-sdk: 2.72.1 -current_generation: 25e621a6eb7584bd0761ac10041190771fa2b388 + - commit_sha: e786c326897b24c11b59828850ec97f41450f038 + tree_hash: 47983da8ad4d1e6d1dfbbb89e1f2cfbd48914ff1 + timestamp: 2026-07-14T15:56:46.232Z + cli_version: unknown + generator_versions: + fernapi/fern-csharp-sdk: 2.72.1 +current_generation: e786c326897b24c11b59828850ec97f41450f038 patches: - id: patch-4a7a2c3e content_hash: sha256:afae223b4593598543491ca12e36149571f886b494dcf4311dcea092548f7bd0 original_commit: 4a7a2c3e44bfc06c1f164a3c6ef0ae748ce3075b original_message: Adds extension to convert UserDateSchema to DateTime original_author: Kailash B - base_generation: 25e621a6eb7584bd0761ac10041190771fa2b388 + base_generation: e786c326897b24c11b59828850ec97f41450f038 files: - tests/Auth0.ManagementApi.Test/Unit/Extensions/UserDateSchemaExtensionsTest.cs patch_content: | @@ -245,7 +251,7 @@ patches: original_commit: f898e213a3bde5c59096e7f5eb940e6fd76c26d8 original_message: Customer customizations (composite) original_author: composite - base_generation: 25e621a6eb7584bd0761ac10041190771fa2b388 + base_generation: e786c326897b24c11b59828850ec97f41450f038 files: - src/Auth0.ManagementApi/Core/JsonConfiguration.cs - tests/Auth0.ManagementApi.Test/Auth0.ManagementApi.Test.csproj diff --git a/src/Auth0.ManagementApi/Core/JsonConfiguration.cs b/src/Auth0.ManagementApi/Core/JsonConfiguration.cs index 2ef97a37a..7588e83c1 100644 --- a/src/Auth0.ManagementApi/Core/JsonConfiguration.cs +++ b/src/Auth0.ManagementApi/Core/JsonConfiguration.cs @@ -17,6 +17,7 @@ static JsonOptions() var options = new JsonSerializerOptions { Converters = { new DateTimeSerializer(), + new BooleanStringConverter(), #if USE_PORTABLE_DATE_ONLY new DateOnlyConverter(), #endif diff --git a/tests/Auth0.ManagementApi.Test/Auth0.ManagementApi.Test.csproj b/tests/Auth0.ManagementApi.Test/Auth0.ManagementApi.Test.csproj index ab18c1f30..63c4abb22 100644 --- a/tests/Auth0.ManagementApi.Test/Auth0.ManagementApi.Test.csproj +++ b/tests/Auth0.ManagementApi.Test/Auth0.ManagementApi.Test.csproj @@ -25,7 +25,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/tests/Auth0.ManagementApi.Test/Unit/Extensions/UserDateSchemaExtensionsTest.cs b/tests/Auth0.ManagementApi.Test/Unit/Extensions/UserDateSchemaExtensionsTest.cs new file mode 100644 index 000000000..7d867ca66 --- /dev/null +++ b/tests/Auth0.ManagementApi.Test/Unit/Extensions/UserDateSchemaExtensionsTest.cs @@ -0,0 +1,95 @@ +using NUnit.Framework; + +namespace Auth0.ManagementApi.Test.Unit.Extensions; + +[TestFixture] +public class UserDateSchemaExtensionsTest +{ + [Test] + public void ToDateTime_WithValidIso8601String_ReturnsUtcDateTime() + { + var schema = UserDateSchema.FromString("2024-03-15T10:30:00.000Z"); + + var result = schema.ToDateTime(); + + Assert.That(result, Is.Not.Null); + Assert.That(result!.Value, Is.EqualTo(new DateTime(2024, 3, 15, 10, 30, 0, DateTimeKind.Utc))); + Assert.That(result.Value.Kind, Is.EqualTo(DateTimeKind.Utc)); + } + + [Test] + public void ToDateTime_WithNull_ReturnsNull() + { + UserDateSchema? schema = null; + + var result = schema.ToDateTime(); + + Assert.That(result, Is.Null); + } + + [Test] + public void ToDateTime_WithMapType_ReturnsNull() + { + var schema = UserDateSchema.FromMapOfStringToUnknown(new Dictionary + { + { "some_key", "some_value" } + }); + + var result = schema.ToDateTime(); + + Assert.That(result, Is.Null); + } + + [Test] + public void ToDateTime_WithMalformedString_ReturnsNull() + { + var schema = UserDateSchema.FromString("not-a-date"); + + var result = schema.ToDateTime(); + + Assert.That(result, Is.Null); + } + + [Test] + public void ToDateTime_WithOffsetString_PreservesLocalKind() + { + var schema = UserDateSchema.FromString("2024-06-20T14:00:00.000+05:30"); + + var result = schema.ToDateTime(); + var expectedLocal = new DateTimeOffset(2024, 6, 20, 14, 0, 0, TimeSpan.FromMinutes(330)).LocalDateTime; + + Assert.That(result, Is.Not.Null); + Assert.That(result!.Value, Is.EqualTo(expectedLocal)); + Assert.That(result.Value.Kind, Is.EqualTo(DateTimeKind.Local)); + } + + [Test] + public void ToDateTime_WithDateTimeOffset_ReturnsUtcConverted() + { + var schema = UserDateSchema.FromString("2024-06-20T14:00:00.000+05:30"); + + var result = schema.ToDateTime(TimeZoneInfo.Utc); + + Assert.That(result, Is.Not.Null); + Assert.That(result!.Value.Kind, Is.EqualTo(DateTimeKind.Utc)); + Assert.That(result.Value, Is.EqualTo(new DateTime(2024, 6, 20, 8, 30, 0, DateTimeKind.Utc))); + } + + [Test] + public void ToDateTime_WithMalformedStringAndTargetTimeZone_ReturnsNull() + { + var schema = UserDateSchema.FromString("not-a-date"); + + var result = schema.ToDateTime(TimeZoneInfo.Utc); + + Assert.That(result, Is.Null); + } + + [Test] + public void ToDateTime_WithNullTargetTimeZone_ThrowsArgumentNullException() + { + var schema = UserDateSchema.FromString("2024-03-15T10:30:00.000Z"); + + Assert.Throws(() => schema.ToDateTime(null!)); + } +} From a4ee94c4b6b4ad1f881465e6680286ef144d2b4f Mon Sep 17 00:00:00 2001 From: Kailash B Date: Tue, 14 Jul 2026 18:15:26 +0530 Subject: [PATCH 3/3] mgmt: Removed unwanted files --- .../UserDateSchemaExtensionsTest.cs | 95 ------------------- 1 file changed, 95 deletions(-) delete mode 100644 tests/Auth0.ManagementApi.Test/Unit/Extensions/UserDateSchemaExtensionsTest.cs diff --git a/tests/Auth0.ManagementApi.Test/Unit/Extensions/UserDateSchemaExtensionsTest.cs b/tests/Auth0.ManagementApi.Test/Unit/Extensions/UserDateSchemaExtensionsTest.cs deleted file mode 100644 index 7d867ca66..000000000 --- a/tests/Auth0.ManagementApi.Test/Unit/Extensions/UserDateSchemaExtensionsTest.cs +++ /dev/null @@ -1,95 +0,0 @@ -using NUnit.Framework; - -namespace Auth0.ManagementApi.Test.Unit.Extensions; - -[TestFixture] -public class UserDateSchemaExtensionsTest -{ - [Test] - public void ToDateTime_WithValidIso8601String_ReturnsUtcDateTime() - { - var schema = UserDateSchema.FromString("2024-03-15T10:30:00.000Z"); - - var result = schema.ToDateTime(); - - Assert.That(result, Is.Not.Null); - Assert.That(result!.Value, Is.EqualTo(new DateTime(2024, 3, 15, 10, 30, 0, DateTimeKind.Utc))); - Assert.That(result.Value.Kind, Is.EqualTo(DateTimeKind.Utc)); - } - - [Test] - public void ToDateTime_WithNull_ReturnsNull() - { - UserDateSchema? schema = null; - - var result = schema.ToDateTime(); - - Assert.That(result, Is.Null); - } - - [Test] - public void ToDateTime_WithMapType_ReturnsNull() - { - var schema = UserDateSchema.FromMapOfStringToUnknown(new Dictionary - { - { "some_key", "some_value" } - }); - - var result = schema.ToDateTime(); - - Assert.That(result, Is.Null); - } - - [Test] - public void ToDateTime_WithMalformedString_ReturnsNull() - { - var schema = UserDateSchema.FromString("not-a-date"); - - var result = schema.ToDateTime(); - - Assert.That(result, Is.Null); - } - - [Test] - public void ToDateTime_WithOffsetString_PreservesLocalKind() - { - var schema = UserDateSchema.FromString("2024-06-20T14:00:00.000+05:30"); - - var result = schema.ToDateTime(); - var expectedLocal = new DateTimeOffset(2024, 6, 20, 14, 0, 0, TimeSpan.FromMinutes(330)).LocalDateTime; - - Assert.That(result, Is.Not.Null); - Assert.That(result!.Value, Is.EqualTo(expectedLocal)); - Assert.That(result.Value.Kind, Is.EqualTo(DateTimeKind.Local)); - } - - [Test] - public void ToDateTime_WithDateTimeOffset_ReturnsUtcConverted() - { - var schema = UserDateSchema.FromString("2024-06-20T14:00:00.000+05:30"); - - var result = schema.ToDateTime(TimeZoneInfo.Utc); - - Assert.That(result, Is.Not.Null); - Assert.That(result!.Value.Kind, Is.EqualTo(DateTimeKind.Utc)); - Assert.That(result.Value, Is.EqualTo(new DateTime(2024, 6, 20, 8, 30, 0, DateTimeKind.Utc))); - } - - [Test] - public void ToDateTime_WithMalformedStringAndTargetTimeZone_ReturnsNull() - { - var schema = UserDateSchema.FromString("not-a-date"); - - var result = schema.ToDateTime(TimeZoneInfo.Utc); - - Assert.That(result, Is.Null); - } - - [Test] - public void ToDateTime_WithNullTargetTimeZone_ThrowsArgumentNullException() - { - var schema = UserDateSchema.FromString("2024-03-15T10:30:00.000Z"); - - Assert.Throws(() => schema.ToDateTime(null!)); - } -}