Share via


DigitalTwinsClient.GetRelationship<T> Method

Definition

Gets a relationship on a digital twin synchronously.

public virtual Azure.Response<T> GetRelationship<T> (string digitalTwinId, string relationshipId, System.Threading.CancellationToken cancellationToken = default);
abstract member GetRelationship : string * string * System.Threading.CancellationToken -> Azure.Response<'T>
override this.GetRelationship : string * string * System.Threading.CancellationToken -> Azure.Response<'T>
Public Overridable Function GetRelationship(Of T) (digitalTwinId As String, relationshipId As String, Optional cancellationToken As CancellationToken = Nothing) As Response(Of T)

Type Parameters

T

The type to deserialize the relationship to.

Parameters

digitalTwinId
String

The Id of the source digital twin.

relationshipId
String

The Id of the relationship to retrieve.

cancellationToken
CancellationToken

The cancellation token.

Returns

The deserialized application/json relationship corresponding to the provided relationshipId 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 digitalTwinId or relationshipId is null.

Remarks

For more samples, see our repo samples.

Applies to

See also