Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TA] Update service version and some cleanup #17347

Merged
merged 2 commits into from
Dec 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -536,13 +536,13 @@ public TextAnalyticsClient(System.Uri endpoint, Azure.Core.TokenCredential crede
}
public partial class TextAnalyticsClientOptions : Azure.Core.ClientOptions
{
public TextAnalyticsClientOptions(Azure.AI.TextAnalytics.TextAnalyticsClientOptions.ServiceVersion version = Azure.AI.TextAnalytics.TextAnalyticsClientOptions.ServiceVersion.V3_1_Preview_2) { }
public TextAnalyticsClientOptions(Azure.AI.TextAnalytics.TextAnalyticsClientOptions.ServiceVersion version = Azure.AI.TextAnalytics.TextAnalyticsClientOptions.ServiceVersion.V3_1_Preview_3) { }
public string DefaultCountryHint { get { throw null; } set { } }
public string DefaultLanguage { get { throw null; } set { } }
public enum ServiceVersion
{
V3_0 = 1,
V3_1_Preview_2 = 2,
V3_1_Preview_3 = 2,
}
}
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;

Expand All @@ -18,12 +16,11 @@ namespace Azure.AI.TextAnalytics
/// <summary>
/// The client to use for interacting with the Azure Cognitive Service, Text Analytics.
/// </summary>
public partial class TextAnalyticsClient
public class TextAnalyticsClient
{
private readonly Uri _baseUri;
internal readonly TextAnalyticsRestClient _serviceRestClient;
internal readonly ClientDiagnostics _clientDiagnostics;
private readonly string _apiVersion;
private readonly TextAnalyticsClientOptions _options;
private readonly string DefaultCognitiveScope = "https://cognitiveservices.azure.com/.default";
private const string AuthorizationHeader = "Ocp-Apim-Subscription-Key";
Expand Down Expand Up @@ -68,7 +65,6 @@ public TextAnalyticsClient(Uri endpoint, TokenCredential credential, TextAnalyti
Argument.AssertNotNull(options, nameof(options));

_baseUri = endpoint;
_apiVersion = options.GetVersionString();
_clientDiagnostics = new ClientDiagnostics(options);
_options = options;

Expand Down Expand Up @@ -108,7 +104,6 @@ public TextAnalyticsClient(Uri endpoint, AzureKeyCredential credential, TextAnal
Argument.AssertNotNull(options, nameof(options));

_baseUri = endpoint;
_apiVersion = options.GetVersionString();
_clientDiagnostics = new ClientDiagnostics(options);
_options = options;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class TextAnalyticsClientOptions : ClientOptions
/// <summary>
/// The latest service version supported by this client library.
/// </summary>
internal const ServiceVersion LatestVersion = ServiceVersion.V3_1_Preview_2;
internal const ServiceVersion LatestVersion = ServiceVersion.V3_1_Preview_3;

/// <summary>
/// The versions of the Text Analytics service supported by this client library.
Expand All @@ -30,9 +30,9 @@ public enum ServiceVersion
V3_0 = 1,

/// <summary>
/// Version 3.1-preview.2
/// Version 3.1-preview.3
/// </summary>
V3_1_Preview_2 = 2,
V3_1_Preview_3 = 2,
#pragma warning restore CA1707 // Identifiers should not contain underscores
}

Expand Down Expand Up @@ -74,9 +74,9 @@ internal string GetVersionString()
return Version switch
{
ServiceVersion.V3_0 => "v3.0",
ServiceVersion.V3_1_Preview_2 => "v3.1-preview.2",
ServiceVersion.V3_1_Preview_3 => "v3.1-preview.3",

_ => throw new ArgumentException($"Version {Version.ToString()} not supported."),
_ => throw new ArgumentException($"Version {Version} not supported."),
};
}
}
Expand Down