Skip to content

Commit 318d6ca

Browse files
azure-sdkchunyu3
andauthored
Update AutoRest C# version to 3.0.0-beta.20230518.1 (Azure#36373)
* Update Generator Version 3.0.0-beta.20230518.1 * Update SDK codes * Update SDK codes * update AnomalyDetector samples * update api of healthinsights --------- Co-authored-by: FAREAST\chunyu <chunyu@microsoft.com>
1 parent 6dc66d7 commit 318d6ca

26 files changed

+112
-132
lines changed

eng/Packages.Data.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@
167167
All should have PrivateAssets="All" set so they don't become package dependencies
168168
-->
169169
<ItemGroup>
170-
<PackageReference Update="Microsoft.Azure.AutoRest.CSharp" Version="3.0.0-beta.20230517.2" PrivateAssets="All" />
170+
<PackageReference Update="Microsoft.Azure.AutoRest.CSharp" Version="3.0.0-beta.20230518.1" PrivateAssets="All" />
171171
<PackageReference Update="Azure.ClientSdk.Analyzers" Version="0.1.1-dev.20230131.1" PrivateAssets="All" />
172172
<PackageReference Update="coverlet.collector" Version="1.3.0" PrivateAssets="All" />
173173
<PackageReference Update="Microsoft.CodeAnalysis.NetAnalyzers" Version="7.0.1" PrivateAssets="All" />

eng/emitter-package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"main": "dist/src/index.js",
33
"dependencies": {
4-
"@azure-tools/typespec-csharp": "0.2.0-beta.20230517.2"
4+
"@azure-tools/typespec-csharp": "0.2.0-beta.20230518.1"
55
}
66
}

sdk/anomalydetector/Azure.AI.AnomalyDetector/api/Azure.AI.AnomalyDetector.netstandard2.0.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public partial class AnomalyDetectionModel
3030
internal AnomalyDetectionModel() { }
3131
public System.DateTimeOffset CreatedTime { get { throw null; } }
3232
public System.DateTimeOffset LastUpdatedTime { get { throw null; } }
33-
public string ModelId { get { throw null; } }
33+
public System.Guid ModelId { get { throw null; } }
3434
public Azure.AI.AnomalyDetector.ModelInfo ModelInfo { get { throw null; } }
3535
}
3636
public partial class AnomalyDetectorClient
@@ -59,10 +59,10 @@ public AnomalyDetectorClient(System.Uri endpoint, Azure.AzureKeyCredential crede
5959
public virtual Azure.Response DetectUnivariateLastPoint(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; }
6060
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.AI.AnomalyDetector.UnivariateLastDetectionResult>> DetectUnivariateLastPointAsync(Azure.AI.AnomalyDetector.UnivariateDetectionOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
6161
public virtual System.Threading.Tasks.Task<Azure.Response> DetectUnivariateLastPointAsync(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; }
62-
public virtual Azure.Response GetMultivariateBatchDetectionResult(string resultId, Azure.RequestContext context) { throw null; }
63-
public virtual Azure.Response<Azure.AI.AnomalyDetector.MultivariateDetectionResult> GetMultivariateBatchDetectionResult(string resultId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
64-
public virtual System.Threading.Tasks.Task<Azure.Response> GetMultivariateBatchDetectionResultAsync(string resultId, Azure.RequestContext context) { throw null; }
65-
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.AI.AnomalyDetector.MultivariateDetectionResult>> GetMultivariateBatchDetectionResultAsync(string resultId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
62+
public virtual Azure.Response GetMultivariateBatchDetectionResult(System.Guid resultId, Azure.RequestContext context) { throw null; }
63+
public virtual Azure.Response<Azure.AI.AnomalyDetector.MultivariateDetectionResult> GetMultivariateBatchDetectionResult(System.Guid resultId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
64+
public virtual System.Threading.Tasks.Task<Azure.Response> GetMultivariateBatchDetectionResultAsync(System.Guid resultId, Azure.RequestContext context) { throw null; }
65+
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.AI.AnomalyDetector.MultivariateDetectionResult>> GetMultivariateBatchDetectionResultAsync(System.Guid resultId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
6666
public virtual Azure.Response GetMultivariateModel(string modelId, Azure.RequestContext context) { throw null; }
6767
public virtual Azure.Response<Azure.AI.AnomalyDetector.AnomalyDetectionModel> GetMultivariateModel(string modelId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
6868
public virtual System.Threading.Tasks.Task<Azure.Response> GetMultivariateModelAsync(string modelId, Azure.RequestContext context) { throw null; }
@@ -186,10 +186,10 @@ public ErrorResponse(string code, string message) { }
186186
}
187187
public partial class ModelInfo
188188
{
189-
public ModelInfo(string dataSource, System.DateTimeOffset startTime, System.DateTimeOffset endTime) { }
189+
public ModelInfo(System.Uri dataSource, System.DateTimeOffset startTime, System.DateTimeOffset endTime) { }
190190
public Azure.AI.AnomalyDetector.AlignPolicy AlignPolicy { get { throw null; } set { } }
191191
public Azure.AI.AnomalyDetector.DataSchema? DataSchema { get { throw null; } set { } }
192-
public string DataSource { get { throw null; } set { } }
192+
public System.Uri DataSource { get { throw null; } set { } }
193193
public Azure.AI.AnomalyDetector.DiagnosticsInfo DiagnosticsInfo { get { throw null; } }
194194
public string DisplayName { get { throw null; } set { } }
195195
public System.DateTimeOffset EndTime { get { throw null; } set { } }
@@ -228,8 +228,8 @@ public ModelState() { }
228228
}
229229
public partial class MultivariateBatchDetectionOptions
230230
{
231-
public MultivariateBatchDetectionOptions(string dataSource, System.DateTimeOffset startTime, System.DateTimeOffset endTime) { }
232-
public string DataSource { get { throw null; } set { } }
231+
public MultivariateBatchDetectionOptions(System.Uri dataSource, System.DateTimeOffset startTime, System.DateTimeOffset endTime) { }
232+
public System.Uri DataSource { get { throw null; } set { } }
233233
public System.DateTimeOffset EndTime { get { throw null; } set { } }
234234
public System.DateTimeOffset StartTime { get { throw null; } set { } }
235235
public int? TopContributorCount { get { throw null; } set { } }
@@ -265,7 +265,7 @@ internal MultivariateBatchDetectionResultSummary() { }
265265
public partial class MultivariateDetectionResult
266266
{
267267
internal MultivariateDetectionResult() { }
268-
public string ResultId { get { throw null; } }
268+
public System.Guid ResultId { get { throw null; } }
269269
public System.Collections.Generic.IReadOnlyList<Azure.AI.AnomalyDetector.AnomalyState> Results { get { throw null; } }
270270
public Azure.AI.AnomalyDetector.MultivariateBatchDetectionResultSummary Summary { get { throw null; } }
271271
}

sdk/anomalydetector/Azure.AI.AnomalyDetector/samples/Sample2_DetectLastPointAnomaly.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ You can set `endpoint` and `apiKey` based on an environment variable, a configur
1313
//read endpoint and apiKey
1414
string endpoint = TestEnvironment.Endpoint;
1515
string apiKey = TestEnvironment.ApiKey;
16-
string dataSource = TestEnvironment.DataSource;
16+
Uri dataSource = new Uri(TestEnvironment.DataSource);
1717

1818
Uri endpointUri = new Uri(endpoint);
1919
AzureKeyCredential credential = new AzureKeyCredential(apiKey);

sdk/anomalydetector/Azure.AI.AnomalyDetector/samples/Sample3_DetectChangePoint.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ You can set `endpoint` and `apiKey` based on an environment variable, a configur
1313
//read endpoint and apiKey
1414
string endpoint = TestEnvironment.Endpoint;
1515
string apiKey = TestEnvironment.ApiKey;
16-
string dataSource = TestEnvironment.DataSource;
16+
Uri dataSource = new Uri(TestEnvironment.DataSource);
1717

1818
Uri endpointUri = new Uri(endpoint);
1919
AzureKeyCredential credential = new AzureKeyCredential(apiKey);

sdk/anomalydetector/Azure.AI.AnomalyDetector/samples/Sample4_MultivariateDetect.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ You can set `endpoint` and `apiKey` based on an environment variable, a configur
1313
//read endpoint and apiKey
1414
string endpoint = TestEnvironment.Endpoint;
1515
string apiKey = TestEnvironment.ApiKey;
16-
string dataSource = TestEnvironment.DataSource;
16+
Uri dataSource = new Uri(TestEnvironment.DataSource);
1717

1818
Uri endpointUri = new Uri(endpoint);
1919
AzureKeyCredential credential = new AzureKeyCredential(apiKey);
@@ -31,7 +31,7 @@ You could add the data source, along with start time and end time to a `ModelInf
3131
Call `CreateAndTrainMultivariateModel` with the created data feed and extract the model ID from the response. Afterwards, you can get the model info, including the model status, by calling `GetMultivariateModelValue` with the model ID. Wait until the model status is ready.
3232

3333
```C# Snippet:TrainMultivariateModel
34-
private string TrainModel(AnomalyDetectorClient client, string dataSource, DateTimeOffset startTime, DateTimeOffset endTime, int maxTryout = 500)
34+
private string TrainModel(AnomalyDetectorClient client, Uri dataSource, DateTimeOffset startTime, DateTimeOffset endTime, int maxTryout = 500)
3535
{
3636
try
3737
{
@@ -46,7 +46,7 @@ private string TrainModel(AnomalyDetectorClient client, string dataSource, DateT
4646

4747
Console.WriteLine("Training new model...(it may take a few minutes)");
4848
AnomalyDetectionModel response = client.TrainMultivariateModel(modelInfo);
49-
string trainedModelId = response.ModelId;
49+
string trainedModelId = response.ModelId.ToString();
5050
Console.WriteLine($"Training model id is {trainedModelId}");
5151

5252
// Wait until the model is ready. It usually takes several minutes
@@ -98,7 +98,7 @@ private string TrainModel(AnomalyDetectorClient client, string dataSource, DateT
9898
To detect anomalies using your newly trained model, create a private async Task named `BatchDetect`. You will create a new `DetectionRequest`, pass that as a parameter to `DetectMultivariateBatchAnomaly` and get a `DetectionResult` and extract result ID from it. With the result ID, you could get the detection content and detection status by `GetMultivariateBatchDetectionResultValue`. Return the detection content when the detection status is ready.
9999

100100
```C# Snippet:DetectMultivariateAnomaly
101-
private MultivariateDetectionResult BatchDetect(AnomalyDetectorClient client, string datasource, string modelId, DateTimeOffset startTime, DateTimeOffset endTime, int maxTryout = 500)
101+
private MultivariateDetectionResult BatchDetect(AnomalyDetectorClient client, Uri datasource, string modelId, DateTimeOffset startTime, DateTimeOffset endTime, int maxTryout = 500)
102102
{
103103
try
104104
{
@@ -107,8 +107,8 @@ private MultivariateDetectionResult BatchDetect(AnomalyDetectorClient client, st
107107

108108
Console.WriteLine("Start batch detection, this might take a few minutes...");
109109
MultivariateDetectionResult response = client.DetectMultivariateBatchAnomaly(modelId, request);
110-
string resultId = response.ResultId;
111-
Console.WriteLine($"result id is: {resultId}");
110+
Guid resultId = response.ResultId;
111+
Console.WriteLine($"result id is: {resultId.ToString()}");
112112

113113
// get detection result
114114
MultivariateDetectionResult resultResponse = client.GetMultivariateBatchDetectionResult(resultId);

sdk/anomalydetector/Azure.AI.AnomalyDetector/src/Generated/AnomalyDetectionModel.Serialization.cs

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/anomalydetector/Azure.AI.AnomalyDetector/src/Generated/AnomalyDetectionModel.cs

Lines changed: 3 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)