Freigeben über


Relationship.UpdateAsync Method

Definition

Overloads

Name Description
UpdateAsync(AtlasRelationship, CancellationToken)

Update an existing relationship between entities.

UpdateAsync(RequestContent, RequestContext)

[Protocol Method] Update an existing relationship between entities.

UpdateAsync(AtlasRelationship, CancellationToken)

Source:
Relationship.cs

Update an existing relationship between entities.

public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Analytics.Purview.DataMap.AtlasRelationship>> UpdateAsync(Azure.Analytics.Purview.DataMap.AtlasRelationship body, System.Threading.CancellationToken cancellationToken = default);
abstract member UpdateAsync : Azure.Analytics.Purview.DataMap.AtlasRelationship * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Analytics.Purview.DataMap.AtlasRelationship>>
override this.UpdateAsync : Azure.Analytics.Purview.DataMap.AtlasRelationship * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Analytics.Purview.DataMap.AtlasRelationship>>
Public Overridable Function UpdateAsync (body As AtlasRelationship, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of AtlasRelationship))

Parameters

body
AtlasRelationship

Body parameter.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

body is null.

Examples

This sample shows how to call UpdateAsync.

Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Relationship client = new DataMapClient(endpoint, credential).GetRelationshipClient();

AtlasRelationship body = new AtlasRelationship
{
    Attributes =
    {
        ["expression"] = BinaryData.FromObjectAsJson("Example Expression"),
        ["steward"] = BinaryData.FromObjectAsJson("Example Steward"),
        ["description"] = BinaryData.FromObjectAsJson("Example Description"),
        ["source"] = null,
        ["status"] = null
    },
    TypeName = "AtlasGlossarySynonym",
    CreatedBy = "ExampleCreator",
    End1 = new AtlasObjectId
    {
        Guid = "77481037-2874-9bdc-9b9e-76bb94ee71aa",
        TypeName = "AtlasGlossaryTerm",
    },
    End2 = new AtlasObjectId
    {
        Guid = "b0942506-2d7d-1f45-d286-c29ca9e7f2ef",
        TypeName = "AtlasGlossaryTerm",
    },
    Guid = "b2810301-293f-493f-88f1-7ac8784fb1fd",
    Label = "r:AtlasGlossarySynonym",
    Status = StatusAtlasRelationship.Active,
    UpdatedBy = "ExampleUpdator",
    Version = 0L,
};
Response<AtlasRelationship> response = await client.UpdateAsync(body);

Applies to

UpdateAsync(RequestContent, RequestContext)

Source:
Relationship.cs

[Protocol Method] Update an existing relationship between entities.

public virtual System.Threading.Tasks.Task<Azure.Response> UpdateAsync(Azure.Core.RequestContent content, Azure.RequestContext context = default);
abstract member UpdateAsync : Azure.Core.RequestContent * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.UpdateAsync : Azure.Core.RequestContent * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function UpdateAsync (content As RequestContent, Optional context As RequestContext = Nothing) As Task(Of Response)

Parameters

content
RequestContent

The content to send as the body of the request.

context
RequestContext

The request context, which can override default behaviors of the client pipeline on a per-call basis.

Returns

The response returned from the service.

Exceptions

content is null.

Service returned a non-success status code.

Examples

This sample shows how to call UpdateAsync and parse the result.

Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Relationship client = new DataMapClient(endpoint, credential).GetRelationshipClient();

using RequestContent content = RequestContent.Create(new
{
    typeName = "AtlasGlossarySynonym",
    attributes = new
    {
        expression = "Example Expression",
        steward = "Example Steward",
        description = "Example Description",
    },
    guid = "b2810301-293f-493f-88f1-7ac8784fb1fd",
    end1 = new
    {
        guid = "77481037-2874-9bdc-9b9e-76bb94ee71aa",
        typeName = "AtlasGlossaryTerm",
    },
    end2 = new
    {
        guid = "b0942506-2d7d-1f45-d286-c29ca9e7f2ef",
        typeName = "AtlasGlossaryTerm",
    },
    label = "r:AtlasGlossarySynonym",
    status = "ACTIVE",
    createdBy = "ExampleCreator",
    updatedBy = "ExampleUpdator",
    version = 0L,
});
Response response = await client.UpdateAsync(content);

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.ToString());

Applies to