DigitalTwinsClient.GetModel(String, CancellationToken) Method

Definition

Gets a model, including the model metadata and the model definition synchronously.

public virtual Azure.Response<Azure.DigitalTwins.Core.DigitalTwinsModelData> GetModel (string modelId, System.Threading.CancellationToken cancellationToken = default);
abstract member GetModel : string * System.Threading.CancellationToken -> Azure.Response<Azure.DigitalTwins.Core.DigitalTwinsModelData>
override this.GetModel : string * System.Threading.CancellationToken -> Azure.Response<Azure.DigitalTwins.Core.DigitalTwinsModelData>
Public Overridable Function GetModel (modelId As String, Optional cancellationToken As CancellationToken = Nothing) As Response(Of DigitalTwinsModelData)

Parameters

modelId
System.String

The Id of the model.

cancellationToken
System.Threading.CancellationToken

The cancellation token.

Returns

Response<DigitalTwinsModelData>

The application/json model and the http response Response<T>.

Exceptions

The exception that captures the errors from the service. Check the ErrorCode and Status properties for more details.

System.ArgumentNullException

The exception is thrown when modelId is null.

Remarks

For more samples, see our repo samples.

Applies to

See also