Skip to content

Commit

Permalink
[TA] Update service version and some cleanup (#17347)
Browse files Browse the repository at this point in the history
* update service version

* run export
  • Loading branch information
maririos authored Dec 4, 2020
1 parent 69e32d5 commit 16ac6c4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 13 deletions.
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

0 comments on commit 16ac6c4

Please sign in to comment.