Table of Contents

Class DeviceCredentialsClient

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

Contains methods to access the /device-credentials endpoints.

public class DeviceCredentialsClient : BaseClient, IDeviceCredentialsClient
Inheritance
DeviceCredentialsClient
Implements
Inherited Members

Constructors

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

Initializes a new instance of DeviceCredentialsClient.

public DeviceCredentialsClient(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

CreateAsync(DeviceCredentialCreateRequest, CancellationToken)

Creates a new device credential.

public Task<DeviceCredential> CreateAsync(DeviceCredentialCreateRequest request, CancellationToken cancellationToken = default)

Parameters

request DeviceCredentialCreateRequest

The request containing the details of the device credential to create.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<DeviceCredential>

The newly created DeviceCredential.

DeleteAsync(string, CancellationToken)

Deletes a device credential.

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

Parameters

id string

The id of the device credential to delete.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task

A Task that represents the asynchronous delete operation.

GetAllAsync(GetDeviceCredentialsRequest, PaginationInfo, CancellationToken)

Gets a list of all the device credentials.

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

Parameters

request GetDeviceCredentialsRequest

Specifies criteria to use when querying device credentials.

pagination PaginationInfo

Specifies PaginationInfo to use in requesting paged results.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<IPagedList<DeviceCredential>>

A list of DeviceCredential which conforms to the criteria specified.

GetAllAsync(string, bool, string, string, string, CancellationToken)

Gets a list of all the device credentials.

[Obsolete("Getting a list of device credentials without pagination is not recommended. Please use the overload that accepts pagination information.")]
public Task<IList<DeviceCredential>> GetAllAsync(string fields = null, bool includeFields = true, string userId = null, string clientId = null, string type = null, CancellationToken cancellationToken = default)

Parameters

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 excluded from the result, false otherwise (defaults to true).

userId string

The user id of the devices to retrieve.

clientId string

The client id of the devices to retrieve.

type string

The type of credentials.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<IList<DeviceCredential>>

A list of DeviceCredential which conforms to the criteria specified.