Table of Contents

Class ConnectionsClient

Namespace
Auth0.ManagementApi.Clients
Assembly
Auth0.ManagementApi.dll

Contains methods to access the /connections endpoints.

public class ConnectionsClient : BaseClient, IConnectionsClient
Inheritance
ConnectionsClient
Implements
Inherited Members

Constructors

ConnectionsClient(IManagementConnection, Uri, IDictionary<string, string>)

Initializes a new instance of the ConnectionsClient.

public ConnectionsClient(IManagementConnection connection, Uri baseUri, IDictionary<string, string> defaultHeaders)

Parameters

connection IManagementConnection

IManagementConnection used to make all API calls.

baseUri Uri

Uri of the endpoint to use in making API calls.

defaultHeaders IDictionary<string, string>

Dictionary containing default headers included with every request this client makes.

Methods

CheckStatusAsync(string, CancellationToken)

Retrieves the status of an ad/ldap connection.

public Task CheckStatusAsync(string id, CancellationToken cancellationToken = default)

Parameters

id string

ID of the connection to check.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task

A Task that represents the asynchronous check operation. Will throw if the check fails.

CreateAsync(ConnectionCreateRequest, CancellationToken)

Creates a new connection according to the request.

public Task<Connection> CreateAsync(ConnectionCreateRequest request, CancellationToken cancellationToken = default)

Parameters

request ConnectionCreateRequest

The request containing the properties for the new connection.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<Connection>

A Connection containing the newly created Connection.

DeleteAsync(string, CancellationToken)

Deletes a connection and all its users.

public Task DeleteAsync(string id, CancellationToken cancellationToken = default)

Parameters

id string

The id of the connection to delete.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task

A Task that represents the asynchronous delete operation.

DeleteUserAsync(string, string, CancellationToken)

Deletes a specified connection user by its email.

public Task DeleteUserAsync(string id, string email, CancellationToken cancellationToken = default)

Parameters

id string

The identifier of the connection.

email string

The email of the user to delete.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task

A Task that represents the asynchronous delete operation.

Remarks

Currently only database connections are supported and you cannot delete all users from specific connection.

GetAllAsync(GetConnectionsRequest, PaginationInfo, CancellationToken)

Retrieves every connection matching the specified strategy. All connections are retrieved if no strategy is being specified. Accepts a list of fields to include or exclude in the resulting list of connection objects.

public Task<IPagedList<Connection>> GetAllAsync(GetConnectionsRequest request, PaginationInfo pagination = null, CancellationToken cancellationToken = default)

Parameters

request GetConnectionsRequest

Specifies criteria to use when querying connections.

pagination PaginationInfo

Specifies pagination info to use when requesting paged results.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<IPagedList<Connection>>

An IPagedList<T> containing the list of connections.

GetAsync(string, string, bool, CancellationToken)

Retrieves a connection by its id.

public Task<Connection> GetAsync(string id, string fields = null, bool includeFields = true, CancellationToken cancellationToken = default)

Parameters

id string

The id of the connection to retrieve.

fields string

A comma separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields.

includeFields bool

True if the fields specified are to be included in the result, false otherwise (defaults to true).

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<Connection>

The Connection.

UpdateAsync(string, ConnectionUpdateRequest, CancellationToken)

Updates a connection.

public Task<Connection> UpdateAsync(string id, ConnectionUpdateRequest request, CancellationToken cancellationToken = default)

Parameters

id string

The id of the connection to update.

request ConnectionUpdateRequest

The ConnectionUpdateRequest containing the properties of the connection you wish to update.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<Connection>

The Connection that has been updated.