From 418e332443828fd5f8a75d85876ea264b488cc1f Mon Sep 17 00:00:00 2001 From: JT Date: Wed, 19 Oct 2022 12:03:36 +0800 Subject: [PATCH 1/3] Add support for the connection status API --- src/Auth0.ManagementApi/Clients/ConnectionsClient.cs | 11 +++++++++++ src/Auth0.ManagementApi/Clients/IConnectionsClient.cs | 8 ++++++++ 2 files changed, 19 insertions(+) diff --git a/src/Auth0.ManagementApi/Clients/ConnectionsClient.cs b/src/Auth0.ManagementApi/Clients/ConnectionsClient.cs index 04ab2a422..00e8fcdaf 100644 --- a/src/Auth0.ManagementApi/Clients/ConnectionsClient.cs +++ b/src/Auth0.ManagementApi/Clients/ConnectionsClient.cs @@ -132,5 +132,16 @@ public Task UpdateAsync(string id, ConnectionUpdateRequest request, { return Connection.SendAsync(new HttpMethod("PATCH"), BuildUri($"connections/{EncodePath(id)}"), request, DefaultHeaders, cancellationToken: cancellationToken); } + + /// + /// Retrieves the status of an ad/ldap connection + /// + /// D of the connection to check + /// The cancellation token to cancel operation. + /// A that represents the asynchronous check operation. Will throw if the check fails. + public Task CheckAsync(string id, CancellationToken cancellationToken = default) + { + return Connection.GetAsync(BuildUri($"connections/{EncodePath(id)}/status"), DefaultHeaders, cancellationToken: cancellationToken); + } } } diff --git a/src/Auth0.ManagementApi/Clients/IConnectionsClient.cs b/src/Auth0.ManagementApi/Clients/IConnectionsClient.cs index 28260ccba..7f58d90fb 100644 --- a/src/Auth0.ManagementApi/Clients/IConnectionsClient.cs +++ b/src/Auth0.ManagementApi/Clients/IConnectionsClient.cs @@ -62,5 +62,13 @@ public interface IConnectionsClient /// The cancellation token to cancel operation. /// The that has been updated. Task UpdateAsync(string id, ConnectionUpdateRequest request, CancellationToken cancellationToken = default); + + /// + /// Retrieves the status of an ad/ldap connection. + /// + /// ID of the connection to check. + /// The cancellation token to cancel operation. + /// A that represents the asynchronous check operation. Will throw if the status check fails. + Task CheckAsync(string id, CancellationToken cancellationToken = default); } } From 0388f9f7332b7188ea2c2de1635c5e7e066c8ee9 Mon Sep 17 00:00:00 2001 From: JT Date: Wed, 19 Oct 2022 15:43:36 +0800 Subject: [PATCH 2/3] Code review items --- src/Auth0.ManagementApi/Clients/ConnectionsClient.cs | 4 ++-- src/Auth0.ManagementApi/Clients/IConnectionsClient.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Auth0.ManagementApi/Clients/ConnectionsClient.cs b/src/Auth0.ManagementApi/Clients/ConnectionsClient.cs index 00e8fcdaf..592ec4620 100644 --- a/src/Auth0.ManagementApi/Clients/ConnectionsClient.cs +++ b/src/Auth0.ManagementApi/Clients/ConnectionsClient.cs @@ -136,10 +136,10 @@ public Task UpdateAsync(string id, ConnectionUpdateRequest request, /// /// Retrieves the status of an ad/ldap connection /// - /// D of the connection to check + /// ID of the connection to check /// The cancellation token to cancel operation. /// A that represents the asynchronous check operation. Will throw if the check fails. - public Task CheckAsync(string id, CancellationToken cancellationToken = default) + public Task CheckStatusAsync(string id, CancellationToken cancellationToken = default) { return Connection.GetAsync(BuildUri($"connections/{EncodePath(id)}/status"), DefaultHeaders, cancellationToken: cancellationToken); } diff --git a/src/Auth0.ManagementApi/Clients/IConnectionsClient.cs b/src/Auth0.ManagementApi/Clients/IConnectionsClient.cs index 7f58d90fb..70699bc4c 100644 --- a/src/Auth0.ManagementApi/Clients/IConnectionsClient.cs +++ b/src/Auth0.ManagementApi/Clients/IConnectionsClient.cs @@ -69,6 +69,6 @@ public interface IConnectionsClient /// ID of the connection to check. /// The cancellation token to cancel operation. /// A that represents the asynchronous check operation. Will throw if the status check fails. - Task CheckAsync(string id, CancellationToken cancellationToken = default); + Task CheckStatusAsync(string id, CancellationToken cancellationToken = default); } } From 05728111196bbfbdb40402828eb412c1422ce1f8 Mon Sep 17 00:00:00 2001 From: JT Date: Wed, 19 Oct 2022 15:44:18 +0800 Subject: [PATCH 3/3] Align doco --- src/Auth0.ManagementApi/Clients/ConnectionsClient.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Auth0.ManagementApi/Clients/ConnectionsClient.cs b/src/Auth0.ManagementApi/Clients/ConnectionsClient.cs index 592ec4620..07a16bb2b 100644 --- a/src/Auth0.ManagementApi/Clients/ConnectionsClient.cs +++ b/src/Auth0.ManagementApi/Clients/ConnectionsClient.cs @@ -134,9 +134,9 @@ public Task UpdateAsync(string id, ConnectionUpdateRequest request, } /// - /// Retrieves the status of an ad/ldap connection + /// Retrieves the status of an ad/ldap connection. /// - /// ID of the connection to check + /// ID of the connection to check. /// The cancellation token to cancel operation. /// A that represents the asynchronous check operation. Will throw if the check fails. public Task CheckStatusAsync(string id, CancellationToken cancellationToken = default)