Share via


DigitalTwinsClient.GetRelationships<T> Method

Definition

Gets all the relationships on a digital twin by iterating through a collection synchronously.

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

Type Parameters

T

The type to deserialize the relationship to.

Parameters

digitalTwinId
String

The Id of the source digital twin.

relationshipName
String

The name of a relationship to filter to. If null, all relationships for the digital twin will be returned.

cancellationToken
CancellationToken

The cancellation token.

Returns

The pageable list Pageable<T> of application/json relationships belonging to the specified digital twin and the HTTP response.

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 is null.

Remarks

For more samples, see our repo samples.

Applies to

See also