TypeDefinition.GetRelationshipByNameAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
GetRelationshipByNameAsync(String, CancellationToken) |
Get the relationship definition by its name (unique). |
GetRelationshipByNameAsync(String, RequestContext) |
[Protocol Method] Get the relationship definition by its name (unique).
|
GetRelationshipByNameAsync(String, CancellationToken)
- Source:
- TypeDefinition.cs
Get the relationship definition by its name (unique).
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Analytics.Purview.DataMap.AtlasRelationshipDef>> GetRelationshipByNameAsync (string name, System.Threading.CancellationToken cancellationToken = default);
abstract member GetRelationshipByNameAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Analytics.Purview.DataMap.AtlasRelationshipDef>>
override this.GetRelationshipByNameAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Analytics.Purview.DataMap.AtlasRelationshipDef>>
Public Overridable Function GetRelationshipByNameAsync (name As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of AtlasRelationshipDef))
Parameters
- name
- String
The name of the relationship.
- cancellationToken
- CancellationToken
The cancellation token to use.
Returns
Exceptions
name
is null.
name
is an empty string, and was expected to be non-empty.
Examples
This sample shows how to call GetRelationshipByNameAsync.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
TypeDefinition client = new DataMapClient(endpoint, credential).GetTypeDefinitionClient();
Response<AtlasRelationshipDef> response = await client.GetRelationshipByNameAsync("<name>");
This sample shows how to call GetRelationshipByNameAsync with all parameters.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
TypeDefinition client = new DataMapClient(endpoint, credential).GetTypeDefinitionClient();
Response<AtlasRelationshipDef> response = await client.GetRelationshipByNameAsync("<name>");
Applies to
GetRelationshipByNameAsync(String, RequestContext)
- Source:
- TypeDefinition.cs
[Protocol Method] Get the relationship definition by its name (unique).
- This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
- Please try the simpler GetRelationshipByNameAsync(String, CancellationToken) convenience overload with strongly typed models first.
public virtual System.Threading.Tasks.Task<Azure.Response> GetRelationshipByNameAsync (string name, Azure.RequestContext context);
abstract member GetRelationshipByNameAsync : string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.GetRelationshipByNameAsync : string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function GetRelationshipByNameAsync (name As String, context As RequestContext) As Task(Of Response)
Parameters
- name
- String
The name of the relationship.
- 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
name
is null.
name
is an empty string, and was expected to be non-empty.
Service returned a non-success status code.
Examples
This sample shows how to call GetRelationshipByNameAsync and parse the result.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
TypeDefinition client = new DataMapClient(endpoint, credential).GetTypeDefinitionClient();
Response response = await client.GetRelationshipByNameAsync("<name>", null);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.ToString());
This sample shows how to call GetRelationshipByNameAsync with all parameters and parse the result.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
TypeDefinition client = new DataMapClient(endpoint, credential).GetTypeDefinitionClient();
Response response = await client.GetRelationshipByNameAsync("<name>", null);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("category").ToString());
Console.WriteLine(result.GetProperty("createTime").ToString());
Console.WriteLine(result.GetProperty("createdBy").ToString());
Console.WriteLine(result.GetProperty("dateFormatter").GetProperty("availableLocales")[0].ToString());
Console.WriteLine(result.GetProperty("dateFormatter").GetProperty("calendar").ToString());
Console.WriteLine(result.GetProperty("dateFormatter").GetProperty("lenient").ToString());
Console.WriteLine(result.GetProperty("dateFormatter").GetProperty("numberFormat").GetProperty("availableLocales")[0].ToString());
Console.WriteLine(result.GetProperty("dateFormatter").GetProperty("numberFormat").GetProperty("currency").ToString());
Console.WriteLine(result.GetProperty("dateFormatter").GetProperty("numberFormat").GetProperty("groupingUsed").ToString());
Console.WriteLine(result.GetProperty("dateFormatter").GetProperty("numberFormat").GetProperty("maximumFractionDigits").ToString());
Console.WriteLine(result.GetProperty("dateFormatter").GetProperty("numberFormat").GetProperty("maximumIntegerDigits").ToString());
Console.WriteLine(result.GetProperty("dateFormatter").GetProperty("numberFormat").GetProperty("minimumFractionDigits").ToString());
Console.WriteLine(result.GetProperty("dateFormatter").GetProperty("numberFormat").GetProperty("minimumIntegerDigits").ToString());
Console.WriteLine(result.GetProperty("dateFormatter").GetProperty("numberFormat").GetProperty("parseIntegerOnly").ToString());
Console.WriteLine(result.GetProperty("dateFormatter").GetProperty("numberFormat").GetProperty("roundingMode").ToString());
Console.WriteLine(result.GetProperty("dateFormatter").GetProperty("timeZone").GetProperty("dstSavings").ToString());
Console.WriteLine(result.GetProperty("dateFormatter").GetProperty("timeZone").GetProperty("id").ToString());
Console.WriteLine(result.GetProperty("dateFormatter").GetProperty("timeZone").GetProperty("availableIds")[0].ToString());
Console.WriteLine(result.GetProperty("dateFormatter").GetProperty("timeZone").GetProperty("displayName").ToString());
Console.WriteLine(result.GetProperty("dateFormatter").GetProperty("timeZone").GetProperty("rawOffset").ToString());
Console.WriteLine(result.GetProperty("description").ToString());
Console.WriteLine(result.GetProperty("guid").ToString());
Console.WriteLine(result.GetProperty("name").ToString());
Console.WriteLine(result.GetProperty("options").GetProperty("<key>").ToString());
Console.WriteLine(result.GetProperty("serviceType").ToString());
Console.WriteLine(result.GetProperty("typeVersion").ToString());
Console.WriteLine(result.GetProperty("updateTime").ToString());
Console.WriteLine(result.GetProperty("updatedBy").ToString());
Console.WriteLine(result.GetProperty("version").ToString());
Console.WriteLine(result.GetProperty("lastModifiedTS").ToString());
Console.WriteLine(result.GetProperty("attributeDefs")[0].GetProperty("cardinality").ToString());
Console.WriteLine(result.GetProperty("attributeDefs")[0].GetProperty("constraints")[0].GetProperty("params").GetProperty("<key>").ToString());
Console.WriteLine(result.GetProperty("attributeDefs")[0].GetProperty("constraints")[0].GetProperty("type").ToString());
Console.WriteLine(result.GetProperty("attributeDefs")[0].GetProperty("defaultValue").ToString());
Console.WriteLine(result.GetProperty("attributeDefs")[0].GetProperty("description").ToString());
Console.WriteLine(result.GetProperty("attributeDefs")[0].GetProperty("includeInNotification").ToString());
Console.WriteLine(result.GetProperty("attributeDefs")[0].GetProperty("isIndexable").ToString());
Console.WriteLine(result.GetProperty("attributeDefs")[0].GetProperty("isOptional").ToString());
Console.WriteLine(result.GetProperty("attributeDefs")[0].GetProperty("isUnique").ToString());
Console.WriteLine(result.GetProperty("attributeDefs")[0].GetProperty("name").ToString());
Console.WriteLine(result.GetProperty("attributeDefs")[0].GetProperty("options").GetProperty("<key>").ToString());
Console.WriteLine(result.GetProperty("attributeDefs")[0].GetProperty("typeName").ToString());
Console.WriteLine(result.GetProperty("attributeDefs")[0].GetProperty("valuesMaxCount").ToString());
Console.WriteLine(result.GetProperty("attributeDefs")[0].GetProperty("valuesMinCount").ToString());
Console.WriteLine(result.GetProperty("endDef1").GetProperty("cardinality").ToString());
Console.WriteLine(result.GetProperty("endDef1").GetProperty("description").ToString());
Console.WriteLine(result.GetProperty("endDef1").GetProperty("isContainer").ToString());
Console.WriteLine(result.GetProperty("endDef1").GetProperty("isLegacyAttribute").ToString());
Console.WriteLine(result.GetProperty("endDef1").GetProperty("name").ToString());
Console.WriteLine(result.GetProperty("endDef1").GetProperty("type").ToString());
Console.WriteLine(result.GetProperty("endDef2").GetProperty("cardinality").ToString());
Console.WriteLine(result.GetProperty("endDef2").GetProperty("description").ToString());
Console.WriteLine(result.GetProperty("endDef2").GetProperty("isContainer").ToString());
Console.WriteLine(result.GetProperty("endDef2").GetProperty("isLegacyAttribute").ToString());
Console.WriteLine(result.GetProperty("endDef2").GetProperty("name").ToString());
Console.WriteLine(result.GetProperty("endDef2").GetProperty("type").ToString());
Console.WriteLine(result.GetProperty("relationshipCategory").ToString());
Console.WriteLine(result.GetProperty("relationshipLabel").ToString());
Applies to
Azure SDK for .NET