diff --git a/eng/Packages.Data.props b/eng/Packages.Data.props index 29752b576f39..e92cb14ec898 100644 --- a/eng/Packages.Data.props +++ b/eng/Packages.Data.props @@ -176,7 +176,7 @@ All should have PrivateAssets="All" set so they don't become package dependencies --> - + diff --git a/eng/emitter-package.json b/eng/emitter-package.json index baea717ce990..6d73189559de 100644 --- a/eng/emitter-package.json +++ b/eng/emitter-package.json @@ -1,6 +1,6 @@ { "main": "dist/src/index.js", "dependencies": { - "@azure-tools/typespec-csharp": "0.2.0-beta.20230928.1" + "@azure-tools/typespec-csharp": "0.2.0-alpha.20231007.1" } } diff --git a/sdk/anomalydetector/Azure.AI.AnomalyDetector/src/Generated/AnomalyDetectorClient.cs b/sdk/anomalydetector/Azure.AI.AnomalyDetector/src/Generated/AnomalyDetectorClient.cs index 0b8e5f6a61bb..8b0a9cf181a4 100644 --- a/sdk/anomalydetector/Azure.AI.AnomalyDetector/src/Generated/AnomalyDetectorClient.cs +++ b/sdk/anomalydetector/Azure.AI.AnomalyDetector/src/Generated/AnomalyDetectorClient.cs @@ -150,7 +150,8 @@ public virtual async Task> DetectUnivari Argument.AssertNotNull(options, nameof(options)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await DetectUnivariateLastPointAsync(options.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = options.ToRequestContent(); + Response response = await DetectUnivariateLastPointAsync(content, context).ConfigureAwait(false); return Response.FromValue(UnivariateLastDetectionResult.FromResponse(response), response); } @@ -168,7 +169,8 @@ public virtual Response DetectUnivariateLastPoint Argument.AssertNotNull(options, nameof(options)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = DetectUnivariateLastPoint(options.ToRequestContent(), context); + using RequestContent content = options.ToRequestContent(); + Response response = DetectUnivariateLastPoint(content, context); return Response.FromValue(UnivariateLastDetectionResult.FromResponse(response), response); } @@ -261,7 +263,8 @@ public virtual async Task> Detect Argument.AssertNotNull(options, nameof(options)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await DetectUnivariateChangePointAsync(options.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = options.ToRequestContent(); + Response response = await DetectUnivariateChangePointAsync(content, context).ConfigureAwait(false); return Response.FromValue(UnivariateChangePointDetectionResult.FromResponse(response), response); } @@ -276,7 +279,8 @@ public virtual Response DetectUnivariateCh Argument.AssertNotNull(options, nameof(options)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = DetectUnivariateChangePoint(options.ToRequestContent(), context); + using RequestContent content = options.ToRequestContent(); + Response response = DetectUnivariateChangePoint(content, context); return Response.FromValue(UnivariateChangePointDetectionResult.FromResponse(response), response); } @@ -482,7 +486,8 @@ public virtual async Task> TrainMultivariateMode Argument.AssertNotNull(modelInfo, nameof(modelInfo)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await TrainMultivariateModelAsync(modelInfo.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = modelInfo.ToRequestContent(); + Response response = await TrainMultivariateModelAsync(content, context).ConfigureAwait(false); return Response.FromValue(AnomalyDetectionModel.FromResponse(response), response); } @@ -508,7 +513,8 @@ public virtual Response TrainMultivariateModel(ModelInfo Argument.AssertNotNull(modelInfo, nameof(modelInfo)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = TrainMultivariateModel(modelInfo.ToRequestContent(), context); + using RequestContent content = modelInfo.ToRequestContent(); + Response response = TrainMultivariateModel(content, context); return Response.FromValue(AnomalyDetectionModel.FromResponse(response), response); } @@ -801,7 +807,8 @@ public virtual async Task> DetectMultivari Argument.AssertNotNull(options, nameof(options)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await DetectMultivariateBatchAnomalyAsync(modelId, options.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = options.ToRequestContent(); + Response response = await DetectMultivariateBatchAnomalyAsync(modelId, content, context).ConfigureAwait(false); return Response.FromValue(MultivariateDetectionResult.FromResponse(response), response); } @@ -826,7 +833,8 @@ public virtual Response DetectMultivariateBatchAnom Argument.AssertNotNull(options, nameof(options)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = DetectMultivariateBatchAnomaly(modelId, options.ToRequestContent(), context); + using RequestContent content = options.ToRequestContent(); + Response response = DetectMultivariateBatchAnomaly(modelId, content, context); return Response.FromValue(MultivariateDetectionResult.FromResponse(response), response); } @@ -933,7 +941,8 @@ public virtual async Task> DetectMulti Argument.AssertNotNull(options, nameof(options)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await DetectMultivariateLastAnomalyAsync(modelId, options.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = options.ToRequestContent(); + Response response = await DetectMultivariateLastAnomalyAsync(modelId, content, context).ConfigureAwait(false); return Response.FromValue(MultivariateLastDetectionResult.FromResponse(response), response); } @@ -956,7 +965,8 @@ public virtual Response DetectMultivariateLastA Argument.AssertNotNull(options, nameof(options)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = DetectMultivariateLastAnomaly(modelId, options.ToRequestContent(), context); + using RequestContent content = options.ToRequestContent(); + Response response = DetectMultivariateLastAnomaly(modelId, content, context); return Response.FromValue(MultivariateLastDetectionResult.FromResponse(response), response); } diff --git a/sdk/contentsafety/Azure.AI.ContentSafety/src/Generated/ContentSafetyClient.cs b/sdk/contentsafety/Azure.AI.ContentSafety/src/Generated/ContentSafetyClient.cs index 5cf374ddc9a3..44e41bd84a12 100644 --- a/sdk/contentsafety/Azure.AI.ContentSafety/src/Generated/ContentSafetyClient.cs +++ b/sdk/contentsafety/Azure.AI.ContentSafety/src/Generated/ContentSafetyClient.cs @@ -79,7 +79,8 @@ public virtual async Task> AnalyzeTextAsync(AnalyzeT Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await AnalyzeTextAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await AnalyzeTextAsync(content, context).ConfigureAwait(false); return Response.FromValue(AnalyzeTextResult.FromResponse(response), response); } @@ -94,7 +95,8 @@ public virtual Response AnalyzeText(AnalyzeTextOptions body, Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = AnalyzeText(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = AnalyzeText(content, context); return Response.FromValue(AnalyzeTextResult.FromResponse(response), response); } @@ -187,7 +189,8 @@ public virtual async Task> AnalyzeImageAsync(Analyz Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await AnalyzeImageAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await AnalyzeImageAsync(content, context).ConfigureAwait(false); return Response.FromValue(AnalyzeImageResult.FromResponse(response), response); } @@ -202,7 +205,8 @@ public virtual Response AnalyzeImage(AnalyzeImageOptions bod Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = AnalyzeImage(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = AnalyzeImage(content, context); return Response.FromValue(AnalyzeImageResult.FromResponse(response), response); } @@ -556,7 +560,8 @@ public virtual async Task> AddBlockItemsAsync(stri Argument.AssertNotNull(addBlockItemsOptions, nameof(addBlockItemsOptions)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await AddBlockItemsAsync(blocklistName, addBlockItemsOptions.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = addBlockItemsOptions.ToRequestContent(); + Response response = await AddBlockItemsAsync(blocklistName, content, context).ConfigureAwait(false); return Response.FromValue(AddBlockItemsResult.FromResponse(response), response); } @@ -574,7 +579,8 @@ public virtual Response AddBlockItems(string blocklistName, Argument.AssertNotNull(addBlockItemsOptions, nameof(addBlockItemsOptions)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = AddBlockItems(blocklistName, addBlockItemsOptions.ToRequestContent(), context); + using RequestContent content = addBlockItemsOptions.ToRequestContent(); + Response response = AddBlockItems(blocklistName, content, context); return Response.FromValue(AddBlockItemsResult.FromResponse(response), response); } @@ -676,7 +682,8 @@ public virtual async Task RemoveBlockItemsAsync(string blocklistName, Argument.AssertNotNull(removeBlockItemsOptions, nameof(removeBlockItemsOptions)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await RemoveBlockItemsAsync(blocklistName, removeBlockItemsOptions.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = removeBlockItemsOptions.ToRequestContent(); + Response response = await RemoveBlockItemsAsync(blocklistName, content, context).ConfigureAwait(false); return response; } @@ -694,7 +701,8 @@ public virtual Response RemoveBlockItems(string blocklistName, RemoveBlockItemsO Argument.AssertNotNull(removeBlockItemsOptions, nameof(removeBlockItemsOptions)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = RemoveBlockItems(blocklistName, removeBlockItemsOptions.ToRequestContent(), context); + using RequestContent content = removeBlockItemsOptions.ToRequestContent(); + Response response = RemoveBlockItems(blocklistName, content, context); return response; } diff --git a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/CancerProfilingClient.cs b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/CancerProfilingClient.cs index 6a93da6a078f..368a01f697a4 100644 --- a/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/CancerProfilingClient.cs +++ b/sdk/healthinsights/Azure.Health.Insights.CancerProfiling/src/Generated/CancerProfilingClient.cs @@ -73,7 +73,8 @@ public virtual async Task> InferCancerProfileAsyn Argument.AssertNotNull(oncoPhenotypeData, nameof(oncoPhenotypeData)); RequestContext context = FromCancellationToken(cancellationToken); - Operation response = await InferCancerProfileAsync(waitUntil, oncoPhenotypeData.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = oncoPhenotypeData.ToRequestContent(); + Operation response = await InferCancerProfileAsync(waitUntil, content, context).ConfigureAwait(false); return ProtocolOperationHelpers.Convert(response, OncoPhenotypeResult.FromResponse, ClientDiagnostics, "CancerProfilingClient.InferCancerProfile"); } @@ -89,7 +90,8 @@ public virtual Operation InferCancerProfile(WaitUntil waitU Argument.AssertNotNull(oncoPhenotypeData, nameof(oncoPhenotypeData)); RequestContext context = FromCancellationToken(cancellationToken); - Operation response = InferCancerProfile(waitUntil, oncoPhenotypeData.ToRequestContent(), context); + using RequestContent content = oncoPhenotypeData.ToRequestContent(); + Operation response = InferCancerProfile(waitUntil, content, context); return ProtocolOperationHelpers.Convert(response, OncoPhenotypeResult.FromResponse, ClientDiagnostics, "CancerProfilingClient.InferCancerProfile"); } diff --git a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalMatchingClient.cs b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalMatchingClient.cs index 3984bf1f11ae..531050542978 100644 --- a/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalMatchingClient.cs +++ b/sdk/healthinsights/Azure.Health.Insights.ClinicalMatching/src/Generated/ClinicalMatchingClient.cs @@ -73,7 +73,8 @@ public virtual async Task> MatchTrialsAsync(WaitUn Argument.AssertNotNull(trialMatcherData, nameof(trialMatcherData)); RequestContext context = FromCancellationToken(cancellationToken); - Operation response = await MatchTrialsAsync(waitUntil, trialMatcherData.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = trialMatcherData.ToRequestContent(); + Operation response = await MatchTrialsAsync(waitUntil, content, context).ConfigureAwait(false); return ProtocolOperationHelpers.Convert(response, TrialMatcherResult.FromResponse, ClientDiagnostics, "ClinicalMatchingClient.MatchTrials"); } @@ -89,7 +90,8 @@ public virtual Operation MatchTrials(WaitUntil waitUntil, Tr Argument.AssertNotNull(trialMatcherData, nameof(trialMatcherData)); RequestContext context = FromCancellationToken(cancellationToken); - Operation response = MatchTrials(waitUntil, trialMatcherData.ToRequestContent(), context); + using RequestContent content = trialMatcherData.ToRequestContent(); + Operation response = MatchTrials(waitUntil, content, context); return ProtocolOperationHelpers.Convert(response, TrialMatcherResult.FromResponse, ClientDiagnostics, "ClinicalMatchingClient.MatchTrials"); } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/OpenAIClient.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/OpenAIClient.cs index 5c9517355a94..e104ca9fd681 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/OpenAIClient.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/OpenAIClient.cs @@ -47,7 +47,8 @@ internal virtual async Task> Be Argument.AssertNotNull(imageGenerationOptions, nameof(imageGenerationOptions)); RequestContext context = FromCancellationToken(cancellationToken); - Operation response = await BeginAzureBatchImageGenerationAsync(waitUntil, imageGenerationOptions.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = imageGenerationOptions.ToRequestContent(); + Operation response = await BeginAzureBatchImageGenerationAsync(waitUntil, content, context).ConfigureAwait(false); return ProtocolOperationHelpers.Convert(response, BatchImageGenerationOperationResponse.FromResponse, ClientDiagnostics, "OpenAIClient.BeginAzureBatchImageGeneration"); } @@ -61,7 +62,8 @@ internal virtual Operation BeginAzureBatc Argument.AssertNotNull(imageGenerationOptions, nameof(imageGenerationOptions)); RequestContext context = FromCancellationToken(cancellationToken); - Operation response = BeginAzureBatchImageGeneration(waitUntil, imageGenerationOptions.ToRequestContent(), context); + using RequestContent content = imageGenerationOptions.ToRequestContent(); + Operation response = BeginAzureBatchImageGeneration(waitUntil, content, context); return ProtocolOperationHelpers.Convert(response, BatchImageGenerationOperationResponse.FromResponse, ClientDiagnostics, "OpenAIClient.BeginAzureBatchImageGeneration"); }