API version:
Show / Hide Table of Contents

Class DefaultDataStore

The default implementation of IDataStore.

Inheritance
System.Object
DefaultDataStore
Implements
IDataStore
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Okta.Sdk.Internal
Assembly: Okta.Sdk.dll
Syntax
public sealed class DefaultDataStore : IDataStore

Constructors

DefaultDataStore(IRequestExecutor, ISerializer, ResourceFactory, ILogger)

Initializes a new instance of the DefaultDataStore class.

Declaration
public DefaultDataStore(IRequestExecutor requestExecutor, ISerializer serializer, ResourceFactory resourceFactory, ILogger logger)
Parameters
Type Name Description
IRequestExecutor requestExecutor

The IRequestExecutor to use.

ISerializer serializer

The ISerializer to use.

ResourceFactory resourceFactory

The ResourceFactory.

Microsoft.Extensions.Logging.ILogger logger

The logging interface.

Properties

RequestExecutor

Gets the IRequestExecutor used by this IDataStore.

Declaration
public IRequestExecutor RequestExecutor { get; }
Property Value
Type Description
IRequestExecutor

The IRequestExecutor used by this IDataStore.

Serializer

Gets the ISerializer used by this IDataStore.

Declaration
public ISerializer Serializer { get; }
Property Value
Type Description
ISerializer

The ISerializer used by this IDataStore.

Methods

DeleteAsync(HttpRequest, RequestContext, CancellationToken)

Deletes a resource.

Declaration
public Task<HttpResponse> DeleteAsync(HttpRequest request, RequestContext requestContext, CancellationToken cancellationToken)
Parameters
Type Name Description
HttpRequest request

The HTTP request options.

RequestContext requestContext

Information about the upstream request.

System.Threading.CancellationToken cancellationToken

The cancellation token.

Returns
Type Description
System.Threading.Tasks.Task<HttpResponse>

The HttpResponse data.

GetArrayAsync<T>(HttpRequest, RequestContext, CancellationToken)

Gets an array of resources and deserializes each item to a Resource type.

Declaration
public Task<HttpResponse<IEnumerable<T>>> GetArrayAsync<T>(HttpRequest request, RequestContext requestContext, CancellationToken cancellationToken)
    where T : IResource
Parameters
Type Name Description
HttpRequest request

The HTTP request options.

RequestContext requestContext

Information about the upstream request.

System.Threading.CancellationToken cancellationToken

The cancellation token.

Returns
Type Description
System.Threading.Tasks.Task<HttpResponse<System.Collections.Generic.IEnumerable<T>>>

An array of deserialized resources and HttpResponse data.

Type Parameters
Name Description
T

The Resource type to deserialize the returned data to.

Exceptions
Type Condition
OktaApiException

An API error occurred.

GetAsync<T>(HttpRequest, RequestContext, CancellationToken)

Gets a resource and deserializes it to a Resource type.

Declaration
public Task<HttpResponse<T>> GetAsync<T>(HttpRequest request, RequestContext requestContext, CancellationToken cancellationToken)
    where T : Resource, new()
Parameters
Type Name Description
HttpRequest request

The HTTP request options.

RequestContext requestContext

Information about the upstream request.

System.Threading.CancellationToken cancellationToken

The cancellation token.

Returns
Type Description
System.Threading.Tasks.Task<HttpResponse<T>>

The deserialized resource and HttpResponse data.

Type Parameters
Name Description
T

The Resource type to deserialize the returned data to.

Exceptions
Type Condition
OktaApiException

An API error occurred.

PostAsync<TResponse>(HttpRequest, RequestContext, CancellationToken)

Posts data to an endpoint and deserializes the response to a Resource type.

Declaration
public Task<HttpResponse<TResponse>> PostAsync<TResponse>(HttpRequest request, RequestContext requestContext, CancellationToken cancellationToken)
    where TResponse : Resource, new()
Parameters
Type Name Description
HttpRequest request

The HTTP request options.

RequestContext requestContext

Information about the upstream request.

System.Threading.CancellationToken cancellationToken

The cancellation token.

Returns
Type Description
System.Threading.Tasks.Task<HttpResponse<TResponse>>

The deserialized response resource and HttpResponse data.

Type Parameters
Name Description
TResponse

The Resource type to deserialize the returned data to.

Exceptions
Type Condition
OktaApiException

An API error occurred.

PutAsync<TResponse>(HttpRequest, RequestContext, CancellationToken)

Puts data to an endpoint and deserializes the response to a Resource type.

Declaration
public Task<HttpResponse<TResponse>> PutAsync<TResponse>(HttpRequest request, RequestContext requestContext, CancellationToken cancellationToken)
    where TResponse : Resource, new()
Parameters
Type Name Description
HttpRequest request

The HTTP request options.

RequestContext requestContext

Information about the upstream request.

System.Threading.CancellationToken cancellationToken

The cancellation token.

Returns
Type Description
System.Threading.Tasks.Task<HttpResponse<TResponse>>

The deserialized response resource and HttpResponse data.

Type Parameters
Name Description
TResponse

The Resource type to deserialize the returned data to.

Exceptions
Type Condition
OktaApiException

An API error occurred.

Implements

IDataStore
Back to top Copyright © 2021 Okta, Inc.
Generated with DocFx.