TypeDefinition.GetEnumById Method
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.
GetEnumById(String, RequestContext) |
[Protocol Method] Get the enum definition for the given GUID.
|
GetEnumById(String, CancellationToken) |
Get the enum definition for the given GUID. |
- Source:
- TypeDefinition.cs
[Protocol Method] Get the enum definition for the given GUID.
- This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
- Please try the simpler GetEnumById(String, CancellationToken) convenience overload with strongly typed models first.
public virtual Azure.Response GetEnumById (string guid, Azure.RequestContext context);
abstract member GetEnumById : string * Azure.RequestContext -> Azure.Response
override this.GetEnumById : string * Azure.RequestContext -> Azure.Response
Public Overridable Function GetEnumById (guid As String, context As RequestContext) As Response
Parameters
- guid
- String
The globally unique identifier of the enum.
- 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
guid
is null.
guid
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 GetEnumById 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 = client.GetEnumById("<guid>", null);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.ToString());
This sample shows how to call GetEnumById 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 = client.GetEnumById("<guid>", 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("defaultValue").ToString());
Console.WriteLine(result.GetProperty("elementDefs")[0].GetProperty("description").ToString());
Console.WriteLine(result.GetProperty("elementDefs")[0].GetProperty("ordinal").ToString());
Console.WriteLine(result.GetProperty("elementDefs")[0].GetProperty("value").ToString());
Applies to
- Source:
- TypeDefinition.cs
Get the enum definition for the given GUID.
public virtual Azure.Response<Azure.Analytics.Purview.DataMap.AtlasEnumDef> GetEnumById (string guid, System.Threading.CancellationToken cancellationToken = default);
abstract member GetEnumById : string * System.Threading.CancellationToken -> Azure.Response<Azure.Analytics.Purview.DataMap.AtlasEnumDef>
override this.GetEnumById : string * System.Threading.CancellationToken -> Azure.Response<Azure.Analytics.Purview.DataMap.AtlasEnumDef>
Public Overridable Function GetEnumById (guid As String, Optional cancellationToken As CancellationToken = Nothing) As Response(Of AtlasEnumDef)
Parameters
- guid
- String
The globally unique identifier of the enum.
- cancellationToken
- CancellationToken
The cancellation token to use.
Returns
Exceptions
guid
is null.
guid
is an empty string, and was expected to be non-empty.
Examples
This sample shows how to call GetEnumById.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
TypeDefinition client = new DataMapClient(endpoint, credential).GetTypeDefinitionClient();
Response<AtlasEnumDef> response = client.GetEnumById("<guid>");
This sample shows how to call GetEnumById with all parameters.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
TypeDefinition client = new DataMapClient(endpoint, credential).GetTypeDefinitionClient();
Response<AtlasEnumDef> response = client.GetEnumById("<guid>");
Applies to
ملاحظات Azure SDK for .NET
Azure SDK for .NET هو مشروع مصدر مفتوح. حدد رابطًا لتقديم الملاحظات: