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

[experiment][dpg] do not convert enum client parameters into string #4457

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 5 additions & 12 deletions samples/AnomalyDetector/src/Generated/AnomalyDetectorClient.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

104 changes: 52 additions & 52 deletions samples/AnomalyDetector/src/Generated/Docs/Multivariate.xml

Large diffs are not rendered by default.

48 changes: 24 additions & 24 deletions samples/AnomalyDetector/src/Generated/Docs/Univariate.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This sample shows how to call DetectUnivariateEntireSeriesAsync.
<code><![CDATA[
Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
Univariate client = new AnomalyDetectorClient(endpoint, credential).GetUnivariateClient(apiVersion: "v1.1");
Univariate client = new AnomalyDetectorClient(endpoint, credential).GetUnivariateClient(apiVersion: APIVersion.V11);

UnivariateDetectionOptions options = new UnivariateDetectionOptions(new TimeSeriesPoint[]
{
Expand All @@ -19,7 +19,7 @@ This sample shows how to call DetectUnivariateEntireSeriesAsync with all paramet
<code><![CDATA[
Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
Univariate client = new AnomalyDetectorClient(endpoint, credential).GetUnivariateClient(apiVersion: "v1.1");
Univariate client = new AnomalyDetectorClient(endpoint, credential).GetUnivariateClient(apiVersion: APIVersion.V11);

UnivariateDetectionOptions options = new UnivariateDetectionOptions(new TimeSeriesPoint[]
{
Expand All @@ -46,7 +46,7 @@ This sample shows how to call DetectUnivariateEntireSeries.
<code><![CDATA[
Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
Univariate client = new AnomalyDetectorClient(endpoint, credential).GetUnivariateClient(apiVersion: "v1.1");
Univariate client = new AnomalyDetectorClient(endpoint, credential).GetUnivariateClient(apiVersion: APIVersion.V11);

UnivariateDetectionOptions options = new UnivariateDetectionOptions(new TimeSeriesPoint[]
{
Expand All @@ -58,7 +58,7 @@ This sample shows how to call DetectUnivariateEntireSeries with all parameters.
<code><![CDATA[
Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
Univariate client = new AnomalyDetectorClient(endpoint, credential).GetUnivariateClient(apiVersion: "v1.1");
Univariate client = new AnomalyDetectorClient(endpoint, credential).GetUnivariateClient(apiVersion: APIVersion.V11);

UnivariateDetectionOptions options = new UnivariateDetectionOptions(new TimeSeriesPoint[]
{
Expand All @@ -85,7 +85,7 @@ This sample shows how to call DetectUnivariateEntireSeriesAsync and parse the re
<code><![CDATA[
Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
Univariate client = new AnomalyDetectorClient(endpoint, credential).GetUnivariateClient(apiVersion: "v1.1");
Univariate client = new AnomalyDetectorClient(endpoint, credential).GetUnivariateClient(apiVersion: APIVersion.V11);

using RequestContent content = RequestContent.Create(new
{
Expand All @@ -112,7 +112,7 @@ This sample shows how to call DetectUnivariateEntireSeriesAsync with all request
<code><![CDATA[
Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
Univariate client = new AnomalyDetectorClient(endpoint, credential).GetUnivariateClient(apiVersion: "v1.1");
Univariate client = new AnomalyDetectorClient(endpoint, credential).GetUnivariateClient(apiVersion: APIVersion.V11);

using RequestContent content = RequestContent.Create(new
{
Expand Down Expand Up @@ -151,7 +151,7 @@ This sample shows how to call DetectUnivariateEntireSeries and parse the result.
<code><![CDATA[
Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
Univariate client = new AnomalyDetectorClient(endpoint, credential).GetUnivariateClient(apiVersion: "v1.1");
Univariate client = new AnomalyDetectorClient(endpoint, credential).GetUnivariateClient(apiVersion: APIVersion.V11);

using RequestContent content = RequestContent.Create(new
{
Expand All @@ -178,7 +178,7 @@ This sample shows how to call DetectUnivariateEntireSeries with all request cont
<code><![CDATA[
Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
Univariate client = new AnomalyDetectorClient(endpoint, credential).GetUnivariateClient(apiVersion: "v1.1");
Univariate client = new AnomalyDetectorClient(endpoint, credential).GetUnivariateClient(apiVersion: APIVersion.V11);

using RequestContent content = RequestContent.Create(new
{
Expand Down Expand Up @@ -217,7 +217,7 @@ This sample shows how to call DetectUnivariateLastPointAsync.
<code><![CDATA[
Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
Univariate client = new AnomalyDetectorClient(endpoint, credential).GetUnivariateClient(apiVersion: "v1.1");
Univariate client = new AnomalyDetectorClient(endpoint, credential).GetUnivariateClient(apiVersion: APIVersion.V11);

UnivariateDetectionOptions options = new UnivariateDetectionOptions(new TimeSeriesPoint[]
{
Expand All @@ -229,7 +229,7 @@ This sample shows how to call DetectUnivariateLastPointAsync with all parameters
<code><![CDATA[
Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
Univariate client = new AnomalyDetectorClient(endpoint, credential).GetUnivariateClient(apiVersion: "v1.1");
Univariate client = new AnomalyDetectorClient(endpoint, credential).GetUnivariateClient(apiVersion: APIVersion.V11);

UnivariateDetectionOptions options = new UnivariateDetectionOptions(new TimeSeriesPoint[]
{
Expand All @@ -256,7 +256,7 @@ This sample shows how to call DetectUnivariateLastPoint.
<code><![CDATA[
Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
Univariate client = new AnomalyDetectorClient(endpoint, credential).GetUnivariateClient(apiVersion: "v1.1");
Univariate client = new AnomalyDetectorClient(endpoint, credential).GetUnivariateClient(apiVersion: APIVersion.V11);

UnivariateDetectionOptions options = new UnivariateDetectionOptions(new TimeSeriesPoint[]
{
Expand All @@ -268,7 +268,7 @@ This sample shows how to call DetectUnivariateLastPoint with all parameters.
<code><![CDATA[
Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
Univariate client = new AnomalyDetectorClient(endpoint, credential).GetUnivariateClient(apiVersion: "v1.1");
Univariate client = new AnomalyDetectorClient(endpoint, credential).GetUnivariateClient(apiVersion: APIVersion.V11);

UnivariateDetectionOptions options = new UnivariateDetectionOptions(new TimeSeriesPoint[]
{
Expand All @@ -295,7 +295,7 @@ This sample shows how to call DetectUnivariateLastPointAsync and parse the resul
<code><![CDATA[
Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
Univariate client = new AnomalyDetectorClient(endpoint, credential).GetUnivariateClient(apiVersion: "v1.1");
Univariate client = new AnomalyDetectorClient(endpoint, credential).GetUnivariateClient(apiVersion: APIVersion.V11);

using RequestContent content = RequestContent.Create(new
{
Expand Down Expand Up @@ -323,7 +323,7 @@ This sample shows how to call DetectUnivariateLastPointAsync with all request co
<code><![CDATA[
Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
Univariate client = new AnomalyDetectorClient(endpoint, credential).GetUnivariateClient(apiVersion: "v1.1");
Univariate client = new AnomalyDetectorClient(endpoint, credential).GetUnivariateClient(apiVersion: APIVersion.V11);

using RequestContent content = RequestContent.Create(new
{
Expand Down Expand Up @@ -363,7 +363,7 @@ This sample shows how to call DetectUnivariateLastPoint and parse the result.
<code><![CDATA[
Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
Univariate client = new AnomalyDetectorClient(endpoint, credential).GetUnivariateClient(apiVersion: "v1.1");
Univariate client = new AnomalyDetectorClient(endpoint, credential).GetUnivariateClient(apiVersion: APIVersion.V11);

using RequestContent content = RequestContent.Create(new
{
Expand Down Expand Up @@ -391,7 +391,7 @@ This sample shows how to call DetectUnivariateLastPoint with all request content
<code><![CDATA[
Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
Univariate client = new AnomalyDetectorClient(endpoint, credential).GetUnivariateClient(apiVersion: "v1.1");
Univariate client = new AnomalyDetectorClient(endpoint, credential).GetUnivariateClient(apiVersion: APIVersion.V11);

using RequestContent content = RequestContent.Create(new
{
Expand Down Expand Up @@ -431,7 +431,7 @@ This sample shows how to call DetectUnivariateChangePointAsync.
<code><![CDATA[
Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
Univariate client = new AnomalyDetectorClient(endpoint, credential).GetUnivariateClient(apiVersion: "v1.1");
Univariate client = new AnomalyDetectorClient(endpoint, credential).GetUnivariateClient(apiVersion: APIVersion.V11);

UnivariateChangePointDetectionOptions options = new UnivariateChangePointDetectionOptions(new TimeSeriesPoint[]
{
Expand All @@ -443,7 +443,7 @@ This sample shows how to call DetectUnivariateChangePointAsync with all paramete
<code><![CDATA[
Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
Univariate client = new AnomalyDetectorClient(endpoint, credential).GetUnivariateClient(apiVersion: "v1.1");
Univariate client = new AnomalyDetectorClient(endpoint, credential).GetUnivariateClient(apiVersion: APIVersion.V11);

UnivariateChangePointDetectionOptions options = new UnivariateChangePointDetectionOptions(new TimeSeriesPoint[]
{
Expand All @@ -467,7 +467,7 @@ This sample shows how to call DetectUnivariateChangePoint.
<code><![CDATA[
Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
Univariate client = new AnomalyDetectorClient(endpoint, credential).GetUnivariateClient(apiVersion: "v1.1");
Univariate client = new AnomalyDetectorClient(endpoint, credential).GetUnivariateClient(apiVersion: APIVersion.V11);

UnivariateChangePointDetectionOptions options = new UnivariateChangePointDetectionOptions(new TimeSeriesPoint[]
{
Expand All @@ -479,7 +479,7 @@ This sample shows how to call DetectUnivariateChangePoint with all parameters.
<code><![CDATA[
Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
Univariate client = new AnomalyDetectorClient(endpoint, credential).GetUnivariateClient(apiVersion: "v1.1");
Univariate client = new AnomalyDetectorClient(endpoint, credential).GetUnivariateClient(apiVersion: APIVersion.V11);

UnivariateChangePointDetectionOptions options = new UnivariateChangePointDetectionOptions(new TimeSeriesPoint[]
{
Expand All @@ -503,7 +503,7 @@ This sample shows how to call DetectUnivariateChangePointAsync and parse the res
<code><![CDATA[
Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
Univariate client = new AnomalyDetectorClient(endpoint, credential).GetUnivariateClient(apiVersion: "v1.1");
Univariate client = new AnomalyDetectorClient(endpoint, credential).GetUnivariateClient(apiVersion: APIVersion.V11);

using RequestContent content = RequestContent.Create(new
{
Expand All @@ -525,7 +525,7 @@ This sample shows how to call DetectUnivariateChangePointAsync with all request
<code><![CDATA[
Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
Univariate client = new AnomalyDetectorClient(endpoint, credential).GetUnivariateClient(apiVersion: "v1.1");
Univariate client = new AnomalyDetectorClient(endpoint, credential).GetUnivariateClient(apiVersion: APIVersion.V11);

using RequestContent content = RequestContent.Create(new
{
Expand Down Expand Up @@ -557,7 +557,7 @@ This sample shows how to call DetectUnivariateChangePoint and parse the result.
<code><![CDATA[
Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
Univariate client = new AnomalyDetectorClient(endpoint, credential).GetUnivariateClient(apiVersion: "v1.1");
Univariate client = new AnomalyDetectorClient(endpoint, credential).GetUnivariateClient(apiVersion: APIVersion.V11);

using RequestContent content = RequestContent.Create(new
{
Expand All @@ -579,7 +579,7 @@ This sample shows how to call DetectUnivariateChangePoint with all request conte
<code><![CDATA[
Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
Univariate client = new AnomalyDetectorClient(endpoint, credential).GetUnivariateClient(apiVersion: "v1.1");
Univariate client = new AnomalyDetectorClient(endpoint, credential).GetUnivariateClient(apiVersion: APIVersion.V11);

using RequestContent content = RequestContent.Create(new
{
Expand Down
48 changes: 48 additions & 0 deletions samples/AnomalyDetector/src/Generated/Models/APIVersion.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

// <auto-generated/>

#nullable disable

using System;
using System.ComponentModel;

namespace AnomalyDetector.Models
{
/// <summary> The APIVersion. </summary>
public readonly partial struct APIVersion : IEquatable<APIVersion>
{
private readonly string _value;

/// <summary> Initializes a new instance of <see cref="APIVersion"/>. </summary>
/// <exception cref="ArgumentNullException"> <paramref name="value"/> is null. </exception>
public APIVersion(string value)
{
_value = value ?? throw new ArgumentNullException(nameof(value));
}

private const string V11Value = "v1.1";

/// <summary> v1.1. </summary>
public static APIVersion V11 { get; } = new APIVersion(V11Value);
/// <summary> Determines if two <see cref="APIVersion"/> values are the same. </summary>
public static bool operator ==(APIVersion left, APIVersion right) => left.Equals(right);
/// <summary> Determines if two <see cref="APIVersion"/> values are not the same. </summary>
public static bool operator !=(APIVersion left, APIVersion right) => !left.Equals(right);
/// <summary> Converts a string to a <see cref="APIVersion"/>. </summary>
public static implicit operator APIVersion(string value) => new APIVersion(value);

/// <inheritdoc />
[EditorBrowsable(EditorBrowsableState.Never)]
public override bool Equals(object obj) => obj is APIVersion other && Equals(other);
/// <inheritdoc />
public bool Equals(APIVersion other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);

/// <inheritdoc />
[EditorBrowsable(EditorBrowsableState.Never)]
public override int GetHashCode() => _value?.GetHashCode() ?? 0;
/// <inheritdoc />
public override string ToString() => _value;
}
}