Table of Contents

Class NexusClient

Namespace
Nexus.Api
Assembly
Nexus.Api.dll

Supports all classes in the .NET class hierarchy and provides low-level services to derived classes. This is the ultimate base class of all .NET classes; it is the root of the type hierarchy.

public class NexusClient : INexusClient, IDisposable
Inheritance
NexusClient
Implements
Inherited Members

Constructors

NexusClient(HttpClient)

Initializes a new instance of the NexusClient.

public NexusClient(HttpClient httpClient)

Parameters

httpClient HttpClient

The HTTP client to use.

NexusClient(Uri)

Initializes a new instance of the NexusClient.

public NexusClient(Uri baseUrl)

Parameters

baseUrl Uri

The base URL to connect to.

Properties

IsAuthenticated

Gets a value which indicates if the user is authenticated.

public bool IsAuthenticated { get; }

Property Value

bool

V1

Gets the V1 client.

public IV1 V1 { get; }

Property Value

IV1

V2

Gets the V2 client.

public IV2 V2 { get; }

Property Value

IV2

Methods

AttachConfiguration(object)

Attaches configuration data to subsequent API requests.

public IDisposable AttachConfiguration(object configuration)

Parameters

configuration object

The configuration data.

Returns

IDisposable

ClearConfiguration()

Clears configuration data for all subsequent API requests.

public void ClearConfiguration()

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Export(DateTime, DateTime, TimeSpan, string?, IEnumerable<string>, IReadOnlyDictionary<string, object>?, string, Precision, Action<double, string>?)

This high-level methods simplifies exporting multiple resources at once.

public void Export(DateTime begin, DateTime end, TimeSpan filePeriod, string? fileFormat, IEnumerable<string> resourcePaths, IReadOnlyDictionary<string, object>? configuration, string targetFolder, Precision precision, Action<double, string>? onProgress = null)

Parameters

begin DateTime

The begin date/time.

end DateTime

The end date/time.

filePeriod TimeSpan

The file period. Use TimeSpan.Zero to get a single file.

fileFormat string

The target file format. If null, data will be read (and possibly cached) but not returned. This is useful for data pre-aggregation.

resourcePaths IEnumerable<string>

The resource paths to export.

configuration IReadOnlyDictionary<string, object>

The configuration.

targetFolder string

The target folder for the files to extract.

precision Precision

The floating point precision used for exported sample values.

onProgress Action<double, string>

A callback which accepts the current progress and the progress message.

ExportAsync(DateTime, DateTime, TimeSpan, string?, IEnumerable<string>, IReadOnlyDictionary<string, object>?, string, Precision, Action<double, string>?, CancellationToken)

This high-level methods simplifies exporting multiple resources at once.

public Task ExportAsync(DateTime begin, DateTime end, TimeSpan filePeriod, string? fileFormat, IEnumerable<string> resourcePaths, IReadOnlyDictionary<string, object>? configuration, string targetFolder, Precision precision, Action<double, string>? onProgress = null, CancellationToken cancellationToken = default)

Parameters

begin DateTime

The begin date/time.

end DateTime

The end date/time.

filePeriod TimeSpan

The file period. Use TimeSpan.Zero to get a single file.

fileFormat string

The target file format. If null, data will be read (and possibly cached) but not returned. This is useful for data pre-aggregation.

resourcePaths IEnumerable<string>

The resource paths to export.

configuration IReadOnlyDictionary<string, object>

The configuration.

targetFolder string

The target folder for the files to extract.

precision Precision

The floating point precision used for exported sample values.

onProgress Action<double, string>

A callback which accepts the current progress and the progress message.

cancellationToken CancellationToken

A token to cancel the current operation.

Returns

Task

LoadAsync<T>(DateTime, DateTime, IEnumerable<string>, Action<double>?, CancellationToken)

This high-level methods simplifies loading multiple resources at once.

public Task<IReadOnlyDictionary<string, DataResponse<T>>> LoadAsync<T>(DateTime begin, DateTime end, IEnumerable<string> resourcePaths, Action<double>? onProgress = null, CancellationToken cancellationToken = default) where T : struct

Parameters

begin DateTime

Start date/time.

end DateTime

End date/time.

resourcePaths IEnumerable<string>

The resource paths.

onProgress Action<double>

A callback which accepts the current progress.

cancellationToken CancellationToken

A token to cancel the current operation.

Returns

Task<IReadOnlyDictionary<string, DataResponse<T>>>

Type Parameters

T

The element type. Use double for 64-bit or float for 32-bit precision.

LoadAsync<T>(DateTime, DateTime, IEnumerable<string>, Func<string, int, long, Memory<T>>, Action<double>?, CancellationToken)

This high-level methods simplifies loading multiple resources at once into caller-provided buffers.

public Task<IReadOnlyDictionary<string, ResourceInfo>> LoadAsync<T>(DateTime begin, DateTime end, IEnumerable<string> resourcePaths, Func<string, int, long, Memory<T>> bufferProvider, Action<double>? onProgress = null, CancellationToken cancellationToken = default) where T : struct

Parameters

begin DateTime

Start date/time.

end DateTime

End date/time.

resourcePaths IEnumerable<string>

The resource paths.

bufferProvider Func<string, int, long, Memory<T>>

A callback which provides a writable buffer for each resource path, chunk element count, and remaining resource element count.

onProgress Action<double>

A callback which accepts the current progress.

cancellationToken CancellationToken

A token to cancel the current operation.

Returns

Task<IReadOnlyDictionary<string, ResourceInfo>>

Type Parameters

T

The element type. Use double for 64-bit or float for 32-bit precision.

Load<T>(DateTime, DateTime, IEnumerable<string>, Action<double>?)

This high-level methods simplifies loading multiple resources at once.

public IReadOnlyDictionary<string, DataResponse<T>> Load<T>(DateTime begin, DateTime end, IEnumerable<string> resourcePaths, Action<double>? onProgress = null) where T : struct

Parameters

begin DateTime

Start date/time.

end DateTime

End date/time.

resourcePaths IEnumerable<string>

The resource paths.

onProgress Action<double>

A callback which accepts the current progress.

Returns

IReadOnlyDictionary<string, DataResponse<T>>

Type Parameters

T

The element type. Use double for 64-bit or float for 32-bit precision.

Load<T>(DateTime, DateTime, IEnumerable<string>, Func<string, int, long, Memory<T>>, Action<double>?)

This high-level methods simplifies loading multiple resources at once into caller-provided buffers.

public IReadOnlyDictionary<string, ResourceInfo> Load<T>(DateTime begin, DateTime end, IEnumerable<string> resourcePaths, Func<string, int, long, Memory<T>> bufferProvider, Action<double>? onProgress = null) where T : struct

Parameters

begin DateTime

Start date/time.

end DateTime

End date/time.

resourcePaths IEnumerable<string>

The resource paths.

bufferProvider Func<string, int, long, Memory<T>>

A callback which provides a writable buffer for each resource path, chunk element count, and remaining resource element count.

onProgress Action<double>

A callback which accepts the current progress.

Returns

IReadOnlyDictionary<string, ResourceInfo>

Type Parameters

T

The element type. Use double for 64-bit or float for 32-bit precision.

SignIn(string)

Signs in the user.

public void SignIn(string accessToken)

Parameters

accessToken string

The access token.