Share via


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
String

The Id of the model.

cancellationToken
CancellationToken

The cancellation token.

Returns

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.

The exception is thrown when modelId is null.

Remarks

For more samples, see our repo samples.

Applies to

See also