// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
//
#nullable disable
using System;
using System.Diagnostics.CodeAnalysis;
using Azure.Core;
using Microsoft.Extensions.Configuration;
namespace Azure.AI.Language.Documents
{
/// Client options for .
public partial class DocumentAnalysisClientOptions : ClientOptions
{
private const ServiceVersion LatestVersion = ServiceVersion.V2026_05_15_Preview;
/// Initializes a new instance of DocumentAnalysisClientOptions.
/// The service version.
public DocumentAnalysisClientOptions(ServiceVersion version = LatestVersion)
{
Version = version switch
{
ServiceVersion.V2024_11_15_Preview => "2024-11-15-preview",
ServiceVersion.V2026_05_01 => "2026-05-01",
ServiceVersion.V2026_05_15_Preview => "2026-05-15-preview",
_ => throw new NotSupportedException()
};
ConfigureLogging();
}
/// Initializes a new instance of DocumentAnalysisClientOptions from configuration.
/// The configuration section.
[Experimental("SCME0002")]
internal DocumentAnalysisClientOptions(IConfigurationSection section) : base(section, null)
{
Version = "2026-05-15-preview";
if (section is null || !section.Exists())
{
return;
}
if (section["Version"] is string version)
{
Version = version;
}
ConfigureLogging();
}
/// Gets the Version.
internal string Version { get; }
/// Configures logging for the client options.
partial void ConfigureLogging();
/// The version of the service to use.
public enum ServiceVersion
{
/// Version 2024-11-15-preview.
V2024_11_15_Preview = 1,
/// Version 2026-05-01.
V2026_05_01 = 2,
/// Version 2026-05-15-preview.
V2026_05_15_Preview = 3
}
}
}