Table of Contents

Class AdrBaseService.Client

Namespace
Azure.Iot.Operations.Services.AssetAndDeviceRegistry.AdrBaseService
Assembly
Azure.Iot.Operations.Services.dll
public abstract class AdrBaseService.Client : IAsyncDisposable
Inheritance
AdrBaseService.Client
Implements
Inherited Members

Constructors

Client(ApplicationContext, IMqttPubSubClient, Dictionary<string, string>?)

Construct a new instance of this client.

public Client(ApplicationContext applicationContext, IMqttPubSubClient mqttClient, Dictionary<string, string>? topicTokenMap = null)

Parameters

applicationContext ApplicationContext

The shared context for your application.

mqttClient IMqttPubSubClient

The MQTT client to use.

topicTokenMap Dictionary<string, string>

The topic token replacement map to use for all operations by default. Generally, this will include the token values for topic tokens such as "modelId" which should be the same for the duration of this client's lifetime.

Properties

AssetUpdateEventTelemetryReceiver

public AdrBaseService.AssetUpdateEventTelemetryReceiver AssetUpdateEventTelemetryReceiver { get; }

Property Value

AdrBaseService.AssetUpdateEventTelemetryReceiver

CreateOrUpdateDiscoveredAssetCommandInvoker

public AdrBaseService.CreateOrUpdateDiscoveredAssetCommandInvoker CreateOrUpdateDiscoveredAssetCommandInvoker { get; }

Property Value

AdrBaseService.CreateOrUpdateDiscoveredAssetCommandInvoker

DeviceUpdateEventTelemetryReceiver

public AdrBaseService.DeviceUpdateEventTelemetryReceiver DeviceUpdateEventTelemetryReceiver { get; }

Property Value

AdrBaseService.DeviceUpdateEventTelemetryReceiver

GetAssetCommandInvoker

public AdrBaseService.GetAssetCommandInvoker GetAssetCommandInvoker { get; }

Property Value

AdrBaseService.GetAssetCommandInvoker

GetAssetStatusCommandInvoker

public AdrBaseService.GetAssetStatusCommandInvoker GetAssetStatusCommandInvoker { get; }

Property Value

AdrBaseService.GetAssetStatusCommandInvoker

GetDeviceCommandInvoker

public AdrBaseService.GetDeviceCommandInvoker GetDeviceCommandInvoker { get; }

Property Value

AdrBaseService.GetDeviceCommandInvoker

GetDeviceStatusCommandInvoker

public AdrBaseService.GetDeviceStatusCommandInvoker GetDeviceStatusCommandInvoker { get; }

Property Value

AdrBaseService.GetDeviceStatusCommandInvoker

SetNotificationPreferenceForAssetUpdatesCommandInvoker

public AdrBaseService.SetNotificationPreferenceForAssetUpdatesCommandInvoker SetNotificationPreferenceForAssetUpdatesCommandInvoker { get; }

Property Value

AdrBaseService.SetNotificationPreferenceForAssetUpdatesCommandInvoker

SetNotificationPreferenceForDeviceUpdatesCommandInvoker

public AdrBaseService.SetNotificationPreferenceForDeviceUpdatesCommandInvoker SetNotificationPreferenceForDeviceUpdatesCommandInvoker { get; }

Property Value

AdrBaseService.SetNotificationPreferenceForDeviceUpdatesCommandInvoker

UpdateAssetStatusCommandInvoker

public AdrBaseService.UpdateAssetStatusCommandInvoker UpdateAssetStatusCommandInvoker { get; }

Property Value

AdrBaseService.UpdateAssetStatusCommandInvoker

UpdateDeviceStatusCommandInvoker

public AdrBaseService.UpdateDeviceStatusCommandInvoker UpdateDeviceStatusCommandInvoker { get; }

Property Value

AdrBaseService.UpdateDeviceStatusCommandInvoker

Methods

CreateOrUpdateDiscoveredAssetAsync(CreateOrUpdateDiscoveredAssetRequestPayload, CommandRequestMetadata?, Dictionary<string, string>?, TimeSpan?, CancellationToken)

Invoke a command.

public RpcCallAsync<CreateOrUpdateDiscoveredAssetResponsePayload> CreateOrUpdateDiscoveredAssetAsync(CreateOrUpdateDiscoveredAssetRequestPayload request, CommandRequestMetadata? requestMetadata = null, Dictionary<string, string>? additionalTopicTokenMap = null, TimeSpan? commandTimeout = null, CancellationToken cancellationToken = default)

Parameters

request CreateOrUpdateDiscoveredAssetRequestPayload

The data for this command request.

requestMetadata CommandRequestMetadata

The metadata for this command request.

additionalTopicTokenMap Dictionary<string, string>

The topic token replacement map to use in addition to the topic tokens specified in the constructor. If this map contains any keys that the topic tokens specified in the constructor also has, then values specified in this map will take precedence.

commandTimeout TimeSpan?

How long the command will be available on the broker for an executor to receive.

cancellationToken CancellationToken

Cancellation token.

Returns

RpcCallAsync<CreateOrUpdateDiscoveredAssetResponsePayload>

The command response.

DisposeAsync()

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

public ValueTask DisposeAsync()

Returns

ValueTask

A task that represents the asynchronous dispose operation.

DisposeAsync(bool)

public ValueTask DisposeAsync(bool disposing)

Parameters

disposing bool

Returns

ValueTask

GetAssetAsync(GetAssetRequestPayload, CommandRequestMetadata?, Dictionary<string, string>?, TimeSpan?, CancellationToken)

Invoke a command.

public RpcCallAsync<GetAssetResponsePayload> GetAssetAsync(GetAssetRequestPayload request, CommandRequestMetadata? requestMetadata = null, Dictionary<string, string>? additionalTopicTokenMap = null, TimeSpan? commandTimeout = null, CancellationToken cancellationToken = default)

Parameters

request GetAssetRequestPayload

The data for this command request.

requestMetadata CommandRequestMetadata

The metadata for this command request.

additionalTopicTokenMap Dictionary<string, string>

The topic token replacement map to use in addition to the topic tokens specified in the constructor. If this map contains any keys that the topic tokens specified in the constructor also has, then values specified in this map will take precedence.

commandTimeout TimeSpan?

How long the command will be available on the broker for an executor to receive.

cancellationToken CancellationToken

Cancellation token.

Returns

RpcCallAsync<GetAssetResponsePayload>

The command response.

GetAssetStatusAsync(GetAssetStatusRequestPayload, CommandRequestMetadata?, Dictionary<string, string>?, TimeSpan?, CancellationToken)

Invoke a command.

public RpcCallAsync<GetAssetStatusResponsePayload> GetAssetStatusAsync(GetAssetStatusRequestPayload request, CommandRequestMetadata? requestMetadata = null, Dictionary<string, string>? additionalTopicTokenMap = null, TimeSpan? commandTimeout = null, CancellationToken cancellationToken = default)

Parameters

request GetAssetStatusRequestPayload

The data for this command request.

requestMetadata CommandRequestMetadata

The metadata for this command request.

additionalTopicTokenMap Dictionary<string, string>

The topic token replacement map to use in addition to the topic tokens specified in the constructor. If this map contains any keys that the topic tokens specified in the constructor also has, then values specified in this map will take precedence.

commandTimeout TimeSpan?

How long the command will be available on the broker for an executor to receive.

cancellationToken CancellationToken

Cancellation token.

Returns

RpcCallAsync<GetAssetStatusResponsePayload>

The command response.

GetDeviceAsync(CommandRequestMetadata?, Dictionary<string, string>?, TimeSpan?, CancellationToken)

Invoke a command.

public RpcCallAsync<GetDeviceResponsePayload> GetDeviceAsync(CommandRequestMetadata? requestMetadata = null, Dictionary<string, string>? additionalTopicTokenMap = null, TimeSpan? commandTimeout = null, CancellationToken cancellationToken = default)

Parameters

requestMetadata CommandRequestMetadata

The metadata for this command request.

additionalTopicTokenMap Dictionary<string, string>

The topic token replacement map to use in addition to the topic tokens specified in the constructor. If this map contains any keys that the topic tokens specified in the constructor also has, then values specified in this map will take precedence.

commandTimeout TimeSpan?

How long the command will be available on the broker for an executor to receive.

cancellationToken CancellationToken

Cancellation token.

Returns

RpcCallAsync<GetDeviceResponsePayload>

The command response.

GetDeviceStatusAsync(CommandRequestMetadata?, Dictionary<string, string>?, TimeSpan?, CancellationToken)

Invoke a command.

public RpcCallAsync<GetDeviceStatusResponsePayload> GetDeviceStatusAsync(CommandRequestMetadata? requestMetadata = null, Dictionary<string, string>? additionalTopicTokenMap = null, TimeSpan? commandTimeout = null, CancellationToken cancellationToken = default)

Parameters

requestMetadata CommandRequestMetadata

The metadata for this command request.

additionalTopicTokenMap Dictionary<string, string>

The topic token replacement map to use in addition to the topic tokens specified in the constructor. If this map contains any keys that the topic tokens specified in the constructor also has, then values specified in this map will take precedence.

commandTimeout TimeSpan?

How long the command will be available on the broker for an executor to receive.

cancellationToken CancellationToken

Cancellation token.

Returns

RpcCallAsync<GetDeviceStatusResponsePayload>

The command response.

ReceiveTelemetry(string, AssetUpdateEventTelemetry, IncomingTelemetryMetadata)

public abstract Task ReceiveTelemetry(string senderId, AssetUpdateEventTelemetry telemetry, IncomingTelemetryMetadata metadata)

Parameters

senderId string
telemetry AssetUpdateEventTelemetry
metadata IncomingTelemetryMetadata

Returns

Task

ReceiveTelemetry(string, DeviceUpdateEventTelemetry, IncomingTelemetryMetadata)

public abstract Task ReceiveTelemetry(string senderId, DeviceUpdateEventTelemetry telemetry, IncomingTelemetryMetadata metadata)

Parameters

senderId string
telemetry DeviceUpdateEventTelemetry
metadata IncomingTelemetryMetadata

Returns

Task

SetNotificationPreferenceForAssetUpdatesAsync(SetNotificationPreferenceForAssetUpdatesRequestPayload, CommandRequestMetadata?, Dictionary<string, string>?, TimeSpan?, CancellationToken)

Invoke a command.

public RpcCallAsync<SetNotificationPreferenceForAssetUpdatesResponsePayload> SetNotificationPreferenceForAssetUpdatesAsync(SetNotificationPreferenceForAssetUpdatesRequestPayload request, CommandRequestMetadata? requestMetadata = null, Dictionary<string, string>? additionalTopicTokenMap = null, TimeSpan? commandTimeout = null, CancellationToken cancellationToken = default)

Parameters

request SetNotificationPreferenceForAssetUpdatesRequestPayload

The data for this command request.

requestMetadata CommandRequestMetadata

The metadata for this command request.

additionalTopicTokenMap Dictionary<string, string>

The topic token replacement map to use in addition to the topic tokens specified in the constructor. If this map contains any keys that the topic tokens specified in the constructor also has, then values specified in this map will take precedence.

commandTimeout TimeSpan?

How long the command will be available on the broker for an executor to receive.

cancellationToken CancellationToken

Cancellation token.

Returns

RpcCallAsync<SetNotificationPreferenceForAssetUpdatesResponsePayload>

The command response.

SetNotificationPreferenceForDeviceUpdatesAsync(SetNotificationPreferenceForDeviceUpdatesRequestPayload, CommandRequestMetadata?, Dictionary<string, string>?, TimeSpan?, CancellationToken)

Invoke a command.

public RpcCallAsync<SetNotificationPreferenceForDeviceUpdatesResponsePayload> SetNotificationPreferenceForDeviceUpdatesAsync(SetNotificationPreferenceForDeviceUpdatesRequestPayload request, CommandRequestMetadata? requestMetadata = null, Dictionary<string, string>? additionalTopicTokenMap = null, TimeSpan? commandTimeout = null, CancellationToken cancellationToken = default)

Parameters

request SetNotificationPreferenceForDeviceUpdatesRequestPayload

The data for this command request.

requestMetadata CommandRequestMetadata

The metadata for this command request.

additionalTopicTokenMap Dictionary<string, string>

The topic token replacement map to use in addition to the topic tokens specified in the constructor. If this map contains any keys that the topic tokens specified in the constructor also has, then values specified in this map will take precedence.

commandTimeout TimeSpan?

How long the command will be available on the broker for an executor to receive.

cancellationToken CancellationToken

Cancellation token.

Returns

RpcCallAsync<SetNotificationPreferenceForDeviceUpdatesResponsePayload>

The command response.

StartAsync(CancellationToken)

Begin accepting telemetry for all telemetry receivers.

public Task StartAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Cancellation token.

Returns

Task

StopAsync(CancellationToken)

Stop accepting telemetry for all telemetry receivers.

public Task StopAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Cancellation token.

Returns

Task

UpdateAssetStatusAsync(UpdateAssetStatusRequestPayload, CommandRequestMetadata?, Dictionary<string, string>?, TimeSpan?, CancellationToken)

Invoke a command.

public RpcCallAsync<UpdateAssetStatusResponsePayload> UpdateAssetStatusAsync(UpdateAssetStatusRequestPayload request, CommandRequestMetadata? requestMetadata = null, Dictionary<string, string>? additionalTopicTokenMap = null, TimeSpan? commandTimeout = null, CancellationToken cancellationToken = default)

Parameters

request UpdateAssetStatusRequestPayload

The data for this command request.

requestMetadata CommandRequestMetadata

The metadata for this command request.

additionalTopicTokenMap Dictionary<string, string>

The topic token replacement map to use in addition to the topic tokens specified in the constructor. If this map contains any keys that the topic tokens specified in the constructor also has, then values specified in this map will take precedence.

commandTimeout TimeSpan?

How long the command will be available on the broker for an executor to receive.

cancellationToken CancellationToken

Cancellation token.

Returns

RpcCallAsync<UpdateAssetStatusResponsePayload>

The command response.

UpdateDeviceStatusAsync(UpdateDeviceStatusRequestPayload, CommandRequestMetadata?, Dictionary<string, string>?, TimeSpan?, CancellationToken)

Invoke a command.

public RpcCallAsync<UpdateDeviceStatusResponsePayload> UpdateDeviceStatusAsync(UpdateDeviceStatusRequestPayload request, CommandRequestMetadata? requestMetadata = null, Dictionary<string, string>? additionalTopicTokenMap = null, TimeSpan? commandTimeout = null, CancellationToken cancellationToken = default)

Parameters

request UpdateDeviceStatusRequestPayload

The data for this command request.

requestMetadata CommandRequestMetadata

The metadata for this command request.

additionalTopicTokenMap Dictionary<string, string>

The topic token replacement map to use in addition to the topic tokens specified in the constructor. If this map contains any keys that the topic tokens specified in the constructor also has, then values specified in this map will take precedence.

commandTimeout TimeSpan?

How long the command will be available on the broker for an executor to receive.

cancellationToken CancellationToken

Cancellation token.

Returns

RpcCallAsync<UpdateDeviceStatusResponsePayload>

The command response.