diff --git a/samples/AnomalyDetector/src/Generated/AnomalyDetectorClient.cs b/samples/AnomalyDetector/src/Generated/AnomalyDetectorClient.cs index 85e671b0844..f0781ebe2dd 100644 --- a/samples/AnomalyDetector/src/Generated/AnomalyDetectorClient.cs +++ b/samples/AnomalyDetector/src/Generated/AnomalyDetectorClient.cs @@ -85,7 +85,8 @@ public virtual async Task> DetectUniva Argument.AssertNotNull(options, nameof(options)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await DetectUnivariateEntireSeriesAsync(options.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = options.ToRequestContent(); + Response response = await DetectUnivariateEntireSeriesAsync(content, context).ConfigureAwait(false); return Response.FromValue(UnivariateEntireDetectionResult.FromResponse(response), response); } @@ -105,7 +106,8 @@ public virtual Response DetectUnivariateEntireS Argument.AssertNotNull(options, nameof(options)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = DetectUnivariateEntireSeries(options.ToRequestContent(), context); + using RequestContent content = options.ToRequestContent(); + Response response = DetectUnivariateEntireSeries(content, context); return Response.FromValue(UnivariateEntireDetectionResult.FromResponse(response), response); } @@ -201,7 +203,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); } @@ -219,7 +222,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); } @@ -312,7 +316,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); } @@ -327,7 +332,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); } @@ -530,7 +536,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); } @@ -553,7 +560,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); } @@ -846,7 +854,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); } @@ -871,7 +880,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); } @@ -978,7 +988,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); } @@ -1001,7 +1012,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/samples/AnomalyDetector/src/Generated/Docs/AnomalyDetectorClient.xml b/samples/AnomalyDetector/src/Generated/Docs/AnomalyDetectorClient.xml index 9d57b5918bd..c83299e18c9 100644 --- a/samples/AnomalyDetector/src/Generated/Docs/AnomalyDetectorClient.xml +++ b/samples/AnomalyDetector/src/Generated/Docs/AnomalyDetectorClient.xml @@ -87,7 +87,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); AnomalyDetectorClient client = new AnomalyDetectorClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { series = new object[] { @@ -114,7 +114,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); AnomalyDetectorClient client = new AnomalyDetectorClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { series = new object[] { @@ -153,7 +153,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); AnomalyDetectorClient client = new AnomalyDetectorClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { series = new object[] { @@ -180,7 +180,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); AnomalyDetectorClient client = new AnomalyDetectorClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { series = new object[] { @@ -297,7 +297,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); AnomalyDetectorClient client = new AnomalyDetectorClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { series = new object[] { @@ -325,7 +325,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); AnomalyDetectorClient client = new AnomalyDetectorClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { series = new object[] { @@ -365,7 +365,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); AnomalyDetectorClient client = new AnomalyDetectorClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { series = new object[] { @@ -393,7 +393,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); AnomalyDetectorClient client = new AnomalyDetectorClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { series = new object[] { @@ -505,7 +505,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); AnomalyDetectorClient client = new AnomalyDetectorClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { series = new object[] { @@ -527,7 +527,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); AnomalyDetectorClient client = new AnomalyDetectorClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { series = new object[] { @@ -559,7 +559,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); AnomalyDetectorClient client = new AnomalyDetectorClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { series = new object[] { @@ -581,7 +581,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); AnomalyDetectorClient client = new AnomalyDetectorClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { series = new object[] { @@ -857,7 +857,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); AnomalyDetectorClient client = new AnomalyDetectorClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { dataSource = "", startTime = "2022-05-10T14:57:31.2311892-04:00", @@ -876,7 +876,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); AnomalyDetectorClient client = new AnomalyDetectorClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { dataSource = "", dataSchema = "OneTable", @@ -962,7 +962,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); AnomalyDetectorClient client = new AnomalyDetectorClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { dataSource = "", startTime = "2022-05-10T14:57:31.2311892-04:00", @@ -981,7 +981,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); AnomalyDetectorClient client = new AnomalyDetectorClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { dataSource = "", dataSchema = "OneTable", @@ -1293,7 +1293,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); AnomalyDetectorClient client = new AnomalyDetectorClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { dataSource = "http://localhost:3000", topContributorCount = 1234, @@ -1317,7 +1317,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); AnomalyDetectorClient client = new AnomalyDetectorClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { dataSource = "http://localhost:3000", topContributorCount = 1234, @@ -1359,7 +1359,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); AnomalyDetectorClient client = new AnomalyDetectorClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { dataSource = "http://localhost:3000", topContributorCount = 1234, @@ -1383,7 +1383,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); AnomalyDetectorClient client = new AnomalyDetectorClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { dataSource = "http://localhost:3000", topContributorCount = 1234, @@ -1479,7 +1479,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); AnomalyDetectorClient client = new AnomalyDetectorClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { variables = new object[] { @@ -1509,7 +1509,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); AnomalyDetectorClient client = new AnomalyDetectorClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { variables = new object[] { @@ -1555,7 +1555,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); AnomalyDetectorClient client = new AnomalyDetectorClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { variables = new object[] { @@ -1585,7 +1585,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); AnomalyDetectorClient client = new AnomalyDetectorClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { variables = new object[] { diff --git a/samples/AnomalyDetector/tests/Generated/Samples/Samples_AnomalyDetectorClient.cs b/samples/AnomalyDetector/tests/Generated/Samples/Samples_AnomalyDetectorClient.cs index e2ed2048f5a..2e91f86875d 100644 --- a/samples/AnomalyDetector/tests/Generated/Samples/Samples_AnomalyDetectorClient.cs +++ b/samples/AnomalyDetector/tests/Generated/Samples/Samples_AnomalyDetectorClient.cs @@ -27,7 +27,7 @@ public void Example_DetectUnivariateEntireSeries_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); AnomalyDetectorClient client = new AnomalyDetectorClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { series = new object[] { @@ -57,7 +57,7 @@ public async Task Example_DetectUnivariateEntireSeries_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); AnomalyDetectorClient client = new AnomalyDetectorClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { series = new object[] { @@ -117,7 +117,7 @@ public void Example_DetectUnivariateEntireSeries_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); AnomalyDetectorClient client = new AnomalyDetectorClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { series = new object[] { @@ -156,7 +156,7 @@ public async Task Example_DetectUnivariateEntireSeries_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); AnomalyDetectorClient client = new AnomalyDetectorClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { series = new object[] { @@ -249,7 +249,7 @@ public void Example_DetectUnivariateLastPoint_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); AnomalyDetectorClient client = new AnomalyDetectorClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { series = new object[] { @@ -280,7 +280,7 @@ public async Task Example_DetectUnivariateLastPoint_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); AnomalyDetectorClient client = new AnomalyDetectorClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { series = new object[] { @@ -341,7 +341,7 @@ public void Example_DetectUnivariateLastPoint_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); AnomalyDetectorClient client = new AnomalyDetectorClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { series = new object[] { @@ -381,7 +381,7 @@ public async Task Example_DetectUnivariateLastPoint_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); AnomalyDetectorClient client = new AnomalyDetectorClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { series = new object[] { @@ -475,7 +475,7 @@ public void Example_DetectUnivariateChangePoint_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); AnomalyDetectorClient client = new AnomalyDetectorClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { series = new object[] { @@ -500,7 +500,7 @@ public async Task Example_DetectUnivariateChangePoint_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); AnomalyDetectorClient client = new AnomalyDetectorClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { series = new object[] { @@ -555,7 +555,7 @@ public void Example_DetectUnivariateChangePoint_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); AnomalyDetectorClient client = new AnomalyDetectorClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { series = new object[] { @@ -587,7 +587,7 @@ public async Task Example_DetectUnivariateChangePoint_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); AnomalyDetectorClient client = new AnomalyDetectorClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { series = new object[] { @@ -821,7 +821,7 @@ public void Example_TrainMultivariateModel_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); AnomalyDetectorClient client = new AnomalyDetectorClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { dataSource = "", startTime = "2022-05-10T14:57:31.2311892-04:00", @@ -843,7 +843,7 @@ public async Task Example_TrainMultivariateModel_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); AnomalyDetectorClient client = new AnomalyDetectorClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { dataSource = "", startTime = "2022-05-10T14:57:31.2311892-04:00", @@ -889,7 +889,7 @@ public void Example_TrainMultivariateModel_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); AnomalyDetectorClient client = new AnomalyDetectorClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { dataSource = "", dataSchema = "OneTable", @@ -975,7 +975,7 @@ public async Task Example_TrainMultivariateModel_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); AnomalyDetectorClient client = new AnomalyDetectorClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { dataSource = "", dataSchema = "OneTable", @@ -1347,7 +1347,7 @@ public void Example_DetectMultivariateBatchAnomaly_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); AnomalyDetectorClient client = new AnomalyDetectorClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { dataSource = "http://localhost:3000", topContributorCount = 1234, @@ -1374,7 +1374,7 @@ public async Task Example_DetectMultivariateBatchAnomaly_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); AnomalyDetectorClient client = new AnomalyDetectorClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { dataSource = "http://localhost:3000", topContributorCount = 1234, @@ -1425,7 +1425,7 @@ public void Example_DetectMultivariateBatchAnomaly_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); AnomalyDetectorClient client = new AnomalyDetectorClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { dataSource = "http://localhost:3000", topContributorCount = 1234, @@ -1467,7 +1467,7 @@ public async Task Example_DetectMultivariateBatchAnomaly_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); AnomalyDetectorClient client = new AnomalyDetectorClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { dataSource = "http://localhost:3000", topContributorCount = 1234, @@ -1533,7 +1533,7 @@ public void Example_DetectMultivariateLastAnomaly_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); AnomalyDetectorClient client = new AnomalyDetectorClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { variables = new object[] { @@ -1566,7 +1566,7 @@ public async Task Example_DetectMultivariateLastAnomaly_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); AnomalyDetectorClient client = new AnomalyDetectorClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { variables = new object[] { @@ -1629,7 +1629,7 @@ public void Example_DetectMultivariateLastAnomaly_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); AnomalyDetectorClient client = new AnomalyDetectorClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { variables = new object[] { @@ -1675,7 +1675,7 @@ public async Task Example_DetectMultivariateLastAnomaly_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); AnomalyDetectorClient client = new AnomalyDetectorClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { variables = new object[] { diff --git a/samples/Azure.AI.DocumentTranslation/src/Generated/Docs/DocumentTranslationClient.xml b/samples/Azure.AI.DocumentTranslation/src/Generated/Docs/DocumentTranslationClient.xml index bca7481f1b6..b1e7033d4f9 100644 --- a/samples/Azure.AI.DocumentTranslation/src/Generated/Docs/DocumentTranslationClient.xml +++ b/samples/Azure.AI.DocumentTranslation/src/Generated/Docs/DocumentTranslationClient.xml @@ -644,7 +644,7 @@ This sample shows how to call StartTranslationAsync. AzureKeyCredential credential = new AzureKeyCredential(""); DocumentTranslationClient client = new DocumentTranslationClient("", credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { inputs = new object[] { @@ -672,7 +672,7 @@ This sample shows how to call StartTranslationAsync with all parameters and requ AzureKeyCredential credential = new AzureKeyCredential(""); DocumentTranslationClient client = new DocumentTranslationClient("", credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { inputs = new object[] { @@ -723,7 +723,7 @@ This sample shows how to call StartTranslation. AzureKeyCredential credential = new AzureKeyCredential(""); DocumentTranslationClient client = new DocumentTranslationClient("", credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { inputs = new object[] { @@ -751,7 +751,7 @@ This sample shows how to call StartTranslation with all parameters and request c AzureKeyCredential credential = new AzureKeyCredential(""); DocumentTranslationClient client = new DocumentTranslationClient("", credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { inputs = new object[] { diff --git a/samples/Azure.AI.DocumentTranslation/tests/Generated/Samples/Samples_DocumentTranslationClient.cs b/samples/Azure.AI.DocumentTranslation/tests/Generated/Samples/Samples_DocumentTranslationClient.cs index 64e937f733e..b6e290dfcc4 100644 --- a/samples/Azure.AI.DocumentTranslation/tests/Generated/Samples/Samples_DocumentTranslationClient.cs +++ b/samples/Azure.AI.DocumentTranslation/tests/Generated/Samples/Samples_DocumentTranslationClient.cs @@ -709,7 +709,7 @@ public void Example_StartTranslation_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); DocumentTranslationClient client = new DocumentTranslationClient("", credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { inputs = new object[] { @@ -740,7 +740,7 @@ public async Task Example_StartTranslation_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); DocumentTranslationClient client = new DocumentTranslationClient("", credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { inputs = new object[] { @@ -771,7 +771,7 @@ public void Example_StartTranslation_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); DocumentTranslationClient client = new DocumentTranslationClient("", credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { inputs = new object[] { @@ -822,7 +822,7 @@ public async Task Example_StartTranslation_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); DocumentTranslationClient client = new DocumentTranslationClient("", credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { inputs = new object[] { diff --git a/samples/Azure.Analytics.Purview.Account/src/Generated/Docs/PurviewAccountCollections.xml b/samples/Azure.Analytics.Purview.Account/src/Generated/Docs/PurviewAccountCollections.xml index f658c134736..dfedce8df50 100644 --- a/samples/Azure.Analytics.Purview.Account/src/Generated/Docs/PurviewAccountCollections.xml +++ b/samples/Azure.Analytics.Purview.Account/src/Generated/Docs/PurviewAccountCollections.xml @@ -81,7 +81,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); PurviewAccountCollections client = new PurviewAccountsClient(endpoint, credential).GetCollectionsClient(""); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.CreateOrUpdateCollectionAsync(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -93,7 +93,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); PurviewAccountCollections client = new PurviewAccountsClient(endpoint, credential).GetCollectionsClient(""); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { description = "", friendlyName = "", @@ -127,7 +127,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); PurviewAccountCollections client = new PurviewAccountsClient(endpoint, credential).GetCollectionsClient(""); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = client.CreateOrUpdateCollection(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -139,7 +139,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); PurviewAccountCollections client = new PurviewAccountsClient(endpoint, credential).GetCollectionsClient(""); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { description = "", friendlyName = "", diff --git a/samples/Azure.Analytics.Purview.Account/src/Generated/Docs/PurviewAccountResourceSetRules.xml b/samples/Azure.Analytics.Purview.Account/src/Generated/Docs/PurviewAccountResourceSetRules.xml index 6f5819f40ed..81203f97f1d 100644 --- a/samples/Azure.Analytics.Purview.Account/src/Generated/Docs/PurviewAccountResourceSetRules.xml +++ b/samples/Azure.Analytics.Purview.Account/src/Generated/Docs/PurviewAccountResourceSetRules.xml @@ -227,7 +227,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); PurviewAccountResourceSetRules client = new PurviewAccountsClient(endpoint, credential).GetResourceSetRulesClient(); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.CreateOrUpdateResourceSetRuleAsync(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -239,7 +239,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); PurviewAccountResourceSetRules client = new PurviewAccountsClient(endpoint, credential).GetResourceSetRulesClient(); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { advancedResourceSet = new { @@ -448,7 +448,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); PurviewAccountResourceSetRules client = new PurviewAccountsClient(endpoint, credential).GetResourceSetRulesClient(); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = client.CreateOrUpdateResourceSetRule(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -460,7 +460,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); PurviewAccountResourceSetRules client = new PurviewAccountsClient(endpoint, credential).GetResourceSetRulesClient(); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { advancedResourceSet = new { diff --git a/samples/Azure.Analytics.Purview.Account/src/Generated/Docs/PurviewAccountsClient.xml b/samples/Azure.Analytics.Purview.Account/src/Generated/Docs/PurviewAccountsClient.xml index a44f6d9b774..f35f975b2eb 100644 --- a/samples/Azure.Analytics.Purview.Account/src/Generated/Docs/PurviewAccountsClient.xml +++ b/samples/Azure.Analytics.Purview.Account/src/Generated/Docs/PurviewAccountsClient.xml @@ -133,7 +133,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); PurviewAccountsClient client = new PurviewAccountsClient(endpoint, credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.UpdateAccountPropertiesAsync(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -145,7 +145,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); PurviewAccountsClient client = new PurviewAccountsClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { friendlyName = "", }); @@ -200,7 +200,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); PurviewAccountsClient client = new PurviewAccountsClient(endpoint, credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = client.UpdateAccountProperties(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -212,7 +212,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); PurviewAccountsClient client = new PurviewAccountsClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { friendlyName = "", }); @@ -319,7 +319,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); PurviewAccountsClient client = new PurviewAccountsClient(endpoint, credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.RegenerateAccessKeyAsync(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -331,7 +331,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); PurviewAccountsClient client = new PurviewAccountsClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { keyType = "PrimaryAtlasKafkaKey", }); @@ -350,7 +350,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); PurviewAccountsClient client = new PurviewAccountsClient(endpoint, credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = client.RegenerateAccessKey(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -362,7 +362,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); PurviewAccountsClient client = new PurviewAccountsClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { keyType = "PrimaryAtlasKafkaKey", }); diff --git a/samples/Azure.Analytics.Purview.Account/tests/Generated/Samples/Samples_PurviewAccountCollections.cs b/samples/Azure.Analytics.Purview.Account/tests/Generated/Samples/Samples_PurviewAccountCollections.cs index 4e627b54c14..13e13a36805 100644 --- a/samples/Azure.Analytics.Purview.Account/tests/Generated/Samples/Samples_PurviewAccountCollections.cs +++ b/samples/Azure.Analytics.Purview.Account/tests/Generated/Samples/Samples_PurviewAccountCollections.cs @@ -104,7 +104,7 @@ public void Example_CreateOrUpdateCollection_ShortVersion() TokenCredential credential = new DefaultAzureCredential(); PurviewAccountCollections client = new PurviewAccountsClient(endpoint, credential).GetCollectionsClient(""); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.CreateOrUpdateCollection(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -119,7 +119,7 @@ public async Task Example_CreateOrUpdateCollection_ShortVersion_Async() TokenCredential credential = new DefaultAzureCredential(); PurviewAccountCollections client = new PurviewAccountsClient(endpoint, credential).GetCollectionsClient(""); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.CreateOrUpdateCollectionAsync(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -134,7 +134,7 @@ public void Example_CreateOrUpdateCollection_AllParameters() TokenCredential credential = new DefaultAzureCredential(); PurviewAccountCollections client = new PurviewAccountsClient(endpoint, credential).GetCollectionsClient(""); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { description = "", friendlyName = "", @@ -168,7 +168,7 @@ public async Task Example_CreateOrUpdateCollection_AllParameters_Async() TokenCredential credential = new DefaultAzureCredential(); PurviewAccountCollections client = new PurviewAccountsClient(endpoint, credential).GetCollectionsClient(""); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { description = "", friendlyName = "", diff --git a/samples/Azure.Analytics.Purview.Account/tests/Generated/Samples/Samples_PurviewAccountResourceSetRules.cs b/samples/Azure.Analytics.Purview.Account/tests/Generated/Samples/Samples_PurviewAccountResourceSetRules.cs index c1108121f4b..f55ec2776ef 100644 --- a/samples/Azure.Analytics.Purview.Account/tests/Generated/Samples/Samples_PurviewAccountResourceSetRules.cs +++ b/samples/Azure.Analytics.Purview.Account/tests/Generated/Samples/Samples_PurviewAccountResourceSetRules.cs @@ -250,7 +250,7 @@ public void Example_CreateOrUpdateResourceSetRule_ShortVersion() TokenCredential credential = new DefaultAzureCredential(); PurviewAccountResourceSetRules client = new PurviewAccountsClient(endpoint, credential).GetResourceSetRulesClient(); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.CreateOrUpdateResourceSetRule(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -265,7 +265,7 @@ public async Task Example_CreateOrUpdateResourceSetRule_ShortVersion_Async() TokenCredential credential = new DefaultAzureCredential(); PurviewAccountResourceSetRules client = new PurviewAccountsClient(endpoint, credential).GetResourceSetRulesClient(); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.CreateOrUpdateResourceSetRuleAsync(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -280,7 +280,7 @@ public void Example_CreateOrUpdateResourceSetRule_AllParameters() TokenCredential credential = new DefaultAzureCredential(); PurviewAccountResourceSetRules client = new PurviewAccountsClient(endpoint, credential).GetResourceSetRulesClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { advancedResourceSet = new { @@ -489,7 +489,7 @@ public async Task Example_CreateOrUpdateResourceSetRule_AllParameters_Async() TokenCredential credential = new DefaultAzureCredential(); PurviewAccountResourceSetRules client = new PurviewAccountsClient(endpoint, credential).GetResourceSetRulesClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { advancedResourceSet = new { diff --git a/samples/Azure.Analytics.Purview.Account/tests/Generated/Samples/Samples_PurviewAccountsClient.cs b/samples/Azure.Analytics.Purview.Account/tests/Generated/Samples/Samples_PurviewAccountsClient.cs index c14f05b80e7..1e021f648af 100644 --- a/samples/Azure.Analytics.Purview.Account/tests/Generated/Samples/Samples_PurviewAccountsClient.cs +++ b/samples/Azure.Analytics.Purview.Account/tests/Generated/Samples/Samples_PurviewAccountsClient.cs @@ -156,7 +156,7 @@ public void Example_UpdateAccountProperties_ShortVersion() TokenCredential credential = new DefaultAzureCredential(); PurviewAccountsClient client = new PurviewAccountsClient(endpoint, credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.UpdateAccountProperties(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -171,7 +171,7 @@ public async Task Example_UpdateAccountProperties_ShortVersion_Async() TokenCredential credential = new DefaultAzureCredential(); PurviewAccountsClient client = new PurviewAccountsClient(endpoint, credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.UpdateAccountPropertiesAsync(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -186,7 +186,7 @@ public void Example_UpdateAccountProperties_AllParameters() TokenCredential credential = new DefaultAzureCredential(); PurviewAccountsClient client = new PurviewAccountsClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { friendlyName = "", }); @@ -241,7 +241,7 @@ public async Task Example_UpdateAccountProperties_AllParameters_Async() TokenCredential credential = new DefaultAzureCredential(); PurviewAccountsClient client = new PurviewAccountsClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { friendlyName = "", }); @@ -354,7 +354,7 @@ public void Example_RegenerateAccessKey_ShortVersion() TokenCredential credential = new DefaultAzureCredential(); PurviewAccountsClient client = new PurviewAccountsClient(endpoint, credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.RegenerateAccessKey(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -369,7 +369,7 @@ public async Task Example_RegenerateAccessKey_ShortVersion_Async() TokenCredential credential = new DefaultAzureCredential(); PurviewAccountsClient client = new PurviewAccountsClient(endpoint, credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.RegenerateAccessKeyAsync(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -384,7 +384,7 @@ public void Example_RegenerateAccessKey_AllParameters() TokenCredential credential = new DefaultAzureCredential(); PurviewAccountsClient client = new PurviewAccountsClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { keyType = "PrimaryAtlasKafkaKey", }); @@ -403,7 +403,7 @@ public async Task Example_RegenerateAccessKey_AllParameters_Async() TokenCredential credential = new DefaultAzureCredential(); PurviewAccountsClient client = new PurviewAccountsClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { keyType = "PrimaryAtlasKafkaKey", }); diff --git a/src/AutoRest.CSharp/Common/Output/Expressions/Snippets.DeclarationStatements.cs b/src/AutoRest.CSharp/Common/Output/Expressions/Snippets.DeclarationStatements.cs index 2867bc19ed0..5f0a7748c79 100644 --- a/src/AutoRest.CSharp/Common/Output/Expressions/Snippets.DeclarationStatements.cs +++ b/src/AutoRest.CSharp/Common/Output/Expressions/Snippets.DeclarationStatements.cs @@ -51,6 +51,9 @@ public static DeclarationStatement Declare(string name, TypedValueExpression val public static DeclarationStatement Declare(VariableReference variable, ValueExpression value) => new DeclareVariableStatement(variable.Type, variable.Declaration, value); + public static DeclarationStatement UsingDeclare(VariableReference variable, ValueExpression value) + => new UsingDeclareVariableStatement(variable.Type, variable.Declaration, value); + public static DeclarationStatement UsingVar(string name, HttpMessageExpression value, out HttpMessageExpression variable) => UsingVar(name, value, d => new HttpMessageExpression(d), out variable); diff --git a/src/AutoRest.CSharp/LowLevel/Output/ConvenienceMethod.cs b/src/AutoRest.CSharp/LowLevel/Output/ConvenienceMethod.cs index a754c8c6d12..cec030906c1 100644 --- a/src/AutoRest.CSharp/LowLevel/Output/ConvenienceMethod.cs +++ b/src/AutoRest.CSharp/LowLevel/Output/ConvenienceMethod.cs @@ -21,17 +21,20 @@ internal record ConvenienceMethod(MethodSignature Signature, IReadOnlyList ParameterValues, Action Converter) GetParameterValues(CodeWriterDeclaration contextVariable) { - var (parameterValues, spreadVariable) = PrepareConvenienceMethodParameters(contextVariable); + var (parameterValues, contentInfo, spreadVariable) = PrepareConvenienceMethodParameters(contextVariable); - var converter = EnsureConvenienceBodyConverter(spreadVariable, contextVariable); + var converter = EnsureConvenienceBodyConverter(spreadVariable, contextVariable, contentInfo); return (parameterValues, converter); } - private (IReadOnlyList ParameterValues, CodeWriterDeclaration? SpreadVariable) PrepareConvenienceMethodParameters(CodeWriterDeclaration contextVariable) + private record RequestContentParameterInfo(CodeWriterDeclaration ContentVariable, FormattableString ContentValue); + + private (IReadOnlyList ParameterValues, RequestContentParameterInfo? ContentInfo, CodeWriterDeclaration? SpreadVariable) PrepareConvenienceMethodParameters(CodeWriterDeclaration contextVariable) { CodeWriterDeclaration? spreadVariable = null; var parameters = new List(); + RequestContentParameterInfo? contentInfo = null; foreach (var converter in ProtocolToConvenienceParameterConverters) { var protocolParameter = converter.Protocol; @@ -43,7 +46,18 @@ internal record ConvenienceMethod(MethodSignature Signature, IReadOnlyList EnsureConvenienceBodyConverter(CodeWriterDeclaration? spreadVariable, CodeWriterDeclaration contextVariable) + private Action EnsureConvenienceBodyConverter(CodeWriterDeclaration? spreadVariable, CodeWriterDeclaration contextVariable, RequestContentParameterInfo? contentInfo) { var convenienceSpread = ProtocolToConvenienceParameterConverters.Select(c => c.ConvenienceSpread).WhereNotNull().SingleOrDefault(); if (spreadVariable == null || convenienceSpread == null) - return writer => WriteCancellationTokenToRequestContext(writer, contextVariable); + return writer => + { + WriteCancellationTokenToRequestContext(writer, contextVariable); + if (contentInfo != null) + { + WriteBodyToRequestContent(writer, contentInfo.ContentVariable, contentInfo.ContentValue); + } + }; // we need to get all the property initializers therefore here we use serialization constructor var serializationCtor = convenienceSpread.BackingModel.SerializationConstructor; @@ -91,6 +112,11 @@ private static void WriteCancellationTokenToRequestContext(CodeWriter writer, Co writer.Line($"{typeof(RequestContext)} {contextVariable:D} = FromCancellationToken({KnownParameters.CancellationTokenParameter.Name});"); } + private static void WriteBodyToRequestContent(CodeWriter writer, CodeWriterDeclaration contentVariable, FormattableString requestContentValue) + { + writer.Line($"using {typeof(RequestContent)} {contentVariable:D} = {requestContentValue};"); + } + public bool IsDeprecatedForExamples() { if (Deprecated is not null) diff --git a/src/AutoRest.CSharp/LowLevel/Output/Samples/DpgOperationSample.cs b/src/AutoRest.CSharp/LowLevel/Output/Samples/DpgOperationSample.cs index faac491557b..ea8d2d47295 100644 --- a/src/AutoRest.CSharp/LowLevel/Output/Samples/DpgOperationSample.cs +++ b/src/AutoRest.CSharp/LowLevel/Output/Samples/DpgOperationSample.cs @@ -106,7 +106,7 @@ public IEnumerable GetValueExpressionsForParameters(IEnumerable { // when it is not inline parameter, we add the declaration of the parameter into the statements, and returns the parameter name reference var parameterReference = new VariableReference(parameter.Type, parameter.Name); - var declaration = Snippets.Declare(parameterReference, parameterExpression); + var declaration = NeedsDispose(parameter) ? UsingDeclare(parameterReference, parameterExpression) : Declare(parameterReference, parameterExpression); variableDeclarationStatements.Add(declaration); yield return parameter.IsOptionalInSignature ? new PositionalParameterReference(parameter.Name, parameterReference) : parameterReference; // returns the parameter name reference } @@ -292,6 +292,14 @@ public InputExampleValue GetEndpointValue(string parameterName) return InputExampleValue.Value(InputPrimitiveType.String, $"<{parameterName}>"); } + private bool NeedsDispose(Parameter parameter) + { + if (IsSameParameter(parameter, KnownParameters.RequestContent) || IsSameParameter(parameter, KnownParameters.RequestContentNullable)) + return true; + + return false; + } + private bool IsInlineParameter(Parameter parameter) { if (IsSameParameter(parameter, KnownParameters.RequestContent) || IsSameParameter(parameter, KnownParameters.RequestContentNullable)) diff --git a/test/CadlRanchProjects/azure/client-generator-core/usage/src/Generated/Docs/UsageClient.xml b/test/CadlRanchProjects/azure/client-generator-core/usage/src/Generated/Docs/UsageClient.xml index 5f218a77a29..bf974b25fd5 100644 --- a/test/CadlRanchProjects/azure/client-generator-core/usage/src/Generated/Docs/UsageClient.xml +++ b/test/CadlRanchProjects/azure/client-generator-core/usage/src/Generated/Docs/UsageClient.xml @@ -41,7 +41,7 @@ This sample shows how to call InputToInputOutputAsync. ", }); @@ -53,7 +53,7 @@ This sample shows how to call InputToInputOutputAsync with all request content. ", }); @@ -68,7 +68,7 @@ This sample shows how to call InputToInputOutput. ", }); @@ -80,7 +80,7 @@ This sample shows how to call InputToInputOutput with all request content. ", }); diff --git a/test/CadlRanchProjects/azure/client-generator-core/usage/src/Generated/UsageClient.cs b/test/CadlRanchProjects/azure/client-generator-core/usage/src/Generated/UsageClient.cs index 240f95990ca..4cb0d99f4f8 100644 --- a/test/CadlRanchProjects/azure/client-generator-core/usage/src/Generated/UsageClient.cs +++ b/test/CadlRanchProjects/azure/client-generator-core/usage/src/Generated/UsageClient.cs @@ -66,7 +66,8 @@ public virtual async Task InputToInputOutputAsync(InputModel body, Can Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await InputToInputOutputAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await InputToInputOutputAsync(content, context).ConfigureAwait(false); return response; } @@ -87,7 +88,8 @@ public virtual Response InputToInputOutput(InputModel body, CancellationToken ca Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = InputToInputOutput(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = InputToInputOutput(content, context); return response; } diff --git a/test/CadlRanchProjects/azure/client-generator-core/usage/tests/Generated/Samples/Samples_UsageClient.cs b/test/CadlRanchProjects/azure/client-generator-core/usage/tests/Generated/Samples/Samples_UsageClient.cs index b74de7ddb28..663915b3c09 100644 --- a/test/CadlRanchProjects/azure/client-generator-core/usage/tests/Generated/Samples/Samples_UsageClient.cs +++ b/test/CadlRanchProjects/azure/client-generator-core/usage/tests/Generated/Samples/Samples_UsageClient.cs @@ -25,7 +25,7 @@ public void Example_InputToInputOutput_ShortVersion() { UsageClient client = new UsageClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", }); @@ -40,7 +40,7 @@ public async Task Example_InputToInputOutput_ShortVersion_Async() { UsageClient client = new UsageClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", }); @@ -75,7 +75,7 @@ public void Example_InputToInputOutput_AllParameters() { UsageClient client = new UsageClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", }); @@ -90,7 +90,7 @@ public async Task Example_InputToInputOutput_AllParameters_Async() { UsageClient client = new UsageClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", }); diff --git a/test/CadlRanchProjects/azure/core/basic/src/Generated/BasicClient.cs b/test/CadlRanchProjects/azure/core/basic/src/Generated/BasicClient.cs index a7eacfb944c..88aa5ca499e 100644 --- a/test/CadlRanchProjects/azure/core/basic/src/Generated/BasicClient.cs +++ b/test/CadlRanchProjects/azure/core/basic/src/Generated/BasicClient.cs @@ -133,7 +133,8 @@ public virtual async Task> CreateOrReplaceAsync(int id, User reso Argument.AssertNotNull(resource, nameof(resource)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await CreateOrReplaceAsync(id, resource.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = resource.ToRequestContent(); + Response response = await CreateOrReplaceAsync(id, content, context).ConfigureAwait(false); return Response.FromValue(User.FromResponse(response), response); } @@ -149,7 +150,8 @@ public virtual Response CreateOrReplace(int id, User resource, Cancellatio Argument.AssertNotNull(resource, nameof(resource)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = CreateOrReplace(id, resource.ToRequestContent(), context); + using RequestContent content = resource.ToRequestContent(); + Response response = CreateOrReplace(id, content, context); return Response.FromValue(User.FromResponse(response), response); } diff --git a/test/CadlRanchProjects/azure/core/basic/src/Generated/Docs/BasicClient.xml b/test/CadlRanchProjects/azure/core/basic/src/Generated/Docs/BasicClient.xml index b04893b53a7..a0d140f3626 100644 --- a/test/CadlRanchProjects/azure/core/basic/src/Generated/Docs/BasicClient.xml +++ b/test/CadlRanchProjects/azure/core/basic/src/Generated/Docs/BasicClient.xml @@ -7,7 +7,7 @@ This sample shows how to call CreateOrUpdateAsync and parse the result. ", }); @@ -22,7 +22,7 @@ This sample shows how to call CreateOrUpdateAsync with all parameters and reques ", orders = new object[] @@ -51,7 +51,7 @@ This sample shows how to call CreateOrUpdate and parse the result. ", }); @@ -66,7 +66,7 @@ This sample shows how to call CreateOrUpdate with all parameters and request con ", orders = new object[] @@ -135,7 +135,7 @@ This sample shows how to call CreateOrReplaceAsync and parse the result. ", }); @@ -150,7 +150,7 @@ This sample shows how to call CreateOrReplaceAsync with all parameters and reque ", orders = new object[] @@ -179,7 +179,7 @@ This sample shows how to call CreateOrReplace and parse the result. ", }); @@ -194,7 +194,7 @@ This sample shows how to call CreateOrReplace with all parameters and request co ", orders = new object[] diff --git a/test/CadlRanchProjects/azure/core/basic/tests/Generated/Samples/Samples_BasicClient.cs b/test/CadlRanchProjects/azure/core/basic/tests/Generated/Samples/Samples_BasicClient.cs index cafac1a4659..ec7cac3b224 100644 --- a/test/CadlRanchProjects/azure/core/basic/tests/Generated/Samples/Samples_BasicClient.cs +++ b/test/CadlRanchProjects/azure/core/basic/tests/Generated/Samples/Samples_BasicClient.cs @@ -25,7 +25,7 @@ public void Example_CreateOrUpdate_ShortVersion() { BasicClient client = new BasicClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", }); @@ -43,7 +43,7 @@ public async Task Example_CreateOrUpdate_ShortVersion_Async() { BasicClient client = new BasicClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", }); @@ -61,7 +61,7 @@ public void Example_CreateOrUpdate_AllParameters() { BasicClient client = new BasicClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", orders = new object[] @@ -90,7 +90,7 @@ public async Task Example_CreateOrUpdate_AllParameters_Async() { BasicClient client = new BasicClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", orders = new object[] @@ -119,7 +119,7 @@ public void Example_CreateOrReplace_ShortVersion() { BasicClient client = new BasicClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", }); @@ -137,7 +137,7 @@ public async Task Example_CreateOrReplace_ShortVersion_Async() { BasicClient client = new BasicClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", }); @@ -175,7 +175,7 @@ public void Example_CreateOrReplace_AllParameters() { BasicClient client = new BasicClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", orders = new object[] @@ -204,7 +204,7 @@ public async Task Example_CreateOrReplace_AllParameters_Async() { BasicClient client = new BasicClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", orders = new object[] diff --git a/test/CadlRanchProjects/azure/core/traits/src/Generated/Docs/TraitsClient.xml b/test/CadlRanchProjects/azure/core/traits/src/Generated/Docs/TraitsClient.xml index 08d2d236f55..487b299c10d 100644 --- a/test/CadlRanchProjects/azure/core/traits/src/Generated/Docs/TraitsClient.xml +++ b/test/CadlRanchProjects/azure/core/traits/src/Generated/Docs/TraitsClient.xml @@ -115,7 +115,7 @@ This sample shows how to call RepeatableActionAsync and parse the result. ", }); @@ -128,7 +128,7 @@ This sample shows how to call RepeatableActionAsync with all parameters and requ ", }); @@ -144,7 +144,7 @@ This sample shows how to call RepeatableAction and parse the result. ", }); @@ -157,7 +157,7 @@ This sample shows how to call RepeatableAction with all parameters and request c ", }); diff --git a/test/CadlRanchProjects/azure/core/traits/src/Generated/TraitsClient.cs b/test/CadlRanchProjects/azure/core/traits/src/Generated/TraitsClient.cs index cda6d45109c..0750730c6e3 100644 --- a/test/CadlRanchProjects/azure/core/traits/src/Generated/TraitsClient.cs +++ b/test/CadlRanchProjects/azure/core/traits/src/Generated/TraitsClient.cs @@ -174,7 +174,8 @@ public virtual async Task> RepeatableActionAsync(in Argument.AssertNotNull(userActionParam, nameof(userActionParam)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await RepeatableActionAsync(id, userActionParam.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = userActionParam.ToRequestContent(); + Response response = await RepeatableActionAsync(id, content, context).ConfigureAwait(false); return Response.FromValue(UserActionResponse.FromResponse(response), response); } @@ -189,7 +190,8 @@ public virtual Response RepeatableAction(int id, UserActionP Argument.AssertNotNull(userActionParam, nameof(userActionParam)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = RepeatableAction(id, userActionParam.ToRequestContent(), context); + using RequestContent content = userActionParam.ToRequestContent(); + Response response = RepeatableAction(id, content, context); return Response.FromValue(UserActionResponse.FromResponse(response), response); } diff --git a/test/CadlRanchProjects/azure/core/traits/tests/Generated/Samples/Samples_TraitsClient.cs b/test/CadlRanchProjects/azure/core/traits/tests/Generated/Samples/Samples_TraitsClient.cs index f7ac2b8dca0..00a5572b47b 100644 --- a/test/CadlRanchProjects/azure/core/traits/tests/Generated/Samples/Samples_TraitsClient.cs +++ b/test/CadlRanchProjects/azure/core/traits/tests/Generated/Samples/Samples_TraitsClient.cs @@ -111,7 +111,7 @@ public void Example_RepeatableAction_ShortVersion() { TraitsClient client = new TraitsClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { userActionValue = "", }); @@ -127,7 +127,7 @@ public async Task Example_RepeatableAction_ShortVersion_Async() { TraitsClient client = new TraitsClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { userActionValue = "", }); @@ -163,7 +163,7 @@ public void Example_RepeatableAction_AllParameters() { TraitsClient client = new TraitsClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { userActionValue = "", }); @@ -179,7 +179,7 @@ public async Task Example_RepeatableAction_AllParameters_Async() { TraitsClient client = new TraitsClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { userActionValue = "", }); diff --git a/test/CadlRanchProjects/encode/bytes/src/Generated/Docs/Property.xml b/test/CadlRanchProjects/encode/bytes/src/Generated/Docs/Property.xml index 693074d3b1a..0851a43c82a 100644 --- a/test/CadlRanchProjects/encode/bytes/src/Generated/Docs/Property.xml +++ b/test/CadlRanchProjects/encode/bytes/src/Generated/Docs/Property.xml @@ -41,7 +41,7 @@ This sample shows how to call DefaultAsync and parse the result. > DefaultAsync(DefaultBy Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await DefaultAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await DefaultAsync(content, context).ConfigureAwait(false); return Response.FromValue(DefaultBytesProperty.FromResponse(response), response); } @@ -69,7 +70,8 @@ public virtual Response Default(DefaultBytesProperty body, Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Default(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = Default(content, context); return Response.FromValue(DefaultBytesProperty.FromResponse(response), response); } @@ -160,7 +162,8 @@ public virtual async Task> Base64Async(Base64Bytes Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await Base64Async(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await Base64Async(content, context).ConfigureAwait(false); return Response.FromValue(Base64BytesProperty.FromResponse(response), response); } @@ -173,7 +176,8 @@ public virtual Response Base64(Base64BytesProperty body, Ca Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Base64(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = Base64(content, context); return Response.FromValue(Base64BytesProperty.FromResponse(response), response); } @@ -264,7 +268,8 @@ public virtual async Task> Base64urlAsync(Base6 Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await Base64urlAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await Base64urlAsync(content, context).ConfigureAwait(false); return Response.FromValue(Base64urlBytesProperty.FromResponse(response), response); } @@ -277,7 +282,8 @@ public virtual Response Base64url(Base64urlBytesProperty Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Base64url(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = Base64url(content, context); return Response.FromValue(Base64urlBytesProperty.FromResponse(response), response); } @@ -368,7 +374,8 @@ public virtual async Task> Base64urlArrayA Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await Base64urlArrayAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await Base64urlArrayAsync(content, context).ConfigureAwait(false); return Response.FromValue(Base64urlArrayBytesProperty.FromResponse(response), response); } @@ -381,7 +388,8 @@ public virtual Response Base64urlArray(Base64urlArr Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Base64urlArray(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = Base64urlArray(content, context); return Response.FromValue(Base64urlArrayBytesProperty.FromResponse(response), response); } diff --git a/test/CadlRanchProjects/encode/bytes/src/Generated/RequestBody.cs b/test/CadlRanchProjects/encode/bytes/src/Generated/RequestBody.cs index ddae4803373..7da4fa8f4ef 100644 --- a/test/CadlRanchProjects/encode/bytes/src/Generated/RequestBody.cs +++ b/test/CadlRanchProjects/encode/bytes/src/Generated/RequestBody.cs @@ -55,7 +55,8 @@ public virtual async Task DefaultAsync(BinaryData value, CancellationT Argument.AssertNotNull(value, nameof(value)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await DefaultAsync(RequestContentHelper.FromObject(value), context).ConfigureAwait(false); + using RequestContent content = RequestContentHelper.FromObject(value); + Response response = await DefaultAsync(content, context).ConfigureAwait(false); return response; } @@ -68,7 +69,8 @@ public virtual Response Default(BinaryData value, CancellationToken cancellation Argument.AssertNotNull(value, nameof(value)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Default(RequestContentHelper.FromObject(value), context); + using RequestContent content = RequestContentHelper.FromObject(value); + Response response = Default(content, context); return response; } @@ -159,7 +161,8 @@ public virtual async Task OctetStreamAsync(BinaryData value, Cancellat Argument.AssertNotNull(value, nameof(value)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await OctetStreamAsync(RequestContentHelper.FromObject(value), context).ConfigureAwait(false); + using RequestContent content = RequestContentHelper.FromObject(value); + Response response = await OctetStreamAsync(content, context).ConfigureAwait(false); return response; } @@ -172,7 +175,8 @@ public virtual Response OctetStream(BinaryData value, CancellationToken cancella Argument.AssertNotNull(value, nameof(value)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = OctetStream(RequestContentHelper.FromObject(value), context); + using RequestContent content = RequestContentHelper.FromObject(value); + Response response = OctetStream(content, context); return response; } @@ -263,7 +267,8 @@ public virtual async Task CustomContentTypeAsync(BinaryData value, Can Argument.AssertNotNull(value, nameof(value)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await CustomContentTypeAsync(RequestContentHelper.FromObject(value), context).ConfigureAwait(false); + using RequestContent content = RequestContentHelper.FromObject(value); + Response response = await CustomContentTypeAsync(content, context).ConfigureAwait(false); return response; } @@ -276,7 +281,8 @@ public virtual Response CustomContentType(BinaryData value, CancellationToken ca Argument.AssertNotNull(value, nameof(value)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = CustomContentType(RequestContentHelper.FromObject(value), context); + using RequestContent content = RequestContentHelper.FromObject(value); + Response response = CustomContentType(content, context); return response; } @@ -367,7 +373,8 @@ public virtual async Task Base64Async(BinaryData value, CancellationTo Argument.AssertNotNull(value, nameof(value)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await Base64Async(RequestContentHelper.FromObject(value), context).ConfigureAwait(false); + using RequestContent content = RequestContentHelper.FromObject(value); + Response response = await Base64Async(content, context).ConfigureAwait(false); return response; } @@ -380,7 +387,8 @@ public virtual Response Base64(BinaryData value, CancellationToken cancellationT Argument.AssertNotNull(value, nameof(value)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Base64(RequestContentHelper.FromObject(value), context); + using RequestContent content = RequestContentHelper.FromObject(value); + Response response = Base64(content, context); return response; } @@ -471,7 +479,8 @@ public virtual async Task Base64urlAsync(BinaryData value, Cancellatio Argument.AssertNotNull(value, nameof(value)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await Base64urlAsync(RequestContentHelper.FromObject(value), context).ConfigureAwait(false); + using RequestContent content = RequestContentHelper.FromObject(value); + Response response = await Base64urlAsync(content, context).ConfigureAwait(false); return response; } @@ -484,7 +493,8 @@ public virtual Response Base64url(BinaryData value, CancellationToken cancellati Argument.AssertNotNull(value, nameof(value)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Base64url(RequestContentHelper.FromObject(value), context); + using RequestContent content = RequestContentHelper.FromObject(value); + Response response = Base64url(content, context); return response; } diff --git a/test/CadlRanchProjects/encode/bytes/tests/Generated/Samples/Samples_Property.cs b/test/CadlRanchProjects/encode/bytes/tests/Generated/Samples/Samples_Property.cs index b2df04454ba..1424b4ec6b9 100644 --- a/test/CadlRanchProjects/encode/bytes/tests/Generated/Samples/Samples_Property.cs +++ b/test/CadlRanchProjects/encode/bytes/tests/Generated/Samples/Samples_Property.cs @@ -25,7 +25,7 @@ public void Example_Default_ShortVersion() { Property client = new BytesClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = new object(), }); @@ -41,7 +41,7 @@ public async Task Example_Default_ShortVersion_Async() { Property client = new BytesClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = new object(), }); @@ -77,7 +77,7 @@ public void Example_Default_AllParameters() { Property client = new BytesClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = new object(), }); @@ -93,7 +93,7 @@ public async Task Example_Default_AllParameters_Async() { Property client = new BytesClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = new object(), }); @@ -129,7 +129,7 @@ public void Example_Base64_ShortVersion() { Property client = new BytesClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = new object(), }); @@ -145,7 +145,7 @@ public async Task Example_Base64_ShortVersion_Async() { Property client = new BytesClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = new object(), }); @@ -181,7 +181,7 @@ public void Example_Base64_AllParameters() { Property client = new BytesClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = new object(), }); @@ -197,7 +197,7 @@ public async Task Example_Base64_AllParameters_Async() { Property client = new BytesClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = new object(), }); @@ -233,7 +233,7 @@ public void Example_Base64url_ShortVersion() { Property client = new BytesClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = new object(), }); @@ -249,7 +249,7 @@ public async Task Example_Base64url_ShortVersion_Async() { Property client = new BytesClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = new object(), }); @@ -285,7 +285,7 @@ public void Example_Base64url_AllParameters() { Property client = new BytesClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = new object(), }); @@ -301,7 +301,7 @@ public async Task Example_Base64url_AllParameters_Async() { Property client = new BytesClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = new object(), }); @@ -337,7 +337,7 @@ public void Example_Base64urlArray_ShortVersion() { Property client = new BytesClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = new object[] { @@ -356,7 +356,7 @@ public async Task Example_Base64urlArray_ShortVersion_Async() { Property client = new BytesClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = new object[] { @@ -401,7 +401,7 @@ public void Example_Base64urlArray_AllParameters() { Property client = new BytesClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = new object[] { @@ -420,7 +420,7 @@ public async Task Example_Base64urlArray_AllParameters_Async() { Property client = new BytesClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = new object[] { diff --git a/test/CadlRanchProjects/encode/bytes/tests/Generated/Samples/Samples_RequestBody.cs b/test/CadlRanchProjects/encode/bytes/tests/Generated/Samples/Samples_RequestBody.cs index d0148de54af..de23bd351fb 100644 --- a/test/CadlRanchProjects/encode/bytes/tests/Generated/Samples/Samples_RequestBody.cs +++ b/test/CadlRanchProjects/encode/bytes/tests/Generated/Samples/Samples_RequestBody.cs @@ -23,7 +23,7 @@ public void Example_Default_ShortVersion() { RequestBody client = new BytesClient().GetRequestBodyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.Default(content); Console.WriteLine(response.Status); @@ -35,7 +35,7 @@ public async Task Example_Default_ShortVersion_Async() { RequestBody client = new BytesClient().GetRequestBodyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.DefaultAsync(content); Console.WriteLine(response.Status); @@ -65,7 +65,7 @@ public void Example_Default_AllParameters() { RequestBody client = new BytesClient().GetRequestBodyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.Default(content); Console.WriteLine(response.Status); @@ -77,7 +77,7 @@ public async Task Example_Default_AllParameters_Async() { RequestBody client = new BytesClient().GetRequestBodyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.DefaultAsync(content); Console.WriteLine(response.Status); @@ -107,7 +107,7 @@ public void Example_OctetStream_ShortVersion() { RequestBody client = new BytesClient().GetRequestBodyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.OctetStream(content); Console.WriteLine(response.Status); @@ -119,7 +119,7 @@ public async Task Example_OctetStream_ShortVersion_Async() { RequestBody client = new BytesClient().GetRequestBodyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.OctetStreamAsync(content); Console.WriteLine(response.Status); @@ -149,7 +149,7 @@ public void Example_OctetStream_AllParameters() { RequestBody client = new BytesClient().GetRequestBodyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.OctetStream(content); Console.WriteLine(response.Status); @@ -161,7 +161,7 @@ public async Task Example_OctetStream_AllParameters_Async() { RequestBody client = new BytesClient().GetRequestBodyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.OctetStreamAsync(content); Console.WriteLine(response.Status); @@ -191,7 +191,7 @@ public void Example_CustomContentType_ShortVersion() { RequestBody client = new BytesClient().GetRequestBodyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.CustomContentType(content); Console.WriteLine(response.Status); @@ -203,7 +203,7 @@ public async Task Example_CustomContentType_ShortVersion_Async() { RequestBody client = new BytesClient().GetRequestBodyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.CustomContentTypeAsync(content); Console.WriteLine(response.Status); @@ -233,7 +233,7 @@ public void Example_CustomContentType_AllParameters() { RequestBody client = new BytesClient().GetRequestBodyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.CustomContentType(content); Console.WriteLine(response.Status); @@ -245,7 +245,7 @@ public async Task Example_CustomContentType_AllParameters_Async() { RequestBody client = new BytesClient().GetRequestBodyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.CustomContentTypeAsync(content); Console.WriteLine(response.Status); @@ -275,7 +275,7 @@ public void Example_Base64_ShortVersion() { RequestBody client = new BytesClient().GetRequestBodyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.Base64(content); Console.WriteLine(response.Status); @@ -287,7 +287,7 @@ public async Task Example_Base64_ShortVersion_Async() { RequestBody client = new BytesClient().GetRequestBodyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.Base64Async(content); Console.WriteLine(response.Status); @@ -317,7 +317,7 @@ public void Example_Base64_AllParameters() { RequestBody client = new BytesClient().GetRequestBodyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.Base64(content); Console.WriteLine(response.Status); @@ -329,7 +329,7 @@ public async Task Example_Base64_AllParameters_Async() { RequestBody client = new BytesClient().GetRequestBodyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.Base64Async(content); Console.WriteLine(response.Status); @@ -359,7 +359,7 @@ public void Example_Base64url_ShortVersion() { RequestBody client = new BytesClient().GetRequestBodyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.Base64url(content); Console.WriteLine(response.Status); @@ -371,7 +371,7 @@ public async Task Example_Base64url_ShortVersion_Async() { RequestBody client = new BytesClient().GetRequestBodyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.Base64urlAsync(content); Console.WriteLine(response.Status); @@ -401,7 +401,7 @@ public void Example_Base64url_AllParameters() { RequestBody client = new BytesClient().GetRequestBodyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.Base64url(content); Console.WriteLine(response.Status); @@ -413,7 +413,7 @@ public async Task Example_Base64url_AllParameters_Async() { RequestBody client = new BytesClient().GetRequestBodyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.Base64urlAsync(content); Console.WriteLine(response.Status); diff --git a/test/CadlRanchProjects/encode/datetime/src/Generated/Docs/Property.xml b/test/CadlRanchProjects/encode/datetime/src/Generated/Docs/Property.xml index 83732feed7b..a945c043b87 100644 --- a/test/CadlRanchProjects/encode/datetime/src/Generated/Docs/Property.xml +++ b/test/CadlRanchProjects/encode/datetime/src/Generated/Docs/Property.xml @@ -41,7 +41,7 @@ This sample shows how to call DefaultAsync and parse the result. > DefaultAsync(Defaul Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await DefaultAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await DefaultAsync(content, context).ConfigureAwait(false); return Response.FromValue(DefaultDatetimeProperty.FromResponse(response), response); } @@ -69,7 +70,8 @@ public virtual Response Default(DefaultDatetimeProperty Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Default(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = Default(content, context); return Response.FromValue(DefaultDatetimeProperty.FromResponse(response), response); } @@ -160,7 +162,8 @@ public virtual async Task> Rfc3339Async(Rfc333 Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await Rfc3339Async(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await Rfc3339Async(content, context).ConfigureAwait(false); return Response.FromValue(Rfc3339DatetimeProperty.FromResponse(response), response); } @@ -173,7 +176,8 @@ public virtual Response Rfc3339(Rfc3339DatetimeProperty Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Rfc3339(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = Rfc3339(content, context); return Response.FromValue(Rfc3339DatetimeProperty.FromResponse(response), response); } @@ -264,7 +268,8 @@ public virtual async Task> Rfc7231Async(Rfc723 Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await Rfc7231Async(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await Rfc7231Async(content, context).ConfigureAwait(false); return Response.FromValue(Rfc7231DatetimeProperty.FromResponse(response), response); } @@ -277,7 +282,8 @@ public virtual Response Rfc7231(Rfc7231DatetimeProperty Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Rfc7231(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = Rfc7231(content, context); return Response.FromValue(Rfc7231DatetimeProperty.FromResponse(response), response); } @@ -368,7 +374,8 @@ public virtual async Task> UnixTimestamp Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await UnixTimestampAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await UnixTimestampAsync(content, context).ConfigureAwait(false); return Response.FromValue(UnixTimestampDatetimeProperty.FromResponse(response), response); } @@ -381,7 +388,8 @@ public virtual Response UnixTimestamp(UnixTimesta Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = UnixTimestamp(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = UnixTimestamp(content, context); return Response.FromValue(UnixTimestampDatetimeProperty.FromResponse(response), response); } @@ -472,7 +480,8 @@ public virtual async Task> UnixTime Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await UnixTimestampArrayAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await UnixTimestampArrayAsync(content, context).ConfigureAwait(false); return Response.FromValue(UnixTimestampArrayDatetimeProperty.FromResponse(response), response); } @@ -485,7 +494,8 @@ public virtual Response UnixTimestampArray(U Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = UnixTimestampArray(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = UnixTimestampArray(content, context); return Response.FromValue(UnixTimestampArrayDatetimeProperty.FromResponse(response), response); } diff --git a/test/CadlRanchProjects/encode/datetime/tests/Generated/Samples/Samples_Property.cs b/test/CadlRanchProjects/encode/datetime/tests/Generated/Samples/Samples_Property.cs index 2932826ef63..2901933f3d3 100644 --- a/test/CadlRanchProjects/encode/datetime/tests/Generated/Samples/Samples_Property.cs +++ b/test/CadlRanchProjects/encode/datetime/tests/Generated/Samples/Samples_Property.cs @@ -25,7 +25,7 @@ public void Example_Default_ShortVersion() { Property client = new DatetimeClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = "2022-05-10T14:57:31.2311892-04:00", }); @@ -41,7 +41,7 @@ public async Task Example_Default_ShortVersion_Async() { Property client = new DatetimeClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = "2022-05-10T14:57:31.2311892-04:00", }); @@ -77,7 +77,7 @@ public void Example_Default_AllParameters() { Property client = new DatetimeClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = "2022-05-10T14:57:31.2311892-04:00", }); @@ -93,7 +93,7 @@ public async Task Example_Default_AllParameters_Async() { Property client = new DatetimeClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = "2022-05-10T14:57:31.2311892-04:00", }); @@ -129,7 +129,7 @@ public void Example_Rfc3339_ShortVersion() { Property client = new DatetimeClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = "2022-05-10T18:57:31.2311892Z", }); @@ -145,7 +145,7 @@ public async Task Example_Rfc3339_ShortVersion_Async() { Property client = new DatetimeClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = "2022-05-10T18:57:31.2311892Z", }); @@ -181,7 +181,7 @@ public void Example_Rfc3339_AllParameters() { Property client = new DatetimeClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = "2022-05-10T18:57:31.2311892Z", }); @@ -197,7 +197,7 @@ public async Task Example_Rfc3339_AllParameters_Async() { Property client = new DatetimeClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = "2022-05-10T18:57:31.2311892Z", }); @@ -233,7 +233,7 @@ public void Example_Rfc7231_ShortVersion() { Property client = new DatetimeClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = "Tue, 10 May 2022 18:57:31 GMT", }); @@ -249,7 +249,7 @@ public async Task Example_Rfc7231_ShortVersion_Async() { Property client = new DatetimeClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = "Tue, 10 May 2022 18:57:31 GMT", }); @@ -285,7 +285,7 @@ public void Example_Rfc7231_AllParameters() { Property client = new DatetimeClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = "Tue, 10 May 2022 18:57:31 GMT", }); @@ -301,7 +301,7 @@ public async Task Example_Rfc7231_AllParameters_Async() { Property client = new DatetimeClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = "Tue, 10 May 2022 18:57:31 GMT", }); @@ -337,7 +337,7 @@ public void Example_UnixTimestamp_ShortVersion() { Property client = new DatetimeClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = 1652209051, }); @@ -353,7 +353,7 @@ public async Task Example_UnixTimestamp_ShortVersion_Async() { Property client = new DatetimeClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = 1652209051, }); @@ -389,7 +389,7 @@ public void Example_UnixTimestamp_AllParameters() { Property client = new DatetimeClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = 1652209051, }); @@ -405,7 +405,7 @@ public async Task Example_UnixTimestamp_AllParameters_Async() { Property client = new DatetimeClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = 1652209051, }); @@ -441,7 +441,7 @@ public void Example_UnixTimestampArray_ShortVersion() { Property client = new DatetimeClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = new object[] { @@ -460,7 +460,7 @@ public async Task Example_UnixTimestampArray_ShortVersion_Async() { Property client = new DatetimeClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = new object[] { @@ -499,7 +499,7 @@ public void Example_UnixTimestampArray_AllParameters() { Property client = new DatetimeClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = new object[] { @@ -518,7 +518,7 @@ public async Task Example_UnixTimestampArray_AllParameters_Async() { Property client = new DatetimeClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = new object[] { diff --git a/test/CadlRanchProjects/encode/duration/src/Generated/Docs/Property.xml b/test/CadlRanchProjects/encode/duration/src/Generated/Docs/Property.xml index 31b9454c35e..8a313802e67 100644 --- a/test/CadlRanchProjects/encode/duration/src/Generated/Docs/Property.xml +++ b/test/CadlRanchProjects/encode/duration/src/Generated/Docs/Property.xml @@ -41,7 +41,7 @@ This sample shows how to call DefaultAsync and parse the result. > DefaultAsync(Defaul Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await DefaultAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await DefaultAsync(content, context).ConfigureAwait(false); return Response.FromValue(DefaultDurationProperty.FromResponse(response), response); } @@ -69,7 +70,8 @@ public virtual Response Default(DefaultDurationProperty Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Default(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = Default(content, context); return Response.FromValue(DefaultDurationProperty.FromResponse(response), response); } @@ -160,7 +162,8 @@ public virtual async Task> Iso8601Async(ISO860 Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await Iso8601Async(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await Iso8601Async(content, context).ConfigureAwait(false); return Response.FromValue(ISO8601DurationProperty.FromResponse(response), response); } @@ -173,7 +176,8 @@ public virtual Response Iso8601(ISO8601DurationProperty Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Iso8601(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = Iso8601(content, context); return Response.FromValue(ISO8601DurationProperty.FromResponse(response), response); } @@ -264,7 +268,8 @@ public virtual async Task> Int32SecondsAs Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await Int32SecondsAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await Int32SecondsAsync(content, context).ConfigureAwait(false); return Response.FromValue(Int32SecondsDurationProperty.FromResponse(response), response); } @@ -277,7 +282,8 @@ public virtual Response Int32Seconds(Int32SecondsD Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Int32Seconds(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = Int32Seconds(content, context); return Response.FromValue(Int32SecondsDurationProperty.FromResponse(response), response); } @@ -368,7 +374,8 @@ public virtual async Task> FloatSecondsAs Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await FloatSecondsAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await FloatSecondsAsync(content, context).ConfigureAwait(false); return Response.FromValue(FloatSecondsDurationProperty.FromResponse(response), response); } @@ -381,7 +388,8 @@ public virtual Response FloatSeconds(FloatSecondsD Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = FloatSeconds(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = FloatSeconds(content, context); return Response.FromValue(FloatSecondsDurationProperty.FromResponse(response), response); } @@ -472,7 +480,8 @@ public virtual async Task> FloatSeco Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await FloatSecondsArrayAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await FloatSecondsArrayAsync(content, context).ConfigureAwait(false); return Response.FromValue(FloatSecondsDurationArrayProperty.FromResponse(response), response); } @@ -485,7 +494,8 @@ public virtual Response FloatSecondsArray(Flo Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = FloatSecondsArray(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = FloatSecondsArray(content, context); return Response.FromValue(FloatSecondsDurationArrayProperty.FromResponse(response), response); } diff --git a/test/CadlRanchProjects/encode/duration/tests/Generated/Samples/Samples_Property.cs b/test/CadlRanchProjects/encode/duration/tests/Generated/Samples/Samples_Property.cs index e339da23905..facca36a079 100644 --- a/test/CadlRanchProjects/encode/duration/tests/Generated/Samples/Samples_Property.cs +++ b/test/CadlRanchProjects/encode/duration/tests/Generated/Samples/Samples_Property.cs @@ -26,7 +26,7 @@ public void Example_Default_ShortVersion() { Property client = new DurationClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = "PT1H23M45S", }); @@ -42,7 +42,7 @@ public async Task Example_Default_ShortVersion_Async() { Property client = new DurationClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = "PT1H23M45S", }); @@ -78,7 +78,7 @@ public void Example_Default_AllParameters() { Property client = new DurationClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = "PT1H23M45S", }); @@ -94,7 +94,7 @@ public async Task Example_Default_AllParameters_Async() { Property client = new DurationClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = "PT1H23M45S", }); @@ -130,7 +130,7 @@ public void Example_Iso8601_ShortVersion() { Property client = new DurationClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = "PT1H23M45S", }); @@ -146,7 +146,7 @@ public async Task Example_Iso8601_ShortVersion_Async() { Property client = new DurationClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = "PT1H23M45S", }); @@ -182,7 +182,7 @@ public void Example_Iso8601_AllParameters() { Property client = new DurationClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = "PT1H23M45S", }); @@ -198,7 +198,7 @@ public async Task Example_Iso8601_AllParameters_Async() { Property client = new DurationClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = "PT1H23M45S", }); @@ -234,7 +234,7 @@ public void Example_Int32Seconds_ShortVersion() { Property client = new DurationClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = 10, }); @@ -250,7 +250,7 @@ public async Task Example_Int32Seconds_ShortVersion_Async() { Property client = new DurationClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = 10, }); @@ -286,7 +286,7 @@ public void Example_Int32Seconds_AllParameters() { Property client = new DurationClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = 10, }); @@ -302,7 +302,7 @@ public async Task Example_Int32Seconds_AllParameters_Async() { Property client = new DurationClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = 10, }); @@ -338,7 +338,7 @@ public void Example_FloatSeconds_ShortVersion() { Property client = new DurationClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = 10F, }); @@ -354,7 +354,7 @@ public async Task Example_FloatSeconds_ShortVersion_Async() { Property client = new DurationClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = 10F, }); @@ -390,7 +390,7 @@ public void Example_FloatSeconds_AllParameters() { Property client = new DurationClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = 10F, }); @@ -406,7 +406,7 @@ public async Task Example_FloatSeconds_AllParameters_Async() { Property client = new DurationClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = 10F, }); @@ -442,7 +442,7 @@ public void Example_FloatSecondsArray_ShortVersion() { Property client = new DurationClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = new object[] { @@ -461,7 +461,7 @@ public async Task Example_FloatSecondsArray_ShortVersion_Async() { Property client = new DurationClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = new object[] { @@ -500,7 +500,7 @@ public void Example_FloatSecondsArray_AllParameters() { Property client = new DurationClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = new object[] { @@ -519,7 +519,7 @@ public async Task Example_FloatSecondsArray_AllParameters_Async() { Property client = new DurationClient().GetPropertyClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { value = new object[] { diff --git a/test/CadlRanchProjects/parameters/body-optionality/src/Generated/BodyOptionalityClient.cs b/test/CadlRanchProjects/parameters/body-optionality/src/Generated/BodyOptionalityClient.cs index 01e0771e379..73281d87401 100644 --- a/test/CadlRanchProjects/parameters/body-optionality/src/Generated/BodyOptionalityClient.cs +++ b/test/CadlRanchProjects/parameters/body-optionality/src/Generated/BodyOptionalityClient.cs @@ -58,7 +58,8 @@ public virtual async Task RequiredExplicitAsync(BodyModel body, Cancel Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await RequiredExplicitAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await RequiredExplicitAsync(content, context).ConfigureAwait(false); return response; } @@ -71,7 +72,8 @@ public virtual Response RequiredExplicit(BodyModel body, CancellationToken cance Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = RequiredExplicit(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = RequiredExplicit(content, context); return response; } @@ -162,7 +164,8 @@ public virtual async Task RequiredImplicitAsync(BodyModel bodyModel, C Argument.AssertNotNull(bodyModel, nameof(bodyModel)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await RequiredImplicitAsync(bodyModel.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = bodyModel.ToRequestContent(); + Response response = await RequiredImplicitAsync(content, context).ConfigureAwait(false); return response; } @@ -175,7 +178,8 @@ public virtual Response RequiredImplicit(BodyModel bodyModel, CancellationToken Argument.AssertNotNull(bodyModel, nameof(bodyModel)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = RequiredImplicit(bodyModel.ToRequestContent(), context); + using RequestContent content = bodyModel.ToRequestContent(); + Response response = RequiredImplicit(content, context); return response; } diff --git a/test/CadlRanchProjects/parameters/body-optionality/src/Generated/Docs/BodyOptionalityClient.xml b/test/CadlRanchProjects/parameters/body-optionality/src/Generated/Docs/BodyOptionalityClient.xml index 5e4c01bb885..de36cd1f628 100644 --- a/test/CadlRanchProjects/parameters/body-optionality/src/Generated/Docs/BodyOptionalityClient.xml +++ b/test/CadlRanchProjects/parameters/body-optionality/src/Generated/Docs/BodyOptionalityClient.xml @@ -41,7 +41,7 @@ This sample shows how to call RequiredExplicitAsync. ", }); @@ -53,7 +53,7 @@ This sample shows how to call RequiredExplicitAsync with all request content. ", }); @@ -68,7 +68,7 @@ This sample shows how to call RequiredExplicit. ", }); @@ -80,7 +80,7 @@ This sample shows how to call RequiredExplicit with all request content. ", }); @@ -129,7 +129,7 @@ This sample shows how to call RequiredImplicitAsync. ", }); @@ -141,7 +141,7 @@ This sample shows how to call RequiredImplicitAsync with all request content. ", }); @@ -156,7 +156,7 @@ This sample shows how to call RequiredImplicit. ", }); @@ -168,7 +168,7 @@ This sample shows how to call RequiredImplicit with all request content. ", }); diff --git a/test/CadlRanchProjects/parameters/body-optionality/src/Generated/Docs/OptionalExplicit.xml b/test/CadlRanchProjects/parameters/body-optionality/src/Generated/Docs/OptionalExplicit.xml index e36044697ef..d37f0a00e24 100644 --- a/test/CadlRanchProjects/parameters/body-optionality/src/Generated/Docs/OptionalExplicit.xml +++ b/test/CadlRanchProjects/parameters/body-optionality/src/Generated/Docs/OptionalExplicit.xml @@ -39,7 +39,7 @@ This sample shows how to call SetAsync. ", }); @@ -63,7 +63,7 @@ This sample shows how to call Set. ", }); @@ -119,7 +119,7 @@ This sample shows how to call OmitAsync. ", }); @@ -143,7 +143,7 @@ This sample shows how to call Omit. ", }); diff --git a/test/CadlRanchProjects/parameters/body-optionality/src/Generated/OptionalExplicit.cs b/test/CadlRanchProjects/parameters/body-optionality/src/Generated/OptionalExplicit.cs index f47c11c63b7..a853cf189b8 100644 --- a/test/CadlRanchProjects/parameters/body-optionality/src/Generated/OptionalExplicit.cs +++ b/test/CadlRanchProjects/parameters/body-optionality/src/Generated/OptionalExplicit.cs @@ -53,7 +53,8 @@ internal OptionalExplicit(ClientDiagnostics clientDiagnostics, HttpPipeline pipe public virtual async Task SetAsync(BodyModel body = null, CancellationToken cancellationToken = default) { RequestContext context = FromCancellationToken(cancellationToken); - Response response = await SetAsync(body?.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body?.ToRequestContent(); + Response response = await SetAsync(content, context).ConfigureAwait(false); return response; } @@ -63,7 +64,8 @@ public virtual async Task SetAsync(BodyModel body = null, Cancellation public virtual Response Set(BodyModel body = null, CancellationToken cancellationToken = default) { RequestContext context = FromCancellationToken(cancellationToken); - Response response = Set(body?.ToRequestContent(), context); + using RequestContent content = body?.ToRequestContent(); + Response response = Set(content, context); return response; } @@ -145,7 +147,8 @@ public virtual Response Set(RequestContent content, RequestContext context = nul public virtual async Task OmitAsync(BodyModel body = null, CancellationToken cancellationToken = default) { RequestContext context = FromCancellationToken(cancellationToken); - Response response = await OmitAsync(body?.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body?.ToRequestContent(); + Response response = await OmitAsync(content, context).ConfigureAwait(false); return response; } @@ -155,7 +158,8 @@ public virtual async Task OmitAsync(BodyModel body = null, Cancellatio public virtual Response Omit(BodyModel body = null, CancellationToken cancellationToken = default) { RequestContext context = FromCancellationToken(cancellationToken); - Response response = Omit(body?.ToRequestContent(), context); + using RequestContent content = body?.ToRequestContent(); + Response response = Omit(content, context); return response; } diff --git a/test/CadlRanchProjects/parameters/body-optionality/tests/Generated/Samples/Samples_BodyOptionalityClient.cs b/test/CadlRanchProjects/parameters/body-optionality/tests/Generated/Samples/Samples_BodyOptionalityClient.cs index d3f10d8151e..208012bc0e7 100644 --- a/test/CadlRanchProjects/parameters/body-optionality/tests/Generated/Samples/Samples_BodyOptionalityClient.cs +++ b/test/CadlRanchProjects/parameters/body-optionality/tests/Generated/Samples/Samples_BodyOptionalityClient.cs @@ -24,7 +24,7 @@ public void Example_RequiredExplicit_ShortVersion() { BodyOptionalityClient client = new BodyOptionalityClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", }); @@ -39,7 +39,7 @@ public async Task Example_RequiredExplicit_ShortVersion_Async() { BodyOptionalityClient client = new BodyOptionalityClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", }); @@ -74,7 +74,7 @@ public void Example_RequiredExplicit_AllParameters() { BodyOptionalityClient client = new BodyOptionalityClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", }); @@ -89,7 +89,7 @@ public async Task Example_RequiredExplicit_AllParameters_Async() { BodyOptionalityClient client = new BodyOptionalityClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", }); @@ -124,7 +124,7 @@ public void Example_RequiredImplicit_ShortVersion() { BodyOptionalityClient client = new BodyOptionalityClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", }); @@ -139,7 +139,7 @@ public async Task Example_RequiredImplicit_ShortVersion_Async() { BodyOptionalityClient client = new BodyOptionalityClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", }); @@ -174,7 +174,7 @@ public void Example_RequiredImplicit_AllParameters() { BodyOptionalityClient client = new BodyOptionalityClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", }); @@ -189,7 +189,7 @@ public async Task Example_RequiredImplicit_AllParameters_Async() { BodyOptionalityClient client = new BodyOptionalityClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", }); diff --git a/test/CadlRanchProjects/parameters/body-optionality/tests/Generated/Samples/Samples_OptionalExplicit.cs b/test/CadlRanchProjects/parameters/body-optionality/tests/Generated/Samples/Samples_OptionalExplicit.cs index c91fc11f574..c9981ca0400 100644 --- a/test/CadlRanchProjects/parameters/body-optionality/tests/Generated/Samples/Samples_OptionalExplicit.cs +++ b/test/CadlRanchProjects/parameters/body-optionality/tests/Generated/Samples/Samples_OptionalExplicit.cs @@ -24,7 +24,7 @@ public void Example_Set_ShortVersion() { OptionalExplicit client = new BodyOptionalityClient().GetOptionalExplicitClient(); - RequestContent content = null; + using RequestContent content = null; Response response = client.Set(content); Console.WriteLine(response.Status); @@ -36,7 +36,7 @@ public async Task Example_Set_ShortVersion_Async() { OptionalExplicit client = new BodyOptionalityClient().GetOptionalExplicitClient(); - RequestContent content = null; + using RequestContent content = null; Response response = await client.SetAsync(content); Console.WriteLine(response.Status); @@ -66,7 +66,7 @@ public void Example_Set_AllParameters() { OptionalExplicit client = new BodyOptionalityClient().GetOptionalExplicitClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", }); @@ -81,7 +81,7 @@ public async Task Example_Set_AllParameters_Async() { OptionalExplicit client = new BodyOptionalityClient().GetOptionalExplicitClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", }); @@ -116,7 +116,7 @@ public void Example_Omit_ShortVersion() { OptionalExplicit client = new BodyOptionalityClient().GetOptionalExplicitClient(); - RequestContent content = null; + using RequestContent content = null; Response response = client.Omit(content); Console.WriteLine(response.Status); @@ -128,7 +128,7 @@ public async Task Example_Omit_ShortVersion_Async() { OptionalExplicit client = new BodyOptionalityClient().GetOptionalExplicitClient(); - RequestContent content = null; + using RequestContent content = null; Response response = await client.OmitAsync(content); Console.WriteLine(response.Status); @@ -158,7 +158,7 @@ public void Example_Omit_AllParameters() { OptionalExplicit client = new BodyOptionalityClient().GetOptionalExplicitClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", }); @@ -173,7 +173,7 @@ public async Task Example_Omit_AllParameters_Async() { OptionalExplicit client = new BodyOptionalityClient().GetOptionalExplicitClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", }); diff --git a/test/CadlRanchProjects/parameters/spread/src/Generated/Docs/Alias.xml b/test/CadlRanchProjects/parameters/spread/src/Generated/Docs/Alias.xml index e286726fc34..7a1453d5261 100644 --- a/test/CadlRanchProjects/parameters/spread/src/Generated/Docs/Alias.xml +++ b/test/CadlRanchProjects/parameters/spread/src/Generated/Docs/Alias.xml @@ -37,7 +37,7 @@ This sample shows how to call SpreadAsRequestBodyAsync. ", }); @@ -49,7 +49,7 @@ This sample shows how to call SpreadAsRequestBodyAsync with all request content. ", }); @@ -64,7 +64,7 @@ This sample shows how to call SpreadAsRequestBody. ", }); @@ -76,7 +76,7 @@ This sample shows how to call SpreadAsRequestBody with all request content. ", }); @@ -121,7 +121,7 @@ This sample shows how to call SpreadAsRequestParameterAsync. ", }); @@ -133,7 +133,7 @@ This sample shows how to call SpreadAsRequestParameterAsync with all parameters ", }); @@ -148,7 +148,7 @@ This sample shows how to call SpreadAsRequestParameter. ", }); @@ -160,7 +160,7 @@ This sample shows how to call SpreadAsRequestParameter with all parameters and r ", }); @@ -205,7 +205,7 @@ This sample shows how to call SpreadWithMultipleParametersAsync. ", prop2 = "", @@ -222,7 +222,7 @@ This sample shows how to call SpreadWithMultipleParametersAsync with all paramet ", prop2 = "", @@ -242,7 +242,7 @@ This sample shows how to call SpreadWithMultipleParameters. ", prop2 = "", @@ -259,7 +259,7 @@ This sample shows how to call SpreadWithMultipleParameters with all parameters a ", prop2 = "", diff --git a/test/CadlRanchProjects/parameters/spread/src/Generated/Docs/Model.xml b/test/CadlRanchProjects/parameters/spread/src/Generated/Docs/Model.xml index 1c879248dec..c0fb1e1fc07 100644 --- a/test/CadlRanchProjects/parameters/spread/src/Generated/Docs/Model.xml +++ b/test/CadlRanchProjects/parameters/spread/src/Generated/Docs/Model.xml @@ -41,7 +41,7 @@ This sample shows how to call SpreadAsRequestBodyAsync. ", }); @@ -53,7 +53,7 @@ This sample shows how to call SpreadAsRequestBodyAsync with all request content. ", }); @@ -68,7 +68,7 @@ This sample shows how to call SpreadAsRequestBody. ", }); @@ -80,7 +80,7 @@ This sample shows how to call SpreadAsRequestBody with all request content. ", }); diff --git a/test/CadlRanchProjects/parameters/spread/src/Generated/Model.cs b/test/CadlRanchProjects/parameters/spread/src/Generated/Model.cs index d320689898c..24e993fca13 100644 --- a/test/CadlRanchProjects/parameters/spread/src/Generated/Model.cs +++ b/test/CadlRanchProjects/parameters/spread/src/Generated/Model.cs @@ -56,7 +56,8 @@ public virtual async Task SpreadAsRequestBodyAsync(BodyParameter bodyP Argument.AssertNotNull(bodyParameter, nameof(bodyParameter)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await SpreadAsRequestBodyAsync(bodyParameter.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = bodyParameter.ToRequestContent(); + Response response = await SpreadAsRequestBodyAsync(content, context).ConfigureAwait(false); return response; } @@ -69,7 +70,8 @@ public virtual Response SpreadAsRequestBody(BodyParameter bodyParameter, Cancell Argument.AssertNotNull(bodyParameter, nameof(bodyParameter)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = SpreadAsRequestBody(bodyParameter.ToRequestContent(), context); + using RequestContent content = bodyParameter.ToRequestContent(); + Response response = SpreadAsRequestBody(content, context); return response; } diff --git a/test/CadlRanchProjects/parameters/spread/tests/Generated/Samples/Samples_Alias.cs b/test/CadlRanchProjects/parameters/spread/tests/Generated/Samples/Samples_Alias.cs index c8da9460ea1..7534152c8cf 100644 --- a/test/CadlRanchProjects/parameters/spread/tests/Generated/Samples/Samples_Alias.cs +++ b/test/CadlRanchProjects/parameters/spread/tests/Generated/Samples/Samples_Alias.cs @@ -23,7 +23,7 @@ public void Example_SpreadAsRequestBody_ShortVersion() { Alias client = new SpreadClient().GetAliasClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", }); @@ -38,7 +38,7 @@ public async Task Example_SpreadAsRequestBody_ShortVersion_Async() { Alias client = new SpreadClient().GetAliasClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", }); @@ -71,7 +71,7 @@ public void Example_SpreadAsRequestBody_AllParameters() { Alias client = new SpreadClient().GetAliasClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", }); @@ -86,7 +86,7 @@ public async Task Example_SpreadAsRequestBody_AllParameters_Async() { Alias client = new SpreadClient().GetAliasClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", }); @@ -119,7 +119,7 @@ public void Example_SpreadAsRequestParameter_ShortVersion() { Alias client = new SpreadClient().GetAliasClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", }); @@ -134,7 +134,7 @@ public async Task Example_SpreadAsRequestParameter_ShortVersion_Async() { Alias client = new SpreadClient().GetAliasClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", }); @@ -167,7 +167,7 @@ public void Example_SpreadAsRequestParameter_AllParameters() { Alias client = new SpreadClient().GetAliasClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", }); @@ -182,7 +182,7 @@ public async Task Example_SpreadAsRequestParameter_AllParameters_Async() { Alias client = new SpreadClient().GetAliasClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", }); @@ -215,7 +215,7 @@ public void Example_SpreadWithMultipleParameters_ShortVersion() { Alias client = new SpreadClient().GetAliasClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { prop1 = "", prop2 = "", @@ -235,7 +235,7 @@ public async Task Example_SpreadWithMultipleParameters_ShortVersion_Async() { Alias client = new SpreadClient().GetAliasClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { prop1 = "", prop2 = "", @@ -273,7 +273,7 @@ public void Example_SpreadWithMultipleParameters_AllParameters() { Alias client = new SpreadClient().GetAliasClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { prop1 = "", prop2 = "", @@ -293,7 +293,7 @@ public async Task Example_SpreadWithMultipleParameters_AllParameters_Async() { Alias client = new SpreadClient().GetAliasClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { prop1 = "", prop2 = "", diff --git a/test/CadlRanchProjects/parameters/spread/tests/Generated/Samples/Samples_Model.cs b/test/CadlRanchProjects/parameters/spread/tests/Generated/Samples/Samples_Model.cs index 6761b8afab9..9fdf6a6968d 100644 --- a/test/CadlRanchProjects/parameters/spread/tests/Generated/Samples/Samples_Model.cs +++ b/test/CadlRanchProjects/parameters/spread/tests/Generated/Samples/Samples_Model.cs @@ -24,7 +24,7 @@ public void Example_SpreadAsRequestBody_ShortVersion() { Model client = new SpreadClient().GetModelClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", }); @@ -39,7 +39,7 @@ public async Task Example_SpreadAsRequestBody_ShortVersion_Async() { Model client = new SpreadClient().GetModelClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", }); @@ -74,7 +74,7 @@ public void Example_SpreadAsRequestBody_AllParameters() { Model client = new SpreadClient().GetModelClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", }); @@ -89,7 +89,7 @@ public async Task Example_SpreadAsRequestBody_AllParameters_Async() { Model client = new SpreadClient().GetModelClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", }); diff --git a/test/CadlRanchProjects/projection/projected-name/src/Generated/Docs/Property.xml b/test/CadlRanchProjects/projection/projected-name/src/Generated/Docs/Property.xml index b981d66717d..37564a452c7 100644 --- a/test/CadlRanchProjects/projection/projected-name/src/Generated/Docs/Property.xml +++ b/test/CadlRanchProjects/projection/projected-name/src/Generated/Docs/Property.xml @@ -41,7 +41,7 @@ This sample shows how to call JsonAsync. JsonAsync(JsonProjectedNameModel jsonProject Argument.AssertNotNull(jsonProjectedNameModel, nameof(jsonProjectedNameModel)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await JsonAsync(jsonProjectedNameModel.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = jsonProjectedNameModel.ToRequestContent(); + Response response = await JsonAsync(content, context).ConfigureAwait(false); return response; } @@ -69,7 +70,8 @@ public virtual Response Json(JsonProjectedNameModel jsonProjectedNameModel, Canc Argument.AssertNotNull(jsonProjectedNameModel, nameof(jsonProjectedNameModel)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Json(jsonProjectedNameModel.ToRequestContent(), context); + using RequestContent content = jsonProjectedNameModel.ToRequestContent(); + Response response = Json(content, context); return response; } @@ -160,7 +162,8 @@ public virtual async Task ClientAsync(ClientProjectedNameModel clientP Argument.AssertNotNull(clientProjectedNameModel, nameof(clientProjectedNameModel)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await ClientAsync(clientProjectedNameModel.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = clientProjectedNameModel.ToRequestContent(); + Response response = await ClientAsync(content, context).ConfigureAwait(false); return response; } @@ -173,7 +176,8 @@ public virtual Response Client(ClientProjectedNameModel clientProjectedNameModel Argument.AssertNotNull(clientProjectedNameModel, nameof(clientProjectedNameModel)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Client(clientProjectedNameModel.ToRequestContent(), context); + using RequestContent content = clientProjectedNameModel.ToRequestContent(); + Response response = Client(content, context); return response; } @@ -264,7 +268,8 @@ public virtual async Task LanguageAsync(LanguageProjectedNameModel lan Argument.AssertNotNull(languageProjectedNameModel, nameof(languageProjectedNameModel)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await LanguageAsync(languageProjectedNameModel.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = languageProjectedNameModel.ToRequestContent(); + Response response = await LanguageAsync(content, context).ConfigureAwait(false); return response; } @@ -277,7 +282,8 @@ public virtual Response Language(LanguageProjectedNameModel languageProjectedNam Argument.AssertNotNull(languageProjectedNameModel, nameof(languageProjectedNameModel)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Language(languageProjectedNameModel.ToRequestContent(), context); + using RequestContent content = languageProjectedNameModel.ToRequestContent(); + Response response = Language(content, context); return response; } @@ -368,7 +374,8 @@ public virtual async Task JsonAndClientAsync(JsonAndClientProjectedNam Argument.AssertNotNull(jsonAndClientProjectedNameModel, nameof(jsonAndClientProjectedNameModel)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await JsonAndClientAsync(jsonAndClientProjectedNameModel.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = jsonAndClientProjectedNameModel.ToRequestContent(); + Response response = await JsonAndClientAsync(content, context).ConfigureAwait(false); return response; } @@ -381,7 +388,8 @@ public virtual Response JsonAndClient(JsonAndClientProjectedNameModel jsonAndCli Argument.AssertNotNull(jsonAndClientProjectedNameModel, nameof(jsonAndClientProjectedNameModel)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = JsonAndClient(jsonAndClientProjectedNameModel.ToRequestContent(), context); + using RequestContent content = jsonAndClientProjectedNameModel.ToRequestContent(); + Response response = JsonAndClient(content, context); return response; } diff --git a/test/CadlRanchProjects/projection/projected-name/tests/Generated/Samples/Samples_Property.cs b/test/CadlRanchProjects/projection/projected-name/tests/Generated/Samples/Samples_Property.cs index 8ec2730822a..4c3d85418bb 100644 --- a/test/CadlRanchProjects/projection/projected-name/tests/Generated/Samples/Samples_Property.cs +++ b/test/CadlRanchProjects/projection/projected-name/tests/Generated/Samples/Samples_Property.cs @@ -24,7 +24,7 @@ public void Example_Json_ShortVersion() { Property client = new ProjectedNameClient().GetPropertyClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { wireName = true, }); @@ -39,7 +39,7 @@ public async Task Example_Json_ShortVersion_Async() { Property client = new ProjectedNameClient().GetPropertyClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { wireName = true, }); @@ -74,7 +74,7 @@ public void Example_Json_AllParameters() { Property client = new ProjectedNameClient().GetPropertyClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { wireName = true, }); @@ -89,7 +89,7 @@ public async Task Example_Json_AllParameters_Async() { Property client = new ProjectedNameClient().GetPropertyClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { wireName = true, }); @@ -124,7 +124,7 @@ public void Example_Client_ShortVersion() { Property client = new ProjectedNameClient().GetPropertyClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { defaultName = true, }); @@ -139,7 +139,7 @@ public async Task Example_Client_ShortVersion_Async() { Property client = new ProjectedNameClient().GetPropertyClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { defaultName = true, }); @@ -174,7 +174,7 @@ public void Example_Client_AllParameters() { Property client = new ProjectedNameClient().GetPropertyClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { defaultName = true, }); @@ -189,7 +189,7 @@ public async Task Example_Client_AllParameters_Async() { Property client = new ProjectedNameClient().GetPropertyClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { defaultName = true, }); @@ -224,7 +224,7 @@ public void Example_Language_ShortVersion() { Property client = new ProjectedNameClient().GetPropertyClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { defaultName = true, }); @@ -239,7 +239,7 @@ public async Task Example_Language_ShortVersion_Async() { Property client = new ProjectedNameClient().GetPropertyClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { defaultName = true, }); @@ -274,7 +274,7 @@ public void Example_Language_AllParameters() { Property client = new ProjectedNameClient().GetPropertyClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { defaultName = true, }); @@ -289,7 +289,7 @@ public async Task Example_Language_AllParameters_Async() { Property client = new ProjectedNameClient().GetPropertyClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { defaultName = true, }); @@ -324,7 +324,7 @@ public void Example_JsonAndClient_ShortVersion() { Property client = new ProjectedNameClient().GetPropertyClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { wireName = true, }); @@ -339,7 +339,7 @@ public async Task Example_JsonAndClient_ShortVersion_Async() { Property client = new ProjectedNameClient().GetPropertyClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { wireName = true, }); @@ -374,7 +374,7 @@ public void Example_JsonAndClient_AllParameters() { Property client = new ProjectedNameClient().GetPropertyClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { wireName = true, }); @@ -389,7 +389,7 @@ public async Task Example_JsonAndClient_AllParameters_Async() { Property client = new ProjectedNameClient().GetPropertyClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { wireName = true, }); diff --git a/test/CadlRanchProjects/special-words/src/Generated/Docs/Model.xml b/test/CadlRanchProjects/special-words/src/Generated/Docs/Model.xml index 6dd6ca2733d..9baaebcdac8 100644 --- a/test/CadlRanchProjects/special-words/src/Generated/Docs/Model.xml +++ b/test/CadlRanchProjects/special-words/src/Generated/Docs/Model.xml @@ -113,7 +113,7 @@ This sample shows how to call PutAsync. +using RequestContent content = RequestContent.Create(new Dictionary { ["derived.name"] = "", ["for"] = "", @@ -127,7 +127,7 @@ This sample shows how to call PutAsync with all request content. +using RequestContent content = RequestContent.Create(new Dictionary { ["derived.name"] = "", ["for"] = "", @@ -144,7 +144,7 @@ This sample shows how to call Put. +using RequestContent content = RequestContent.Create(new Dictionary { ["derived.name"] = "", ["for"] = "", @@ -158,7 +158,7 @@ This sample shows how to call Put with all request content. +using RequestContent content = RequestContent.Create(new Dictionary { ["derived.name"] = "", ["for"] = "", diff --git a/test/CadlRanchProjects/special-words/src/Generated/Model.cs b/test/CadlRanchProjects/special-words/src/Generated/Model.cs index e5e48b284a0..e6220bb0669 100644 --- a/test/CadlRanchProjects/special-words/src/Generated/Model.cs +++ b/test/CadlRanchProjects/special-words/src/Generated/Model.cs @@ -164,7 +164,8 @@ public virtual async Task PutAsync(BaseModel body, CancellationToken c Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await PutAsync(content, context).ConfigureAwait(false); return response; } @@ -177,7 +178,8 @@ public virtual Response Put(BaseModel body, CancellationToken cancellationToken Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Put(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = Put(content, context); return response; } diff --git a/test/CadlRanchProjects/special-words/tests/Generated/Samples/Samples_Model.cs b/test/CadlRanchProjects/special-words/tests/Generated/Samples/Samples_Model.cs index 2cdc59aabe6..cfd9fd3bfde 100644 --- a/test/CadlRanchProjects/special-words/tests/Generated/Samples/Samples_Model.cs +++ b/test/CadlRanchProjects/special-words/tests/Generated/Samples/Samples_Model.cs @@ -110,7 +110,7 @@ public void Example_Put_ShortVersion() { Model client = new SpecialWordsClient().GetModelClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new Dictionary + using RequestContent content = RequestContent.Create(new Dictionary { ["derived.name"] = "", ["for"] = "", @@ -127,7 +127,7 @@ public async Task Example_Put_ShortVersion_Async() { Model client = new SpecialWordsClient().GetModelClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new Dictionary + using RequestContent content = RequestContent.Create(new Dictionary { ["derived.name"] = "", ["for"] = "", @@ -164,7 +164,7 @@ public void Example_Put_AllParameters() { Model client = new SpecialWordsClient().GetModelClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new Dictionary + using RequestContent content = RequestContent.Create(new Dictionary { ["derived.name"] = "", ["for"] = "", @@ -181,7 +181,7 @@ public async Task Example_Put_AllParameters_Async() { Model client = new SpecialWordsClient().GetModelClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new Dictionary + using RequestContent content = RequestContent.Create(new Dictionary { ["derived.name"] = "", ["for"] = "", diff --git a/test/CadlRanchProjects/type/array/src/Generated/BooleanValue.cs b/test/CadlRanchProjects/type/array/src/Generated/BooleanValue.cs index bf33c845f91..c2dfcefe6f2 100644 --- a/test/CadlRanchProjects/type/array/src/Generated/BooleanValue.cs +++ b/test/CadlRanchProjects/type/array/src/Generated/BooleanValue.cs @@ -161,7 +161,8 @@ public virtual async Task PutAsync(IEnumerable body, Cancellatio Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutAsync(RequestContentHelper.FromEnumerable(body), context).ConfigureAwait(false); + using RequestContent content = RequestContentHelper.FromEnumerable(body); + Response response = await PutAsync(content, context).ConfigureAwait(false); return response; } @@ -174,7 +175,8 @@ public virtual Response Put(IEnumerable body, CancellationToken cancellati Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Put(RequestContentHelper.FromEnumerable(body), context); + using RequestContent content = RequestContentHelper.FromEnumerable(body); + Response response = Put(content, context); return response; } diff --git a/test/CadlRanchProjects/type/array/src/Generated/DatetimeValue.cs b/test/CadlRanchProjects/type/array/src/Generated/DatetimeValue.cs index a5474e625d4..258d56a9c7e 100644 --- a/test/CadlRanchProjects/type/array/src/Generated/DatetimeValue.cs +++ b/test/CadlRanchProjects/type/array/src/Generated/DatetimeValue.cs @@ -161,7 +161,8 @@ public virtual async Task PutAsync(IEnumerable body, C Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutAsync(RequestContentHelper.FromEnumerable(body), context).ConfigureAwait(false); + using RequestContent content = RequestContentHelper.FromEnumerable(body); + Response response = await PutAsync(content, context).ConfigureAwait(false); return response; } @@ -174,7 +175,8 @@ public virtual Response Put(IEnumerable body, CancellationToken Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Put(RequestContentHelper.FromEnumerable(body), context); + using RequestContent content = RequestContentHelper.FromEnumerable(body); + Response response = Put(content, context); return response; } diff --git a/test/CadlRanchProjects/type/array/src/Generated/Docs/BooleanValue.xml b/test/CadlRanchProjects/type/array/src/Generated/Docs/BooleanValue.xml index 77d27baad38..111c2b81e98 100644 --- a/test/CadlRanchProjects/type/array/src/Generated/Docs/BooleanValue.xml +++ b/test/CadlRanchProjects/type/array/src/Generated/Docs/BooleanValue.xml @@ -109,7 +109,7 @@ This sample shows how to call PutAsync. " }); @@ -121,7 +121,7 @@ This sample shows how to call PutAsync with all request content. " }); @@ -136,7 +136,7 @@ This sample shows how to call Put. " }); @@ -148,7 +148,7 @@ This sample shows how to call Put with all request content. " }); diff --git a/test/CadlRanchProjects/type/array/src/Generated/Docs/UnknownValue.xml b/test/CadlRanchProjects/type/array/src/Generated/Docs/UnknownValue.xml index 49b9e028351..a7f42aa96ee 100644 --- a/test/CadlRanchProjects/type/array/src/Generated/Docs/UnknownValue.xml +++ b/test/CadlRanchProjects/type/array/src/Generated/Docs/UnknownValue.xml @@ -121,7 +121,7 @@ This sample shows how to call PutAsync. PutAsync(IEnumerable body, Cancell Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutAsync(RequestContentHelper.FromEnumerable(body), context).ConfigureAwait(false); + using RequestContent content = RequestContentHelper.FromEnumerable(body); + Response response = await PutAsync(content, context).ConfigureAwait(false); return response; } @@ -174,7 +175,8 @@ public virtual Response Put(IEnumerable body, CancellationToken cancel Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Put(RequestContentHelper.FromEnumerable(body), context); + using RequestContent content = RequestContentHelper.FromEnumerable(body); + Response response = Put(content, context); return response; } diff --git a/test/CadlRanchProjects/type/array/src/Generated/Float32Value.cs b/test/CadlRanchProjects/type/array/src/Generated/Float32Value.cs index 03358c2b589..e9a553ac315 100644 --- a/test/CadlRanchProjects/type/array/src/Generated/Float32Value.cs +++ b/test/CadlRanchProjects/type/array/src/Generated/Float32Value.cs @@ -161,7 +161,8 @@ public virtual async Task PutAsync(IEnumerable body, Cancellati Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutAsync(RequestContentHelper.FromEnumerable(body), context).ConfigureAwait(false); + using RequestContent content = RequestContentHelper.FromEnumerable(body); + Response response = await PutAsync(content, context).ConfigureAwait(false); return response; } @@ -174,7 +175,8 @@ public virtual Response Put(IEnumerable body, CancellationToken cancellat Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Put(RequestContentHelper.FromEnumerable(body), context); + using RequestContent content = RequestContentHelper.FromEnumerable(body); + Response response = Put(content, context); return response; } diff --git a/test/CadlRanchProjects/type/array/src/Generated/Int32Value.cs b/test/CadlRanchProjects/type/array/src/Generated/Int32Value.cs index 832524dd03d..c6e3ad9376f 100644 --- a/test/CadlRanchProjects/type/array/src/Generated/Int32Value.cs +++ b/test/CadlRanchProjects/type/array/src/Generated/Int32Value.cs @@ -161,7 +161,8 @@ public virtual async Task PutAsync(IEnumerable body, Cancellation Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutAsync(RequestContentHelper.FromEnumerable(body), context).ConfigureAwait(false); + using RequestContent content = RequestContentHelper.FromEnumerable(body); + Response response = await PutAsync(content, context).ConfigureAwait(false); return response; } @@ -174,7 +175,8 @@ public virtual Response Put(IEnumerable body, CancellationToken cancellatio Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Put(RequestContentHelper.FromEnumerable(body), context); + using RequestContent content = RequestContentHelper.FromEnumerable(body); + Response response = Put(content, context); return response; } diff --git a/test/CadlRanchProjects/type/array/src/Generated/Int64Value.cs b/test/CadlRanchProjects/type/array/src/Generated/Int64Value.cs index ac291942160..861c591fc6f 100644 --- a/test/CadlRanchProjects/type/array/src/Generated/Int64Value.cs +++ b/test/CadlRanchProjects/type/array/src/Generated/Int64Value.cs @@ -161,7 +161,8 @@ public virtual async Task PutAsync(IEnumerable body, Cancellatio Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutAsync(RequestContentHelper.FromEnumerable(body), context).ConfigureAwait(false); + using RequestContent content = RequestContentHelper.FromEnumerable(body); + Response response = await PutAsync(content, context).ConfigureAwait(false); return response; } @@ -174,7 +175,8 @@ public virtual Response Put(IEnumerable body, CancellationToken cancellati Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Put(RequestContentHelper.FromEnumerable(body), context); + using RequestContent content = RequestContentHelper.FromEnumerable(body); + Response response = Put(content, context); return response; } diff --git a/test/CadlRanchProjects/type/array/src/Generated/ModelValue.cs b/test/CadlRanchProjects/type/array/src/Generated/ModelValue.cs index e28ef2bd0fd..08107da1692 100644 --- a/test/CadlRanchProjects/type/array/src/Generated/ModelValue.cs +++ b/test/CadlRanchProjects/type/array/src/Generated/ModelValue.cs @@ -162,7 +162,8 @@ public virtual async Task PutAsync(IEnumerable body, Cance Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutAsync(RequestContentHelper.FromEnumerable(body), context).ConfigureAwait(false); + using RequestContent content = RequestContentHelper.FromEnumerable(body); + Response response = await PutAsync(content, context).ConfigureAwait(false); return response; } @@ -175,7 +176,8 @@ public virtual Response Put(IEnumerable body, CancellationToken canc Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Put(RequestContentHelper.FromEnumerable(body), context); + using RequestContent content = RequestContentHelper.FromEnumerable(body); + Response response = Put(content, context); return response; } diff --git a/test/CadlRanchProjects/type/array/src/Generated/NullableFloatValue.cs b/test/CadlRanchProjects/type/array/src/Generated/NullableFloatValue.cs index 5f5980936b5..ffa26aa592c 100644 --- a/test/CadlRanchProjects/type/array/src/Generated/NullableFloatValue.cs +++ b/test/CadlRanchProjects/type/array/src/Generated/NullableFloatValue.cs @@ -175,7 +175,8 @@ public virtual async Task PutAsync(IEnumerable body, Cancellat Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutAsync(RequestContentHelper.FromEnumerable(body), context).ConfigureAwait(false); + using RequestContent content = RequestContentHelper.FromEnumerable(body); + Response response = await PutAsync(content, context).ConfigureAwait(false); return response; } @@ -188,7 +189,8 @@ public virtual Response Put(IEnumerable body, CancellationToken cancella Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Put(RequestContentHelper.FromEnumerable(body), context); + using RequestContent content = RequestContentHelper.FromEnumerable(body); + Response response = Put(content, context); return response; } diff --git a/test/CadlRanchProjects/type/array/src/Generated/StringValue.cs b/test/CadlRanchProjects/type/array/src/Generated/StringValue.cs index c5815d5c14d..e51b15f668c 100644 --- a/test/CadlRanchProjects/type/array/src/Generated/StringValue.cs +++ b/test/CadlRanchProjects/type/array/src/Generated/StringValue.cs @@ -161,7 +161,8 @@ public virtual async Task PutAsync(IEnumerable body, Cancellat Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutAsync(RequestContentHelper.FromEnumerable(body), context).ConfigureAwait(false); + using RequestContent content = RequestContentHelper.FromEnumerable(body); + Response response = await PutAsync(content, context).ConfigureAwait(false); return response; } @@ -174,7 +175,8 @@ public virtual Response Put(IEnumerable body, CancellationToken cancella Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Put(RequestContentHelper.FromEnumerable(body), context); + using RequestContent content = RequestContentHelper.FromEnumerable(body); + Response response = Put(content, context); return response; } diff --git a/test/CadlRanchProjects/type/array/src/Generated/UnknownValue.cs b/test/CadlRanchProjects/type/array/src/Generated/UnknownValue.cs index efbd9d687f4..997cc01b4d8 100644 --- a/test/CadlRanchProjects/type/array/src/Generated/UnknownValue.cs +++ b/test/CadlRanchProjects/type/array/src/Generated/UnknownValue.cs @@ -175,7 +175,8 @@ public virtual async Task PutAsync(IEnumerable body, Cance Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutAsync(RequestContentHelper.FromEnumerable(body), context).ConfigureAwait(false); + using RequestContent content = RequestContentHelper.FromEnumerable(body); + Response response = await PutAsync(content, context).ConfigureAwait(false); return response; } @@ -188,7 +189,8 @@ public virtual Response Put(IEnumerable body, CancellationToken canc Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Put(RequestContentHelper.FromEnumerable(body), context); + using RequestContent content = RequestContentHelper.FromEnumerable(body); + Response response = Put(content, context); return response; } diff --git a/test/CadlRanchProjects/type/array/tests/Generated/Samples/Samples_BooleanValue.cs b/test/CadlRanchProjects/type/array/tests/Generated/Samples/Samples_BooleanValue.cs index b185905b61f..2c7a199778b 100644 --- a/test/CadlRanchProjects/type/array/tests/Generated/Samples/Samples_BooleanValue.cs +++ b/test/CadlRanchProjects/type/array/tests/Generated/Samples/Samples_BooleanValue.cs @@ -109,7 +109,7 @@ public void Example_Put_ShortVersion() { BooleanValue client = new ArrayClient().GetBooleanValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { true }); @@ -124,7 +124,7 @@ public async Task Example_Put_ShortVersion_Async() { BooleanValue client = new ArrayClient().GetBooleanValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { true }); @@ -157,7 +157,7 @@ public void Example_Put_AllParameters() { BooleanValue client = new ArrayClient().GetBooleanValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { true }); @@ -172,7 +172,7 @@ public async Task Example_Put_AllParameters_Async() { BooleanValue client = new ArrayClient().GetBooleanValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { true }); diff --git a/test/CadlRanchProjects/type/array/tests/Generated/Samples/Samples_DatetimeValue.cs b/test/CadlRanchProjects/type/array/tests/Generated/Samples/Samples_DatetimeValue.cs index f90965fbedd..cfd192bfaff 100644 --- a/test/CadlRanchProjects/type/array/tests/Generated/Samples/Samples_DatetimeValue.cs +++ b/test/CadlRanchProjects/type/array/tests/Generated/Samples/Samples_DatetimeValue.cs @@ -109,7 +109,7 @@ public void Example_Put_ShortVersion() { DatetimeValue client = new ArrayClient().GetDatetimeValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { "2022-05-10T14:57:31.2311892-04:00" }); @@ -124,7 +124,7 @@ public async Task Example_Put_ShortVersion_Async() { DatetimeValue client = new ArrayClient().GetDatetimeValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { "2022-05-10T14:57:31.2311892-04:00" }); @@ -157,7 +157,7 @@ public void Example_Put_AllParameters() { DatetimeValue client = new ArrayClient().GetDatetimeValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { "2022-05-10T14:57:31.2311892-04:00" }); @@ -172,7 +172,7 @@ public async Task Example_Put_AllParameters_Async() { DatetimeValue client = new ArrayClient().GetDatetimeValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { "2022-05-10T14:57:31.2311892-04:00" }); diff --git a/test/CadlRanchProjects/type/array/tests/Generated/Samples/Samples_DurationValue.cs b/test/CadlRanchProjects/type/array/tests/Generated/Samples/Samples_DurationValue.cs index 78c9a1b11ae..3c7ed5b2438 100644 --- a/test/CadlRanchProjects/type/array/tests/Generated/Samples/Samples_DurationValue.cs +++ b/test/CadlRanchProjects/type/array/tests/Generated/Samples/Samples_DurationValue.cs @@ -110,7 +110,7 @@ public void Example_Put_ShortVersion() { DurationValue client = new ArrayClient().GetDurationValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { "PT1H23M45S" }); @@ -125,7 +125,7 @@ public async Task Example_Put_ShortVersion_Async() { DurationValue client = new ArrayClient().GetDurationValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { "PT1H23M45S" }); @@ -158,7 +158,7 @@ public void Example_Put_AllParameters() { DurationValue client = new ArrayClient().GetDurationValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { "PT1H23M45S" }); @@ -173,7 +173,7 @@ public async Task Example_Put_AllParameters_Async() { DurationValue client = new ArrayClient().GetDurationValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { "PT1H23M45S" }); diff --git a/test/CadlRanchProjects/type/array/tests/Generated/Samples/Samples_Float32Value.cs b/test/CadlRanchProjects/type/array/tests/Generated/Samples/Samples_Float32Value.cs index 40fb8c1a971..4fa318f216a 100644 --- a/test/CadlRanchProjects/type/array/tests/Generated/Samples/Samples_Float32Value.cs +++ b/test/CadlRanchProjects/type/array/tests/Generated/Samples/Samples_Float32Value.cs @@ -109,7 +109,7 @@ public void Example_Put_ShortVersion() { Float32Value client = new ArrayClient().GetFloat32ValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { 123.45F }); @@ -124,7 +124,7 @@ public async Task Example_Put_ShortVersion_Async() { Float32Value client = new ArrayClient().GetFloat32ValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { 123.45F }); @@ -157,7 +157,7 @@ public void Example_Put_AllParameters() { Float32Value client = new ArrayClient().GetFloat32ValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { 123.45F }); @@ -172,7 +172,7 @@ public async Task Example_Put_AllParameters_Async() { Float32Value client = new ArrayClient().GetFloat32ValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { 123.45F }); diff --git a/test/CadlRanchProjects/type/array/tests/Generated/Samples/Samples_Int32Value.cs b/test/CadlRanchProjects/type/array/tests/Generated/Samples/Samples_Int32Value.cs index 3fb168bc416..305d91a1719 100644 --- a/test/CadlRanchProjects/type/array/tests/Generated/Samples/Samples_Int32Value.cs +++ b/test/CadlRanchProjects/type/array/tests/Generated/Samples/Samples_Int32Value.cs @@ -109,7 +109,7 @@ public void Example_Put_ShortVersion() { Int32Value client = new ArrayClient().GetInt32ValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { 1234 }); @@ -124,7 +124,7 @@ public async Task Example_Put_ShortVersion_Async() { Int32Value client = new ArrayClient().GetInt32ValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { 1234 }); @@ -157,7 +157,7 @@ public void Example_Put_AllParameters() { Int32Value client = new ArrayClient().GetInt32ValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { 1234 }); @@ -172,7 +172,7 @@ public async Task Example_Put_AllParameters_Async() { Int32Value client = new ArrayClient().GetInt32ValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { 1234 }); diff --git a/test/CadlRanchProjects/type/array/tests/Generated/Samples/Samples_Int64Value.cs b/test/CadlRanchProjects/type/array/tests/Generated/Samples/Samples_Int64Value.cs index e564d81ef57..b4f26fe61b1 100644 --- a/test/CadlRanchProjects/type/array/tests/Generated/Samples/Samples_Int64Value.cs +++ b/test/CadlRanchProjects/type/array/tests/Generated/Samples/Samples_Int64Value.cs @@ -109,7 +109,7 @@ public void Example_Put_ShortVersion() { Int64Value client = new ArrayClient().GetInt64ValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { 1234L }); @@ -124,7 +124,7 @@ public async Task Example_Put_ShortVersion_Async() { Int64Value client = new ArrayClient().GetInt64ValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { 1234L }); @@ -157,7 +157,7 @@ public void Example_Put_AllParameters() { Int64Value client = new ArrayClient().GetInt64ValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { 1234L }); @@ -172,7 +172,7 @@ public async Task Example_Put_AllParameters_Async() { Int64Value client = new ArrayClient().GetInt64ValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { 1234L }); diff --git a/test/CadlRanchProjects/type/array/tests/Generated/Samples/Samples_ModelValue.cs b/test/CadlRanchProjects/type/array/tests/Generated/Samples/Samples_ModelValue.cs index 93fb0ab7460..8eb3a208d2f 100644 --- a/test/CadlRanchProjects/type/array/tests/Generated/Samples/Samples_ModelValue.cs +++ b/test/CadlRanchProjects/type/array/tests/Generated/Samples/Samples_ModelValue.cs @@ -112,7 +112,7 @@ public void Example_Put_ShortVersion() { ModelValue client = new ArrayClient().GetModelValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { new { @@ -130,7 +130,7 @@ public async Task Example_Put_ShortVersion_Async() { ModelValue client = new ArrayClient().GetModelValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { new { @@ -172,7 +172,7 @@ public void Example_Put_AllParameters() { ModelValue client = new ArrayClient().GetModelValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { new { @@ -194,7 +194,7 @@ public async Task Example_Put_AllParameters_Async() { ModelValue client = new ArrayClient().GetModelValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { new { diff --git a/test/CadlRanchProjects/type/array/tests/Generated/Samples/Samples_NullableFloatValue.cs b/test/CadlRanchProjects/type/array/tests/Generated/Samples/Samples_NullableFloatValue.cs index 636c45e1fa8..eff426c0207 100644 --- a/test/CadlRanchProjects/type/array/tests/Generated/Samples/Samples_NullableFloatValue.cs +++ b/test/CadlRanchProjects/type/array/tests/Generated/Samples/Samples_NullableFloatValue.cs @@ -109,7 +109,7 @@ public void Example_Put_ShortVersion() { NullableFloatValue client = new ArrayClient().GetNullableFloatValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { 123.45F }); @@ -124,7 +124,7 @@ public async Task Example_Put_ShortVersion_Async() { NullableFloatValue client = new ArrayClient().GetNullableFloatValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { 123.45F }); @@ -157,7 +157,7 @@ public void Example_Put_AllParameters() { NullableFloatValue client = new ArrayClient().GetNullableFloatValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { 123.45F }); @@ -172,7 +172,7 @@ public async Task Example_Put_AllParameters_Async() { NullableFloatValue client = new ArrayClient().GetNullableFloatValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { 123.45F }); diff --git a/test/CadlRanchProjects/type/array/tests/Generated/Samples/Samples_StringValue.cs b/test/CadlRanchProjects/type/array/tests/Generated/Samples/Samples_StringValue.cs index 7f71d61c647..a253d309e2c 100644 --- a/test/CadlRanchProjects/type/array/tests/Generated/Samples/Samples_StringValue.cs +++ b/test/CadlRanchProjects/type/array/tests/Generated/Samples/Samples_StringValue.cs @@ -109,7 +109,7 @@ public void Example_Put_ShortVersion() { StringValue client = new ArrayClient().GetStringValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { "" }); @@ -124,7 +124,7 @@ public async Task Example_Put_ShortVersion_Async() { StringValue client = new ArrayClient().GetStringValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { "" }); @@ -157,7 +157,7 @@ public void Example_Put_AllParameters() { StringValue client = new ArrayClient().GetStringValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { "" }); @@ -172,7 +172,7 @@ public async Task Example_Put_AllParameters_Async() { StringValue client = new ArrayClient().GetStringValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { "" }); diff --git a/test/CadlRanchProjects/type/array/tests/Generated/Samples/Samples_UnknownValue.cs b/test/CadlRanchProjects/type/array/tests/Generated/Samples/Samples_UnknownValue.cs index cacee5f3c97..376f4d63ebc 100644 --- a/test/CadlRanchProjects/type/array/tests/Generated/Samples/Samples_UnknownValue.cs +++ b/test/CadlRanchProjects/type/array/tests/Generated/Samples/Samples_UnknownValue.cs @@ -109,7 +109,7 @@ public void Example_Put_ShortVersion() { UnknownValue client = new ArrayClient().GetUnknownValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { new object() }); @@ -124,7 +124,7 @@ public async Task Example_Put_ShortVersion_Async() { UnknownValue client = new ArrayClient().GetUnknownValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { new object() }); @@ -163,7 +163,7 @@ public void Example_Put_AllParameters() { UnknownValue client = new ArrayClient().GetUnknownValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { new object() }); @@ -178,7 +178,7 @@ public async Task Example_Put_AllParameters_Async() { UnknownValue client = new ArrayClient().GetUnknownValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { new object() }); diff --git a/test/CadlRanchProjects/type/dictionary/src/Generated/BooleanValue.cs b/test/CadlRanchProjects/type/dictionary/src/Generated/BooleanValue.cs index 9817ee1e867..8a12f94f086 100644 --- a/test/CadlRanchProjects/type/dictionary/src/Generated/BooleanValue.cs +++ b/test/CadlRanchProjects/type/dictionary/src/Generated/BooleanValue.cs @@ -161,7 +161,8 @@ public virtual async Task PutAsync(IDictionary body, Can Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutAsync(RequestContentHelper.FromDictionary(body), context).ConfigureAwait(false); + using RequestContent content = RequestContentHelper.FromDictionary(body); + Response response = await PutAsync(content, context).ConfigureAwait(false); return response; } @@ -174,7 +175,8 @@ public virtual Response Put(IDictionary body, CancellationToken ca Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Put(RequestContentHelper.FromDictionary(body), context); + using RequestContent content = RequestContentHelper.FromDictionary(body); + Response response = Put(content, context); return response; } diff --git a/test/CadlRanchProjects/type/dictionary/src/Generated/DatetimeValue.cs b/test/CadlRanchProjects/type/dictionary/src/Generated/DatetimeValue.cs index 18e0acf6a65..5e0129448d4 100644 --- a/test/CadlRanchProjects/type/dictionary/src/Generated/DatetimeValue.cs +++ b/test/CadlRanchProjects/type/dictionary/src/Generated/DatetimeValue.cs @@ -161,7 +161,8 @@ public virtual async Task PutAsync(IDictionary Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutAsync(RequestContentHelper.FromDictionary(body), context).ConfigureAwait(false); + using RequestContent content = RequestContentHelper.FromDictionary(body); + Response response = await PutAsync(content, context).ConfigureAwait(false); return response; } @@ -174,7 +175,8 @@ public virtual Response Put(IDictionary body, Cancellati Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Put(RequestContentHelper.FromDictionary(body), context); + using RequestContent content = RequestContentHelper.FromDictionary(body); + Response response = Put(content, context); return response; } diff --git a/test/CadlRanchProjects/type/dictionary/src/Generated/Docs/BooleanValue.xml b/test/CadlRanchProjects/type/dictionary/src/Generated/Docs/BooleanValue.xml index 3c73f865efd..5eef91379de 100644 --- a/test/CadlRanchProjects/type/dictionary/src/Generated/Docs/BooleanValue.xml +++ b/test/CadlRanchProjects/type/dictionary/src/Generated/Docs/BooleanValue.xml @@ -121,7 +121,7 @@ This sample shows how to call PutAsync. ", }); @@ -133,7 +133,7 @@ This sample shows how to call PutAsync with all request content. ", }); @@ -148,7 +148,7 @@ This sample shows how to call Put. ", }); @@ -160,7 +160,7 @@ This sample shows how to call Put with all request content. ", }); diff --git a/test/CadlRanchProjects/type/dictionary/src/Generated/Docs/UnknownValue.xml b/test/CadlRanchProjects/type/dictionary/src/Generated/Docs/UnknownValue.xml index 5fa8e1ac262..812af2d0f52 100644 --- a/test/CadlRanchProjects/type/dictionary/src/Generated/Docs/UnknownValue.xml +++ b/test/CadlRanchProjects/type/dictionary/src/Generated/Docs/UnknownValue.xml @@ -121,7 +121,7 @@ This sample shows how to call PutAsync. PutAsync(IDictionary body, Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutAsync(RequestContentHelper.FromDictionary(body), context).ConfigureAwait(false); + using RequestContent content = RequestContentHelper.FromDictionary(body); + Response response = await PutAsync(content, context).ConfigureAwait(false); return response; } @@ -174,7 +175,8 @@ public virtual Response Put(IDictionary body, CancellationToke Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Put(RequestContentHelper.FromDictionary(body), context); + using RequestContent content = RequestContentHelper.FromDictionary(body); + Response response = Put(content, context); return response; } diff --git a/test/CadlRanchProjects/type/dictionary/src/Generated/Float32Value.cs b/test/CadlRanchProjects/type/dictionary/src/Generated/Float32Value.cs index 5c22fa0c0fb..06ea60204e8 100644 --- a/test/CadlRanchProjects/type/dictionary/src/Generated/Float32Value.cs +++ b/test/CadlRanchProjects/type/dictionary/src/Generated/Float32Value.cs @@ -161,7 +161,8 @@ public virtual async Task PutAsync(IDictionary body, Ca Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutAsync(RequestContentHelper.FromDictionary(body), context).ConfigureAwait(false); + using RequestContent content = RequestContentHelper.FromDictionary(body); + Response response = await PutAsync(content, context).ConfigureAwait(false); return response; } @@ -174,7 +175,8 @@ public virtual Response Put(IDictionary body, CancellationToken c Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Put(RequestContentHelper.FromDictionary(body), context); + using RequestContent content = RequestContentHelper.FromDictionary(body); + Response response = Put(content, context); return response; } diff --git a/test/CadlRanchProjects/type/dictionary/src/Generated/Int32Value.cs b/test/CadlRanchProjects/type/dictionary/src/Generated/Int32Value.cs index 9bb0d18390b..54f2a62d22f 100644 --- a/test/CadlRanchProjects/type/dictionary/src/Generated/Int32Value.cs +++ b/test/CadlRanchProjects/type/dictionary/src/Generated/Int32Value.cs @@ -161,7 +161,8 @@ public virtual async Task PutAsync(IDictionary body, Canc Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutAsync(RequestContentHelper.FromDictionary(body), context).ConfigureAwait(false); + using RequestContent content = RequestContentHelper.FromDictionary(body); + Response response = await PutAsync(content, context).ConfigureAwait(false); return response; } @@ -174,7 +175,8 @@ public virtual Response Put(IDictionary body, CancellationToken can Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Put(RequestContentHelper.FromDictionary(body), context); + using RequestContent content = RequestContentHelper.FromDictionary(body); + Response response = Put(content, context); return response; } diff --git a/test/CadlRanchProjects/type/dictionary/src/Generated/Int64Value.cs b/test/CadlRanchProjects/type/dictionary/src/Generated/Int64Value.cs index e1870afc93c..c3287a960ce 100644 --- a/test/CadlRanchProjects/type/dictionary/src/Generated/Int64Value.cs +++ b/test/CadlRanchProjects/type/dictionary/src/Generated/Int64Value.cs @@ -161,7 +161,8 @@ public virtual async Task PutAsync(IDictionary body, Can Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutAsync(RequestContentHelper.FromDictionary(body), context).ConfigureAwait(false); + using RequestContent content = RequestContentHelper.FromDictionary(body); + Response response = await PutAsync(content, context).ConfigureAwait(false); return response; } @@ -174,7 +175,8 @@ public virtual Response Put(IDictionary body, CancellationToken ca Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Put(RequestContentHelper.FromDictionary(body), context); + using RequestContent content = RequestContentHelper.FromDictionary(body); + Response response = Put(content, context); return response; } diff --git a/test/CadlRanchProjects/type/dictionary/src/Generated/ModelValue.cs b/test/CadlRanchProjects/type/dictionary/src/Generated/ModelValue.cs index acf9f39ad21..f5aac4c39ea 100644 --- a/test/CadlRanchProjects/type/dictionary/src/Generated/ModelValue.cs +++ b/test/CadlRanchProjects/type/dictionary/src/Generated/ModelValue.cs @@ -162,7 +162,8 @@ public virtual async Task PutAsync(IDictionary bod Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutAsync(RequestContentHelper.FromDictionary(body), context).ConfigureAwait(false); + using RequestContent content = RequestContentHelper.FromDictionary(body); + Response response = await PutAsync(content, context).ConfigureAwait(false); return response; } @@ -175,7 +176,8 @@ public virtual Response Put(IDictionary body, CancellationTo Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Put(RequestContentHelper.FromDictionary(body), context); + using RequestContent content = RequestContentHelper.FromDictionary(body); + Response response = Put(content, context); return response; } diff --git a/test/CadlRanchProjects/type/dictionary/src/Generated/NullableFloatValue.cs b/test/CadlRanchProjects/type/dictionary/src/Generated/NullableFloatValue.cs index c353fa5d850..85cedcbe83d 100644 --- a/test/CadlRanchProjects/type/dictionary/src/Generated/NullableFloatValue.cs +++ b/test/CadlRanchProjects/type/dictionary/src/Generated/NullableFloatValue.cs @@ -175,7 +175,8 @@ public virtual async Task PutAsync(IDictionary body, C Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutAsync(RequestContentHelper.FromDictionary(body), context).ConfigureAwait(false); + using RequestContent content = RequestContentHelper.FromDictionary(body); + Response response = await PutAsync(content, context).ConfigureAwait(false); return response; } @@ -188,7 +189,8 @@ public virtual Response Put(IDictionary body, CancellationToken Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Put(RequestContentHelper.FromDictionary(body), context); + using RequestContent content = RequestContentHelper.FromDictionary(body); + Response response = Put(content, context); return response; } diff --git a/test/CadlRanchProjects/type/dictionary/src/Generated/RecursiveModelValue.cs b/test/CadlRanchProjects/type/dictionary/src/Generated/RecursiveModelValue.cs index 9aceeb2b94c..97a68597e38 100644 --- a/test/CadlRanchProjects/type/dictionary/src/Generated/RecursiveModelValue.cs +++ b/test/CadlRanchProjects/type/dictionary/src/Generated/RecursiveModelValue.cs @@ -162,7 +162,8 @@ public virtual async Task PutAsync(IDictionary bod Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutAsync(RequestContentHelper.FromDictionary(body), context).ConfigureAwait(false); + using RequestContent content = RequestContentHelper.FromDictionary(body); + Response response = await PutAsync(content, context).ConfigureAwait(false); return response; } @@ -175,7 +176,8 @@ public virtual Response Put(IDictionary body, CancellationTo Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Put(RequestContentHelper.FromDictionary(body), context); + using RequestContent content = RequestContentHelper.FromDictionary(body); + Response response = Put(content, context); return response; } diff --git a/test/CadlRanchProjects/type/dictionary/src/Generated/StringValue.cs b/test/CadlRanchProjects/type/dictionary/src/Generated/StringValue.cs index d3f77170702..2e2ea58c2f4 100644 --- a/test/CadlRanchProjects/type/dictionary/src/Generated/StringValue.cs +++ b/test/CadlRanchProjects/type/dictionary/src/Generated/StringValue.cs @@ -161,7 +161,8 @@ public virtual async Task PutAsync(IDictionary body, C Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutAsync(RequestContentHelper.FromDictionary(body), context).ConfigureAwait(false); + using RequestContent content = RequestContentHelper.FromDictionary(body); + Response response = await PutAsync(content, context).ConfigureAwait(false); return response; } @@ -174,7 +175,8 @@ public virtual Response Put(IDictionary body, CancellationToken Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Put(RequestContentHelper.FromDictionary(body), context); + using RequestContent content = RequestContentHelper.FromDictionary(body); + Response response = Put(content, context); return response; } diff --git a/test/CadlRanchProjects/type/dictionary/src/Generated/UnknownValue.cs b/test/CadlRanchProjects/type/dictionary/src/Generated/UnknownValue.cs index bedd5ca2e81..abdf18926e2 100644 --- a/test/CadlRanchProjects/type/dictionary/src/Generated/UnknownValue.cs +++ b/test/CadlRanchProjects/type/dictionary/src/Generated/UnknownValue.cs @@ -175,7 +175,8 @@ public virtual async Task PutAsync(IDictionary bod Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutAsync(RequestContentHelper.FromDictionary(body), context).ConfigureAwait(false); + using RequestContent content = RequestContentHelper.FromDictionary(body); + Response response = await PutAsync(content, context).ConfigureAwait(false); return response; } @@ -188,7 +189,8 @@ public virtual Response Put(IDictionary body, CancellationTo Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Put(RequestContentHelper.FromDictionary(body), context); + using RequestContent content = RequestContentHelper.FromDictionary(body); + Response response = Put(content, context); return response; } diff --git a/test/CadlRanchProjects/type/dictionary/tests/Generated/Samples/Samples_BooleanValue.cs b/test/CadlRanchProjects/type/dictionary/tests/Generated/Samples/Samples_BooleanValue.cs index 702de4e15a1..189d3f72640 100644 --- a/test/CadlRanchProjects/type/dictionary/tests/Generated/Samples/Samples_BooleanValue.cs +++ b/test/CadlRanchProjects/type/dictionary/tests/Generated/Samples/Samples_BooleanValue.cs @@ -109,7 +109,7 @@ public void Example_Put_ShortVersion() { BooleanValue client = new DictionaryClient().GetBooleanValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { key = true, }); @@ -124,7 +124,7 @@ public async Task Example_Put_ShortVersion_Async() { BooleanValue client = new DictionaryClient().GetBooleanValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { key = true, }); @@ -163,7 +163,7 @@ public void Example_Put_AllParameters() { BooleanValue client = new DictionaryClient().GetBooleanValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { key = true, }); @@ -178,7 +178,7 @@ public async Task Example_Put_AllParameters_Async() { BooleanValue client = new DictionaryClient().GetBooleanValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { key = true, }); diff --git a/test/CadlRanchProjects/type/dictionary/tests/Generated/Samples/Samples_DatetimeValue.cs b/test/CadlRanchProjects/type/dictionary/tests/Generated/Samples/Samples_DatetimeValue.cs index 66a5276caff..0ebf07d5986 100644 --- a/test/CadlRanchProjects/type/dictionary/tests/Generated/Samples/Samples_DatetimeValue.cs +++ b/test/CadlRanchProjects/type/dictionary/tests/Generated/Samples/Samples_DatetimeValue.cs @@ -109,7 +109,7 @@ public void Example_Put_ShortVersion() { DatetimeValue client = new DictionaryClient().GetDatetimeValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { key = "2022-05-10T14:57:31.2311892-04:00", }); @@ -124,7 +124,7 @@ public async Task Example_Put_ShortVersion_Async() { DatetimeValue client = new DictionaryClient().GetDatetimeValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { key = "2022-05-10T14:57:31.2311892-04:00", }); @@ -163,7 +163,7 @@ public void Example_Put_AllParameters() { DatetimeValue client = new DictionaryClient().GetDatetimeValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { key = "2022-05-10T14:57:31.2311892-04:00", }); @@ -178,7 +178,7 @@ public async Task Example_Put_AllParameters_Async() { DatetimeValue client = new DictionaryClient().GetDatetimeValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { key = "2022-05-10T14:57:31.2311892-04:00", }); diff --git a/test/CadlRanchProjects/type/dictionary/tests/Generated/Samples/Samples_DurationValue.cs b/test/CadlRanchProjects/type/dictionary/tests/Generated/Samples/Samples_DurationValue.cs index 38b6b3f69e6..b707a87e50e 100644 --- a/test/CadlRanchProjects/type/dictionary/tests/Generated/Samples/Samples_DurationValue.cs +++ b/test/CadlRanchProjects/type/dictionary/tests/Generated/Samples/Samples_DurationValue.cs @@ -110,7 +110,7 @@ public void Example_Put_ShortVersion() { DurationValue client = new DictionaryClient().GetDurationValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { key = "PT1H23M45S", }); @@ -125,7 +125,7 @@ public async Task Example_Put_ShortVersion_Async() { DurationValue client = new DictionaryClient().GetDurationValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { key = "PT1H23M45S", }); @@ -164,7 +164,7 @@ public void Example_Put_AllParameters() { DurationValue client = new DictionaryClient().GetDurationValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { key = "PT1H23M45S", }); @@ -179,7 +179,7 @@ public async Task Example_Put_AllParameters_Async() { DurationValue client = new DictionaryClient().GetDurationValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { key = "PT1H23M45S", }); diff --git a/test/CadlRanchProjects/type/dictionary/tests/Generated/Samples/Samples_Float32Value.cs b/test/CadlRanchProjects/type/dictionary/tests/Generated/Samples/Samples_Float32Value.cs index e3ec50c5322..823b93e23bf 100644 --- a/test/CadlRanchProjects/type/dictionary/tests/Generated/Samples/Samples_Float32Value.cs +++ b/test/CadlRanchProjects/type/dictionary/tests/Generated/Samples/Samples_Float32Value.cs @@ -109,7 +109,7 @@ public void Example_Put_ShortVersion() { Float32Value client = new DictionaryClient().GetFloat32ValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { key = 123.45F, }); @@ -124,7 +124,7 @@ public async Task Example_Put_ShortVersion_Async() { Float32Value client = new DictionaryClient().GetFloat32ValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { key = 123.45F, }); @@ -163,7 +163,7 @@ public void Example_Put_AllParameters() { Float32Value client = new DictionaryClient().GetFloat32ValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { key = 123.45F, }); @@ -178,7 +178,7 @@ public async Task Example_Put_AllParameters_Async() { Float32Value client = new DictionaryClient().GetFloat32ValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { key = 123.45F, }); diff --git a/test/CadlRanchProjects/type/dictionary/tests/Generated/Samples/Samples_Int32Value.cs b/test/CadlRanchProjects/type/dictionary/tests/Generated/Samples/Samples_Int32Value.cs index 54a59b93632..f220a267386 100644 --- a/test/CadlRanchProjects/type/dictionary/tests/Generated/Samples/Samples_Int32Value.cs +++ b/test/CadlRanchProjects/type/dictionary/tests/Generated/Samples/Samples_Int32Value.cs @@ -109,7 +109,7 @@ public void Example_Put_ShortVersion() { Int32Value client = new DictionaryClient().GetInt32ValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { key = 1234, }); @@ -124,7 +124,7 @@ public async Task Example_Put_ShortVersion_Async() { Int32Value client = new DictionaryClient().GetInt32ValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { key = 1234, }); @@ -163,7 +163,7 @@ public void Example_Put_AllParameters() { Int32Value client = new DictionaryClient().GetInt32ValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { key = 1234, }); @@ -178,7 +178,7 @@ public async Task Example_Put_AllParameters_Async() { Int32Value client = new DictionaryClient().GetInt32ValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { key = 1234, }); diff --git a/test/CadlRanchProjects/type/dictionary/tests/Generated/Samples/Samples_Int64Value.cs b/test/CadlRanchProjects/type/dictionary/tests/Generated/Samples/Samples_Int64Value.cs index 81768d10e02..8b656ca090d 100644 --- a/test/CadlRanchProjects/type/dictionary/tests/Generated/Samples/Samples_Int64Value.cs +++ b/test/CadlRanchProjects/type/dictionary/tests/Generated/Samples/Samples_Int64Value.cs @@ -109,7 +109,7 @@ public void Example_Put_ShortVersion() { Int64Value client = new DictionaryClient().GetInt64ValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { key = 1234L, }); @@ -124,7 +124,7 @@ public async Task Example_Put_ShortVersion_Async() { Int64Value client = new DictionaryClient().GetInt64ValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { key = 1234L, }); @@ -163,7 +163,7 @@ public void Example_Put_AllParameters() { Int64Value client = new DictionaryClient().GetInt64ValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { key = 1234L, }); @@ -178,7 +178,7 @@ public async Task Example_Put_AllParameters_Async() { Int64Value client = new DictionaryClient().GetInt64ValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { key = 1234L, }); diff --git a/test/CadlRanchProjects/type/dictionary/tests/Generated/Samples/Samples_ModelValue.cs b/test/CadlRanchProjects/type/dictionary/tests/Generated/Samples/Samples_ModelValue.cs index f190d36a92e..d095cc3c5d8 100644 --- a/test/CadlRanchProjects/type/dictionary/tests/Generated/Samples/Samples_ModelValue.cs +++ b/test/CadlRanchProjects/type/dictionary/tests/Generated/Samples/Samples_ModelValue.cs @@ -112,7 +112,7 @@ public void Example_Put_ShortVersion() { ModelValue client = new DictionaryClient().GetModelValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { key = new { @@ -130,7 +130,7 @@ public async Task Example_Put_ShortVersion_Async() { ModelValue client = new DictionaryClient().GetModelValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { key = new { @@ -172,7 +172,7 @@ public void Example_Put_AllParameters() { ModelValue client = new DictionaryClient().GetModelValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { key = new { @@ -191,7 +191,7 @@ public async Task Example_Put_AllParameters_Async() { ModelValue client = new DictionaryClient().GetModelValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { key = new { diff --git a/test/CadlRanchProjects/type/dictionary/tests/Generated/Samples/Samples_NullableFloatValue.cs b/test/CadlRanchProjects/type/dictionary/tests/Generated/Samples/Samples_NullableFloatValue.cs index f0d8eba5f7b..12aa7c53706 100644 --- a/test/CadlRanchProjects/type/dictionary/tests/Generated/Samples/Samples_NullableFloatValue.cs +++ b/test/CadlRanchProjects/type/dictionary/tests/Generated/Samples/Samples_NullableFloatValue.cs @@ -109,7 +109,7 @@ public void Example_Put_ShortVersion() { NullableFloatValue client = new DictionaryClient().GetNullableFloatValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { key = 123.45F, }); @@ -124,7 +124,7 @@ public async Task Example_Put_ShortVersion_Async() { NullableFloatValue client = new DictionaryClient().GetNullableFloatValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { key = 123.45F, }); @@ -163,7 +163,7 @@ public void Example_Put_AllParameters() { NullableFloatValue client = new DictionaryClient().GetNullableFloatValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { key = 123.45F, }); @@ -178,7 +178,7 @@ public async Task Example_Put_AllParameters_Async() { NullableFloatValue client = new DictionaryClient().GetNullableFloatValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { key = 123.45F, }); diff --git a/test/CadlRanchProjects/type/dictionary/tests/Generated/Samples/Samples_RecursiveModelValue.cs b/test/CadlRanchProjects/type/dictionary/tests/Generated/Samples/Samples_RecursiveModelValue.cs index b30eafc9f78..ce92073f8f6 100644 --- a/test/CadlRanchProjects/type/dictionary/tests/Generated/Samples/Samples_RecursiveModelValue.cs +++ b/test/CadlRanchProjects/type/dictionary/tests/Generated/Samples/Samples_RecursiveModelValue.cs @@ -112,7 +112,7 @@ public void Example_Put_ShortVersion() { RecursiveModelValue client = new DictionaryClient().GetRecursiveModelValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { key = new { @@ -130,7 +130,7 @@ public async Task Example_Put_ShortVersion_Async() { RecursiveModelValue client = new DictionaryClient().GetRecursiveModelValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { key = new { @@ -172,7 +172,7 @@ public void Example_Put_AllParameters() { RecursiveModelValue client = new DictionaryClient().GetRecursiveModelValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { key = new { @@ -191,7 +191,7 @@ public async Task Example_Put_AllParameters_Async() { RecursiveModelValue client = new DictionaryClient().GetRecursiveModelValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { key = new { diff --git a/test/CadlRanchProjects/type/dictionary/tests/Generated/Samples/Samples_StringValue.cs b/test/CadlRanchProjects/type/dictionary/tests/Generated/Samples/Samples_StringValue.cs index 390ecbf3c33..9ea9e138620 100644 --- a/test/CadlRanchProjects/type/dictionary/tests/Generated/Samples/Samples_StringValue.cs +++ b/test/CadlRanchProjects/type/dictionary/tests/Generated/Samples/Samples_StringValue.cs @@ -109,7 +109,7 @@ public void Example_Put_ShortVersion() { StringValue client = new DictionaryClient().GetStringValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { key = "", }); @@ -124,7 +124,7 @@ public async Task Example_Put_ShortVersion_Async() { StringValue client = new DictionaryClient().GetStringValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { key = "", }); @@ -163,7 +163,7 @@ public void Example_Put_AllParameters() { StringValue client = new DictionaryClient().GetStringValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { key = "", }); @@ -178,7 +178,7 @@ public async Task Example_Put_AllParameters_Async() { StringValue client = new DictionaryClient().GetStringValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { key = "", }); diff --git a/test/CadlRanchProjects/type/dictionary/tests/Generated/Samples/Samples_UnknownValue.cs b/test/CadlRanchProjects/type/dictionary/tests/Generated/Samples/Samples_UnknownValue.cs index 308dab1f0b3..a0da9f11c94 100644 --- a/test/CadlRanchProjects/type/dictionary/tests/Generated/Samples/Samples_UnknownValue.cs +++ b/test/CadlRanchProjects/type/dictionary/tests/Generated/Samples/Samples_UnknownValue.cs @@ -109,7 +109,7 @@ public void Example_Put_ShortVersion() { UnknownValue client = new DictionaryClient().GetUnknownValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { key = new object(), }); @@ -124,7 +124,7 @@ public async Task Example_Put_ShortVersion_Async() { UnknownValue client = new DictionaryClient().GetUnknownValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { key = new object(), }); @@ -163,7 +163,7 @@ public void Example_Put_AllParameters() { UnknownValue client = new DictionaryClient().GetUnknownValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { key = new object(), }); @@ -178,7 +178,7 @@ public async Task Example_Put_AllParameters_Async() { UnknownValue client = new DictionaryClient().GetUnknownValueClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { key = new object(), }); diff --git a/test/CadlRanchProjects/type/enum/extensible/src/Generated/Docs/ExtensibleClient.xml b/test/CadlRanchProjects/type/enum/extensible/src/Generated/Docs/ExtensibleClient.xml index e7c7024e354..f53f509ceda 100644 --- a/test/CadlRanchProjects/type/enum/extensible/src/Generated/Docs/ExtensibleClient.xml +++ b/test/CadlRanchProjects/type/enum/extensible/src/Generated/Docs/ExtensibleClient.xml @@ -181,7 +181,7 @@ This sample shows how to call PutKnownValueAsync. PutKnownValueAsync(DaysOfWeekExtensibleEnum body, CancellationToken cancellationToken = default) { RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutKnownValueAsync(BinaryData.FromObjectAsJson(body.ToString()), context).ConfigureAwait(false); + using RequestContent content = BinaryData.FromObjectAsJson(body.ToString()); + Response response = await PutKnownValueAsync(content, context).ConfigureAwait(false); return response; } @@ -241,7 +242,8 @@ public virtual async Task PutKnownValueAsync(DaysOfWeekExtensibleEnum public virtual Response PutKnownValue(DaysOfWeekExtensibleEnum body, CancellationToken cancellationToken = default) { RequestContext context = FromCancellationToken(cancellationToken); - Response response = PutKnownValue(BinaryData.FromObjectAsJson(body.ToString()), context); + using RequestContent content = BinaryData.FromObjectAsJson(body.ToString()); + Response response = PutKnownValue(content, context); return response; } @@ -329,7 +331,8 @@ public virtual Response PutKnownValue(RequestContent content, RequestContext con public virtual async Task PutUnknownValueAsync(DaysOfWeekExtensibleEnum body, CancellationToken cancellationToken = default) { RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutUnknownValueAsync(BinaryData.FromObjectAsJson(body.ToString()), context).ConfigureAwait(false); + using RequestContent content = BinaryData.FromObjectAsJson(body.ToString()); + Response response = await PutUnknownValueAsync(content, context).ConfigureAwait(false); return response; } @@ -339,7 +342,8 @@ public virtual async Task PutUnknownValueAsync(DaysOfWeekExtensibleEnu public virtual Response PutUnknownValue(DaysOfWeekExtensibleEnum body, CancellationToken cancellationToken = default) { RequestContext context = FromCancellationToken(cancellationToken); - Response response = PutUnknownValue(BinaryData.FromObjectAsJson(body.ToString()), context); + using RequestContent content = BinaryData.FromObjectAsJson(body.ToString()); + Response response = PutUnknownValue(content, context); return response; } diff --git a/test/CadlRanchProjects/type/enum/extensible/tests/Generated/Samples/Samples_ExtensibleClient.cs b/test/CadlRanchProjects/type/enum/extensible/tests/Generated/Samples/Samples_ExtensibleClient.cs index fd7897323f3..bbe5130ddee 100644 --- a/test/CadlRanchProjects/type/enum/extensible/tests/Generated/Samples/Samples_ExtensibleClient.cs +++ b/test/CadlRanchProjects/type/enum/extensible/tests/Generated/Samples/Samples_ExtensibleClient.cs @@ -193,7 +193,7 @@ public void Example_PutKnownValue_ShortVersion() { ExtensibleClient client = new ExtensibleClient(); - RequestContent content = RequestContent.Create("Monday"); + using RequestContent content = RequestContent.Create("Monday"); Response response = client.PutKnownValue(content); Console.WriteLine(response.Status); @@ -205,7 +205,7 @@ public async Task Example_PutKnownValue_ShortVersion_Async() { ExtensibleClient client = new ExtensibleClient(); - RequestContent content = RequestContent.Create("Monday"); + using RequestContent content = RequestContent.Create("Monday"); Response response = await client.PutKnownValueAsync(content); Console.WriteLine(response.Status); @@ -235,7 +235,7 @@ public void Example_PutKnownValue_AllParameters() { ExtensibleClient client = new ExtensibleClient(); - RequestContent content = RequestContent.Create("Monday"); + using RequestContent content = RequestContent.Create("Monday"); Response response = client.PutKnownValue(content); Console.WriteLine(response.Status); @@ -247,7 +247,7 @@ public async Task Example_PutKnownValue_AllParameters_Async() { ExtensibleClient client = new ExtensibleClient(); - RequestContent content = RequestContent.Create("Monday"); + using RequestContent content = RequestContent.Create("Monday"); Response response = await client.PutKnownValueAsync(content); Console.WriteLine(response.Status); @@ -277,7 +277,7 @@ public void Example_PutUnknownValue_ShortVersion() { ExtensibleClient client = new ExtensibleClient(); - RequestContent content = RequestContent.Create("Monday"); + using RequestContent content = RequestContent.Create("Monday"); Response response = client.PutUnknownValue(content); Console.WriteLine(response.Status); @@ -289,7 +289,7 @@ public async Task Example_PutUnknownValue_ShortVersion_Async() { ExtensibleClient client = new ExtensibleClient(); - RequestContent content = RequestContent.Create("Monday"); + using RequestContent content = RequestContent.Create("Monday"); Response response = await client.PutUnknownValueAsync(content); Console.WriteLine(response.Status); @@ -319,7 +319,7 @@ public void Example_PutUnknownValue_AllParameters() { ExtensibleClient client = new ExtensibleClient(); - RequestContent content = RequestContent.Create("Monday"); + using RequestContent content = RequestContent.Create("Monday"); Response response = client.PutUnknownValue(content); Console.WriteLine(response.Status); @@ -331,7 +331,7 @@ public async Task Example_PutUnknownValue_AllParameters_Async() { ExtensibleClient client = new ExtensibleClient(); - RequestContent content = RequestContent.Create("Monday"); + using RequestContent content = RequestContent.Create("Monday"); Response response = await client.PutUnknownValueAsync(content); Console.WriteLine(response.Status); diff --git a/test/CadlRanchProjects/type/enum/fixed/src/Generated/Docs/FixedClient.xml b/test/CadlRanchProjects/type/enum/fixed/src/Generated/Docs/FixedClient.xml index 86be47c48bb..38e55f4f897 100644 --- a/test/CadlRanchProjects/type/enum/fixed/src/Generated/Docs/FixedClient.xml +++ b/test/CadlRanchProjects/type/enum/fixed/src/Generated/Docs/FixedClient.xml @@ -109,7 +109,7 @@ This sample shows how to call PutKnownValueAsync. PutKnownValueAsync(DaysOfWeekEnum body, CancellationToken cancellationToken = default) { RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutKnownValueAsync(BinaryData.FromObjectAsJson(body.ToSerialString()), context).ConfigureAwait(false); + using RequestContent content = BinaryData.FromObjectAsJson(body.ToSerialString()); + Response response = await PutKnownValueAsync(content, context).ConfigureAwait(false); return response; } @@ -157,7 +158,8 @@ public virtual async Task PutKnownValueAsync(DaysOfWeekEnum body, Canc public virtual Response PutKnownValue(DaysOfWeekEnum body, CancellationToken cancellationToken = default) { RequestContext context = FromCancellationToken(cancellationToken); - Response response = PutKnownValue(BinaryData.FromObjectAsJson(body.ToSerialString()), context); + using RequestContent content = BinaryData.FromObjectAsJson(body.ToSerialString()); + Response response = PutKnownValue(content, context); return response; } @@ -246,7 +248,8 @@ public virtual Response PutKnownValue(RequestContent content, RequestContext con public virtual async Task PutUnknownValueAsync(DaysOfWeekEnum body, CancellationToken cancellationToken = default) { RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutUnknownValueAsync(BinaryData.FromObjectAsJson(body.ToSerialString()), context).ConfigureAwait(false); + using RequestContent content = BinaryData.FromObjectAsJson(body.ToSerialString()); + Response response = await PutUnknownValueAsync(content, context).ConfigureAwait(false); return response; } @@ -257,7 +260,8 @@ public virtual async Task PutUnknownValueAsync(DaysOfWeekEnum body, Ca public virtual Response PutUnknownValue(DaysOfWeekEnum body, CancellationToken cancellationToken = default) { RequestContext context = FromCancellationToken(cancellationToken); - Response response = PutUnknownValue(BinaryData.FromObjectAsJson(body.ToSerialString()), context); + using RequestContent content = BinaryData.FromObjectAsJson(body.ToSerialString()); + Response response = PutUnknownValue(content, context); return response; } diff --git a/test/CadlRanchProjects/type/enum/fixed/tests/Generated/Samples/Samples_FixedClient.cs b/test/CadlRanchProjects/type/enum/fixed/tests/Generated/Samples/Samples_FixedClient.cs index 9a96189f17e..a876630492e 100644 --- a/test/CadlRanchProjects/type/enum/fixed/tests/Generated/Samples/Samples_FixedClient.cs +++ b/test/CadlRanchProjects/type/enum/fixed/tests/Generated/Samples/Samples_FixedClient.cs @@ -109,7 +109,7 @@ public void Example_PutKnownValue_ShortVersion() { FixedClient client = new FixedClient(); - RequestContent content = RequestContent.Create("Monday"); + using RequestContent content = RequestContent.Create("Monday"); Response response = client.PutKnownValue(content); Console.WriteLine(response.Status); @@ -121,7 +121,7 @@ public async Task Example_PutKnownValue_ShortVersion_Async() { FixedClient client = new FixedClient(); - RequestContent content = RequestContent.Create("Monday"); + using RequestContent content = RequestContent.Create("Monday"); Response response = await client.PutKnownValueAsync(content); Console.WriteLine(response.Status); @@ -151,7 +151,7 @@ public void Example_PutKnownValue_AllParameters() { FixedClient client = new FixedClient(); - RequestContent content = RequestContent.Create("Monday"); + using RequestContent content = RequestContent.Create("Monday"); Response response = client.PutKnownValue(content); Console.WriteLine(response.Status); @@ -163,7 +163,7 @@ public async Task Example_PutKnownValue_AllParameters_Async() { FixedClient client = new FixedClient(); - RequestContent content = RequestContent.Create("Monday"); + using RequestContent content = RequestContent.Create("Monday"); Response response = await client.PutKnownValueAsync(content); Console.WriteLine(response.Status); @@ -193,7 +193,7 @@ public void Example_PutUnknownValue_ShortVersion() { FixedClient client = new FixedClient(); - RequestContent content = RequestContent.Create("Monday"); + using RequestContent content = RequestContent.Create("Monday"); Response response = client.PutUnknownValue(content); Console.WriteLine(response.Status); @@ -205,7 +205,7 @@ public async Task Example_PutUnknownValue_ShortVersion_Async() { FixedClient client = new FixedClient(); - RequestContent content = RequestContent.Create("Monday"); + using RequestContent content = RequestContent.Create("Monday"); Response response = await client.PutUnknownValueAsync(content); Console.WriteLine(response.Status); @@ -235,7 +235,7 @@ public void Example_PutUnknownValue_AllParameters() { FixedClient client = new FixedClient(); - RequestContent content = RequestContent.Create("Monday"); + using RequestContent content = RequestContent.Create("Monday"); Response response = client.PutUnknownValue(content); Console.WriteLine(response.Status); @@ -247,7 +247,7 @@ public async Task Example_PutUnknownValue_AllParameters_Async() { FixedClient client = new FixedClient(); - RequestContent content = RequestContent.Create("Monday"); + using RequestContent content = RequestContent.Create("Monday"); Response response = await client.PutUnknownValueAsync(content); Console.WriteLine(response.Status); diff --git a/test/CadlRanchProjects/type/model/empty/src/Generated/Docs/EmptyClient.xml b/test/CadlRanchProjects/type/model/empty/src/Generated/Docs/EmptyClient.xml index 45a91120ceb..854f0925196 100644 --- a/test/CadlRanchProjects/type/model/empty/src/Generated/Docs/EmptyClient.xml +++ b/test/CadlRanchProjects/type/model/empty/src/Generated/Docs/EmptyClient.xml @@ -41,7 +41,7 @@ This sample shows how to call PutEmptyAsync. PutEmptyAsync(EmptyInput input, Cancellation Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutEmptyAsync(input.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = input.ToRequestContent(); + Response response = await PutEmptyAsync(content, context).ConfigureAwait(false); return response; } @@ -71,7 +72,8 @@ public virtual Response PutEmpty(EmptyInput input, CancellationToken cancellatio Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = PutEmpty(input.ToRequestContent(), context); + using RequestContent content = input.ToRequestContent(); + Response response = PutEmpty(content, context); return response; } @@ -250,7 +252,8 @@ public virtual async Task> PostRoundTripEmptyAsync(Em Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PostRoundTripEmptyAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await PostRoundTripEmptyAsync(content, context).ConfigureAwait(false); return Response.FromValue(EmptyInputOutput.FromResponse(response), response); } @@ -263,7 +266,8 @@ public virtual Response PostRoundTripEmpty(EmptyInputOutput bo Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = PostRoundTripEmpty(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = PostRoundTripEmpty(content, context); return Response.FromValue(EmptyInputOutput.FromResponse(response), response); } diff --git a/test/CadlRanchProjects/type/model/empty/tests/Generated/Samples/Samples_EmptyClient.cs b/test/CadlRanchProjects/type/model/empty/tests/Generated/Samples/Samples_EmptyClient.cs index 5dc3eb89319..eac23985593 100644 --- a/test/CadlRanchProjects/type/model/empty/tests/Generated/Samples/Samples_EmptyClient.cs +++ b/test/CadlRanchProjects/type/model/empty/tests/Generated/Samples/Samples_EmptyClient.cs @@ -25,7 +25,7 @@ public void Example_PutEmpty_ShortVersion() { EmptyClient client = new EmptyClient(); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.PutEmpty(content); Console.WriteLine(response.Status); @@ -37,7 +37,7 @@ public async Task Example_PutEmpty_ShortVersion_Async() { EmptyClient client = new EmptyClient(); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutEmptyAsync(content); Console.WriteLine(response.Status); @@ -69,7 +69,7 @@ public void Example_PutEmpty_AllParameters() { EmptyClient client = new EmptyClient(); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.PutEmpty(content); Console.WriteLine(response.Status); @@ -81,7 +81,7 @@ public async Task Example_PutEmpty_AllParameters_Async() { EmptyClient client = new EmptyClient(); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutEmptyAsync(content); Console.WriteLine(response.Status); @@ -197,7 +197,7 @@ public void Example_PostRoundTripEmpty_ShortVersion() { EmptyClient client = new EmptyClient(); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.PostRoundTripEmpty(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -210,7 +210,7 @@ public async Task Example_PostRoundTripEmpty_ShortVersion_Async() { EmptyClient client = new EmptyClient(); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.PostRoundTripEmptyAsync(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -243,7 +243,7 @@ public void Example_PostRoundTripEmpty_AllParameters() { EmptyClient client = new EmptyClient(); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.PostRoundTripEmpty(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -256,7 +256,7 @@ public async Task Example_PostRoundTripEmpty_AllParameters_Async() { EmptyClient client = new EmptyClient(); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.PostRoundTripEmptyAsync(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; diff --git a/test/CadlRanchProjects/type/model/inheritance/enum-discriminator/src/Generated/Docs/EnumDiscriminatorClient.xml b/test/CadlRanchProjects/type/model/inheritance/enum-discriminator/src/Generated/Docs/EnumDiscriminatorClient.xml index cccdc60c6ed..ba51653eee1 100644 --- a/test/CadlRanchProjects/type/model/inheritance/enum-discriminator/src/Generated/Docs/EnumDiscriminatorClient.xml +++ b/test/CadlRanchProjects/type/model/inheritance/enum-discriminator/src/Generated/Docs/EnumDiscriminatorClient.xml @@ -117,7 +117,7 @@ This sample shows how to call PutExtensibleModelAsync. PutExtensibleModelAsync(Dog input, Cancellat Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutExtensibleModelAsync(input.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = input.ToRequestContent(); + Response response = await PutExtensibleModelAsync(content, context).ConfigureAwait(false); return response; } @@ -163,7 +164,8 @@ public virtual Response PutExtensibleModel(Dog input, CancellationToken cancella Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = PutExtensibleModel(input.ToRequestContent(), context); + using RequestContent content = input.ToRequestContent(); + Response response = PutExtensibleModel(content, context); return response; } @@ -525,7 +527,8 @@ public virtual async Task PutFixedModelAsync(Snake input, Cancellation Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutFixedModelAsync(input.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = input.ToRequestContent(); + Response response = await PutFixedModelAsync(content, context).ConfigureAwait(false); return response; } @@ -539,7 +542,8 @@ public virtual Response PutFixedModel(Snake input, CancellationToken cancellatio Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = PutFixedModel(input.ToRequestContent(), context); + using RequestContent content = input.ToRequestContent(); + Response response = PutFixedModel(content, context); return response; } diff --git a/test/CadlRanchProjects/type/model/inheritance/enum-discriminator/tests/Generated/Samples/Samples_EnumDiscriminatorClient.cs b/test/CadlRanchProjects/type/model/inheritance/enum-discriminator/tests/Generated/Samples/Samples_EnumDiscriminatorClient.cs index db68a8f52e9..18284926b1d 100644 --- a/test/CadlRanchProjects/type/model/inheritance/enum-discriminator/tests/Generated/Samples/Samples_EnumDiscriminatorClient.cs +++ b/test/CadlRanchProjects/type/model/inheritance/enum-discriminator/tests/Generated/Samples/Samples_EnumDiscriminatorClient.cs @@ -113,7 +113,7 @@ public void Example_PutExtensibleModel_ShortVersion() { EnumDiscriminatorClient client = new EnumDiscriminatorClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { kind = "golden", weight = 1234, @@ -129,7 +129,7 @@ public async Task Example_PutExtensibleModel_ShortVersion_Async() { EnumDiscriminatorClient client = new EnumDiscriminatorClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { kind = "golden", weight = 1234, @@ -165,7 +165,7 @@ public void Example_PutExtensibleModel_AllParameters() { EnumDiscriminatorClient client = new EnumDiscriminatorClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { kind = "golden", weight = 1234, @@ -181,7 +181,7 @@ public async Task Example_PutExtensibleModel_AllParameters_Async() { EnumDiscriminatorClient client = new EnumDiscriminatorClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { kind = "golden", weight = 1234, @@ -481,7 +481,7 @@ public void Example_PutFixedModel_ShortVersion() { EnumDiscriminatorClient client = new EnumDiscriminatorClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { kind = "cobra", length = 1234, @@ -497,7 +497,7 @@ public async Task Example_PutFixedModel_ShortVersion_Async() { EnumDiscriminatorClient client = new EnumDiscriminatorClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { kind = "cobra", length = 1234, @@ -533,7 +533,7 @@ public void Example_PutFixedModel_AllParameters() { EnumDiscriminatorClient client = new EnumDiscriminatorClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { kind = "cobra", length = 1234, @@ -549,7 +549,7 @@ public async Task Example_PutFixedModel_AllParameters_Async() { EnumDiscriminatorClient client = new EnumDiscriminatorClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { kind = "cobra", length = 1234, diff --git a/test/CadlRanchProjects/type/model/inheritance/not-discriminated/src/Generated/Docs/NotDiscriminatedClient.xml b/test/CadlRanchProjects/type/model/inheritance/not-discriminated/src/Generated/Docs/NotDiscriminatedClient.xml index bb8bfd969e3..7ccf357fe0b 100644 --- a/test/CadlRanchProjects/type/model/inheritance/not-discriminated/src/Generated/Docs/NotDiscriminatedClient.xml +++ b/test/CadlRanchProjects/type/model/inheritance/not-discriminated/src/Generated/Docs/NotDiscriminatedClient.xml @@ -41,7 +41,7 @@ This sample shows how to call PostValidAsync. PostValidAsync(Siamese input, CancellationTo Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PostValidAsync(input.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = input.ToRequestContent(); + Response response = await PostValidAsync(content, context).ConfigureAwait(false); return response; } @@ -71,7 +72,8 @@ public virtual Response PostValid(Siamese input, CancellationToken cancellationT Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = PostValid(input.ToRequestContent(), context); + using RequestContent content = input.ToRequestContent(); + Response response = PostValid(content, context); return response; } @@ -250,7 +252,8 @@ public virtual async Task> PutValidAsync(Siamese input, Cancel Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutValidAsync(input.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = input.ToRequestContent(); + Response response = await PutValidAsync(content, context).ConfigureAwait(false); return Response.FromValue(Siamese.FromResponse(response), response); } @@ -263,7 +266,8 @@ public virtual Response PutValid(Siamese input, CancellationToken cance Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = PutValid(input.ToRequestContent(), context); + using RequestContent content = input.ToRequestContent(); + Response response = PutValid(content, context); return Response.FromValue(Siamese.FromResponse(response), response); } diff --git a/test/CadlRanchProjects/type/model/inheritance/not-discriminated/tests/Generated/Samples/Samples_NotDiscriminatedClient.cs b/test/CadlRanchProjects/type/model/inheritance/not-discriminated/tests/Generated/Samples/Samples_NotDiscriminatedClient.cs index a5852cac352..43f73e039f9 100644 --- a/test/CadlRanchProjects/type/model/inheritance/not-discriminated/tests/Generated/Samples/Samples_NotDiscriminatedClient.cs +++ b/test/CadlRanchProjects/type/model/inheritance/not-discriminated/tests/Generated/Samples/Samples_NotDiscriminatedClient.cs @@ -25,7 +25,7 @@ public void Example_PostValid_ShortVersion() { NotDiscriminatedClient client = new NotDiscriminatedClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { smart = true, age = 1234, @@ -42,7 +42,7 @@ public async Task Example_PostValid_ShortVersion_Async() { NotDiscriminatedClient client = new NotDiscriminatedClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { smart = true, age = 1234, @@ -79,7 +79,7 @@ public void Example_PostValid_AllParameters() { NotDiscriminatedClient client = new NotDiscriminatedClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { smart = true, age = 1234, @@ -96,7 +96,7 @@ public async Task Example_PostValid_AllParameters_Async() { NotDiscriminatedClient client = new NotDiscriminatedClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { smart = true, age = 1234, @@ -225,7 +225,7 @@ public void Example_PutValid_ShortVersion() { NotDiscriminatedClient client = new NotDiscriminatedClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { smart = true, age = 1234, @@ -245,7 +245,7 @@ public async Task Example_PutValid_ShortVersion_Async() { NotDiscriminatedClient client = new NotDiscriminatedClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { smart = true, age = 1234, @@ -285,7 +285,7 @@ public void Example_PutValid_AllParameters() { NotDiscriminatedClient client = new NotDiscriminatedClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { smart = true, age = 1234, @@ -305,7 +305,7 @@ public async Task Example_PutValid_AllParameters_Async() { NotDiscriminatedClient client = new NotDiscriminatedClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { smart = true, age = 1234, diff --git a/test/CadlRanchProjects/type/model/inheritance/single-discriminator/src/Generated/Docs/SingleDiscriminatorClient.xml b/test/CadlRanchProjects/type/model/inheritance/single-discriminator/src/Generated/Docs/SingleDiscriminatorClient.xml index 4eca17fbce3..9849fb3ee43 100644 --- a/test/CadlRanchProjects/type/model/inheritance/single-discriminator/src/Generated/Docs/SingleDiscriminatorClient.xml +++ b/test/CadlRanchProjects/type/model/inheritance/single-discriminator/src/Generated/Docs/SingleDiscriminatorClient.xml @@ -117,7 +117,7 @@ This sample shows how to call PutModelAsync. PutModelAsync(Bird input, CancellationToken Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutModelAsync(input.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = input.ToRequestContent(); + Response response = await PutModelAsync(content, context).ConfigureAwait(false); return response; } @@ -159,7 +160,8 @@ public virtual Response PutModel(Bird input, CancellationToken cancellationToken Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = PutModel(input.ToRequestContent(), context); + using RequestContent content = input.ToRequestContent(); + Response response = PutModel(content, context); return response; } @@ -338,7 +340,8 @@ public virtual async Task PutRecursiveModelAsync(Bird input, Cancellat Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutRecursiveModelAsync(input.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = input.ToRequestContent(); + Response response = await PutRecursiveModelAsync(content, context).ConfigureAwait(false); return response; } @@ -351,7 +354,8 @@ public virtual Response PutRecursiveModel(Bird input, CancellationToken cancella Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = PutRecursiveModel(input.ToRequestContent(), context); + using RequestContent content = input.ToRequestContent(); + Response response = PutRecursiveModel(content, context); return response; } diff --git a/test/CadlRanchProjects/type/model/inheritance/single-discriminator/tests/Generated/Samples/Samples_SingleDiscriminatorClient.cs b/test/CadlRanchProjects/type/model/inheritance/single-discriminator/tests/Generated/Samples/Samples_SingleDiscriminatorClient.cs index 711831e2820..cc6f09a6837 100644 --- a/test/CadlRanchProjects/type/model/inheritance/single-discriminator/tests/Generated/Samples/Samples_SingleDiscriminatorClient.cs +++ b/test/CadlRanchProjects/type/model/inheritance/single-discriminator/tests/Generated/Samples/Samples_SingleDiscriminatorClient.cs @@ -113,7 +113,7 @@ public void Example_PutModel_ShortVersion() { SingleDiscriminatorClient client = new SingleDiscriminatorClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { kind = "seagull", wingspan = 1234, @@ -129,7 +129,7 @@ public async Task Example_PutModel_ShortVersion_Async() { SingleDiscriminatorClient client = new SingleDiscriminatorClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { kind = "seagull", wingspan = 1234, @@ -165,7 +165,7 @@ public void Example_PutModel_AllParameters() { SingleDiscriminatorClient client = new SingleDiscriminatorClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { kind = "seagull", wingspan = 1234, @@ -181,7 +181,7 @@ public async Task Example_PutModel_AllParameters_Async() { SingleDiscriminatorClient client = new SingleDiscriminatorClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { kind = "seagull", wingspan = 1234, @@ -305,7 +305,7 @@ public void Example_PutRecursiveModel_ShortVersion() { SingleDiscriminatorClient client = new SingleDiscriminatorClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { kind = "seagull", wingspan = 1234, @@ -321,7 +321,7 @@ public async Task Example_PutRecursiveModel_ShortVersion_Async() { SingleDiscriminatorClient client = new SingleDiscriminatorClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { kind = "seagull", wingspan = 1234, @@ -357,7 +357,7 @@ public void Example_PutRecursiveModel_AllParameters() { SingleDiscriminatorClient client = new SingleDiscriminatorClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { kind = "seagull", wingspan = 1234, @@ -373,7 +373,7 @@ public async Task Example_PutRecursiveModel_AllParameters_Async() { SingleDiscriminatorClient client = new SingleDiscriminatorClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { kind = "seagull", wingspan = 1234, diff --git a/test/CadlRanchProjects/type/model/usage/src/Generated/Docs/UsageClient.xml b/test/CadlRanchProjects/type/model/usage/src/Generated/Docs/UsageClient.xml index fb55a2bd745..14f56ca50be 100644 --- a/test/CadlRanchProjects/type/model/usage/src/Generated/Docs/UsageClient.xml +++ b/test/CadlRanchProjects/type/model/usage/src/Generated/Docs/UsageClient.xml @@ -41,7 +41,7 @@ This sample shows how to call InputAsync. ", }); @@ -53,7 +53,7 @@ This sample shows how to call InputAsync with all request content. ", }); @@ -68,7 +68,7 @@ This sample shows how to call Input. ", }); @@ -80,7 +80,7 @@ This sample shows how to call Input with all request content. ", }); @@ -201,7 +201,7 @@ This sample shows how to call InputAndOutputAsync and parse the result. ", }); @@ -214,7 +214,7 @@ This sample shows how to call InputAndOutputAsync with all request content and p ", }); @@ -230,7 +230,7 @@ This sample shows how to call InputAndOutput and parse the result. ", }); @@ -243,7 +243,7 @@ This sample shows how to call InputAndOutput with all request content and parse ", }); diff --git a/test/CadlRanchProjects/type/model/usage/src/Generated/UsageClient.cs b/test/CadlRanchProjects/type/model/usage/src/Generated/UsageClient.cs index 3c5fdc64247..9585f0c08b1 100644 --- a/test/CadlRanchProjects/type/model/usage/src/Generated/UsageClient.cs +++ b/test/CadlRanchProjects/type/model/usage/src/Generated/UsageClient.cs @@ -58,7 +58,8 @@ public virtual async Task InputAsync(InputRecord input, CancellationTo Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await InputAsync(input.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = input.ToRequestContent(); + Response response = await InputAsync(content, context).ConfigureAwait(false); return response; } @@ -71,7 +72,8 @@ public virtual Response Input(InputRecord input, CancellationToken cancellationT Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Input(input.ToRequestContent(), context); + using RequestContent content = input.ToRequestContent(); + Response response = Input(content, context); return response; } @@ -250,7 +252,8 @@ public virtual async Task> InputAndOutputAsync(Input Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await InputAndOutputAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await InputAndOutputAsync(content, context).ConfigureAwait(false); return Response.FromValue(InputOutputRecord.FromResponse(response), response); } @@ -263,7 +266,8 @@ public virtual Response InputAndOutput(InputOutputRecord body Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = InputAndOutput(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = InputAndOutput(content, context); return Response.FromValue(InputOutputRecord.FromResponse(response), response); } diff --git a/test/CadlRanchProjects/type/model/usage/tests/Generated/Samples/Samples_UsageClient.cs b/test/CadlRanchProjects/type/model/usage/tests/Generated/Samples/Samples_UsageClient.cs index 5c0ff4b0d25..e5c3642d031 100644 --- a/test/CadlRanchProjects/type/model/usage/tests/Generated/Samples/Samples_UsageClient.cs +++ b/test/CadlRanchProjects/type/model/usage/tests/Generated/Samples/Samples_UsageClient.cs @@ -25,7 +25,7 @@ public void Example_Input_ShortVersion() { UsageClient client = new UsageClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProp = "", }); @@ -40,7 +40,7 @@ public async Task Example_Input_ShortVersion_Async() { UsageClient client = new UsageClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProp = "", }); @@ -75,7 +75,7 @@ public void Example_Input_AllParameters() { UsageClient client = new UsageClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProp = "", }); @@ -90,7 +90,7 @@ public async Task Example_Input_AllParameters_Async() { UsageClient client = new UsageClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProp = "", }); @@ -209,7 +209,7 @@ public void Example_InputAndOutput_ShortVersion() { UsageClient client = new UsageClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProp = "", }); @@ -225,7 +225,7 @@ public async Task Example_InputAndOutput_ShortVersion_Async() { UsageClient client = new UsageClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProp = "", }); @@ -261,7 +261,7 @@ public void Example_InputAndOutput_AllParameters() { UsageClient client = new UsageClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProp = "", }); @@ -277,7 +277,7 @@ public async Task Example_InputAndOutput_AllParameters_Async() { UsageClient client = new UsageClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProp = "", }); diff --git a/test/CadlRanchProjects/type/property/nullable/src/Generated/Docs/Bytes.xml b/test/CadlRanchProjects/type/property/nullable/src/Generated/Docs/Bytes.xml index 441be6494e7..c8558b96ab8 100644 --- a/test/CadlRanchProjects/type/property/nullable/src/Generated/Docs/Bytes.xml +++ b/test/CadlRanchProjects/type/property/nullable/src/Generated/Docs/Bytes.xml @@ -159,7 +159,7 @@ This sample shows how to call PatchNonNullAsync. ", nullableProperty = new object(), @@ -172,7 +172,7 @@ This sample shows how to call PatchNonNullAsync with all request content. ", nullableProperty = new object(), @@ -188,7 +188,7 @@ This sample shows how to call PatchNonNull. ", nullableProperty = new object(), @@ -201,7 +201,7 @@ This sample shows how to call PatchNonNull with all request content. ", nullableProperty = new object(), @@ -217,7 +217,7 @@ This sample shows how to call PatchNullAsync. ", nullableProperty = new object(), @@ -230,7 +230,7 @@ This sample shows how to call PatchNullAsync with all request content. ", nullableProperty = new object(), @@ -246,7 +246,7 @@ This sample shows how to call PatchNull. ", nullableProperty = new object(), @@ -259,7 +259,7 @@ This sample shows how to call PatchNull with all request content. ", nullableProperty = new object(), diff --git a/test/CadlRanchProjects/type/property/nullable/src/Generated/Docs/CollectionsByte.xml b/test/CadlRanchProjects/type/property/nullable/src/Generated/Docs/CollectionsByte.xml index 1d8b2593d77..65e9c6bb8e9 100644 --- a/test/CadlRanchProjects/type/property/nullable/src/Generated/Docs/CollectionsByte.xml +++ b/test/CadlRanchProjects/type/property/nullable/src/Generated/Docs/CollectionsByte.xml @@ -159,7 +159,7 @@ This sample shows how to call PatchNonNullAsync. ", nullableProperty = new object[] @@ -175,7 +175,7 @@ This sample shows how to call PatchNonNullAsync with all request content. ", nullableProperty = new object[] @@ -194,7 +194,7 @@ This sample shows how to call PatchNonNull. ", nullableProperty = new object[] @@ -210,7 +210,7 @@ This sample shows how to call PatchNonNull with all request content. ", nullableProperty = new object[] @@ -229,7 +229,7 @@ This sample shows how to call PatchNullAsync. ", nullableProperty = new object[] @@ -245,7 +245,7 @@ This sample shows how to call PatchNullAsync with all request content. ", nullableProperty = new object[] @@ -264,7 +264,7 @@ This sample shows how to call PatchNull. ", nullableProperty = new object[] @@ -280,7 +280,7 @@ This sample shows how to call PatchNull with all request content. ", nullableProperty = new object[] diff --git a/test/CadlRanchProjects/type/property/nullable/src/Generated/Docs/CollectionsModel.xml b/test/CadlRanchProjects/type/property/nullable/src/Generated/Docs/CollectionsModel.xml index 557a74887a4..beb2ef83d1d 100644 --- a/test/CadlRanchProjects/type/property/nullable/src/Generated/Docs/CollectionsModel.xml +++ b/test/CadlRanchProjects/type/property/nullable/src/Generated/Docs/CollectionsModel.xml @@ -159,7 +159,7 @@ This sample shows how to call PatchNonNullAsync. ", nullableProperty = new object[] @@ -178,7 +178,7 @@ This sample shows how to call PatchNonNullAsync with all request content. ", nullableProperty = new object[] @@ -200,7 +200,7 @@ This sample shows how to call PatchNonNull. ", nullableProperty = new object[] @@ -219,7 +219,7 @@ This sample shows how to call PatchNonNull with all request content. ", nullableProperty = new object[] @@ -241,7 +241,7 @@ This sample shows how to call PatchNullAsync. ", nullableProperty = new object[] @@ -260,7 +260,7 @@ This sample shows how to call PatchNullAsync with all request content. ", nullableProperty = new object[] @@ -282,7 +282,7 @@ This sample shows how to call PatchNull. ", nullableProperty = new object[] @@ -301,7 +301,7 @@ This sample shows how to call PatchNull with all request content. ", nullableProperty = new object[] diff --git a/test/CadlRanchProjects/type/property/nullable/src/Generated/Docs/Datetime.xml b/test/CadlRanchProjects/type/property/nullable/src/Generated/Docs/Datetime.xml index f190e54cd61..e2fd7f1c584 100644 --- a/test/CadlRanchProjects/type/property/nullable/src/Generated/Docs/Datetime.xml +++ b/test/CadlRanchProjects/type/property/nullable/src/Generated/Docs/Datetime.xml @@ -159,7 +159,7 @@ This sample shows how to call PatchNonNullAsync. ", nullableProperty = "2022-05-10T14:57:31.2311892-04:00", @@ -172,7 +172,7 @@ This sample shows how to call PatchNonNullAsync with all request content. ", nullableProperty = "2022-05-10T14:57:31.2311892-04:00", @@ -188,7 +188,7 @@ This sample shows how to call PatchNonNull. ", nullableProperty = "2022-05-10T14:57:31.2311892-04:00", @@ -201,7 +201,7 @@ This sample shows how to call PatchNonNull with all request content. ", nullableProperty = "2022-05-10T14:57:31.2311892-04:00", @@ -217,7 +217,7 @@ This sample shows how to call PatchNullAsync. ", nullableProperty = "2022-05-10T14:57:31.2311892-04:00", @@ -230,7 +230,7 @@ This sample shows how to call PatchNullAsync with all request content. ", nullableProperty = "2022-05-10T14:57:31.2311892-04:00", @@ -246,7 +246,7 @@ This sample shows how to call PatchNull. ", nullableProperty = "2022-05-10T14:57:31.2311892-04:00", @@ -259,7 +259,7 @@ This sample shows how to call PatchNull with all request content. ", nullableProperty = "2022-05-10T14:57:31.2311892-04:00", diff --git a/test/CadlRanchProjects/type/property/nullable/src/Generated/Docs/Duration.xml b/test/CadlRanchProjects/type/property/nullable/src/Generated/Docs/Duration.xml index 221179bb8e1..cbca2668762 100644 --- a/test/CadlRanchProjects/type/property/nullable/src/Generated/Docs/Duration.xml +++ b/test/CadlRanchProjects/type/property/nullable/src/Generated/Docs/Duration.xml @@ -159,7 +159,7 @@ This sample shows how to call PatchNonNullAsync. ", nullableProperty = "PT1H23M45S", @@ -172,7 +172,7 @@ This sample shows how to call PatchNonNullAsync with all request content. ", nullableProperty = "PT1H23M45S", @@ -188,7 +188,7 @@ This sample shows how to call PatchNonNull. ", nullableProperty = "PT1H23M45S", @@ -201,7 +201,7 @@ This sample shows how to call PatchNonNull with all request content. ", nullableProperty = "PT1H23M45S", @@ -217,7 +217,7 @@ This sample shows how to call PatchNullAsync. ", nullableProperty = "PT1H23M45S", @@ -230,7 +230,7 @@ This sample shows how to call PatchNullAsync with all request content. ", nullableProperty = "PT1H23M45S", @@ -246,7 +246,7 @@ This sample shows how to call PatchNull. ", nullableProperty = "PT1H23M45S", @@ -259,7 +259,7 @@ This sample shows how to call PatchNull with all request content. ", nullableProperty = "PT1H23M45S", diff --git a/test/CadlRanchProjects/type/property/nullable/src/Generated/Docs/String.xml b/test/CadlRanchProjects/type/property/nullable/src/Generated/Docs/String.xml index 4ee51d342ce..85038e926b3 100644 --- a/test/CadlRanchProjects/type/property/nullable/src/Generated/Docs/String.xml +++ b/test/CadlRanchProjects/type/property/nullable/src/Generated/Docs/String.xml @@ -159,7 +159,7 @@ This sample shows how to call PatchNonNullAsync. ", nullableProperty = "", @@ -172,7 +172,7 @@ This sample shows how to call PatchNonNullAsync with all request content. ", nullableProperty = "", @@ -188,7 +188,7 @@ This sample shows how to call PatchNonNull. ", nullableProperty = "", @@ -201,7 +201,7 @@ This sample shows how to call PatchNonNull with all request content. ", nullableProperty = "", @@ -217,7 +217,7 @@ This sample shows how to call PatchNullAsync. ", nullableProperty = "", @@ -230,7 +230,7 @@ This sample shows how to call PatchNullAsync with all request content. ", nullableProperty = "", @@ -246,7 +246,7 @@ This sample shows how to call PatchNull. ", nullableProperty = "", @@ -259,7 +259,7 @@ This sample shows how to call PatchNull with all request content. ", nullableProperty = "", diff --git a/test/CadlRanchProjects/type/property/nullable/tests/Generated/Samples/Samples_Bytes.cs b/test/CadlRanchProjects/type/property/nullable/tests/Generated/Samples/Samples_Bytes.cs index 6c125fa1e77..5678295f4ef 100644 --- a/test/CadlRanchProjects/type/property/nullable/tests/Generated/Samples/Samples_Bytes.cs +++ b/test/CadlRanchProjects/type/property/nullable/tests/Generated/Samples/Samples_Bytes.cs @@ -201,7 +201,7 @@ public void Example_PatchNonNull_ShortVersion() { Bytes client = new NullableClient().GetBytesClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProperty = "", nullableProperty = new object(), @@ -217,7 +217,7 @@ public async Task Example_PatchNonNull_ShortVersion_Async() { Bytes client = new NullableClient().GetBytesClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProperty = "", nullableProperty = new object(), @@ -233,7 +233,7 @@ public void Example_PatchNonNull_AllParameters() { Bytes client = new NullableClient().GetBytesClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProperty = "", nullableProperty = new object(), @@ -249,7 +249,7 @@ public async Task Example_PatchNonNull_AllParameters_Async() { Bytes client = new NullableClient().GetBytesClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProperty = "", nullableProperty = new object(), @@ -265,7 +265,7 @@ public void Example_PatchNull_ShortVersion() { Bytes client = new NullableClient().GetBytesClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProperty = "", nullableProperty = new object(), @@ -281,7 +281,7 @@ public async Task Example_PatchNull_ShortVersion_Async() { Bytes client = new NullableClient().GetBytesClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProperty = "", nullableProperty = new object(), @@ -297,7 +297,7 @@ public void Example_PatchNull_AllParameters() { Bytes client = new NullableClient().GetBytesClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProperty = "", nullableProperty = new object(), @@ -313,7 +313,7 @@ public async Task Example_PatchNull_AllParameters_Async() { Bytes client = new NullableClient().GetBytesClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProperty = "", nullableProperty = new object(), diff --git a/test/CadlRanchProjects/type/property/nullable/tests/Generated/Samples/Samples_CollectionsByte.cs b/test/CadlRanchProjects/type/property/nullable/tests/Generated/Samples/Samples_CollectionsByte.cs index b262557fa56..8c741598411 100644 --- a/test/CadlRanchProjects/type/property/nullable/tests/Generated/Samples/Samples_CollectionsByte.cs +++ b/test/CadlRanchProjects/type/property/nullable/tests/Generated/Samples/Samples_CollectionsByte.cs @@ -201,7 +201,7 @@ public void Example_PatchNonNull_ShortVersion() { CollectionsByte client = new NullableClient().GetCollectionsByteClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProperty = "", nullableProperty = new object[] @@ -220,7 +220,7 @@ public async Task Example_PatchNonNull_ShortVersion_Async() { CollectionsByte client = new NullableClient().GetCollectionsByteClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProperty = "", nullableProperty = new object[] @@ -239,7 +239,7 @@ public void Example_PatchNonNull_AllParameters() { CollectionsByte client = new NullableClient().GetCollectionsByteClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProperty = "", nullableProperty = new object[] @@ -258,7 +258,7 @@ public async Task Example_PatchNonNull_AllParameters_Async() { CollectionsByte client = new NullableClient().GetCollectionsByteClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProperty = "", nullableProperty = new object[] @@ -277,7 +277,7 @@ public void Example_PatchNull_ShortVersion() { CollectionsByte client = new NullableClient().GetCollectionsByteClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProperty = "", nullableProperty = new object[] @@ -296,7 +296,7 @@ public async Task Example_PatchNull_ShortVersion_Async() { CollectionsByte client = new NullableClient().GetCollectionsByteClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProperty = "", nullableProperty = new object[] @@ -315,7 +315,7 @@ public void Example_PatchNull_AllParameters() { CollectionsByte client = new NullableClient().GetCollectionsByteClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProperty = "", nullableProperty = new object[] @@ -334,7 +334,7 @@ public async Task Example_PatchNull_AllParameters_Async() { CollectionsByte client = new NullableClient().GetCollectionsByteClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProperty = "", nullableProperty = new object[] diff --git a/test/CadlRanchProjects/type/property/nullable/tests/Generated/Samples/Samples_CollectionsModel.cs b/test/CadlRanchProjects/type/property/nullable/tests/Generated/Samples/Samples_CollectionsModel.cs index 4066685a462..aec040d0bad 100644 --- a/test/CadlRanchProjects/type/property/nullable/tests/Generated/Samples/Samples_CollectionsModel.cs +++ b/test/CadlRanchProjects/type/property/nullable/tests/Generated/Samples/Samples_CollectionsModel.cs @@ -201,7 +201,7 @@ public void Example_PatchNonNull_ShortVersion() { CollectionsModel client = new NullableClient().GetCollectionsModelClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProperty = "", nullableProperty = new object[] @@ -223,7 +223,7 @@ public async Task Example_PatchNonNull_ShortVersion_Async() { CollectionsModel client = new NullableClient().GetCollectionsModelClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProperty = "", nullableProperty = new object[] @@ -245,7 +245,7 @@ public void Example_PatchNonNull_AllParameters() { CollectionsModel client = new NullableClient().GetCollectionsModelClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProperty = "", nullableProperty = new object[] @@ -267,7 +267,7 @@ public async Task Example_PatchNonNull_AllParameters_Async() { CollectionsModel client = new NullableClient().GetCollectionsModelClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProperty = "", nullableProperty = new object[] @@ -289,7 +289,7 @@ public void Example_PatchNull_ShortVersion() { CollectionsModel client = new NullableClient().GetCollectionsModelClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProperty = "", nullableProperty = new object[] @@ -311,7 +311,7 @@ public async Task Example_PatchNull_ShortVersion_Async() { CollectionsModel client = new NullableClient().GetCollectionsModelClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProperty = "", nullableProperty = new object[] @@ -333,7 +333,7 @@ public void Example_PatchNull_AllParameters() { CollectionsModel client = new NullableClient().GetCollectionsModelClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProperty = "", nullableProperty = new object[] @@ -355,7 +355,7 @@ public async Task Example_PatchNull_AllParameters_Async() { CollectionsModel client = new NullableClient().GetCollectionsModelClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProperty = "", nullableProperty = new object[] diff --git a/test/CadlRanchProjects/type/property/nullable/tests/Generated/Samples/Samples_Datetime.cs b/test/CadlRanchProjects/type/property/nullable/tests/Generated/Samples/Samples_Datetime.cs index 19e7473ce64..9e6ee4d8634 100644 --- a/test/CadlRanchProjects/type/property/nullable/tests/Generated/Samples/Samples_Datetime.cs +++ b/test/CadlRanchProjects/type/property/nullable/tests/Generated/Samples/Samples_Datetime.cs @@ -201,7 +201,7 @@ public void Example_PatchNonNull_ShortVersion() { Datetime client = new NullableClient().GetDatetimeClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProperty = "", nullableProperty = "2022-05-10T14:57:31.2311892-04:00", @@ -217,7 +217,7 @@ public async Task Example_PatchNonNull_ShortVersion_Async() { Datetime client = new NullableClient().GetDatetimeClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProperty = "", nullableProperty = "2022-05-10T14:57:31.2311892-04:00", @@ -233,7 +233,7 @@ public void Example_PatchNonNull_AllParameters() { Datetime client = new NullableClient().GetDatetimeClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProperty = "", nullableProperty = "2022-05-10T14:57:31.2311892-04:00", @@ -249,7 +249,7 @@ public async Task Example_PatchNonNull_AllParameters_Async() { Datetime client = new NullableClient().GetDatetimeClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProperty = "", nullableProperty = "2022-05-10T14:57:31.2311892-04:00", @@ -265,7 +265,7 @@ public void Example_PatchNull_ShortVersion() { Datetime client = new NullableClient().GetDatetimeClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProperty = "", nullableProperty = "2022-05-10T14:57:31.2311892-04:00", @@ -281,7 +281,7 @@ public async Task Example_PatchNull_ShortVersion_Async() { Datetime client = new NullableClient().GetDatetimeClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProperty = "", nullableProperty = "2022-05-10T14:57:31.2311892-04:00", @@ -297,7 +297,7 @@ public void Example_PatchNull_AllParameters() { Datetime client = new NullableClient().GetDatetimeClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProperty = "", nullableProperty = "2022-05-10T14:57:31.2311892-04:00", @@ -313,7 +313,7 @@ public async Task Example_PatchNull_AllParameters_Async() { Datetime client = new NullableClient().GetDatetimeClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProperty = "", nullableProperty = "2022-05-10T14:57:31.2311892-04:00", diff --git a/test/CadlRanchProjects/type/property/nullable/tests/Generated/Samples/Samples_Duration.cs b/test/CadlRanchProjects/type/property/nullable/tests/Generated/Samples/Samples_Duration.cs index 6851e47d793..77f3063f2c5 100644 --- a/test/CadlRanchProjects/type/property/nullable/tests/Generated/Samples/Samples_Duration.cs +++ b/test/CadlRanchProjects/type/property/nullable/tests/Generated/Samples/Samples_Duration.cs @@ -201,7 +201,7 @@ public void Example_PatchNonNull_ShortVersion() { Duration client = new NullableClient().GetDurationClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProperty = "", nullableProperty = "PT1H23M45S", @@ -217,7 +217,7 @@ public async Task Example_PatchNonNull_ShortVersion_Async() { Duration client = new NullableClient().GetDurationClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProperty = "", nullableProperty = "PT1H23M45S", @@ -233,7 +233,7 @@ public void Example_PatchNonNull_AllParameters() { Duration client = new NullableClient().GetDurationClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProperty = "", nullableProperty = "PT1H23M45S", @@ -249,7 +249,7 @@ public async Task Example_PatchNonNull_AllParameters_Async() { Duration client = new NullableClient().GetDurationClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProperty = "", nullableProperty = "PT1H23M45S", @@ -265,7 +265,7 @@ public void Example_PatchNull_ShortVersion() { Duration client = new NullableClient().GetDurationClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProperty = "", nullableProperty = "PT1H23M45S", @@ -281,7 +281,7 @@ public async Task Example_PatchNull_ShortVersion_Async() { Duration client = new NullableClient().GetDurationClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProperty = "", nullableProperty = "PT1H23M45S", @@ -297,7 +297,7 @@ public void Example_PatchNull_AllParameters() { Duration client = new NullableClient().GetDurationClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProperty = "", nullableProperty = "PT1H23M45S", @@ -313,7 +313,7 @@ public async Task Example_PatchNull_AllParameters_Async() { Duration client = new NullableClient().GetDurationClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProperty = "", nullableProperty = "PT1H23M45S", diff --git a/test/CadlRanchProjects/type/property/nullable/tests/Generated/Samples/Samples_String.cs b/test/CadlRanchProjects/type/property/nullable/tests/Generated/Samples/Samples_String.cs index 87ebb002ba2..d491323a97d 100644 --- a/test/CadlRanchProjects/type/property/nullable/tests/Generated/Samples/Samples_String.cs +++ b/test/CadlRanchProjects/type/property/nullable/tests/Generated/Samples/Samples_String.cs @@ -201,7 +201,7 @@ public void Example_PatchNonNull_ShortVersion() { String client = new NullableClient().GetStringClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProperty = "", nullableProperty = "", @@ -217,7 +217,7 @@ public async Task Example_PatchNonNull_ShortVersion_Async() { String client = new NullableClient().GetStringClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProperty = "", nullableProperty = "", @@ -233,7 +233,7 @@ public void Example_PatchNonNull_AllParameters() { String client = new NullableClient().GetStringClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProperty = "", nullableProperty = "", @@ -249,7 +249,7 @@ public async Task Example_PatchNonNull_AllParameters_Async() { String client = new NullableClient().GetStringClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProperty = "", nullableProperty = "", @@ -265,7 +265,7 @@ public void Example_PatchNull_ShortVersion() { String client = new NullableClient().GetStringClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProperty = "", nullableProperty = "", @@ -281,7 +281,7 @@ public async Task Example_PatchNull_ShortVersion_Async() { String client = new NullableClient().GetStringClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProperty = "", nullableProperty = "", @@ -297,7 +297,7 @@ public void Example_PatchNull_AllParameters() { String client = new NullableClient().GetStringClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProperty = "", nullableProperty = "", @@ -313,7 +313,7 @@ public async Task Example_PatchNull_AllParameters_Async() { String client = new NullableClient().GetStringClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProperty = "", nullableProperty = "", diff --git a/test/CadlRanchProjects/type/property/optionality/src/Generated/Bytes.cs b/test/CadlRanchProjects/type/property/optionality/src/Generated/Bytes.cs index 8c0bfc82fc4..417dfe88aeb 100644 --- a/test/CadlRanchProjects/type/property/optionality/src/Generated/Bytes.cs +++ b/test/CadlRanchProjects/type/property/optionality/src/Generated/Bytes.cs @@ -237,7 +237,8 @@ public virtual async Task PutAllAsync(BytesProperty body, Cancellation Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutAllAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await PutAllAsync(content, context).ConfigureAwait(false); return response; } @@ -251,7 +252,8 @@ public virtual Response PutAll(BytesProperty body, CancellationToken cancellatio Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = PutAll(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = PutAll(content, context); return response; } @@ -343,7 +345,8 @@ public virtual async Task PutDefaultAsync(BytesProperty body, Cancella Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutDefaultAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await PutDefaultAsync(content, context).ConfigureAwait(false); return response; } @@ -357,7 +360,8 @@ public virtual Response PutDefault(BytesProperty body, CancellationToken cancell Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = PutDefault(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = PutDefault(content, context); return response; } diff --git a/test/CadlRanchProjects/type/property/optionality/src/Generated/CollectionsByte.cs b/test/CadlRanchProjects/type/property/optionality/src/Generated/CollectionsByte.cs index 953f01a5a9f..7da92e5a074 100644 --- a/test/CadlRanchProjects/type/property/optionality/src/Generated/CollectionsByte.cs +++ b/test/CadlRanchProjects/type/property/optionality/src/Generated/CollectionsByte.cs @@ -237,7 +237,8 @@ public virtual async Task PutAllAsync(CollectionsByteProperty body, Ca Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutAllAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await PutAllAsync(content, context).ConfigureAwait(false); return response; } @@ -251,7 +252,8 @@ public virtual Response PutAll(CollectionsByteProperty body, CancellationToken c Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = PutAll(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = PutAll(content, context); return response; } @@ -343,7 +345,8 @@ public virtual async Task PutDefaultAsync(CollectionsByteProperty body Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutDefaultAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await PutDefaultAsync(content, context).ConfigureAwait(false); return response; } @@ -357,7 +360,8 @@ public virtual Response PutDefault(CollectionsByteProperty body, CancellationTok Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = PutDefault(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = PutDefault(content, context); return response; } diff --git a/test/CadlRanchProjects/type/property/optionality/src/Generated/CollectionsModel.cs b/test/CadlRanchProjects/type/property/optionality/src/Generated/CollectionsModel.cs index 276bd2f5e87..9e9db8fdcf2 100644 --- a/test/CadlRanchProjects/type/property/optionality/src/Generated/CollectionsModel.cs +++ b/test/CadlRanchProjects/type/property/optionality/src/Generated/CollectionsModel.cs @@ -237,7 +237,8 @@ public virtual async Task PutAllAsync(CollectionsModelProperty body, C Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutAllAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await PutAllAsync(content, context).ConfigureAwait(false); return response; } @@ -251,7 +252,8 @@ public virtual Response PutAll(CollectionsModelProperty body, CancellationToken Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = PutAll(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = PutAll(content, context); return response; } @@ -343,7 +345,8 @@ public virtual async Task PutDefaultAsync(CollectionsModelProperty bod Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutDefaultAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await PutDefaultAsync(content, context).ConfigureAwait(false); return response; } @@ -357,7 +360,8 @@ public virtual Response PutDefault(CollectionsModelProperty body, CancellationTo Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = PutDefault(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = PutDefault(content, context); return response; } diff --git a/test/CadlRanchProjects/type/property/optionality/src/Generated/Datetime.cs b/test/CadlRanchProjects/type/property/optionality/src/Generated/Datetime.cs index 292965900a6..94bcee7ca9e 100644 --- a/test/CadlRanchProjects/type/property/optionality/src/Generated/Datetime.cs +++ b/test/CadlRanchProjects/type/property/optionality/src/Generated/Datetime.cs @@ -237,7 +237,8 @@ public virtual async Task PutAllAsync(DatetimeProperty body, Cancellat Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutAllAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await PutAllAsync(content, context).ConfigureAwait(false); return response; } @@ -251,7 +252,8 @@ public virtual Response PutAll(DatetimeProperty body, CancellationToken cancella Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = PutAll(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = PutAll(content, context); return response; } @@ -343,7 +345,8 @@ public virtual async Task PutDefaultAsync(DatetimeProperty body, Cance Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutDefaultAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await PutDefaultAsync(content, context).ConfigureAwait(false); return response; } @@ -357,7 +360,8 @@ public virtual Response PutDefault(DatetimeProperty body, CancellationToken canc Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = PutDefault(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = PutDefault(content, context); return response; } diff --git a/test/CadlRanchProjects/type/property/optionality/src/Generated/Docs/Bytes.xml b/test/CadlRanchProjects/type/property/optionality/src/Generated/Docs/Bytes.xml index b9c19c35ca5..13829fddbb7 100644 --- a/test/CadlRanchProjects/type/property/optionality/src/Generated/Docs/Bytes.xml +++ b/test/CadlRanchProjects/type/property/optionality/src/Generated/Docs/Bytes.xml @@ -191,7 +191,7 @@ This sample shows how to call PutAllAsync. ", requiredProperty = 1234, @@ -223,7 +223,7 @@ This sample shows how to call PutAll. ", requiredProperty = 1234, @@ -291,7 +291,7 @@ This sample shows how to call PutRequiredOnlyAsync. ", requiredProperty = 1234, @@ -319,7 +319,7 @@ This sample shows how to call PutRequiredOnly. ", requiredProperty = 1234, diff --git a/test/CadlRanchProjects/type/property/optionality/src/Generated/Docs/String.xml b/test/CadlRanchProjects/type/property/optionality/src/Generated/Docs/String.xml index 62a2b9d278a..57eaea5bfb6 100644 --- a/test/CadlRanchProjects/type/property/optionality/src/Generated/Docs/String.xml +++ b/test/CadlRanchProjects/type/property/optionality/src/Generated/Docs/String.xml @@ -191,7 +191,7 @@ This sample shows how to call PutAllAsync. ", }); @@ -215,7 +215,7 @@ This sample shows how to call PutAll. ", }); @@ -279,7 +279,7 @@ This sample shows how to call PutDefaultAsync. ", }); @@ -303,7 +303,7 @@ This sample shows how to call PutDefault. ", }); diff --git a/test/CadlRanchProjects/type/property/optionality/src/Generated/Duration.cs b/test/CadlRanchProjects/type/property/optionality/src/Generated/Duration.cs index 0e1393d76d1..d54db26dc72 100644 --- a/test/CadlRanchProjects/type/property/optionality/src/Generated/Duration.cs +++ b/test/CadlRanchProjects/type/property/optionality/src/Generated/Duration.cs @@ -237,7 +237,8 @@ public virtual async Task PutAllAsync(DurationProperty body, Cancellat Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutAllAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await PutAllAsync(content, context).ConfigureAwait(false); return response; } @@ -251,7 +252,8 @@ public virtual Response PutAll(DurationProperty body, CancellationToken cancella Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = PutAll(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = PutAll(content, context); return response; } @@ -343,7 +345,8 @@ public virtual async Task PutDefaultAsync(DurationProperty body, Cance Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutDefaultAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await PutDefaultAsync(content, context).ConfigureAwait(false); return response; } @@ -357,7 +360,8 @@ public virtual Response PutDefault(DurationProperty body, CancellationToken canc Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = PutDefault(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = PutDefault(content, context); return response; } diff --git a/test/CadlRanchProjects/type/property/optionality/src/Generated/RequiredAndOptional.cs b/test/CadlRanchProjects/type/property/optionality/src/Generated/RequiredAndOptional.cs index 863487aeed0..233b3d0b032 100644 --- a/test/CadlRanchProjects/type/property/optionality/src/Generated/RequiredAndOptional.cs +++ b/test/CadlRanchProjects/type/property/optionality/src/Generated/RequiredAndOptional.cs @@ -237,7 +237,8 @@ public virtual async Task PutAllAsync(RequiredAndOptionalProperty body Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutAllAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await PutAllAsync(content, context).ConfigureAwait(false); return response; } @@ -251,7 +252,8 @@ public virtual Response PutAll(RequiredAndOptionalProperty body, CancellationTok Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = PutAll(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = PutAll(content, context); return response; } @@ -343,7 +345,8 @@ public virtual async Task PutRequiredOnlyAsync(RequiredAndOptionalProp Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutRequiredOnlyAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await PutRequiredOnlyAsync(content, context).ConfigureAwait(false); return response; } @@ -357,7 +360,8 @@ public virtual Response PutRequiredOnly(RequiredAndOptionalProperty body, Cancel Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = PutRequiredOnly(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = PutRequiredOnly(content, context); return response; } diff --git a/test/CadlRanchProjects/type/property/optionality/src/Generated/String.cs b/test/CadlRanchProjects/type/property/optionality/src/Generated/String.cs index 82596c685ee..b16b0fdfd4c 100644 --- a/test/CadlRanchProjects/type/property/optionality/src/Generated/String.cs +++ b/test/CadlRanchProjects/type/property/optionality/src/Generated/String.cs @@ -237,7 +237,8 @@ public virtual async Task PutAllAsync(StringProperty body, Cancellatio Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutAllAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await PutAllAsync(content, context).ConfigureAwait(false); return response; } @@ -251,7 +252,8 @@ public virtual Response PutAll(StringProperty body, CancellationToken cancellati Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = PutAll(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = PutAll(content, context); return response; } @@ -343,7 +345,8 @@ public virtual async Task PutDefaultAsync(StringProperty body, Cancell Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutDefaultAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await PutDefaultAsync(content, context).ConfigureAwait(false); return response; } @@ -357,7 +360,8 @@ public virtual Response PutDefault(StringProperty body, CancellationToken cancel Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = PutDefault(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = PutDefault(content, context); return response; } diff --git a/test/CadlRanchProjects/type/property/optionality/tests/Generated/Samples/Samples_Bytes.cs b/test/CadlRanchProjects/type/property/optionality/tests/Generated/Samples/Samples_Bytes.cs index 2fe5175cff8..49dccea0c2b 100644 --- a/test/CadlRanchProjects/type/property/optionality/tests/Generated/Samples/Samples_Bytes.cs +++ b/test/CadlRanchProjects/type/property/optionality/tests/Generated/Samples/Samples_Bytes.cs @@ -193,7 +193,7 @@ public void Example_PutAll_ShortVersion() { Bytes client = new OptionalClient().GetBytesClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.PutAll(content); Console.WriteLine(response.Status); @@ -205,7 +205,7 @@ public async Task Example_PutAll_ShortVersion_Async() { Bytes client = new OptionalClient().GetBytesClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutAllAsync(content); Console.WriteLine(response.Status); @@ -237,7 +237,7 @@ public void Example_PutAll_AllParameters() { Bytes client = new OptionalClient().GetBytesClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = new object(), }); @@ -252,7 +252,7 @@ public async Task Example_PutAll_AllParameters_Async() { Bytes client = new OptionalClient().GetBytesClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = new object(), }); @@ -293,7 +293,7 @@ public void Example_PutDefault_ShortVersion() { Bytes client = new OptionalClient().GetBytesClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.PutDefault(content); Console.WriteLine(response.Status); @@ -305,7 +305,7 @@ public async Task Example_PutDefault_ShortVersion_Async() { Bytes client = new OptionalClient().GetBytesClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutDefaultAsync(content); Console.WriteLine(response.Status); @@ -337,7 +337,7 @@ public void Example_PutDefault_AllParameters() { Bytes client = new OptionalClient().GetBytesClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = new object(), }); @@ -352,7 +352,7 @@ public async Task Example_PutDefault_AllParameters_Async() { Bytes client = new OptionalClient().GetBytesClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = new object(), }); diff --git a/test/CadlRanchProjects/type/property/optionality/tests/Generated/Samples/Samples_CollectionsByte.cs b/test/CadlRanchProjects/type/property/optionality/tests/Generated/Samples/Samples_CollectionsByte.cs index e78b40c7c42..40fbe4dee7c 100644 --- a/test/CadlRanchProjects/type/property/optionality/tests/Generated/Samples/Samples_CollectionsByte.cs +++ b/test/CadlRanchProjects/type/property/optionality/tests/Generated/Samples/Samples_CollectionsByte.cs @@ -193,7 +193,7 @@ public void Example_PutAll_ShortVersion() { CollectionsByte client = new OptionalClient().GetCollectionsByteClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.PutAll(content); Console.WriteLine(response.Status); @@ -205,7 +205,7 @@ public async Task Example_PutAll_ShortVersion_Async() { CollectionsByte client = new OptionalClient().GetCollectionsByteClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutAllAsync(content); Console.WriteLine(response.Status); @@ -237,7 +237,7 @@ public void Example_PutAll_AllParameters() { CollectionsByte client = new OptionalClient().GetCollectionsByteClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = new object[] { @@ -255,7 +255,7 @@ public async Task Example_PutAll_AllParameters_Async() { CollectionsByte client = new OptionalClient().GetCollectionsByteClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = new object[] { @@ -299,7 +299,7 @@ public void Example_PutDefault_ShortVersion() { CollectionsByte client = new OptionalClient().GetCollectionsByteClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.PutDefault(content); Console.WriteLine(response.Status); @@ -311,7 +311,7 @@ public async Task Example_PutDefault_ShortVersion_Async() { CollectionsByte client = new OptionalClient().GetCollectionsByteClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutDefaultAsync(content); Console.WriteLine(response.Status); @@ -343,7 +343,7 @@ public void Example_PutDefault_AllParameters() { CollectionsByte client = new OptionalClient().GetCollectionsByteClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = new object[] { @@ -361,7 +361,7 @@ public async Task Example_PutDefault_AllParameters_Async() { CollectionsByte client = new OptionalClient().GetCollectionsByteClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = new object[] { diff --git a/test/CadlRanchProjects/type/property/optionality/tests/Generated/Samples/Samples_CollectionsModel.cs b/test/CadlRanchProjects/type/property/optionality/tests/Generated/Samples/Samples_CollectionsModel.cs index 3bb7411426f..23f2a35f273 100644 --- a/test/CadlRanchProjects/type/property/optionality/tests/Generated/Samples/Samples_CollectionsModel.cs +++ b/test/CadlRanchProjects/type/property/optionality/tests/Generated/Samples/Samples_CollectionsModel.cs @@ -193,7 +193,7 @@ public void Example_PutAll_ShortVersion() { CollectionsModel client = new OptionalClient().GetCollectionsModelClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.PutAll(content); Console.WriteLine(response.Status); @@ -205,7 +205,7 @@ public async Task Example_PutAll_ShortVersion_Async() { CollectionsModel client = new OptionalClient().GetCollectionsModelClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutAllAsync(content); Console.WriteLine(response.Status); @@ -237,7 +237,7 @@ public void Example_PutAll_AllParameters() { CollectionsModel client = new OptionalClient().GetCollectionsModelClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = new object[] { @@ -258,7 +258,7 @@ public async Task Example_PutAll_AllParameters_Async() { CollectionsModel client = new OptionalClient().GetCollectionsModelClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = new object[] { @@ -311,7 +311,7 @@ public void Example_PutDefault_ShortVersion() { CollectionsModel client = new OptionalClient().GetCollectionsModelClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.PutDefault(content); Console.WriteLine(response.Status); @@ -323,7 +323,7 @@ public async Task Example_PutDefault_ShortVersion_Async() { CollectionsModel client = new OptionalClient().GetCollectionsModelClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutDefaultAsync(content); Console.WriteLine(response.Status); @@ -355,7 +355,7 @@ public void Example_PutDefault_AllParameters() { CollectionsModel client = new OptionalClient().GetCollectionsModelClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = new object[] { @@ -376,7 +376,7 @@ public async Task Example_PutDefault_AllParameters_Async() { CollectionsModel client = new OptionalClient().GetCollectionsModelClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = new object[] { diff --git a/test/CadlRanchProjects/type/property/optionality/tests/Generated/Samples/Samples_Datetime.cs b/test/CadlRanchProjects/type/property/optionality/tests/Generated/Samples/Samples_Datetime.cs index 7afed36d2fd..daeedc76e6f 100644 --- a/test/CadlRanchProjects/type/property/optionality/tests/Generated/Samples/Samples_Datetime.cs +++ b/test/CadlRanchProjects/type/property/optionality/tests/Generated/Samples/Samples_Datetime.cs @@ -193,7 +193,7 @@ public void Example_PutAll_ShortVersion() { Datetime client = new OptionalClient().GetDatetimeClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.PutAll(content); Console.WriteLine(response.Status); @@ -205,7 +205,7 @@ public async Task Example_PutAll_ShortVersion_Async() { Datetime client = new OptionalClient().GetDatetimeClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutAllAsync(content); Console.WriteLine(response.Status); @@ -237,7 +237,7 @@ public void Example_PutAll_AllParameters() { Datetime client = new OptionalClient().GetDatetimeClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = "2022-05-10T14:57:31.2311892-04:00", }); @@ -252,7 +252,7 @@ public async Task Example_PutAll_AllParameters_Async() { Datetime client = new OptionalClient().GetDatetimeClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = "2022-05-10T14:57:31.2311892-04:00", }); @@ -293,7 +293,7 @@ public void Example_PutDefault_ShortVersion() { Datetime client = new OptionalClient().GetDatetimeClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.PutDefault(content); Console.WriteLine(response.Status); @@ -305,7 +305,7 @@ public async Task Example_PutDefault_ShortVersion_Async() { Datetime client = new OptionalClient().GetDatetimeClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutDefaultAsync(content); Console.WriteLine(response.Status); @@ -337,7 +337,7 @@ public void Example_PutDefault_AllParameters() { Datetime client = new OptionalClient().GetDatetimeClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = "2022-05-10T14:57:31.2311892-04:00", }); @@ -352,7 +352,7 @@ public async Task Example_PutDefault_AllParameters_Async() { Datetime client = new OptionalClient().GetDatetimeClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = "2022-05-10T14:57:31.2311892-04:00", }); diff --git a/test/CadlRanchProjects/type/property/optionality/tests/Generated/Samples/Samples_Duration.cs b/test/CadlRanchProjects/type/property/optionality/tests/Generated/Samples/Samples_Duration.cs index 6bd0dee9ec1..9085c6c195e 100644 --- a/test/CadlRanchProjects/type/property/optionality/tests/Generated/Samples/Samples_Duration.cs +++ b/test/CadlRanchProjects/type/property/optionality/tests/Generated/Samples/Samples_Duration.cs @@ -194,7 +194,7 @@ public void Example_PutAll_ShortVersion() { Duration client = new OptionalClient().GetDurationClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.PutAll(content); Console.WriteLine(response.Status); @@ -206,7 +206,7 @@ public async Task Example_PutAll_ShortVersion_Async() { Duration client = new OptionalClient().GetDurationClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutAllAsync(content); Console.WriteLine(response.Status); @@ -238,7 +238,7 @@ public void Example_PutAll_AllParameters() { Duration client = new OptionalClient().GetDurationClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = "PT1H23M45S", }); @@ -253,7 +253,7 @@ public async Task Example_PutAll_AllParameters_Async() { Duration client = new OptionalClient().GetDurationClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = "PT1H23M45S", }); @@ -294,7 +294,7 @@ public void Example_PutDefault_ShortVersion() { Duration client = new OptionalClient().GetDurationClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.PutDefault(content); Console.WriteLine(response.Status); @@ -306,7 +306,7 @@ public async Task Example_PutDefault_ShortVersion_Async() { Duration client = new OptionalClient().GetDurationClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutDefaultAsync(content); Console.WriteLine(response.Status); @@ -338,7 +338,7 @@ public void Example_PutDefault_AllParameters() { Duration client = new OptionalClient().GetDurationClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = "PT1H23M45S", }); @@ -353,7 +353,7 @@ public async Task Example_PutDefault_AllParameters_Async() { Duration client = new OptionalClient().GetDurationClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = "PT1H23M45S", }); diff --git a/test/CadlRanchProjects/type/property/optionality/tests/Generated/Samples/Samples_RequiredAndOptional.cs b/test/CadlRanchProjects/type/property/optionality/tests/Generated/Samples/Samples_RequiredAndOptional.cs index ad8e15ce2aa..ced13a81b04 100644 --- a/test/CadlRanchProjects/type/property/optionality/tests/Generated/Samples/Samples_RequiredAndOptional.cs +++ b/test/CadlRanchProjects/type/property/optionality/tests/Generated/Samples/Samples_RequiredAndOptional.cs @@ -197,7 +197,7 @@ public void Example_PutAll_ShortVersion() { RequiredAndOptional client = new OptionalClient().GetRequiredAndOptionalClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProperty = 1234, }); @@ -212,7 +212,7 @@ public async Task Example_PutAll_ShortVersion_Async() { RequiredAndOptional client = new OptionalClient().GetRequiredAndOptionalClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProperty = 1234, }); @@ -247,7 +247,7 @@ public void Example_PutAll_AllParameters() { RequiredAndOptional client = new OptionalClient().GetRequiredAndOptionalClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { optionalProperty = "", requiredProperty = 1234, @@ -263,7 +263,7 @@ public async Task Example_PutAll_AllParameters_Async() { RequiredAndOptional client = new OptionalClient().GetRequiredAndOptionalClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { optionalProperty = "", requiredProperty = 1234, @@ -305,7 +305,7 @@ public void Example_PutRequiredOnly_ShortVersion() { RequiredAndOptional client = new OptionalClient().GetRequiredAndOptionalClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProperty = 1234, }); @@ -320,7 +320,7 @@ public async Task Example_PutRequiredOnly_ShortVersion_Async() { RequiredAndOptional client = new OptionalClient().GetRequiredAndOptionalClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredProperty = 1234, }); @@ -355,7 +355,7 @@ public void Example_PutRequiredOnly_AllParameters() { RequiredAndOptional client = new OptionalClient().GetRequiredAndOptionalClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { optionalProperty = "", requiredProperty = 1234, @@ -371,7 +371,7 @@ public async Task Example_PutRequiredOnly_AllParameters_Async() { RequiredAndOptional client = new OptionalClient().GetRequiredAndOptionalClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { optionalProperty = "", requiredProperty = 1234, diff --git a/test/CadlRanchProjects/type/property/optionality/tests/Generated/Samples/Samples_String.cs b/test/CadlRanchProjects/type/property/optionality/tests/Generated/Samples/Samples_String.cs index 132f0ca0353..2c9f629f43c 100644 --- a/test/CadlRanchProjects/type/property/optionality/tests/Generated/Samples/Samples_String.cs +++ b/test/CadlRanchProjects/type/property/optionality/tests/Generated/Samples/Samples_String.cs @@ -193,7 +193,7 @@ public void Example_PutAll_ShortVersion() { String client = new OptionalClient().GetStringClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.PutAll(content); Console.WriteLine(response.Status); @@ -205,7 +205,7 @@ public async Task Example_PutAll_ShortVersion_Async() { String client = new OptionalClient().GetStringClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutAllAsync(content); Console.WriteLine(response.Status); @@ -237,7 +237,7 @@ public void Example_PutAll_AllParameters() { String client = new OptionalClient().GetStringClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = "", }); @@ -252,7 +252,7 @@ public async Task Example_PutAll_AllParameters_Async() { String client = new OptionalClient().GetStringClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = "", }); @@ -293,7 +293,7 @@ public void Example_PutDefault_ShortVersion() { String client = new OptionalClient().GetStringClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.PutDefault(content); Console.WriteLine(response.Status); @@ -305,7 +305,7 @@ public async Task Example_PutDefault_ShortVersion_Async() { String client = new OptionalClient().GetStringClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutDefaultAsync(content); Console.WriteLine(response.Status); @@ -337,7 +337,7 @@ public void Example_PutDefault_AllParameters() { String client = new OptionalClient().GetStringClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = "", }); @@ -352,7 +352,7 @@ public async Task Example_PutDefault_AllParameters_Async() { String client = new OptionalClient().GetStringClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = "", }); diff --git a/test/CadlRanchProjects/type/property/value-types/src/Generated/Boolean.cs b/test/CadlRanchProjects/type/property/value-types/src/Generated/Boolean.cs index 164e3c69043..589fa819fad 100644 --- a/test/CadlRanchProjects/type/property/value-types/src/Generated/Boolean.cs +++ b/test/CadlRanchProjects/type/property/value-types/src/Generated/Boolean.cs @@ -147,7 +147,8 @@ public virtual async Task PutAsync(BooleanProperty body, CancellationT Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await PutAsync(content, context).ConfigureAwait(false); return response; } @@ -161,7 +162,8 @@ public virtual Response Put(BooleanProperty body, CancellationToken cancellation Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Put(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = Put(content, context); return response; } diff --git a/test/CadlRanchProjects/type/property/value-types/src/Generated/Bytes.cs b/test/CadlRanchProjects/type/property/value-types/src/Generated/Bytes.cs index 46e5743dc11..9e8d287021f 100644 --- a/test/CadlRanchProjects/type/property/value-types/src/Generated/Bytes.cs +++ b/test/CadlRanchProjects/type/property/value-types/src/Generated/Bytes.cs @@ -147,7 +147,8 @@ public virtual async Task PutAsync(BytesProperty body, CancellationTok Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await PutAsync(content, context).ConfigureAwait(false); return response; } @@ -161,7 +162,8 @@ public virtual Response Put(BytesProperty body, CancellationToken cancellationTo Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Put(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = Put(content, context); return response; } diff --git a/test/CadlRanchProjects/type/property/value-types/src/Generated/CollectionsInt.cs b/test/CadlRanchProjects/type/property/value-types/src/Generated/CollectionsInt.cs index 3f0ed62601f..d61e73fdb4e 100644 --- a/test/CadlRanchProjects/type/property/value-types/src/Generated/CollectionsInt.cs +++ b/test/CadlRanchProjects/type/property/value-types/src/Generated/CollectionsInt.cs @@ -147,7 +147,8 @@ public virtual async Task PutAsync(CollectionsIntProperty body, Cancel Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await PutAsync(content, context).ConfigureAwait(false); return response; } @@ -161,7 +162,8 @@ public virtual Response Put(CollectionsIntProperty body, CancellationToken cance Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Put(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = Put(content, context); return response; } diff --git a/test/CadlRanchProjects/type/property/value-types/src/Generated/CollectionsModel.cs b/test/CadlRanchProjects/type/property/value-types/src/Generated/CollectionsModel.cs index 83ec7b8adfc..706963c5f2f 100644 --- a/test/CadlRanchProjects/type/property/value-types/src/Generated/CollectionsModel.cs +++ b/test/CadlRanchProjects/type/property/value-types/src/Generated/CollectionsModel.cs @@ -147,7 +147,8 @@ public virtual async Task PutAsync(CollectionsModelProperty body, Canc Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await PutAsync(content, context).ConfigureAwait(false); return response; } @@ -161,7 +162,8 @@ public virtual Response Put(CollectionsModelProperty body, CancellationToken can Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Put(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = Put(content, context); return response; } diff --git a/test/CadlRanchProjects/type/property/value-types/src/Generated/CollectionsString.cs b/test/CadlRanchProjects/type/property/value-types/src/Generated/CollectionsString.cs index 675527860d3..bce6cf20ab6 100644 --- a/test/CadlRanchProjects/type/property/value-types/src/Generated/CollectionsString.cs +++ b/test/CadlRanchProjects/type/property/value-types/src/Generated/CollectionsString.cs @@ -147,7 +147,8 @@ public virtual async Task PutAsync(CollectionsStringProperty body, Can Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await PutAsync(content, context).ConfigureAwait(false); return response; } @@ -161,7 +162,8 @@ public virtual Response Put(CollectionsStringProperty body, CancellationToken ca Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Put(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = Put(content, context); return response; } diff --git a/test/CadlRanchProjects/type/property/value-types/src/Generated/Datetime.cs b/test/CadlRanchProjects/type/property/value-types/src/Generated/Datetime.cs index d7b3b8d1bbf..591a777081a 100644 --- a/test/CadlRanchProjects/type/property/value-types/src/Generated/Datetime.cs +++ b/test/CadlRanchProjects/type/property/value-types/src/Generated/Datetime.cs @@ -147,7 +147,8 @@ public virtual async Task PutAsync(DatetimeProperty body, Cancellation Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await PutAsync(content, context).ConfigureAwait(false); return response; } @@ -161,7 +162,8 @@ public virtual Response Put(DatetimeProperty body, CancellationToken cancellatio Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Put(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = Put(content, context); return response; } diff --git a/test/CadlRanchProjects/type/property/value-types/src/Generated/DictionaryString.cs b/test/CadlRanchProjects/type/property/value-types/src/Generated/DictionaryString.cs index 92146e91696..50dda8fa999 100644 --- a/test/CadlRanchProjects/type/property/value-types/src/Generated/DictionaryString.cs +++ b/test/CadlRanchProjects/type/property/value-types/src/Generated/DictionaryString.cs @@ -147,7 +147,8 @@ public virtual async Task PutAsync(DictionaryStringProperty body, Canc Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await PutAsync(content, context).ConfigureAwait(false); return response; } @@ -161,7 +162,8 @@ public virtual Response Put(DictionaryStringProperty body, CancellationToken can Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Put(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = Put(content, context); return response; } diff --git a/test/CadlRanchProjects/type/property/value-types/src/Generated/Docs/Boolean.xml b/test/CadlRanchProjects/type/property/value-types/src/Generated/Docs/Boolean.xml index 278e1743892..ec732735263 100644 --- a/test/CadlRanchProjects/type/property/value-types/src/Generated/Docs/Boolean.xml +++ b/test/CadlRanchProjects/type/property/value-types/src/Generated/Docs/Boolean.xml @@ -113,7 +113,7 @@ This sample shows how to call PutAsync. ", }); @@ -125,7 +125,7 @@ This sample shows how to call PutAsync with all request content. ", }); @@ -140,7 +140,7 @@ This sample shows how to call Put. ", }); @@ -152,7 +152,7 @@ This sample shows how to call Put with all request content. ", }); diff --git a/test/CadlRanchProjects/type/property/value-types/src/Generated/Docs/UnknownArray.xml b/test/CadlRanchProjects/type/property/value-types/src/Generated/Docs/UnknownArray.xml index 5c33ae2d054..e0178b358d4 100644 --- a/test/CadlRanchProjects/type/property/value-types/src/Generated/Docs/UnknownArray.xml +++ b/test/CadlRanchProjects/type/property/value-types/src/Generated/Docs/UnknownArray.xml @@ -113,7 +113,7 @@ This sample shows how to call PutAsync. PutAsync(DurationProperty body, Cancellation Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await PutAsync(content, context).ConfigureAwait(false); return response; } @@ -161,7 +162,8 @@ public virtual Response Put(DurationProperty body, CancellationToken cancellatio Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Put(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = Put(content, context); return response; } diff --git a/test/CadlRanchProjects/type/property/value-types/src/Generated/Enum.cs b/test/CadlRanchProjects/type/property/value-types/src/Generated/Enum.cs index 0ac72c9a263..4278153e691 100644 --- a/test/CadlRanchProjects/type/property/value-types/src/Generated/Enum.cs +++ b/test/CadlRanchProjects/type/property/value-types/src/Generated/Enum.cs @@ -147,7 +147,8 @@ public virtual async Task PutAsync(EnumProperty body, CancellationToke Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await PutAsync(content, context).ConfigureAwait(false); return response; } @@ -161,7 +162,8 @@ public virtual Response Put(EnumProperty body, CancellationToken cancellationTok Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Put(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = Put(content, context); return response; } diff --git a/test/CadlRanchProjects/type/property/value-types/src/Generated/ExtensibleEnum.cs b/test/CadlRanchProjects/type/property/value-types/src/Generated/ExtensibleEnum.cs index 19e998690aa..411ab316cfb 100644 --- a/test/CadlRanchProjects/type/property/value-types/src/Generated/ExtensibleEnum.cs +++ b/test/CadlRanchProjects/type/property/value-types/src/Generated/ExtensibleEnum.cs @@ -147,7 +147,8 @@ public virtual async Task PutAsync(ExtensibleEnumProperty body, Cancel Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await PutAsync(content, context).ConfigureAwait(false); return response; } @@ -161,7 +162,8 @@ public virtual Response Put(ExtensibleEnumProperty body, CancellationToken cance Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Put(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = Put(content, context); return response; } diff --git a/test/CadlRanchProjects/type/property/value-types/src/Generated/Float.cs b/test/CadlRanchProjects/type/property/value-types/src/Generated/Float.cs index adfe989cc5f..2633a353d35 100644 --- a/test/CadlRanchProjects/type/property/value-types/src/Generated/Float.cs +++ b/test/CadlRanchProjects/type/property/value-types/src/Generated/Float.cs @@ -147,7 +147,8 @@ public virtual async Task PutAsync(FloatProperty body, CancellationTok Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await PutAsync(content, context).ConfigureAwait(false); return response; } @@ -161,7 +162,8 @@ public virtual Response Put(FloatProperty body, CancellationToken cancellationTo Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Put(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = Put(content, context); return response; } diff --git a/test/CadlRanchProjects/type/property/value-types/src/Generated/Int.cs b/test/CadlRanchProjects/type/property/value-types/src/Generated/Int.cs index 78f9f8e979b..2c08991110e 100644 --- a/test/CadlRanchProjects/type/property/value-types/src/Generated/Int.cs +++ b/test/CadlRanchProjects/type/property/value-types/src/Generated/Int.cs @@ -147,7 +147,8 @@ public virtual async Task PutAsync(IntProperty body, CancellationToken Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await PutAsync(content, context).ConfigureAwait(false); return response; } @@ -161,7 +162,8 @@ public virtual Response Put(IntProperty body, CancellationToken cancellationToke Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Put(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = Put(content, context); return response; } diff --git a/test/CadlRanchProjects/type/property/value-types/src/Generated/Model.cs b/test/CadlRanchProjects/type/property/value-types/src/Generated/Model.cs index b94ccd92d4a..cd2e11ce095 100644 --- a/test/CadlRanchProjects/type/property/value-types/src/Generated/Model.cs +++ b/test/CadlRanchProjects/type/property/value-types/src/Generated/Model.cs @@ -147,7 +147,8 @@ public virtual async Task PutAsync(ModelProperty body, CancellationTok Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await PutAsync(content, context).ConfigureAwait(false); return response; } @@ -161,7 +162,8 @@ public virtual Response Put(ModelProperty body, CancellationToken cancellationTo Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Put(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = Put(content, context); return response; } diff --git a/test/CadlRanchProjects/type/property/value-types/src/Generated/Never.cs b/test/CadlRanchProjects/type/property/value-types/src/Generated/Never.cs index 08ee5c454e2..cd614e5f472 100644 --- a/test/CadlRanchProjects/type/property/value-types/src/Generated/Never.cs +++ b/test/CadlRanchProjects/type/property/value-types/src/Generated/Never.cs @@ -147,7 +147,8 @@ public virtual async Task PutAsync(NeverProperty body, CancellationTok Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await PutAsync(content, context).ConfigureAwait(false); return response; } @@ -161,7 +162,8 @@ public virtual Response Put(NeverProperty body, CancellationToken cancellationTo Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Put(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = Put(content, context); return response; } diff --git a/test/CadlRanchProjects/type/property/value-types/src/Generated/String.cs b/test/CadlRanchProjects/type/property/value-types/src/Generated/String.cs index e8efb4e6bd5..696a4fc8a84 100644 --- a/test/CadlRanchProjects/type/property/value-types/src/Generated/String.cs +++ b/test/CadlRanchProjects/type/property/value-types/src/Generated/String.cs @@ -147,7 +147,8 @@ public virtual async Task PutAsync(StringProperty body, CancellationTo Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await PutAsync(content, context).ConfigureAwait(false); return response; } @@ -161,7 +162,8 @@ public virtual Response Put(StringProperty body, CancellationToken cancellationT Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Put(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = Put(content, context); return response; } diff --git a/test/CadlRanchProjects/type/property/value-types/src/Generated/UnknownArray.cs b/test/CadlRanchProjects/type/property/value-types/src/Generated/UnknownArray.cs index 6de0915ce11..4e2f6827126 100644 --- a/test/CadlRanchProjects/type/property/value-types/src/Generated/UnknownArray.cs +++ b/test/CadlRanchProjects/type/property/value-types/src/Generated/UnknownArray.cs @@ -147,7 +147,8 @@ public virtual async Task PutAsync(UnknownArrayProperty body, Cancella Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await PutAsync(content, context).ConfigureAwait(false); return response; } @@ -161,7 +162,8 @@ public virtual Response Put(UnknownArrayProperty body, CancellationToken cancell Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Put(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = Put(content, context); return response; } diff --git a/test/CadlRanchProjects/type/property/value-types/src/Generated/UnknownDict.cs b/test/CadlRanchProjects/type/property/value-types/src/Generated/UnknownDict.cs index 3901f121f66..71b5de1d121 100644 --- a/test/CadlRanchProjects/type/property/value-types/src/Generated/UnknownDict.cs +++ b/test/CadlRanchProjects/type/property/value-types/src/Generated/UnknownDict.cs @@ -147,7 +147,8 @@ public virtual async Task PutAsync(UnknownDictProperty body, Cancellat Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await PutAsync(content, context).ConfigureAwait(false); return response; } @@ -161,7 +162,8 @@ public virtual Response Put(UnknownDictProperty body, CancellationToken cancella Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Put(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = Put(content, context); return response; } diff --git a/test/CadlRanchProjects/type/property/value-types/src/Generated/UnknownInt.cs b/test/CadlRanchProjects/type/property/value-types/src/Generated/UnknownInt.cs index 1573ac73c58..2c0e6d552df 100644 --- a/test/CadlRanchProjects/type/property/value-types/src/Generated/UnknownInt.cs +++ b/test/CadlRanchProjects/type/property/value-types/src/Generated/UnknownInt.cs @@ -147,7 +147,8 @@ public virtual async Task PutAsync(UnknownIntProperty body, Cancellati Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await PutAsync(content, context).ConfigureAwait(false); return response; } @@ -161,7 +162,8 @@ public virtual Response Put(UnknownIntProperty body, CancellationToken cancellat Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Put(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = Put(content, context); return response; } diff --git a/test/CadlRanchProjects/type/property/value-types/src/Generated/UnknownString.cs b/test/CadlRanchProjects/type/property/value-types/src/Generated/UnknownString.cs index e0b7e2d2331..7dd55d0ca14 100644 --- a/test/CadlRanchProjects/type/property/value-types/src/Generated/UnknownString.cs +++ b/test/CadlRanchProjects/type/property/value-types/src/Generated/UnknownString.cs @@ -147,7 +147,8 @@ public virtual async Task PutAsync(UnknownStringProperty body, Cancell Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PutAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await PutAsync(content, context).ConfigureAwait(false); return response; } @@ -161,7 +162,8 @@ public virtual Response Put(UnknownStringProperty body, CancellationToken cancel Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Put(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = Put(content, context); return response; } diff --git a/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_Boolean.cs b/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_Boolean.cs index a6f9ee885cd..50972953a8b 100644 --- a/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_Boolean.cs +++ b/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_Boolean.cs @@ -109,7 +109,7 @@ public void Example_Put_ShortVersion() { Boolean client = new ValueTypesClient().GetBooleanClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = true, }); @@ -124,7 +124,7 @@ public async Task Example_Put_ShortVersion_Async() { Boolean client = new ValueTypesClient().GetBooleanClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = true, }); @@ -159,7 +159,7 @@ public void Example_Put_AllParameters() { Boolean client = new ValueTypesClient().GetBooleanClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = true, }); @@ -174,7 +174,7 @@ public async Task Example_Put_AllParameters_Async() { Boolean client = new ValueTypesClient().GetBooleanClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = true, }); diff --git a/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_Bytes.cs b/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_Bytes.cs index fc4ffebbe31..fe0cdc7aaa8 100644 --- a/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_Bytes.cs +++ b/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_Bytes.cs @@ -109,7 +109,7 @@ public void Example_Put_ShortVersion() { Bytes client = new ValueTypesClient().GetBytesClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = new object(), }); @@ -124,7 +124,7 @@ public async Task Example_Put_ShortVersion_Async() { Bytes client = new ValueTypesClient().GetBytesClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = new object(), }); @@ -159,7 +159,7 @@ public void Example_Put_AllParameters() { Bytes client = new ValueTypesClient().GetBytesClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = new object(), }); @@ -174,7 +174,7 @@ public async Task Example_Put_AllParameters_Async() { Bytes client = new ValueTypesClient().GetBytesClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = new object(), }); diff --git a/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_CollectionsInt.cs b/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_CollectionsInt.cs index d0387c46e6e..8240ea99319 100644 --- a/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_CollectionsInt.cs +++ b/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_CollectionsInt.cs @@ -109,7 +109,7 @@ public void Example_Put_ShortVersion() { CollectionsInt client = new ValueTypesClient().GetCollectionsIntClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = new object[] { @@ -127,7 +127,7 @@ public async Task Example_Put_ShortVersion_Async() { CollectionsInt client = new ValueTypesClient().GetCollectionsIntClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = new object[] { @@ -165,7 +165,7 @@ public void Example_Put_AllParameters() { CollectionsInt client = new ValueTypesClient().GetCollectionsIntClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = new object[] { @@ -183,7 +183,7 @@ public async Task Example_Put_AllParameters_Async() { CollectionsInt client = new ValueTypesClient().GetCollectionsIntClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = new object[] { diff --git a/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_CollectionsModel.cs b/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_CollectionsModel.cs index e08ad3304df..0bb94b5b80e 100644 --- a/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_CollectionsModel.cs +++ b/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_CollectionsModel.cs @@ -109,7 +109,7 @@ public void Example_Put_ShortVersion() { CollectionsModel client = new ValueTypesClient().GetCollectionsModelClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = new object[] { @@ -130,7 +130,7 @@ public async Task Example_Put_ShortVersion_Async() { CollectionsModel client = new ValueTypesClient().GetCollectionsModelClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = new object[] { @@ -177,7 +177,7 @@ public void Example_Put_AllParameters() { CollectionsModel client = new ValueTypesClient().GetCollectionsModelClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = new object[] { @@ -198,7 +198,7 @@ public async Task Example_Put_AllParameters_Async() { CollectionsModel client = new ValueTypesClient().GetCollectionsModelClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = new object[] { diff --git a/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_CollectionsString.cs b/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_CollectionsString.cs index 9d02163c15e..9a1eb81c4ec 100644 --- a/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_CollectionsString.cs +++ b/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_CollectionsString.cs @@ -109,7 +109,7 @@ public void Example_Put_ShortVersion() { CollectionsString client = new ValueTypesClient().GetCollectionsStringClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = new object[] { @@ -127,7 +127,7 @@ public async Task Example_Put_ShortVersion_Async() { CollectionsString client = new ValueTypesClient().GetCollectionsStringClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = new object[] { @@ -165,7 +165,7 @@ public void Example_Put_AllParameters() { CollectionsString client = new ValueTypesClient().GetCollectionsStringClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = new object[] { @@ -183,7 +183,7 @@ public async Task Example_Put_AllParameters_Async() { CollectionsString client = new ValueTypesClient().GetCollectionsStringClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = new object[] { diff --git a/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_Datetime.cs b/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_Datetime.cs index 16bcfb34011..3dd47c44360 100644 --- a/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_Datetime.cs +++ b/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_Datetime.cs @@ -109,7 +109,7 @@ public void Example_Put_ShortVersion() { Datetime client = new ValueTypesClient().GetDatetimeClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = "2022-05-10T14:57:31.2311892-04:00", }); @@ -124,7 +124,7 @@ public async Task Example_Put_ShortVersion_Async() { Datetime client = new ValueTypesClient().GetDatetimeClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = "2022-05-10T14:57:31.2311892-04:00", }); @@ -159,7 +159,7 @@ public void Example_Put_AllParameters() { Datetime client = new ValueTypesClient().GetDatetimeClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = "2022-05-10T14:57:31.2311892-04:00", }); @@ -174,7 +174,7 @@ public async Task Example_Put_AllParameters_Async() { Datetime client = new ValueTypesClient().GetDatetimeClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = "2022-05-10T14:57:31.2311892-04:00", }); diff --git a/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_DictionaryString.cs b/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_DictionaryString.cs index bd6b5c16e55..02d85213116 100644 --- a/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_DictionaryString.cs +++ b/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_DictionaryString.cs @@ -110,7 +110,7 @@ public void Example_Put_ShortVersion() { DictionaryString client = new ValueTypesClient().GetDictionaryStringClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = new { @@ -128,7 +128,7 @@ public async Task Example_Put_ShortVersion_Async() { DictionaryString client = new ValueTypesClient().GetDictionaryStringClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = new { @@ -172,7 +172,7 @@ public void Example_Put_AllParameters() { DictionaryString client = new ValueTypesClient().GetDictionaryStringClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = new { @@ -190,7 +190,7 @@ public async Task Example_Put_AllParameters_Async() { DictionaryString client = new ValueTypesClient().GetDictionaryStringClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = new { diff --git a/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_Duration.cs b/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_Duration.cs index 575d1720624..2dedae62534 100644 --- a/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_Duration.cs +++ b/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_Duration.cs @@ -110,7 +110,7 @@ public void Example_Put_ShortVersion() { Duration client = new ValueTypesClient().GetDurationClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = "PT1H23M45S", }); @@ -125,7 +125,7 @@ public async Task Example_Put_ShortVersion_Async() { Duration client = new ValueTypesClient().GetDurationClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = "PT1H23M45S", }); @@ -160,7 +160,7 @@ public void Example_Put_AllParameters() { Duration client = new ValueTypesClient().GetDurationClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = "PT1H23M45S", }); @@ -175,7 +175,7 @@ public async Task Example_Put_AllParameters_Async() { Duration client = new ValueTypesClient().GetDurationClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = "PT1H23M45S", }); diff --git a/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_Enum.cs b/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_Enum.cs index 5be2a9a7bae..32bc0e954cd 100644 --- a/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_Enum.cs +++ b/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_Enum.cs @@ -109,7 +109,7 @@ public void Example_Put_ShortVersion() { Enum client = new ValueTypesClient().GetEnumClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = "ValueOne", }); @@ -124,7 +124,7 @@ public async Task Example_Put_ShortVersion_Async() { Enum client = new ValueTypesClient().GetEnumClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = "ValueOne", }); @@ -159,7 +159,7 @@ public void Example_Put_AllParameters() { Enum client = new ValueTypesClient().GetEnumClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = "ValueOne", }); @@ -174,7 +174,7 @@ public async Task Example_Put_AllParameters_Async() { Enum client = new ValueTypesClient().GetEnumClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = "ValueOne", }); diff --git a/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_ExtensibleEnum.cs b/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_ExtensibleEnum.cs index 9ed2246d25d..98c00abbc00 100644 --- a/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_ExtensibleEnum.cs +++ b/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_ExtensibleEnum.cs @@ -109,7 +109,7 @@ public void Example_Put_ShortVersion() { ExtensibleEnum client = new ValueTypesClient().GetExtensibleEnumClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = "ValueOne", }); @@ -124,7 +124,7 @@ public async Task Example_Put_ShortVersion_Async() { ExtensibleEnum client = new ValueTypesClient().GetExtensibleEnumClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = "ValueOne", }); @@ -159,7 +159,7 @@ public void Example_Put_AllParameters() { ExtensibleEnum client = new ValueTypesClient().GetExtensibleEnumClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = "ValueOne", }); @@ -174,7 +174,7 @@ public async Task Example_Put_AllParameters_Async() { ExtensibleEnum client = new ValueTypesClient().GetExtensibleEnumClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = "ValueOne", }); diff --git a/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_Float.cs b/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_Float.cs index 8c17dac0122..b12ac23a11c 100644 --- a/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_Float.cs +++ b/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_Float.cs @@ -109,7 +109,7 @@ public void Example_Put_ShortVersion() { Float client = new ValueTypesClient().GetFloatClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = 123.45F, }); @@ -124,7 +124,7 @@ public async Task Example_Put_ShortVersion_Async() { Float client = new ValueTypesClient().GetFloatClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = 123.45F, }); @@ -159,7 +159,7 @@ public void Example_Put_AllParameters() { Float client = new ValueTypesClient().GetFloatClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = 123.45F, }); @@ -174,7 +174,7 @@ public async Task Example_Put_AllParameters_Async() { Float client = new ValueTypesClient().GetFloatClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = 123.45F, }); diff --git a/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_Int.cs b/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_Int.cs index 94666b3fc91..6418f9288b7 100644 --- a/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_Int.cs +++ b/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_Int.cs @@ -109,7 +109,7 @@ public void Example_Put_ShortVersion() { Int client = new ValueTypesClient().GetIntClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = 1234, }); @@ -124,7 +124,7 @@ public async Task Example_Put_ShortVersion_Async() { Int client = new ValueTypesClient().GetIntClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = 1234, }); @@ -159,7 +159,7 @@ public void Example_Put_AllParameters() { Int client = new ValueTypesClient().GetIntClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = 1234, }); @@ -174,7 +174,7 @@ public async Task Example_Put_AllParameters_Async() { Int client = new ValueTypesClient().GetIntClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = 1234, }); diff --git a/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_Model.cs b/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_Model.cs index 99913b3cdd8..663ca1c2c43 100644 --- a/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_Model.cs +++ b/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_Model.cs @@ -109,7 +109,7 @@ public void Example_Put_ShortVersion() { Model client = new ValueTypesClient().GetModelClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = new { @@ -127,7 +127,7 @@ public async Task Example_Put_ShortVersion_Async() { Model client = new ValueTypesClient().GetModelClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = new { @@ -165,7 +165,7 @@ public void Example_Put_AllParameters() { Model client = new ValueTypesClient().GetModelClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = new { @@ -183,7 +183,7 @@ public async Task Example_Put_AllParameters_Async() { Model client = new ValueTypesClient().GetModelClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = new { diff --git a/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_Never.cs b/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_Never.cs index 0f72ee3d61a..182cc1bf4a4 100644 --- a/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_Never.cs +++ b/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_Never.cs @@ -109,7 +109,7 @@ public void Example_Put_ShortVersion() { Never client = new ValueTypesClient().GetNeverClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.Put(content); Console.WriteLine(response.Status); @@ -121,7 +121,7 @@ public async Task Example_Put_ShortVersion_Async() { Never client = new ValueTypesClient().GetNeverClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutAsync(content); Console.WriteLine(response.Status); @@ -153,7 +153,7 @@ public void Example_Put_AllParameters() { Never client = new ValueTypesClient().GetNeverClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.Put(content); Console.WriteLine(response.Status); @@ -165,7 +165,7 @@ public async Task Example_Put_AllParameters_Async() { Never client = new ValueTypesClient().GetNeverClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutAsync(content); Console.WriteLine(response.Status); diff --git a/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_String.cs b/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_String.cs index fdd1c51c573..c9c8a337567 100644 --- a/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_String.cs +++ b/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_String.cs @@ -109,7 +109,7 @@ public void Example_Put_ShortVersion() { String client = new ValueTypesClient().GetStringClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = "", }); @@ -124,7 +124,7 @@ public async Task Example_Put_ShortVersion_Async() { String client = new ValueTypesClient().GetStringClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = "", }); @@ -159,7 +159,7 @@ public void Example_Put_AllParameters() { String client = new ValueTypesClient().GetStringClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = "", }); @@ -174,7 +174,7 @@ public async Task Example_Put_AllParameters_Async() { String client = new ValueTypesClient().GetStringClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = "", }); diff --git a/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_UnknownArray.cs b/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_UnknownArray.cs index 7619b26884b..ab07d3bf66d 100644 --- a/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_UnknownArray.cs +++ b/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_UnknownArray.cs @@ -109,7 +109,7 @@ public void Example_Put_ShortVersion() { UnknownArray client = new ValueTypesClient().GetUnknownArrayClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = new object(), }); @@ -124,7 +124,7 @@ public async Task Example_Put_ShortVersion_Async() { UnknownArray client = new ValueTypesClient().GetUnknownArrayClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = new object(), }); @@ -159,7 +159,7 @@ public void Example_Put_AllParameters() { UnknownArray client = new ValueTypesClient().GetUnknownArrayClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = new object(), }); @@ -174,7 +174,7 @@ public async Task Example_Put_AllParameters_Async() { UnknownArray client = new ValueTypesClient().GetUnknownArrayClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = new object(), }); diff --git a/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_UnknownDict.cs b/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_UnknownDict.cs index aeea3597591..c6ca902842a 100644 --- a/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_UnknownDict.cs +++ b/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_UnknownDict.cs @@ -109,7 +109,7 @@ public void Example_Put_ShortVersion() { UnknownDict client = new ValueTypesClient().GetUnknownDictClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = new object(), }); @@ -124,7 +124,7 @@ public async Task Example_Put_ShortVersion_Async() { UnknownDict client = new ValueTypesClient().GetUnknownDictClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = new object(), }); @@ -159,7 +159,7 @@ public void Example_Put_AllParameters() { UnknownDict client = new ValueTypesClient().GetUnknownDictClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = new object(), }); @@ -174,7 +174,7 @@ public async Task Example_Put_AllParameters_Async() { UnknownDict client = new ValueTypesClient().GetUnknownDictClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = new object(), }); diff --git a/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_UnknownInt.cs b/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_UnknownInt.cs index 9eeb8def3d8..f3680fed43d 100644 --- a/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_UnknownInt.cs +++ b/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_UnknownInt.cs @@ -109,7 +109,7 @@ public void Example_Put_ShortVersion() { UnknownInt client = new ValueTypesClient().GetUnknownIntClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = new object(), }); @@ -124,7 +124,7 @@ public async Task Example_Put_ShortVersion_Async() { UnknownInt client = new ValueTypesClient().GetUnknownIntClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = new object(), }); @@ -159,7 +159,7 @@ public void Example_Put_AllParameters() { UnknownInt client = new ValueTypesClient().GetUnknownIntClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = new object(), }); @@ -174,7 +174,7 @@ public async Task Example_Put_AllParameters_Async() { UnknownInt client = new ValueTypesClient().GetUnknownIntClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = new object(), }); diff --git a/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_UnknownString.cs b/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_UnknownString.cs index 64d10388f84..c7ee8685c9f 100644 --- a/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_UnknownString.cs +++ b/test/CadlRanchProjects/type/property/value-types/tests/Generated/Samples/Samples_UnknownString.cs @@ -109,7 +109,7 @@ public void Example_Put_ShortVersion() { UnknownString client = new ValueTypesClient().GetUnknownStringClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = new object(), }); @@ -124,7 +124,7 @@ public async Task Example_Put_ShortVersion_Async() { UnknownString client = new ValueTypesClient().GetUnknownStringClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = new object(), }); @@ -159,7 +159,7 @@ public void Example_Put_AllParameters() { UnknownString client = new ValueTypesClient().GetUnknownStringClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = new object(), }); @@ -174,7 +174,7 @@ public async Task Example_Put_AllParameters_Async() { UnknownString client = new ValueTypesClient().GetUnknownStringClient(apiVersion: "1.0.0"); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { property = new object(), }); diff --git a/test/CadlRanchProjects/type/union/src/Generated/Docs/UnionClient.xml b/test/CadlRanchProjects/type/union/src/Generated/Docs/UnionClient.xml index a0fa080df5d..d2d96daeb58 100644 --- a/test/CadlRanchProjects/type/union/src/Generated/Docs/UnionClient.xml +++ b/test/CadlRanchProjects/type/union/src/Generated/Docs/UnionClient.xml @@ -7,7 +7,7 @@ This sample shows how to call SendIntAsync. SendIntAsync(ModelWithSimpleUnionProperty Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await SendIntAsync(input.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = input.ToRequestContent(); + Response response = await SendIntAsync(content, context).ConfigureAwait(false); return response; } @@ -69,7 +70,8 @@ internal virtual Response SendInt(ModelWithSimpleUnionProperty input, Cancellati Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = SendInt(input.ToRequestContent(), context); + using RequestContent content = input.ToRequestContent(); + Response response = SendInt(content, context); return response; } @@ -151,7 +153,8 @@ internal virtual async Task SendIntArrayAsync(ModelWithSimpleUnionProp Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await SendIntArrayAsync(input.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = input.ToRequestContent(); + Response response = await SendIntArrayAsync(content, context).ConfigureAwait(false); return response; } @@ -163,7 +166,8 @@ internal virtual Response SendIntArray(ModelWithSimpleUnionProperty input, Cance Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = SendIntArray(input.ToRequestContent(), context); + using RequestContent content = input.ToRequestContent(); + Response response = SendIntArray(content, context); return response; } @@ -245,7 +249,8 @@ internal virtual async Task SendFirstNamedUnionValueAsync(ModelWithNam Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await SendFirstNamedUnionValueAsync(input.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = input.ToRequestContent(); + Response response = await SendFirstNamedUnionValueAsync(content, context).ConfigureAwait(false); return response; } @@ -257,7 +262,8 @@ internal virtual Response SendFirstNamedUnionValue(ModelWithNamedUnionProperty i Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = SendFirstNamedUnionValue(input.ToRequestContent(), context); + using RequestContent content = input.ToRequestContent(); + Response response = SendFirstNamedUnionValue(content, context); return response; } @@ -339,7 +345,8 @@ internal virtual async Task SendSecondNamedUnionValueAsync(ModelWithNa Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await SendSecondNamedUnionValueAsync(input.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = input.ToRequestContent(); + Response response = await SendSecondNamedUnionValueAsync(content, context).ConfigureAwait(false); return response; } @@ -351,7 +358,8 @@ internal virtual Response SendSecondNamedUnionValue(ModelWithNamedUnionProperty Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = SendSecondNamedUnionValue(input.ToRequestContent(), context); + using RequestContent content = input.ToRequestContent(); + Response response = SendSecondNamedUnionValue(content, context); return response; } diff --git a/test/CadlRanchProjects/type/union/tests/Generated/Samples/Samples_UnionClient.cs b/test/CadlRanchProjects/type/union/tests/Generated/Samples/Samples_UnionClient.cs index d242df5ece5..3baaab3a3e5 100644 --- a/test/CadlRanchProjects/type/union/tests/Generated/Samples/Samples_UnionClient.cs +++ b/test/CadlRanchProjects/type/union/tests/Generated/Samples/Samples_UnionClient.cs @@ -24,7 +24,7 @@ public void Example_SendInt_ShortVersion() { UnionClient client = new UnionClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { simpleUnion = 1234, }); @@ -39,7 +39,7 @@ public async Task Example_SendInt_ShortVersion_Async() { UnionClient client = new UnionClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { simpleUnion = 1234, }); @@ -54,7 +54,7 @@ public void Example_SendInt_AllParameters() { UnionClient client = new UnionClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { simpleUnion = 1234, }); @@ -69,7 +69,7 @@ public async Task Example_SendInt_AllParameters_Async() { UnionClient client = new UnionClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { simpleUnion = 1234, }); @@ -84,7 +84,7 @@ public void Example_SendIntArray_ShortVersion() { UnionClient client = new UnionClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { simpleUnion = 1234, }); @@ -99,7 +99,7 @@ public async Task Example_SendIntArray_ShortVersion_Async() { UnionClient client = new UnionClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { simpleUnion = 1234, }); @@ -114,7 +114,7 @@ public void Example_SendIntArray_AllParameters() { UnionClient client = new UnionClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { simpleUnion = 1234, }); @@ -129,7 +129,7 @@ public async Task Example_SendIntArray_AllParameters_Async() { UnionClient client = new UnionClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { simpleUnion = 1234, }); @@ -144,7 +144,7 @@ public void Example_SendFirstNamedUnionValue_ShortVersion() { UnionClient client = new UnionClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { namedUnion = new { @@ -163,7 +163,7 @@ public async Task Example_SendFirstNamedUnionValue_ShortVersion_Async() { UnionClient client = new UnionClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { namedUnion = new { @@ -182,7 +182,7 @@ public void Example_SendFirstNamedUnionValue_AllParameters() { UnionClient client = new UnionClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { namedUnion = new { @@ -201,7 +201,7 @@ public async Task Example_SendFirstNamedUnionValue_AllParameters_Async() { UnionClient client = new UnionClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { namedUnion = new { @@ -220,7 +220,7 @@ public void Example_SendSecondNamedUnionValue_ShortVersion() { UnionClient client = new UnionClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { namedUnion = new { @@ -239,7 +239,7 @@ public async Task Example_SendSecondNamedUnionValue_ShortVersion_Async() { UnionClient client = new UnionClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { namedUnion = new { @@ -258,7 +258,7 @@ public void Example_SendSecondNamedUnionValue_AllParameters() { UnionClient client = new UnionClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { namedUnion = new { @@ -277,7 +277,7 @@ public async Task Example_SendSecondNamedUnionValue_AllParameters_Async() { UnionClient client = new UnionClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { namedUnion = new { diff --git a/test/TestProjects/Accessibility-LowLevel-NoAuth/src/Generated/Docs/AccessibilityClient.xml b/test/TestProjects/Accessibility-LowLevel-NoAuth/src/Generated/Docs/AccessibilityClient.xml index 05ef9520a11..a59c1976ee5 100644 --- a/test/TestProjects/Accessibility-LowLevel-NoAuth/src/Generated/Docs/AccessibilityClient.xml +++ b/test/TestProjects/Accessibility-LowLevel-NoAuth/src/Generated/Docs/AccessibilityClient.xml @@ -7,7 +7,7 @@ This sample shows how to call OperationAsync. "); +using RequestContent content = RequestContent.Create(""); Response response = await client.OperationAsync(content); Console.WriteLine(response.Status); @@ -28,7 +28,7 @@ This sample shows how to call Operation. "); +using RequestContent content = RequestContent.Create(""); Response response = client.Operation(content); Console.WriteLine(response.Status); diff --git a/test/TestProjects/Accessibility-LowLevel-NoAuth/tests/Generated/Samples/Samples_AccessibilityClient.cs b/test/TestProjects/Accessibility-LowLevel-NoAuth/tests/Generated/Samples/Samples_AccessibilityClient.cs index 99bc80856c4..ae762bf910a 100644 --- a/test/TestProjects/Accessibility-LowLevel-NoAuth/tests/Generated/Samples/Samples_AccessibilityClient.cs +++ b/test/TestProjects/Accessibility-LowLevel-NoAuth/tests/Generated/Samples/Samples_AccessibilityClient.cs @@ -23,7 +23,7 @@ public void Example_Operation_ShortVersion() { AccessibilityClient client = new AccessibilityClient(); - RequestContent content = null; + using RequestContent content = null; Response response = client.Operation(content); Console.WriteLine(response.Status); @@ -35,7 +35,7 @@ public async Task Example_Operation_ShortVersion_Async() { AccessibilityClient client = new AccessibilityClient(); - RequestContent content = null; + using RequestContent content = null; Response response = await client.OperationAsync(content); Console.WriteLine(response.Status); @@ -47,7 +47,7 @@ public void Example_Operation_AllParameters() { AccessibilityClient client = new AccessibilityClient(); - RequestContent content = RequestContent.Create(""); + using RequestContent content = RequestContent.Create(""); Response response = client.Operation(content); Console.WriteLine(response.Status); @@ -59,7 +59,7 @@ public async Task Example_Operation_AllParameters_Async() { AccessibilityClient client = new AccessibilityClient(); - RequestContent content = RequestContent.Create(""); + using RequestContent content = RequestContent.Create(""); Response response = await client.OperationAsync(content); Console.WriteLine(response.Status); diff --git a/test/TestProjects/Accessibility-LowLevel-TokenAuth/src/Generated/Docs/AccessibilityClient.xml b/test/TestProjects/Accessibility-LowLevel-TokenAuth/src/Generated/Docs/AccessibilityClient.xml index 3ca23a1851f..096c4c5c21d 100644 --- a/test/TestProjects/Accessibility-LowLevel-TokenAuth/src/Generated/Docs/AccessibilityClient.xml +++ b/test/TestProjects/Accessibility-LowLevel-TokenAuth/src/Generated/Docs/AccessibilityClient.xml @@ -8,7 +8,7 @@ This sample shows how to call OperationAsync. TokenCredential credential = new DefaultAzureCredential(); AccessibilityClient client = new AccessibilityClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.OperationAsync(content); Console.WriteLine(response.Status); @@ -18,7 +18,7 @@ This sample shows how to call OperationAsync with all request content. TokenCredential credential = new DefaultAzureCredential(); AccessibilityClient client = new AccessibilityClient(credential); -RequestContent content = RequestContent.Create(""); +using RequestContent content = RequestContent.Create(""); Response response = await client.OperationAsync(content); Console.WriteLine(response.Status); @@ -31,7 +31,7 @@ This sample shows how to call Operation. TokenCredential credential = new DefaultAzureCredential(); AccessibilityClient client = new AccessibilityClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.Operation(content); Console.WriteLine(response.Status); @@ -41,7 +41,7 @@ This sample shows how to call Operation with all request content. TokenCredential credential = new DefaultAzureCredential(); AccessibilityClient client = new AccessibilityClient(credential); -RequestContent content = RequestContent.Create(""); +using RequestContent content = RequestContent.Create(""); Response response = client.Operation(content); Console.WriteLine(response.Status); diff --git a/test/TestProjects/Accessibility-LowLevel-TokenAuth/tests/Generated/Samples/Samples_AccessibilityClient.cs b/test/TestProjects/Accessibility-LowLevel-TokenAuth/tests/Generated/Samples/Samples_AccessibilityClient.cs index 0ec64f8b3c3..111f082cf7f 100644 --- a/test/TestProjects/Accessibility-LowLevel-TokenAuth/tests/Generated/Samples/Samples_AccessibilityClient.cs +++ b/test/TestProjects/Accessibility-LowLevel-TokenAuth/tests/Generated/Samples/Samples_AccessibilityClient.cs @@ -24,7 +24,7 @@ public void Example_Operation_ShortVersion() TokenCredential credential = new DefaultAzureCredential(); AccessibilityClient client = new AccessibilityClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.Operation(content); Console.WriteLine(response.Status); @@ -37,7 +37,7 @@ public async Task Example_Operation_ShortVersion_Async() TokenCredential credential = new DefaultAzureCredential(); AccessibilityClient client = new AccessibilityClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.OperationAsync(content); Console.WriteLine(response.Status); @@ -50,7 +50,7 @@ public void Example_Operation_AllParameters() TokenCredential credential = new DefaultAzureCredential(); AccessibilityClient client = new AccessibilityClient(credential); - RequestContent content = RequestContent.Create(""); + using RequestContent content = RequestContent.Create(""); Response response = client.Operation(content); Console.WriteLine(response.Status); @@ -63,7 +63,7 @@ public async Task Example_Operation_AllParameters_Async() TokenCredential credential = new DefaultAzureCredential(); AccessibilityClient client = new AccessibilityClient(credential); - RequestContent content = RequestContent.Create(""); + using RequestContent content = RequestContent.Create(""); Response response = await client.OperationAsync(content); Console.WriteLine(response.Status); diff --git a/test/TestProjects/Accessibility-LowLevel/src/Generated/Docs/AccessibilityClient.xml b/test/TestProjects/Accessibility-LowLevel/src/Generated/Docs/AccessibilityClient.xml index 3db82fc4e40..64adffefdc4 100644 --- a/test/TestProjects/Accessibility-LowLevel/src/Generated/Docs/AccessibilityClient.xml +++ b/test/TestProjects/Accessibility-LowLevel/src/Generated/Docs/AccessibilityClient.xml @@ -8,7 +8,7 @@ This sample shows how to call OperationAsync. AzureKeyCredential credential = new AzureKeyCredential(""); AccessibilityClient client = new AccessibilityClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.OperationAsync(content); Console.WriteLine(response.Status); @@ -18,7 +18,7 @@ This sample shows how to call OperationAsync with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); AccessibilityClient client = new AccessibilityClient(credential); -RequestContent content = RequestContent.Create(""); +using RequestContent content = RequestContent.Create(""); Response response = await client.OperationAsync(content); Console.WriteLine(response.Status); @@ -31,7 +31,7 @@ This sample shows how to call Operation. AzureKeyCredential credential = new AzureKeyCredential(""); AccessibilityClient client = new AccessibilityClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.Operation(content); Console.WriteLine(response.Status); @@ -41,7 +41,7 @@ This sample shows how to call Operation with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); AccessibilityClient client = new AccessibilityClient(credential); -RequestContent content = RequestContent.Create(""); +using RequestContent content = RequestContent.Create(""); Response response = client.Operation(content); Console.WriteLine(response.Status); diff --git a/test/TestProjects/Accessibility-LowLevel/tests/Generated/Samples/Samples_AccessibilityClient.cs b/test/TestProjects/Accessibility-LowLevel/tests/Generated/Samples/Samples_AccessibilityClient.cs index 45b9b0478be..039f920f4da 100644 --- a/test/TestProjects/Accessibility-LowLevel/tests/Generated/Samples/Samples_AccessibilityClient.cs +++ b/test/TestProjects/Accessibility-LowLevel/tests/Generated/Samples/Samples_AccessibilityClient.cs @@ -24,7 +24,7 @@ public void Example_Operation_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); AccessibilityClient client = new AccessibilityClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.Operation(content); Console.WriteLine(response.Status); @@ -37,7 +37,7 @@ public async Task Example_Operation_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); AccessibilityClient client = new AccessibilityClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.OperationAsync(content); Console.WriteLine(response.Status); @@ -50,7 +50,7 @@ public void Example_Operation_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); AccessibilityClient client = new AccessibilityClient(credential); - RequestContent content = RequestContent.Create(""); + using RequestContent content = RequestContent.Create(""); Response response = client.Operation(content); Console.WriteLine(response.Status); @@ -63,7 +63,7 @@ public async Task Example_Operation_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); AccessibilityClient client = new AccessibilityClient(credential); - RequestContent content = RequestContent.Create(""); + using RequestContent content = RequestContent.Create(""); Response response = await client.OperationAsync(content); Console.WriteLine(response.Status); diff --git a/test/TestProjects/Authoring-TypeSpec/src/Generated/Docs/AuthoringTypeSpecClient.xml b/test/TestProjects/Authoring-TypeSpec/src/Generated/Docs/AuthoringTypeSpecClient.xml index d32fd365c9b..c291c02c277 100644 --- a/test/TestProjects/Authoring-TypeSpec/src/Generated/Docs/AuthoringTypeSpecClient.xml +++ b/test/TestProjects/Authoring-TypeSpec/src/Generated/Docs/AuthoringTypeSpecClient.xml @@ -8,7 +8,7 @@ This sample shows how to call CreateOrUpdateAsync and parse the result. Uri endpoint = new Uri(""); AuthoringTypeSpecClient client = new AuthoringTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { projectKind = "CustomSingleLabelClassification", storageInputContainerName = "", @@ -31,7 +31,7 @@ This sample shows how to call CreateOrUpdateAsync with all parameters and reques Uri endpoint = new Uri(""); AuthoringTypeSpecClient client = new AuthoringTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { projectKind = "CustomSingleLabelClassification", storageInputContainerName = "", @@ -66,7 +66,7 @@ This sample shows how to call CreateOrUpdate and parse the result. Uri endpoint = new Uri(""); AuthoringTypeSpecClient client = new AuthoringTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { projectKind = "CustomSingleLabelClassification", storageInputContainerName = "", @@ -89,7 +89,7 @@ This sample shows how to call CreateOrUpdate with all parameters and request con Uri endpoint = new Uri(""); AuthoringTypeSpecClient client = new AuthoringTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { projectKind = "CustomSingleLabelClassification", storageInputContainerName = "", @@ -368,7 +368,7 @@ This sample shows how to call TrainAsync. Uri endpoint = new Uri(""); AuthoringTypeSpecClient client = new AuthoringTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { modelLabel = "", }); @@ -381,7 +381,7 @@ This sample shows how to call TrainAsync with all parameters and request content Uri endpoint = new Uri(""); AuthoringTypeSpecClient client = new AuthoringTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { modelLabel = "", }); @@ -397,7 +397,7 @@ This sample shows how to call Train. Uri endpoint = new Uri(""); AuthoringTypeSpecClient client = new AuthoringTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { modelLabel = "", }); @@ -410,7 +410,7 @@ This sample shows how to call Train with all parameters and request content. Uri endpoint = new Uri(""); AuthoringTypeSpecClient client = new AuthoringTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { modelLabel = "", }); @@ -472,7 +472,7 @@ This sample shows how to call DeployProjectAsync and parse the result. Uri endpoint = new Uri(""); AuthoringTypeSpecClient client = new AuthoringTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.DeployProjectAsync("", "", content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -483,7 +483,7 @@ This sample shows how to call DeployProjectAsync with all parameters and request Uri endpoint = new Uri(""); AuthoringTypeSpecClient client = new AuthoringTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.DeployProjectAsync("", "", content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -497,7 +497,7 @@ This sample shows how to call DeployProject and parse the result. Uri endpoint = new Uri(""); AuthoringTypeSpecClient client = new AuthoringTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = client.DeployProject("", "", content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -508,7 +508,7 @@ This sample shows how to call DeployProject with all parameters and request cont Uri endpoint = new Uri(""); AuthoringTypeSpecClient client = new AuthoringTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = client.DeployProject("", "", content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -568,7 +568,7 @@ This sample shows how to call SwapDeploymentsAsync. Uri endpoint = new Uri(""); AuthoringTypeSpecClient client = new AuthoringTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { firstDeploymentName = "", secondDeploymentName = "", @@ -582,7 +582,7 @@ This sample shows how to call SwapDeploymentsAsync with all parameters and reque Uri endpoint = new Uri(""); AuthoringTypeSpecClient client = new AuthoringTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { firstDeploymentName = "", secondDeploymentName = "", @@ -599,7 +599,7 @@ This sample shows how to call SwapDeployments. Uri endpoint = new Uri(""); AuthoringTypeSpecClient client = new AuthoringTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { firstDeploymentName = "", secondDeploymentName = "", @@ -613,7 +613,7 @@ This sample shows how to call SwapDeployments with all parameters and request co Uri endpoint = new Uri(""); AuthoringTypeSpecClient client = new AuthoringTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { firstDeploymentName = "", secondDeploymentName = "", diff --git a/test/TestProjects/Authoring-TypeSpec/tests/Generated/Samples/Samples_AuthoringTypeSpecClient.cs b/test/TestProjects/Authoring-TypeSpec/tests/Generated/Samples/Samples_AuthoringTypeSpecClient.cs index a68bd0d82b6..71134401e1e 100644 --- a/test/TestProjects/Authoring-TypeSpec/tests/Generated/Samples/Samples_AuthoringTypeSpecClient.cs +++ b/test/TestProjects/Authoring-TypeSpec/tests/Generated/Samples/Samples_AuthoringTypeSpecClient.cs @@ -26,7 +26,7 @@ public void Example_CreateOrUpdate_ShortVersion() Uri endpoint = new Uri(""); AuthoringTypeSpecClient client = new AuthoringTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { projectKind = "CustomSingleLabelClassification", storageInputContainerName = "", @@ -52,7 +52,7 @@ public async Task Example_CreateOrUpdate_ShortVersion_Async() Uri endpoint = new Uri(""); AuthoringTypeSpecClient client = new AuthoringTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { projectKind = "CustomSingleLabelClassification", storageInputContainerName = "", @@ -78,7 +78,7 @@ public void Example_CreateOrUpdate_AllParameters() Uri endpoint = new Uri(""); AuthoringTypeSpecClient client = new AuthoringTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { projectKind = "CustomSingleLabelClassification", storageInputContainerName = "", @@ -113,7 +113,7 @@ public async Task Example_CreateOrUpdate_AllParameters_Async() Uri endpoint = new Uri(""); AuthoringTypeSpecClient client = new AuthoringTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { projectKind = "CustomSingleLabelClassification", storageInputContainerName = "", @@ -416,7 +416,7 @@ public void Example_Train_ShortVersion() Uri endpoint = new Uri(""); AuthoringTypeSpecClient client = new AuthoringTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { modelLabel = "", }); @@ -432,7 +432,7 @@ public async Task Example_Train_ShortVersion_Async() Uri endpoint = new Uri(""); AuthoringTypeSpecClient client = new AuthoringTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { modelLabel = "", }); @@ -448,7 +448,7 @@ public void Example_Train_AllParameters() Uri endpoint = new Uri(""); AuthoringTypeSpecClient client = new AuthoringTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { modelLabel = "", }); @@ -464,7 +464,7 @@ public async Task Example_Train_AllParameters_Async() Uri endpoint = new Uri(""); AuthoringTypeSpecClient client = new AuthoringTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { modelLabel = "", }); @@ -532,7 +532,7 @@ public void Example_DeployProject_ShortVersion() Uri endpoint = new Uri(""); AuthoringTypeSpecClient client = new AuthoringTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.DeployProject("", "", content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -546,7 +546,7 @@ public async Task Example_DeployProject_ShortVersion_Async() Uri endpoint = new Uri(""); AuthoringTypeSpecClient client = new AuthoringTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.DeployProjectAsync("", "", content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -560,7 +560,7 @@ public void Example_DeployProject_AllParameters() Uri endpoint = new Uri(""); AuthoringTypeSpecClient client = new AuthoringTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.DeployProject("", "", content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -574,7 +574,7 @@ public async Task Example_DeployProject_AllParameters_Async() Uri endpoint = new Uri(""); AuthoringTypeSpecClient client = new AuthoringTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.DeployProjectAsync("", "", content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -640,7 +640,7 @@ public void Example_SwapDeployments_ShortVersion() Uri endpoint = new Uri(""); AuthoringTypeSpecClient client = new AuthoringTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { firstDeploymentName = "", secondDeploymentName = "", @@ -657,7 +657,7 @@ public async Task Example_SwapDeployments_ShortVersion_Async() Uri endpoint = new Uri(""); AuthoringTypeSpecClient client = new AuthoringTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { firstDeploymentName = "", secondDeploymentName = "", @@ -674,7 +674,7 @@ public void Example_SwapDeployments_AllParameters() Uri endpoint = new Uri(""); AuthoringTypeSpecClient client = new AuthoringTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { firstDeploymentName = "", secondDeploymentName = "", @@ -691,7 +691,7 @@ public async Task Example_SwapDeployments_AllParameters_Async() Uri endpoint = new Uri(""); AuthoringTypeSpecClient client = new AuthoringTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { firstDeploymentName = "", secondDeploymentName = "", diff --git a/test/TestProjects/BodyAndPath-LowLevel/src/Generated/Docs/BodyAndPathClient.xml b/test/TestProjects/BodyAndPath-LowLevel/src/Generated/Docs/BodyAndPathClient.xml index aaad5d8672e..f68766399cd 100644 --- a/test/TestProjects/BodyAndPath-LowLevel/src/Generated/Docs/BodyAndPathClient.xml +++ b/test/TestProjects/BodyAndPath-LowLevel/src/Generated/Docs/BodyAndPathClient.xml @@ -8,7 +8,7 @@ This sample shows how to call CreateAsync. AzureKeyCredential credential = new AzureKeyCredential(""); BodyAndPathClient client = new BodyAndPathClient(credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.CreateAsync("", content); Console.WriteLine(response.Status); @@ -18,7 +18,7 @@ This sample shows how to call CreateAsync with all parameters and request conten AzureKeyCredential credential = new AzureKeyCredential(""); BodyAndPathClient client = new BodyAndPathClient(credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.CreateAsync("", content); Console.WriteLine(response.Status); @@ -31,7 +31,7 @@ This sample shows how to call Create. AzureKeyCredential credential = new AzureKeyCredential(""); BodyAndPathClient client = new BodyAndPathClient(credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = client.Create("", content); Console.WriteLine(response.Status); @@ -41,7 +41,7 @@ This sample shows how to call Create with all parameters and request content. AzureKeyCredential credential = new AzureKeyCredential(""); BodyAndPathClient client = new BodyAndPathClient(credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = client.Create("", content); Console.WriteLine(response.Status); @@ -54,7 +54,7 @@ This sample shows how to call CreateStreamAsync. AzureKeyCredential credential = new AzureKeyCredential(""); BodyAndPathClient client = new BodyAndPathClient(credential); -RequestContent content = RequestContent.Create(File.OpenRead("")); +using RequestContent content = RequestContent.Create(File.OpenRead("")); Response response = await client.CreateStreamAsync("", content, new ContentType("application/json")); Console.WriteLine(response.Status); @@ -64,7 +64,7 @@ This sample shows how to call CreateStreamAsync with all parameters and request AzureKeyCredential credential = new AzureKeyCredential(""); BodyAndPathClient client = new BodyAndPathClient(credential); -RequestContent content = RequestContent.Create(File.OpenRead("")); +using RequestContent content = RequestContent.Create(File.OpenRead("")); Response response = await client.CreateStreamAsync("", content, new ContentType("application/json"), excluded: new string[] { "" }); Console.WriteLine(response.Status); @@ -77,7 +77,7 @@ This sample shows how to call CreateStream. AzureKeyCredential credential = new AzureKeyCredential(""); BodyAndPathClient client = new BodyAndPathClient(credential); -RequestContent content = RequestContent.Create(File.OpenRead("")); +using RequestContent content = RequestContent.Create(File.OpenRead("")); Response response = client.CreateStream("", content, new ContentType("application/json")); Console.WriteLine(response.Status); @@ -87,7 +87,7 @@ This sample shows how to call CreateStream with all parameters and request conte AzureKeyCredential credential = new AzureKeyCredential(""); BodyAndPathClient client = new BodyAndPathClient(credential); -RequestContent content = RequestContent.Create(File.OpenRead("")); +using RequestContent content = RequestContent.Create(File.OpenRead("")); Response response = client.CreateStream("", content, new ContentType("application/json"), excluded: new string[] { "" }); Console.WriteLine(response.Status); @@ -100,7 +100,7 @@ This sample shows how to call CreateEnumAsync. AzureKeyCredential credential = new AzureKeyCredential(""); BodyAndPathClient client = new BodyAndPathClient(credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.CreateEnumAsync("current", "latest", content); Console.WriteLine(response.Status); @@ -110,7 +110,7 @@ This sample shows how to call CreateEnumAsync with all parameters and request co AzureKeyCredential credential = new AzureKeyCredential(""); BodyAndPathClient client = new BodyAndPathClient(credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.CreateEnumAsync("current", "latest", content); Console.WriteLine(response.Status); @@ -123,7 +123,7 @@ This sample shows how to call CreateEnum. AzureKeyCredential credential = new AzureKeyCredential(""); BodyAndPathClient client = new BodyAndPathClient(credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = client.CreateEnum("current", "latest", content); Console.WriteLine(response.Status); @@ -133,7 +133,7 @@ This sample shows how to call CreateEnum with all parameters and request content AzureKeyCredential credential = new AzureKeyCredential(""); BodyAndPathClient client = new BodyAndPathClient(credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = client.CreateEnum("current", "latest", content); Console.WriteLine(response.Status); @@ -238,7 +238,7 @@ This sample shows how to call UpdateAsync. AzureKeyCredential credential = new AzureKeyCredential(""); BodyAndPathClient client = new BodyAndPathClient(credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.UpdateAsync("", "", "value", "", content); Console.WriteLine(response.Status); @@ -248,7 +248,7 @@ This sample shows how to call UpdateAsync with all parameters and request conten AzureKeyCredential credential = new AzureKeyCredential(""); BodyAndPathClient client = new BodyAndPathClient(credential); -RequestContent content = RequestContent.Create(new Dictionary +using RequestContent content = RequestContent.Create(new Dictionary { ["invalid-int-name"] = 1234 }); @@ -264,7 +264,7 @@ This sample shows how to call Update. AzureKeyCredential credential = new AzureKeyCredential(""); BodyAndPathClient client = new BodyAndPathClient(credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = client.Update("", "", "value", "", content); Console.WriteLine(response.Status); @@ -274,7 +274,7 @@ This sample shows how to call Update with all parameters and request content. AzureKeyCredential credential = new AzureKeyCredential(""); BodyAndPathClient client = new BodyAndPathClient(credential); -RequestContent content = RequestContent.Create(new Dictionary +using RequestContent content = RequestContent.Create(new Dictionary { ["invalid-int-name"] = 1234 }); diff --git a/test/TestProjects/BodyAndPath-LowLevel/tests/Generated/Samples/Samples_BodyAndPathClient.cs b/test/TestProjects/BodyAndPath-LowLevel/tests/Generated/Samples/Samples_BodyAndPathClient.cs index 51f451e4fa1..9387a88b813 100644 --- a/test/TestProjects/BodyAndPath-LowLevel/tests/Generated/Samples/Samples_BodyAndPathClient.cs +++ b/test/TestProjects/BodyAndPath-LowLevel/tests/Generated/Samples/Samples_BodyAndPathClient.cs @@ -27,7 +27,7 @@ public void Example_Create_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); BodyAndPathClient client = new BodyAndPathClient(credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.Create("", content); Console.WriteLine(response.Status); @@ -40,7 +40,7 @@ public async Task Example_Create_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); BodyAndPathClient client = new BodyAndPathClient(credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.CreateAsync("", content); Console.WriteLine(response.Status); @@ -53,7 +53,7 @@ public void Example_Create_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); BodyAndPathClient client = new BodyAndPathClient(credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.Create("", content); Console.WriteLine(response.Status); @@ -66,7 +66,7 @@ public async Task Example_Create_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); BodyAndPathClient client = new BodyAndPathClient(credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.CreateAsync("", content); Console.WriteLine(response.Status); @@ -79,7 +79,7 @@ public void Example_CreateStream_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); BodyAndPathClient client = new BodyAndPathClient(credential); - RequestContent content = RequestContent.Create(File.OpenRead("")); + using RequestContent content = RequestContent.Create(File.OpenRead("")); Response response = client.CreateStream("", content, new ContentType("application/json")); Console.WriteLine(response.Status); @@ -92,7 +92,7 @@ public async Task Example_CreateStream_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); BodyAndPathClient client = new BodyAndPathClient(credential); - RequestContent content = RequestContent.Create(File.OpenRead("")); + using RequestContent content = RequestContent.Create(File.OpenRead("")); Response response = await client.CreateStreamAsync("", content, new ContentType("application/json")); Console.WriteLine(response.Status); @@ -105,7 +105,7 @@ public void Example_CreateStream_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); BodyAndPathClient client = new BodyAndPathClient(credential); - RequestContent content = RequestContent.Create(File.OpenRead("")); + using RequestContent content = RequestContent.Create(File.OpenRead("")); Response response = client.CreateStream("", content, new ContentType("application/json"), excluded: new string[] { "" }); Console.WriteLine(response.Status); @@ -118,7 +118,7 @@ public async Task Example_CreateStream_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); BodyAndPathClient client = new BodyAndPathClient(credential); - RequestContent content = RequestContent.Create(File.OpenRead("")); + using RequestContent content = RequestContent.Create(File.OpenRead("")); Response response = await client.CreateStreamAsync("", content, new ContentType("application/json"), excluded: new string[] { "" }); Console.WriteLine(response.Status); @@ -131,7 +131,7 @@ public void Example_CreateEnum_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); BodyAndPathClient client = new BodyAndPathClient(credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.CreateEnum("current", "latest", content); Console.WriteLine(response.Status); @@ -144,7 +144,7 @@ public async Task Example_CreateEnum_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); BodyAndPathClient client = new BodyAndPathClient(credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.CreateEnumAsync("current", "latest", content); Console.WriteLine(response.Status); @@ -157,7 +157,7 @@ public void Example_CreateEnum_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); BodyAndPathClient client = new BodyAndPathClient(credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.CreateEnum("current", "latest", content); Console.WriteLine(response.Status); @@ -170,7 +170,7 @@ public async Task Example_CreateEnum_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); BodyAndPathClient client = new BodyAndPathClient(credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.CreateEnumAsync("current", "latest", content); Console.WriteLine(response.Status); @@ -287,7 +287,7 @@ public void Example_Update_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); BodyAndPathClient client = new BodyAndPathClient(credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.Update("", "", "value", "", content); Console.WriteLine(response.Status); @@ -300,7 +300,7 @@ public async Task Example_Update_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); BodyAndPathClient client = new BodyAndPathClient(credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.UpdateAsync("", "", "value", "", content); Console.WriteLine(response.Status); @@ -313,7 +313,7 @@ public void Example_Update_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); BodyAndPathClient client = new BodyAndPathClient(credential); - RequestContent content = RequestContent.Create(new Dictionary + using RequestContent content = RequestContent.Create(new Dictionary { ["invalid-int-name"] = 1234 }); @@ -329,7 +329,7 @@ public async Task Example_Update_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); BodyAndPathClient client = new BodyAndPathClient(credential); - RequestContent content = RequestContent.Create(new Dictionary + using RequestContent content = RequestContent.Create(new Dictionary { ["invalid-int-name"] = 1234 }); diff --git a/test/TestProjects/CollapseRequestCondition-LowLevel/src/Generated/Docs/MatchConditionCollapseClient.xml b/test/TestProjects/CollapseRequestCondition-LowLevel/src/Generated/Docs/MatchConditionCollapseClient.xml index 668773f27d6..d4d26ff80c8 100644 --- a/test/TestProjects/CollapseRequestCondition-LowLevel/src/Generated/Docs/MatchConditionCollapseClient.xml +++ b/test/TestProjects/CollapseRequestCondition-LowLevel/src/Generated/Docs/MatchConditionCollapseClient.xml @@ -50,7 +50,7 @@ This sample shows how to call CollapsePutAsync. AzureKeyCredential credential = new AzureKeyCredential(""); MatchConditionCollapseClient client = new MatchConditionCollapseClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.CollapsePutAsync(content); Console.WriteLine(response.Status); @@ -60,7 +60,7 @@ This sample shows how to call CollapsePutAsync with all parameters and request c AzureKeyCredential credential = new AzureKeyCredential(""); MatchConditionCollapseClient client = new MatchConditionCollapseClient(credential); -RequestContent content = RequestContent.Create(""); +using RequestContent content = RequestContent.Create(""); Response response = await client.CollapsePutAsync(content, matchConditions: null); Console.WriteLine(response.Status); @@ -73,7 +73,7 @@ This sample shows how to call CollapsePut. AzureKeyCredential credential = new AzureKeyCredential(""); MatchConditionCollapseClient client = new MatchConditionCollapseClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.CollapsePut(content); Console.WriteLine(response.Status); @@ -83,7 +83,7 @@ This sample shows how to call CollapsePut with all parameters and request conten AzureKeyCredential credential = new AzureKeyCredential(""); MatchConditionCollapseClient client = new MatchConditionCollapseClient(credential); -RequestContent content = RequestContent.Create(""); +using RequestContent content = RequestContent.Create(""); Response response = client.CollapsePut(content, matchConditions: null); Console.WriteLine(response.Status); diff --git a/test/TestProjects/CollapseRequestCondition-LowLevel/src/Generated/Docs/NonCollapseClient.xml b/test/TestProjects/CollapseRequestCondition-LowLevel/src/Generated/Docs/NonCollapseClient.xml index b33f82c691e..d99dadfe6cf 100644 --- a/test/TestProjects/CollapseRequestCondition-LowLevel/src/Generated/Docs/NonCollapseClient.xml +++ b/test/TestProjects/CollapseRequestCondition-LowLevel/src/Generated/Docs/NonCollapseClient.xml @@ -8,7 +8,7 @@ This sample shows how to call IfMatchPutAsync. AzureKeyCredential credential = new AzureKeyCredential(""); NonCollapseClient client = new NonCollapseClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.IfMatchPutAsync(content); Console.WriteLine(response.Status); @@ -18,7 +18,7 @@ This sample shows how to call IfMatchPutAsync with all parameters and request co AzureKeyCredential credential = new AzureKeyCredential(""); NonCollapseClient client = new NonCollapseClient(credential); -RequestContent content = RequestContent.Create(""); +using RequestContent content = RequestContent.Create(""); Response response = await client.IfMatchPutAsync(content, ifMatch: new ETag("")); Console.WriteLine(response.Status); @@ -31,7 +31,7 @@ This sample shows how to call IfMatchPut. AzureKeyCredential credential = new AzureKeyCredential(""); NonCollapseClient client = new NonCollapseClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.IfMatchPut(content); Console.WriteLine(response.Status); @@ -41,7 +41,7 @@ This sample shows how to call IfMatchPut with all parameters and request content AzureKeyCredential credential = new AzureKeyCredential(""); NonCollapseClient client = new NonCollapseClient(credential); -RequestContent content = RequestContent.Create(""); +using RequestContent content = RequestContent.Create(""); Response response = client.IfMatchPut(content, ifMatch: new ETag("")); Console.WriteLine(response.Status); @@ -54,7 +54,7 @@ This sample shows how to call IfNoneMatchPutAsync. AzureKeyCredential credential = new AzureKeyCredential(""); NonCollapseClient client = new NonCollapseClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.IfNoneMatchPutAsync(content); Console.WriteLine(response.Status); @@ -64,7 +64,7 @@ This sample shows how to call IfNoneMatchPutAsync with all parameters and reques AzureKeyCredential credential = new AzureKeyCredential(""); NonCollapseClient client = new NonCollapseClient(credential); -RequestContent content = RequestContent.Create(""); +using RequestContent content = RequestContent.Create(""); Response response = await client.IfNoneMatchPutAsync(content, ifNoneMatch: new ETag("")); Console.WriteLine(response.Status); @@ -77,7 +77,7 @@ This sample shows how to call IfNoneMatchPut. AzureKeyCredential credential = new AzureKeyCredential(""); NonCollapseClient client = new NonCollapseClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.IfNoneMatchPut(content); Console.WriteLine(response.Status); @@ -87,7 +87,7 @@ This sample shows how to call IfNoneMatchPut with all parameters and request con AzureKeyCredential credential = new AzureKeyCredential(""); NonCollapseClient client = new NonCollapseClient(credential); -RequestContent content = RequestContent.Create(""); +using RequestContent content = RequestContent.Create(""); Response response = client.IfNoneMatchPut(content, ifNoneMatch: new ETag("")); Console.WriteLine(response.Status); diff --git a/test/TestProjects/CollapseRequestCondition-LowLevel/src/Generated/Docs/RequestConditionCollapseClient.xml b/test/TestProjects/CollapseRequestCondition-LowLevel/src/Generated/Docs/RequestConditionCollapseClient.xml index fc8d0a0ff74..10fcb650472 100644 --- a/test/TestProjects/CollapseRequestCondition-LowLevel/src/Generated/Docs/RequestConditionCollapseClient.xml +++ b/test/TestProjects/CollapseRequestCondition-LowLevel/src/Generated/Docs/RequestConditionCollapseClient.xml @@ -8,7 +8,7 @@ This sample shows how to call CollapsePutAsync. AzureKeyCredential credential = new AzureKeyCredential(""); RequestConditionCollapseClient client = new RequestConditionCollapseClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.CollapsePutAsync(content); Console.WriteLine(response.Status); @@ -18,7 +18,7 @@ This sample shows how to call CollapsePutAsync with all parameters and request c AzureKeyCredential credential = new AzureKeyCredential(""); RequestConditionCollapseClient client = new RequestConditionCollapseClient(credential); -RequestContent content = RequestContent.Create(""); +using RequestContent content = RequestContent.Create(""); Response response = await client.CollapsePutAsync(content, requestConditions: null); Console.WriteLine(response.Status); @@ -31,7 +31,7 @@ This sample shows how to call CollapsePut. AzureKeyCredential credential = new AzureKeyCredential(""); RequestConditionCollapseClient client = new RequestConditionCollapseClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.CollapsePut(content); Console.WriteLine(response.Status); @@ -41,7 +41,7 @@ This sample shows how to call CollapsePut with all parameters and request conten AzureKeyCredential credential = new AzureKeyCredential(""); RequestConditionCollapseClient client = new RequestConditionCollapseClient(credential); -RequestContent content = RequestContent.Create(""); +using RequestContent content = RequestContent.Create(""); Response response = client.CollapsePut(content, requestConditions: null); Console.WriteLine(response.Status); diff --git a/test/TestProjects/CollapseRequestCondition-LowLevel/tests/Generated/Samples/Samples_MatchConditionCollapseClient.cs b/test/TestProjects/CollapseRequestCondition-LowLevel/tests/Generated/Samples/Samples_MatchConditionCollapseClient.cs index f84e3de80de..d866e9daa6c 100644 --- a/test/TestProjects/CollapseRequestCondition-LowLevel/tests/Generated/Samples/Samples_MatchConditionCollapseClient.cs +++ b/test/TestProjects/CollapseRequestCondition-LowLevel/tests/Generated/Samples/Samples_MatchConditionCollapseClient.cs @@ -72,7 +72,7 @@ public void Example_CollapsePut_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); MatchConditionCollapseClient client = new MatchConditionCollapseClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.CollapsePut(content); Console.WriteLine(response.Status); @@ -85,7 +85,7 @@ public async Task Example_CollapsePut_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); MatchConditionCollapseClient client = new MatchConditionCollapseClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.CollapsePutAsync(content); Console.WriteLine(response.Status); @@ -98,7 +98,7 @@ public void Example_CollapsePut_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); MatchConditionCollapseClient client = new MatchConditionCollapseClient(credential); - RequestContent content = RequestContent.Create(""); + using RequestContent content = RequestContent.Create(""); Response response = client.CollapsePut(content, matchConditions: null); Console.WriteLine(response.Status); @@ -111,7 +111,7 @@ public async Task Example_CollapsePut_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); MatchConditionCollapseClient client = new MatchConditionCollapseClient(credential); - RequestContent content = RequestContent.Create(""); + using RequestContent content = RequestContent.Create(""); Response response = await client.CollapsePutAsync(content, matchConditions: null); Console.WriteLine(response.Status); diff --git a/test/TestProjects/CollapseRequestCondition-LowLevel/tests/Generated/Samples/Samples_NonCollapseClient.cs b/test/TestProjects/CollapseRequestCondition-LowLevel/tests/Generated/Samples/Samples_NonCollapseClient.cs index a9ad13661fc..8064605d3d2 100644 --- a/test/TestProjects/CollapseRequestCondition-LowLevel/tests/Generated/Samples/Samples_NonCollapseClient.cs +++ b/test/TestProjects/CollapseRequestCondition-LowLevel/tests/Generated/Samples/Samples_NonCollapseClient.cs @@ -24,7 +24,7 @@ public void Example_IfMatchPut_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); NonCollapseClient client = new NonCollapseClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.IfMatchPut(content); Console.WriteLine(response.Status); @@ -37,7 +37,7 @@ public async Task Example_IfMatchPut_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); NonCollapseClient client = new NonCollapseClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.IfMatchPutAsync(content); Console.WriteLine(response.Status); @@ -50,7 +50,7 @@ public void Example_IfMatchPut_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); NonCollapseClient client = new NonCollapseClient(credential); - RequestContent content = RequestContent.Create(""); + using RequestContent content = RequestContent.Create(""); Response response = client.IfMatchPut(content, ifMatch: new ETag("")); Console.WriteLine(response.Status); @@ -63,7 +63,7 @@ public async Task Example_IfMatchPut_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); NonCollapseClient client = new NonCollapseClient(credential); - RequestContent content = RequestContent.Create(""); + using RequestContent content = RequestContent.Create(""); Response response = await client.IfMatchPutAsync(content, ifMatch: new ETag("")); Console.WriteLine(response.Status); @@ -76,7 +76,7 @@ public void Example_IfNoneMatchPut_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); NonCollapseClient client = new NonCollapseClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.IfNoneMatchPut(content); Console.WriteLine(response.Status); @@ -89,7 +89,7 @@ public async Task Example_IfNoneMatchPut_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); NonCollapseClient client = new NonCollapseClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.IfNoneMatchPutAsync(content); Console.WriteLine(response.Status); @@ -102,7 +102,7 @@ public void Example_IfNoneMatchPut_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); NonCollapseClient client = new NonCollapseClient(credential); - RequestContent content = RequestContent.Create(""); + using RequestContent content = RequestContent.Create(""); Response response = client.IfNoneMatchPut(content, ifNoneMatch: new ETag("")); Console.WriteLine(response.Status); @@ -115,7 +115,7 @@ public async Task Example_IfNoneMatchPut_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); NonCollapseClient client = new NonCollapseClient(credential); - RequestContent content = RequestContent.Create(""); + using RequestContent content = RequestContent.Create(""); Response response = await client.IfNoneMatchPutAsync(content, ifNoneMatch: new ETag("")); Console.WriteLine(response.Status); diff --git a/test/TestProjects/CollapseRequestCondition-LowLevel/tests/Generated/Samples/Samples_RequestConditionCollapseClient.cs b/test/TestProjects/CollapseRequestCondition-LowLevel/tests/Generated/Samples/Samples_RequestConditionCollapseClient.cs index f190f305538..6cca2b98d58 100644 --- a/test/TestProjects/CollapseRequestCondition-LowLevel/tests/Generated/Samples/Samples_RequestConditionCollapseClient.cs +++ b/test/TestProjects/CollapseRequestCondition-LowLevel/tests/Generated/Samples/Samples_RequestConditionCollapseClient.cs @@ -24,7 +24,7 @@ public void Example_CollapsePut_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); RequestConditionCollapseClient client = new RequestConditionCollapseClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.CollapsePut(content); Console.WriteLine(response.Status); @@ -37,7 +37,7 @@ public async Task Example_CollapsePut_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); RequestConditionCollapseClient client = new RequestConditionCollapseClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.CollapsePutAsync(content); Console.WriteLine(response.Status); @@ -50,7 +50,7 @@ public void Example_CollapsePut_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); RequestConditionCollapseClient client = new RequestConditionCollapseClient(credential); - RequestContent content = RequestContent.Create(""); + using RequestContent content = RequestContent.Create(""); Response response = client.CollapsePut(content, requestConditions: null); Console.WriteLine(response.Status); @@ -63,7 +63,7 @@ public async Task Example_CollapsePut_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); RequestConditionCollapseClient client = new RequestConditionCollapseClient(credential); - RequestContent content = RequestContent.Create(""); + using RequestContent content = RequestContent.Create(""); Response response = await client.CollapsePutAsync(content, requestConditions: null); Console.WriteLine(response.Status); diff --git a/test/TestProjects/ConfidentLevels-TypeSpec/src/Generated/ConfidentLevelsInTspClient.cs b/test/TestProjects/ConfidentLevels-TypeSpec/src/Generated/ConfidentLevelsInTspClient.cs index d0ebdb3b345..6d99d8ab63f 100644 --- a/test/TestProjects/ConfidentLevels-TypeSpec/src/Generated/ConfidentLevelsInTspClient.cs +++ b/test/TestProjects/ConfidentLevels-TypeSpec/src/Generated/ConfidentLevelsInTspClient.cs @@ -65,7 +65,8 @@ internal virtual async Task UnionInRequestPropertyAsync(ModelWithUnion Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await UnionInRequestPropertyAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await UnionInRequestPropertyAsync(content, context).ConfigureAwait(false); return response; } @@ -78,7 +79,8 @@ internal virtual Response UnionInRequestProperty(ModelWithUnionProperty body, Ca Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = UnionInRequestProperty(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = UnionInRequestProperty(content, context); return response; } @@ -161,7 +163,8 @@ internal virtual async Task> UnionInResp Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await UnionInResponsePropertyAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await UnionInResponsePropertyAsync(content, context).ConfigureAwait(false); return Response.FromValue(AnotherModelWithUnionProperty.FromResponse(response), response); } @@ -174,7 +177,8 @@ internal virtual Response UnionInResponseProperty Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = UnionInResponseProperty(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = UnionInResponseProperty(content, context); return Response.FromValue(AnotherModelWithUnionProperty.FromResponse(response), response); } @@ -257,7 +261,8 @@ internal virtual async Task UnionWithSelfReferenceAsync(NonConfidentMo Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await UnionWithSelfReferenceAsync(input.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = input.ToRequestContent(); + Response response = await UnionWithSelfReferenceAsync(content, context).ConfigureAwait(false); return response; } @@ -270,7 +275,8 @@ internal virtual Response UnionWithSelfReference(NonConfidentModelWithSelfRefere Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = UnionWithSelfReference(input.ToRequestContent(), context); + using RequestContent content = input.ToRequestContent(); + Response response = UnionWithSelfReference(content, context); return response; } @@ -353,7 +359,8 @@ internal virtual async Task UnionWithInderictAsync(NonConfidentModelWi Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await UnionWithInderictAsync(input.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = input.ToRequestContent(); + Response response = await UnionWithInderictAsync(content, context).ConfigureAwait(false); return response; } @@ -366,7 +373,8 @@ internal virtual Response UnionWithInderict(NonConfidentModelWithIndirectSelfRef Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = UnionWithInderict(input.ToRequestContent(), context); + using RequestContent content = input.ToRequestContent(); + Response response = UnionWithInderict(content, context); return response; } @@ -449,7 +457,8 @@ internal virtual async Task LiteralOfIntegerAsync(ModelWithIntegerLite Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await LiteralOfIntegerAsync(input.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = input.ToRequestContent(); + Response response = await LiteralOfIntegerAsync(content, context).ConfigureAwait(false); return response; } @@ -462,7 +471,8 @@ internal virtual Response LiteralOfInteger(ModelWithIntegerLiteralTypeProperty i Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = LiteralOfInteger(input.ToRequestContent(), context); + using RequestContent content = input.ToRequestContent(); + Response response = LiteralOfInteger(content, context); return response; } @@ -545,7 +555,8 @@ internal virtual async Task LiteralOfFloatAsync(ModelWithFloatLiteralT Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await LiteralOfFloatAsync(input.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = input.ToRequestContent(); + Response response = await LiteralOfFloatAsync(content, context).ConfigureAwait(false); return response; } @@ -558,7 +569,8 @@ internal virtual Response LiteralOfFloat(ModelWithFloatLiteralTypeProperty input Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = LiteralOfFloat(input.ToRequestContent(), context); + using RequestContent content = input.ToRequestContent(); + Response response = LiteralOfFloat(content, context); return response; } @@ -642,7 +654,8 @@ public virtual async Task> ConfidentOperationWithDiscriminatorAsyn Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await ConfidentOperationWithDiscriminatorAsync(input.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = input.ToRequestContent(); + Response response = await ConfidentOperationWithDiscriminatorAsync(content, context).ConfigureAwait(false); return Response.FromValue(Pet.FromResponse(response), response); } @@ -656,7 +669,8 @@ public virtual Response ConfidentOperationWithDiscriminator(Pet input, Canc Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = ConfidentOperationWithDiscriminator(input.ToRequestContent(), context); + using RequestContent content = input.ToRequestContent(); + Response response = ConfidentOperationWithDiscriminator(content, context); return Response.FromValue(Pet.FromResponse(response), response); } @@ -747,7 +761,8 @@ internal virtual async Task> PollutedBaseMethodAsync(Pollu Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PollutedBaseMethodAsync(input.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = input.ToRequestContent(); + Response response = await PollutedBaseMethodAsync(content, context).ConfigureAwait(false); return Response.FromValue(PollutedPet.FromResponse(response), response); } @@ -760,7 +775,8 @@ internal virtual Response PollutedBaseMethod(PollutedPet input, Can Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = PollutedBaseMethod(input.ToRequestContent(), context); + using RequestContent content = input.ToRequestContent(); + Response response = PollutedBaseMethod(content, context); return Response.FromValue(PollutedPet.FromResponse(response), response); } @@ -843,7 +859,8 @@ internal virtual async Task> PollutedDerivedMethodAsync(Po Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await PollutedDerivedMethodAsync(input.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = input.ToRequestContent(); + Response response = await PollutedDerivedMethodAsync(content, context).ConfigureAwait(false); return Response.FromValue(PollutedDog.FromResponse(response), response); } @@ -856,7 +873,8 @@ internal virtual Response PollutedDerivedMethod(PollutedDog input, Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = PollutedDerivedMethod(input.ToRequestContent(), context); + using RequestContent content = input.ToRequestContent(); + Response response = PollutedDerivedMethod(content, context); return Response.FromValue(PollutedDog.FromResponse(response), response); } @@ -939,7 +957,8 @@ internal virtual async Task> UnpollutedDerivedMethodAsyn Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await UnpollutedDerivedMethodAsync(input.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = input.ToRequestContent(); + Response response = await UnpollutedDerivedMethodAsync(content, context).ConfigureAwait(false); return Response.FromValue(UnpollutedCat.FromResponse(response), response); } @@ -952,7 +971,8 @@ internal virtual Response UnpollutedDerivedMethod(UnpollutedCat i Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = UnpollutedDerivedMethod(input.ToRequestContent(), context); + using RequestContent content = input.ToRequestContent(); + Response response = UnpollutedDerivedMethod(content, context); return Response.FromValue(UnpollutedCat.FromResponse(response), response); } @@ -1035,7 +1055,8 @@ internal virtual async Task UseDerivedModelAsync(DerivedModel input, C Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await UseDerivedModelAsync(input.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = input.ToRequestContent(); + Response response = await UseDerivedModelAsync(content, context).ConfigureAwait(false); return response; } @@ -1048,7 +1069,8 @@ internal virtual Response UseDerivedModel(DerivedModel input, CancellationToken Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = UseDerivedModel(input.ToRequestContent(), context); + using RequestContent content = input.ToRequestContent(); + Response response = UseDerivedModel(content, context); return response; } @@ -1131,7 +1153,8 @@ internal virtual async Task UseDerivedModelWithUnionAsync(DerivedModel Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await UseDerivedModelWithUnionAsync(input.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = input.ToRequestContent(); + Response response = await UseDerivedModelWithUnionAsync(content, context).ConfigureAwait(false); return response; } @@ -1144,7 +1167,8 @@ internal virtual Response UseDerivedModelWithUnion(DerivedModelWithUnion input, Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = UseDerivedModelWithUnion(input.ToRequestContent(), context); + using RequestContent content = input.ToRequestContent(); + Response response = UseDerivedModelWithUnion(content, context); return response; } diff --git a/test/TestProjects/ConfidentLevels-TypeSpec/src/Generated/Docs/ConfidentLevelsInTspClient.xml b/test/TestProjects/ConfidentLevels-TypeSpec/src/Generated/Docs/ConfidentLevelsInTspClient.xml index 41562fa9a01..f6f3eafa523 100644 --- a/test/TestProjects/ConfidentLevels-TypeSpec/src/Generated/Docs/ConfidentLevelsInTspClient.xml +++ b/test/TestProjects/ConfidentLevels-TypeSpec/src/Generated/Docs/ConfidentLevelsInTspClient.xml @@ -8,7 +8,7 @@ This sample shows how to call UnionInRequestPropertyAsync. Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { unionProperty = "", }); @@ -21,7 +21,7 @@ This sample shows how to call UnionInRequestPropertyAsync with all request conte Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { unionProperty = "", }); @@ -37,7 +37,7 @@ This sample shows how to call UnionInRequestProperty. Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { unionProperty = "", }); @@ -50,7 +50,7 @@ This sample shows how to call UnionInRequestProperty with all request content. Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { unionProperty = "", }); @@ -66,7 +66,7 @@ This sample shows how to call UnionInResponsePropertyAsync and parse the result. Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", age = 1234, @@ -81,7 +81,7 @@ This sample shows how to call UnionInResponsePropertyAsync with all request cont Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", age = 1234, @@ -100,7 +100,7 @@ This sample shows how to call UnionInResponseProperty and parse the result. Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", age = 1234, @@ -115,7 +115,7 @@ This sample shows how to call UnionInResponseProperty with all request content a Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", age = 1234, @@ -134,7 +134,7 @@ This sample shows how to call UnionWithSelfReferenceAsync. Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", selfReference = new object[] @@ -152,7 +152,7 @@ This sample shows how to call UnionWithSelfReferenceAsync with all request conte Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", selfReference = new object[] @@ -173,7 +173,7 @@ This sample shows how to call UnionWithSelfReference. Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", selfReference = new object[] @@ -191,7 +191,7 @@ This sample shows how to call UnionWithSelfReference with all request content. Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", selfReference = new object[] @@ -212,7 +212,7 @@ This sample shows how to call UnionWithInderictAsync. Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", }); @@ -225,7 +225,7 @@ This sample shows how to call UnionWithInderictAsync with all request content. Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", reference = new object[] @@ -258,7 +258,7 @@ This sample shows how to call UnionWithInderict. Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", }); @@ -271,7 +271,7 @@ This sample shows how to call UnionWithInderict with all request content. Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", reference = new object[] @@ -304,7 +304,7 @@ This sample shows how to call LiteralOfIntegerAsync. Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", id = 1, @@ -318,7 +318,7 @@ This sample shows how to call LiteralOfIntegerAsync with all request content. Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", id = 1, @@ -335,7 +335,7 @@ This sample shows how to call LiteralOfInteger. Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", id = 1, @@ -349,7 +349,7 @@ This sample shows how to call LiteralOfInteger with all request content. Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", id = 1, @@ -366,7 +366,7 @@ This sample shows how to call LiteralOfFloatAsync. Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", id = 3.141592F, @@ -380,7 +380,7 @@ This sample shows how to call LiteralOfFloatAsync with all request content. Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", id = 3.141592F, @@ -397,7 +397,7 @@ This sample shows how to call LiteralOfFloat. Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", id = 3.141592F, @@ -411,7 +411,7 @@ This sample shows how to call LiteralOfFloat with all request content. Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", id = 3.141592F, @@ -466,7 +466,7 @@ This sample shows how to call ConfidentOperationWithDiscriminatorAsync and parse Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { meow = "", kind = "cat", @@ -483,7 +483,7 @@ This sample shows how to call ConfidentOperationWithDiscriminatorAsync with all Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { meow = "", kind = "cat", @@ -503,7 +503,7 @@ This sample shows how to call ConfidentOperationWithDiscriminator and parse the Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { meow = "", kind = "cat", @@ -520,7 +520,7 @@ This sample shows how to call ConfidentOperationWithDiscriminator with all reque Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { meow = "", kind = "cat", @@ -540,7 +540,7 @@ This sample shows how to call PollutedBaseMethodAsync and parse the result. Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { woof = "", color = "", @@ -558,7 +558,7 @@ This sample shows how to call PollutedBaseMethodAsync with all request content a Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { woof = "", color = "", @@ -579,7 +579,7 @@ This sample shows how to call PollutedBaseMethod and parse the result. Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { woof = "", color = "", @@ -597,7 +597,7 @@ This sample shows how to call PollutedBaseMethod with all request content and pa Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { woof = "", color = "", @@ -618,7 +618,7 @@ This sample shows how to call PollutedDerivedMethodAsync and parse the result. Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { woof = "", color = "", @@ -638,7 +638,7 @@ This sample shows how to call PollutedDerivedMethodAsync with all request conten Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { woof = "", color = "", @@ -661,7 +661,7 @@ This sample shows how to call PollutedDerivedMethod and parse the result. Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { woof = "", color = "", @@ -681,7 +681,7 @@ This sample shows how to call PollutedDerivedMethod with all request content and Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { woof = "", color = "", @@ -704,7 +704,7 @@ This sample shows how to call UnpollutedDerivedMethodAsync and parse the result. Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { meow = "", kind = "cat", @@ -722,7 +722,7 @@ This sample shows how to call UnpollutedDerivedMethodAsync with all request cont Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { meow = "", kind = "cat", @@ -743,7 +743,7 @@ This sample shows how to call UnpollutedDerivedMethod and parse the result. Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { meow = "", kind = "cat", @@ -761,7 +761,7 @@ This sample shows how to call UnpollutedDerivedMethod with all request content a Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { meow = "", kind = "cat", @@ -782,7 +782,7 @@ This sample shows how to call UseDerivedModelAsync. Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", }); @@ -795,7 +795,7 @@ This sample shows how to call UseDerivedModelAsync with all request content. Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { age = 1234, name = "", @@ -813,7 +813,7 @@ This sample shows how to call UseDerivedModel. Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", }); @@ -826,7 +826,7 @@ This sample shows how to call UseDerivedModel with all request content. Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { age = 1234, name = "", @@ -844,7 +844,7 @@ This sample shows how to call UseDerivedModelWithUnionAsync. Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { unionProperty = "", name = "", @@ -858,7 +858,7 @@ This sample shows how to call UseDerivedModelWithUnionAsync with all request con Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { unionProperty = "", name = "", @@ -876,7 +876,7 @@ This sample shows how to call UseDerivedModelWithUnion. Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { unionProperty = "", name = "", @@ -890,7 +890,7 @@ This sample shows how to call UseDerivedModelWithUnion with all request content. Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { unionProperty = "", name = "", diff --git a/test/TestProjects/ConfidentLevels-TypeSpec/tests/Generated/Samples/Samples_ConfidentLevelsInTspClient.cs b/test/TestProjects/ConfidentLevels-TypeSpec/tests/Generated/Samples/Samples_ConfidentLevelsInTspClient.cs index f714e59363d..25e152e5d56 100644 --- a/test/TestProjects/ConfidentLevels-TypeSpec/tests/Generated/Samples/Samples_ConfidentLevelsInTspClient.cs +++ b/test/TestProjects/ConfidentLevels-TypeSpec/tests/Generated/Samples/Samples_ConfidentLevelsInTspClient.cs @@ -26,7 +26,7 @@ public void Example_UnionInRequestProperty_ShortVersion() Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { unionProperty = "", }); @@ -42,7 +42,7 @@ public async Task Example_UnionInRequestProperty_ShortVersion_Async() Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { unionProperty = "", }); @@ -58,7 +58,7 @@ public void Example_UnionInRequestProperty_AllParameters() Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { unionProperty = "", }); @@ -74,7 +74,7 @@ public async Task Example_UnionInRequestProperty_AllParameters_Async() Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { unionProperty = "", }); @@ -90,7 +90,7 @@ public void Example_UnionInResponseProperty_ShortVersion() Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", age = 1234, @@ -108,7 +108,7 @@ public async Task Example_UnionInResponseProperty_ShortVersion_Async() Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", age = 1234, @@ -126,7 +126,7 @@ public void Example_UnionInResponseProperty_AllParameters() Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", age = 1234, @@ -145,7 +145,7 @@ public async Task Example_UnionInResponseProperty_AllParameters_Async() Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", age = 1234, @@ -164,7 +164,7 @@ public void Example_UnionWithSelfReference_ShortVersion() Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", selfReference = new object[] @@ -185,7 +185,7 @@ public async Task Example_UnionWithSelfReference_ShortVersion_Async() Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", selfReference = new object[] @@ -206,7 +206,7 @@ public void Example_UnionWithSelfReference_AllParameters() Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", selfReference = new object[] @@ -227,7 +227,7 @@ public async Task Example_UnionWithSelfReference_AllParameters_Async() Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", selfReference = new object[] @@ -248,7 +248,7 @@ public void Example_UnionWithInderict_ShortVersion() Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", }); @@ -264,7 +264,7 @@ public async Task Example_UnionWithInderict_ShortVersion_Async() Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", }); @@ -280,7 +280,7 @@ public void Example_UnionWithInderict_AllParameters() Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", reference = new object[] @@ -313,7 +313,7 @@ public async Task Example_UnionWithInderict_AllParameters_Async() Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", reference = new object[] @@ -346,7 +346,7 @@ public void Example_LiteralOfInteger_ShortVersion() Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", id = 1, @@ -363,7 +363,7 @@ public async Task Example_LiteralOfInteger_ShortVersion_Async() Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", id = 1, @@ -380,7 +380,7 @@ public void Example_LiteralOfInteger_AllParameters() Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", id = 1, @@ -397,7 +397,7 @@ public async Task Example_LiteralOfInteger_AllParameters_Async() Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", id = 1, @@ -414,7 +414,7 @@ public void Example_LiteralOfFloat_ShortVersion() Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", id = 3.141592F, @@ -431,7 +431,7 @@ public async Task Example_LiteralOfFloat_ShortVersion_Async() Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", id = 3.141592F, @@ -448,7 +448,7 @@ public void Example_LiteralOfFloat_AllParameters() Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", id = 3.141592F, @@ -465,7 +465,7 @@ public async Task Example_LiteralOfFloat_AllParameters_Async() Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", id = 3.141592F, @@ -482,7 +482,7 @@ public void Example_ConfidentOperationWithDiscriminator_ShortVersion() Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { meow = "", kind = "cat", @@ -502,7 +502,7 @@ public async Task Example_ConfidentOperationWithDiscriminator_ShortVersion_Async Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { meow = "", kind = "cat", @@ -544,7 +544,7 @@ public void Example_ConfidentOperationWithDiscriminator_AllParameters() Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { meow = "", kind = "cat", @@ -564,7 +564,7 @@ public async Task Example_ConfidentOperationWithDiscriminator_AllParameters_Asyn Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { meow = "", kind = "cat", @@ -606,7 +606,7 @@ public void Example_PollutedBaseMethod_ShortVersion() Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { woof = "", color = "", @@ -627,7 +627,7 @@ public async Task Example_PollutedBaseMethod_ShortVersion_Async() Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { woof = "", color = "", @@ -648,7 +648,7 @@ public void Example_PollutedBaseMethod_AllParameters() Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { woof = "", color = "", @@ -669,7 +669,7 @@ public async Task Example_PollutedBaseMethod_AllParameters_Async() Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { woof = "", color = "", @@ -690,7 +690,7 @@ public void Example_PollutedDerivedMethod_ShortVersion() Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { woof = "", color = "", @@ -713,7 +713,7 @@ public async Task Example_PollutedDerivedMethod_ShortVersion_Async() Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { woof = "", color = "", @@ -736,7 +736,7 @@ public void Example_PollutedDerivedMethod_AllParameters() Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { woof = "", color = "", @@ -759,7 +759,7 @@ public async Task Example_PollutedDerivedMethod_AllParameters_Async() Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { woof = "", color = "", @@ -782,7 +782,7 @@ public void Example_UnpollutedDerivedMethod_ShortVersion() Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { meow = "", kind = "cat", @@ -803,7 +803,7 @@ public async Task Example_UnpollutedDerivedMethod_ShortVersion_Async() Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { meow = "", kind = "cat", @@ -824,7 +824,7 @@ public void Example_UnpollutedDerivedMethod_AllParameters() Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { meow = "", kind = "cat", @@ -845,7 +845,7 @@ public async Task Example_UnpollutedDerivedMethod_AllParameters_Async() Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { meow = "", kind = "cat", @@ -866,7 +866,7 @@ public void Example_UseDerivedModel_ShortVersion() Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", }); @@ -882,7 +882,7 @@ public async Task Example_UseDerivedModel_ShortVersion_Async() Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", }); @@ -898,7 +898,7 @@ public void Example_UseDerivedModel_AllParameters() Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { age = 1234, name = "", @@ -916,7 +916,7 @@ public async Task Example_UseDerivedModel_AllParameters_Async() Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { age = 1234, name = "", @@ -934,7 +934,7 @@ public void Example_UseDerivedModelWithUnion_ShortVersion() Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { unionProperty = "", name = "", @@ -951,7 +951,7 @@ public async Task Example_UseDerivedModelWithUnion_ShortVersion_Async() Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { unionProperty = "", name = "", @@ -968,7 +968,7 @@ public void Example_UseDerivedModelWithUnion_AllParameters() Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { unionProperty = "", name = "", @@ -986,7 +986,7 @@ public async Task Example_UseDerivedModelWithUnion_AllParameters_Async() Uri endpoint = new Uri(""); ConfidentLevelsInTspClient client = new ConfidentLevelsInTspClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { unionProperty = "", name = "", diff --git a/test/TestProjects/ConvenienceUpdate-TypeSpec/src/Generated/ConvenienceInCadlClient.cs b/test/TestProjects/ConvenienceUpdate-TypeSpec/src/Generated/ConvenienceInCadlClient.cs index 082fee504c9..14b15c0857d 100644 --- a/test/TestProjects/ConvenienceUpdate-TypeSpec/src/Generated/ConvenienceInCadlClient.cs +++ b/test/TestProjects/ConvenienceUpdate-TypeSpec/src/Generated/ConvenienceInCadlClient.cs @@ -145,7 +145,8 @@ public virtual async Task ConvenienceOptionalBeforeRequiredAsync(Model Argument.AssertNotNull(required, nameof(required)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await ConvenienceOptionalBeforeRequiredAsync(required.ToRequestContent(), optional, context).ConfigureAwait(false); + using RequestContent content = required.ToRequestContent(); + Response response = await ConvenienceOptionalBeforeRequiredAsync(content, optional, context).ConfigureAwait(false); return response; } @@ -160,7 +161,8 @@ public virtual Response ConvenienceOptionalBeforeRequired(Model required, int? o Argument.AssertNotNull(required, nameof(required)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = ConvenienceOptionalBeforeRequired(required.ToRequestContent(), optional, context); + using RequestContent content = required.ToRequestContent(); + Response response = ConvenienceOptionalBeforeRequired(content, optional, context); return response; } @@ -1103,7 +1105,8 @@ public virtual Response ProtocolRequiredQuery(int required, RequestContext conte public virtual async Task ProtocolOptionalModelAsync(Model optional = null, CancellationToken cancellationToken = default) { RequestContext context = FromCancellationToken(cancellationToken); - Response response = await ProtocolOptionalModelAsync(optional?.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = optional?.ToRequestContent(); + Response response = await ProtocolOptionalModelAsync(content, context).ConfigureAwait(false); return response; } @@ -1114,7 +1117,8 @@ public virtual async Task ProtocolOptionalModelAsync(Model optional = public virtual Response ProtocolOptionalModel(Model optional = null, CancellationToken cancellationToken = default) { RequestContext context = FromCancellationToken(cancellationToken); - Response response = ProtocolOptionalModel(optional?.ToRequestContent(), context); + using RequestContent content = optional?.ToRequestContent(); + Response response = ProtocolOptionalModel(content, context); return response; } @@ -1200,7 +1204,8 @@ public virtual async Task ProtocolRequiredModelAsync(Model required, C Argument.AssertNotNull(required, nameof(required)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await ProtocolRequiredModelAsync(required.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = required.ToRequestContent(); + Response response = await ProtocolRequiredModelAsync(content, context).ConfigureAwait(false); return response; } @@ -1214,7 +1219,8 @@ public virtual Response ProtocolRequiredModel(Model required, CancellationToken Argument.AssertNotNull(required, nameof(required)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = ProtocolRequiredModel(required.ToRequestContent(), context); + using RequestContent content = required.ToRequestContent(); + Response response = ProtocolRequiredModel(content, context); return response; } @@ -1719,7 +1725,8 @@ public virtual Response ConvenienceRequiredQueryWithRequired(int required, Reque public virtual async Task ConvenienceOptionalModelWithOptionalAsync(Model optional = null, CancellationToken cancellationToken = default) { RequestContext context = FromCancellationToken(cancellationToken); - Response response = await ConvenienceOptionalModelWithOptionalAsync(optional?.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = optional?.ToRequestContent(); + Response response = await ConvenienceOptionalModelWithOptionalAsync(content, context).ConfigureAwait(false); return response; } @@ -1730,7 +1737,8 @@ public virtual async Task ConvenienceOptionalModelWithOptionalAsync(Mo public virtual Response ConvenienceOptionalModelWithOptional(Model optional = null, CancellationToken cancellationToken = default) { RequestContext context = FromCancellationToken(cancellationToken); - Response response = ConvenienceOptionalModelWithOptional(optional?.ToRequestContent(), context); + using RequestContent content = optional?.ToRequestContent(); + Response response = ConvenienceOptionalModelWithOptional(content, context); return response; } @@ -1816,7 +1824,8 @@ public virtual async Task ConvenienceRequiredModelWithOptionalAsync(Mo Argument.AssertNotNull(required, nameof(required)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await ConvenienceRequiredModelWithOptionalAsync(required.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = required.ToRequestContent(); + Response response = await ConvenienceRequiredModelWithOptionalAsync(content, context).ConfigureAwait(false); return response; } @@ -1830,7 +1839,8 @@ public virtual Response ConvenienceRequiredModelWithOptional(Model required, Can Argument.AssertNotNull(required, nameof(required)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = ConvenienceRequiredModelWithOptional(required.ToRequestContent(), context); + using RequestContent content = required.ToRequestContent(); + Response response = ConvenienceRequiredModelWithOptional(content, context); return response; } @@ -1919,7 +1929,8 @@ public virtual Response ConvenienceRequiredModelWithOptional(RequestContent cont public virtual async Task ConvenienceOptionalModelWithRequiredAsync(Model optional = null, CancellationToken cancellationToken = default) { RequestContext context = FromCancellationToken(cancellationToken); - Response response = await ConvenienceOptionalModelWithRequiredAsync(optional?.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = optional?.ToRequestContent(); + Response response = await ConvenienceOptionalModelWithRequiredAsync(content, context).ConfigureAwait(false); return response; } @@ -1930,7 +1941,8 @@ public virtual async Task ConvenienceOptionalModelWithRequiredAsync(Mo public virtual Response ConvenienceOptionalModelWithRequired(Model optional = null, CancellationToken cancellationToken = default) { RequestContext context = FromCancellationToken(cancellationToken); - Response response = ConvenienceOptionalModelWithRequired(optional?.ToRequestContent(), context); + using RequestContent content = optional?.ToRequestContent(); + Response response = ConvenienceOptionalModelWithRequired(content, context); return response; } @@ -2017,7 +2029,8 @@ public virtual async Task ProtocolOptionalBeforeRequiredAsync(Model re Argument.AssertNotNull(required, nameof(required)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await ProtocolOptionalBeforeRequiredAsync(required.ToRequestContent(), optional, context).ConfigureAwait(false); + using RequestContent content = required.ToRequestContent(); + Response response = await ProtocolOptionalBeforeRequiredAsync(content, optional, context).ConfigureAwait(false); return response; } @@ -2032,7 +2045,8 @@ public virtual Response ProtocolOptionalBeforeRequired(Model required, int? opti Argument.AssertNotNull(required, nameof(required)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = ProtocolOptionalBeforeRequired(required.ToRequestContent(), optional, context); + using RequestContent content = required.ToRequestContent(); + Response response = ProtocolOptionalBeforeRequired(content, optional, context); return response; } diff --git a/test/TestProjects/ConvenienceUpdate-TypeSpec/src/Generated/Docs/ConvenienceInCadlClient.xml b/test/TestProjects/ConvenienceUpdate-TypeSpec/src/Generated/Docs/ConvenienceInCadlClient.xml index c3d096a96d0..d327fc2b6fc 100644 --- a/test/TestProjects/ConvenienceUpdate-TypeSpec/src/Generated/Docs/ConvenienceInCadlClient.xml +++ b/test/TestProjects/ConvenienceUpdate-TypeSpec/src/Generated/Docs/ConvenienceInCadlClient.xml @@ -113,7 +113,7 @@ This sample shows how to call ConvenienceOptionalBeforeRequiredAsync. ", }); @@ -125,7 +125,7 @@ This sample shows how to call ConvenienceOptionalBeforeRequiredAsync with all pa ", }); @@ -140,7 +140,7 @@ This sample shows how to call ConvenienceOptionalBeforeRequired. ", }); @@ -152,7 +152,7 @@ This sample shows how to call ConvenienceOptionalBeforeRequired with all paramet ", }); @@ -209,7 +209,7 @@ This sample shows how to call NoConvenienceRequiredBodyAsync. ", }); @@ -221,7 +221,7 @@ This sample shows how to call NoConvenienceRequiredBodyAsync with all request co ", }); @@ -236,7 +236,7 @@ This sample shows how to call NoConvenienceRequiredBody. ", }); @@ -248,7 +248,7 @@ This sample shows how to call NoConvenienceRequiredBody with all request content ", }); @@ -263,7 +263,7 @@ This sample shows how to call NoConvenienceOptionalBodyAsync. ", }); @@ -287,7 +287,7 @@ This sample shows how to call NoConvenienceOptionalBody. ", }); @@ -779,7 +779,7 @@ This sample shows how to call ProtocolOptionalModelAsync. ", }); @@ -803,7 +803,7 @@ This sample shows how to call ProtocolOptionalModel. ", }); @@ -861,7 +861,7 @@ This sample shows how to call ProtocolRequiredModelAsync. ", }); @@ -873,7 +873,7 @@ This sample shows how to call ProtocolRequiredModelAsync with all request conten ", }); @@ -888,7 +888,7 @@ This sample shows how to call ProtocolRequiredModel. ", }); @@ -900,7 +900,7 @@ This sample shows how to call ProtocolRequiredModel with all request content. ", }); @@ -1235,7 +1235,7 @@ This sample shows how to call ConvenienceOptionalModelWithOptionalAsync. ", }); @@ -1259,7 +1259,7 @@ This sample shows how to call ConvenienceOptionalModelWithOptional. ", }); @@ -1317,7 +1317,7 @@ This sample shows how to call ConvenienceRequiredModelWithOptionalAsync. ", }); @@ -1329,7 +1329,7 @@ This sample shows how to call ConvenienceRequiredModelWithOptionalAsync with all ", }); @@ -1344,7 +1344,7 @@ This sample shows how to call ConvenienceRequiredModelWithOptional. ", }); @@ -1356,7 +1356,7 @@ This sample shows how to call ConvenienceRequiredModelWithOptional with all requ ", }); @@ -1403,7 +1403,7 @@ This sample shows how to call ConvenienceOptionalModelWithRequiredAsync. ", }); @@ -1427,7 +1427,7 @@ This sample shows how to call ConvenienceOptionalModelWithRequired. ", }); @@ -1485,7 +1485,7 @@ This sample shows how to call ProtocolOptionalBeforeRequiredAsync. ", }); @@ -1497,7 +1497,7 @@ This sample shows how to call ProtocolOptionalBeforeRequiredAsync with all param ", }); @@ -1512,7 +1512,7 @@ This sample shows how to call ProtocolOptionalBeforeRequired. ", }); @@ -1524,7 +1524,7 @@ This sample shows how to call ProtocolOptionalBeforeRequired with all parameters ", }); diff --git a/test/TestProjects/ConvenienceUpdate-TypeSpec/tests/Generated/Samples/Samples_ConvenienceInCadlClient.cs b/test/TestProjects/ConvenienceUpdate-TypeSpec/tests/Generated/Samples/Samples_ConvenienceInCadlClient.cs index b67b36efc0c..7a0e6e21839 100644 --- a/test/TestProjects/ConvenienceUpdate-TypeSpec/tests/Generated/Samples/Samples_ConvenienceInCadlClient.cs +++ b/test/TestProjects/ConvenienceUpdate-TypeSpec/tests/Generated/Samples/Samples_ConvenienceInCadlClient.cs @@ -109,7 +109,7 @@ public void Example_ConvenienceOptionalBeforeRequired_ShortVersion() { ConvenienceInCadlClient client = new ConvenienceInCadlClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { id = "", }); @@ -124,7 +124,7 @@ public async Task Example_ConvenienceOptionalBeforeRequired_ShortVersion_Async() { ConvenienceInCadlClient client = new ConvenienceInCadlClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { id = "", }); @@ -159,7 +159,7 @@ public void Example_ConvenienceOptionalBeforeRequired_AllParameters() { ConvenienceInCadlClient client = new ConvenienceInCadlClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { id = "", }); @@ -174,7 +174,7 @@ public async Task Example_ConvenienceOptionalBeforeRequired_AllParameters_Async( { ConvenienceInCadlClient client = new ConvenienceInCadlClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { id = "", }); @@ -257,7 +257,7 @@ public void Example_NoConvenienceRequiredBody_ShortVersion() { ConvenienceInCadlClient client = new ConvenienceInCadlClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { id = "", }); @@ -272,7 +272,7 @@ public async Task Example_NoConvenienceRequiredBody_ShortVersion_Async() { ConvenienceInCadlClient client = new ConvenienceInCadlClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { id = "", }); @@ -287,7 +287,7 @@ public void Example_NoConvenienceRequiredBody_AllParameters() { ConvenienceInCadlClient client = new ConvenienceInCadlClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { id = "", }); @@ -302,7 +302,7 @@ public async Task Example_NoConvenienceRequiredBody_AllParameters_Async() { ConvenienceInCadlClient client = new ConvenienceInCadlClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { id = "", }); @@ -317,7 +317,7 @@ public void Example_NoConvenienceOptionalBody_ShortVersion() { ConvenienceInCadlClient client = new ConvenienceInCadlClient(); - RequestContent content = null; + using RequestContent content = null; Response response = client.NoConvenienceOptionalBody(content); Console.WriteLine(response.Status); @@ -329,7 +329,7 @@ public async Task Example_NoConvenienceOptionalBody_ShortVersion_Async() { ConvenienceInCadlClient client = new ConvenienceInCadlClient(); - RequestContent content = null; + using RequestContent content = null; Response response = await client.NoConvenienceOptionalBodyAsync(content); Console.WriteLine(response.Status); @@ -341,7 +341,7 @@ public void Example_NoConvenienceOptionalBody_AllParameters() { ConvenienceInCadlClient client = new ConvenienceInCadlClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { id = "", }); @@ -356,7 +356,7 @@ public async Task Example_NoConvenienceOptionalBody_AllParameters_Async() { ConvenienceInCadlClient client = new ConvenienceInCadlClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { id = "", }); @@ -879,7 +879,7 @@ public void Example_ProtocolOptionalModel_ShortVersion() { ConvenienceInCadlClient client = new ConvenienceInCadlClient(); - RequestContent content = null; + using RequestContent content = null; Response response = client.ProtocolOptionalModel(content); Console.WriteLine(response.Status); @@ -891,7 +891,7 @@ public async Task Example_ProtocolOptionalModel_ShortVersion_Async() { ConvenienceInCadlClient client = new ConvenienceInCadlClient(); - RequestContent content = null; + using RequestContent content = null; Response response = await client.ProtocolOptionalModelAsync(content); Console.WriteLine(response.Status); @@ -921,7 +921,7 @@ public void Example_ProtocolOptionalModel_AllParameters() { ConvenienceInCadlClient client = new ConvenienceInCadlClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { id = "", }); @@ -936,7 +936,7 @@ public async Task Example_ProtocolOptionalModel_AllParameters_Async() { ConvenienceInCadlClient client = new ConvenienceInCadlClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { id = "", }); @@ -971,7 +971,7 @@ public void Example_ProtocolRequiredModel_ShortVersion() { ConvenienceInCadlClient client = new ConvenienceInCadlClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { id = "", }); @@ -986,7 +986,7 @@ public async Task Example_ProtocolRequiredModel_ShortVersion_Async() { ConvenienceInCadlClient client = new ConvenienceInCadlClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { id = "", }); @@ -1021,7 +1021,7 @@ public void Example_ProtocolRequiredModel_AllParameters() { ConvenienceInCadlClient client = new ConvenienceInCadlClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { id = "", }); @@ -1036,7 +1036,7 @@ public async Task Example_ProtocolRequiredModel_AllParameters_Async() { ConvenienceInCadlClient client = new ConvenienceInCadlClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { id = "", }); @@ -1407,7 +1407,7 @@ public void Example_ConvenienceOptionalModelWithOptional_ShortVersion() { ConvenienceInCadlClient client = new ConvenienceInCadlClient(); - RequestContent content = null; + using RequestContent content = null; Response response = client.ConvenienceOptionalModelWithOptional(content); Console.WriteLine(response.Status); @@ -1419,7 +1419,7 @@ public async Task Example_ConvenienceOptionalModelWithOptional_ShortVersion_Asyn { ConvenienceInCadlClient client = new ConvenienceInCadlClient(); - RequestContent content = null; + using RequestContent content = null; Response response = await client.ConvenienceOptionalModelWithOptionalAsync(content); Console.WriteLine(response.Status); @@ -1449,7 +1449,7 @@ public void Example_ConvenienceOptionalModelWithOptional_AllParameters() { ConvenienceInCadlClient client = new ConvenienceInCadlClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { id = "", }); @@ -1464,7 +1464,7 @@ public async Task Example_ConvenienceOptionalModelWithOptional_AllParameters_Asy { ConvenienceInCadlClient client = new ConvenienceInCadlClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { id = "", }); @@ -1499,7 +1499,7 @@ public void Example_ConvenienceRequiredModelWithOptional_ShortVersion() { ConvenienceInCadlClient client = new ConvenienceInCadlClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { id = "", }); @@ -1514,7 +1514,7 @@ public async Task Example_ConvenienceRequiredModelWithOptional_ShortVersion_Asyn { ConvenienceInCadlClient client = new ConvenienceInCadlClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { id = "", }); @@ -1549,7 +1549,7 @@ public void Example_ConvenienceRequiredModelWithOptional_AllParameters() { ConvenienceInCadlClient client = new ConvenienceInCadlClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { id = "", }); @@ -1564,7 +1564,7 @@ public async Task Example_ConvenienceRequiredModelWithOptional_AllParameters_Asy { ConvenienceInCadlClient client = new ConvenienceInCadlClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { id = "", }); @@ -1599,7 +1599,7 @@ public void Example_ConvenienceOptionalModelWithRequired_ShortVersion() { ConvenienceInCadlClient client = new ConvenienceInCadlClient(); - RequestContent content = null; + using RequestContent content = null; Response response = client.ConvenienceOptionalModelWithRequired(content); Console.WriteLine(response.Status); @@ -1611,7 +1611,7 @@ public async Task Example_ConvenienceOptionalModelWithRequired_ShortVersion_Asyn { ConvenienceInCadlClient client = new ConvenienceInCadlClient(); - RequestContent content = null; + using RequestContent content = null; Response response = await client.ConvenienceOptionalModelWithRequiredAsync(content); Console.WriteLine(response.Status); @@ -1641,7 +1641,7 @@ public void Example_ConvenienceOptionalModelWithRequired_AllParameters() { ConvenienceInCadlClient client = new ConvenienceInCadlClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { id = "", }); @@ -1656,7 +1656,7 @@ public async Task Example_ConvenienceOptionalModelWithRequired_AllParameters_Asy { ConvenienceInCadlClient client = new ConvenienceInCadlClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { id = "", }); @@ -1691,7 +1691,7 @@ public void Example_ProtocolOptionalBeforeRequired_ShortVersion() { ConvenienceInCadlClient client = new ConvenienceInCadlClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { id = "", }); @@ -1706,7 +1706,7 @@ public async Task Example_ProtocolOptionalBeforeRequired_ShortVersion_Async() { ConvenienceInCadlClient client = new ConvenienceInCadlClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { id = "", }); @@ -1741,7 +1741,7 @@ public void Example_ProtocolOptionalBeforeRequired_AllParameters() { ConvenienceInCadlClient client = new ConvenienceInCadlClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { id = "", }); @@ -1756,7 +1756,7 @@ public async Task Example_ProtocolOptionalBeforeRequired_AllParameters_Async() { ConvenienceInCadlClient client = new ConvenienceInCadlClient(); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { id = "", }); diff --git a/test/TestProjects/Customizations-TypeSpec/src/Generated/CustomizationsInTspClient.cs b/test/TestProjects/Customizations-TypeSpec/src/Generated/CustomizationsInTspClient.cs index fcb3c4f38b6..38ec898453c 100644 --- a/test/TestProjects/Customizations-TypeSpec/src/Generated/CustomizationsInTspClient.cs +++ b/test/TestProjects/Customizations-TypeSpec/src/Generated/CustomizationsInTspClient.cs @@ -54,7 +54,8 @@ public virtual async Task> RoundTripAsync(RootModel input, C Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await RoundTripAsync(input.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = input.ToRequestContent(); + Response response = await RoundTripAsync(content, context).ConfigureAwait(false); return Response.FromValue(RootModel.FromResponse(response), response); } @@ -68,7 +69,8 @@ public virtual Response RoundTrip(RootModel input, CancellationToken Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = RoundTrip(input.ToRequestContent(), context); + using RequestContent content = input.ToRequestContent(); + Response response = RoundTrip(content, context); return Response.FromValue(RootModel.FromResponse(response), response); } diff --git a/test/TestProjects/Customizations-TypeSpec/src/Generated/Docs/CustomizationsInTspClient.xml b/test/TestProjects/Customizations-TypeSpec/src/Generated/Docs/CustomizationsInTspClient.xml index 6cd7f2ad78b..223828665c4 100644 --- a/test/TestProjects/Customizations-TypeSpec/src/Generated/Docs/CustomizationsInTspClient.xml +++ b/test/TestProjects/Customizations-TypeSpec/src/Generated/Docs/CustomizationsInTspClient.xml @@ -93,7 +93,7 @@ This sample shows how to call RoundTripAsync and parse the result. "); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", requiredUnion = "", @@ -207,7 +207,7 @@ This sample shows how to call PatchActionAsync with all request content and pars Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", requiredUnion = "", @@ -254,7 +254,7 @@ This sample shows how to call PatchAction and parse the result. Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", requiredUnion = "", @@ -285,7 +285,7 @@ This sample shows how to call PatchAction with all request content and parse the Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", requiredUnion = "", @@ -332,7 +332,7 @@ This sample shows how to call AnonymousBodyAsync and parse the result. Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", requiredUnion = "", @@ -363,7 +363,7 @@ This sample shows how to call AnonymousBodyAsync with all request content and pa Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", requiredUnion = "", @@ -410,7 +410,7 @@ This sample shows how to call AnonymousBody and parse the result. Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", requiredUnion = "", @@ -441,7 +441,7 @@ This sample shows how to call AnonymousBody with all request content and parse t Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", requiredUnion = "", @@ -526,7 +526,7 @@ This sample shows how to call FriendlyModelAsync and parse the result. Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", }); @@ -540,7 +540,7 @@ This sample shows how to call FriendlyModelAsync with all request content and pa Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", }); @@ -557,7 +557,7 @@ This sample shows how to call FriendlyModel and parse the result. Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", }); @@ -571,7 +571,7 @@ This sample shows how to call FriendlyModel with all request content and parse t Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", }); @@ -668,7 +668,7 @@ This sample shows how to call StringFormatAsync. Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { sourceUrl = "http://localhost:3000", guid = "73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a", @@ -682,7 +682,7 @@ This sample shows how to call StringFormatAsync with all parameters and request Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { sourceUrl = "http://localhost:3000", guid = "73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a", @@ -699,7 +699,7 @@ This sample shows how to call StringFormat. Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { sourceUrl = "http://localhost:3000", guid = "73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a", @@ -713,7 +713,7 @@ This sample shows how to call StringFormat with all parameters and request conte Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { sourceUrl = "http://localhost:3000", guid = "73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a", @@ -768,7 +768,7 @@ This sample shows how to call ProjectedNameModelAsync and parse the result. Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", }); @@ -782,7 +782,7 @@ This sample shows how to call ProjectedNameModelAsync with all request content a Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", }); @@ -799,7 +799,7 @@ This sample shows how to call ProjectedNameModel and parse the result. Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", }); @@ -813,7 +813,7 @@ This sample shows how to call ProjectedNameModel with all request content and pa Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", }); @@ -952,7 +952,7 @@ This sample shows how to call StringBodyAsync. Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(""); +using RequestContent content = RequestContent.Create(""); Response response = await client.StringBodyAsync(content); Console.WriteLine(response.Status); @@ -962,7 +962,7 @@ This sample shows how to call StringBodyAsync with all request content. Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(""); +using RequestContent content = RequestContent.Create(""); Response response = await client.StringBodyAsync(content); Console.WriteLine(response.Status); @@ -975,7 +975,7 @@ This sample shows how to call StringBody. Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(""); +using RequestContent content = RequestContent.Create(""); Response response = client.StringBody(content); Console.WriteLine(response.Status); @@ -985,7 +985,7 @@ This sample shows how to call StringBody with all request content. Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(""); +using RequestContent content = RequestContent.Create(""); Response response = client.StringBody(content); Console.WriteLine(response.Status); @@ -1032,7 +1032,7 @@ This sample shows how to call BoolBodyAsync. Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(true); +using RequestContent content = RequestContent.Create(true); Response response = await client.BoolBodyAsync(content); Console.WriteLine(response.Status); @@ -1042,7 +1042,7 @@ This sample shows how to call BoolBodyAsync with all request content. Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(true); +using RequestContent content = RequestContent.Create(true); Response response = await client.BoolBodyAsync(content); Console.WriteLine(response.Status); @@ -1055,7 +1055,7 @@ This sample shows how to call BoolBody. Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(true); +using RequestContent content = RequestContent.Create(true); Response response = client.BoolBody(content); Console.WriteLine(response.Status); @@ -1065,7 +1065,7 @@ This sample shows how to call BoolBody with all request content. Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(true); +using RequestContent content = RequestContent.Create(true); Response response = client.BoolBody(content); Console.WriteLine(response.Status); @@ -1112,7 +1112,7 @@ This sample shows how to call DateTimeBodyAsync. Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create("2022-05-10T14:57:31.2311892-04:00"); +using RequestContent content = RequestContent.Create("2022-05-10T14:57:31.2311892-04:00"); Response response = await client.DateTimeBodyAsync(content); Console.WriteLine(response.Status); @@ -1122,7 +1122,7 @@ This sample shows how to call DateTimeBodyAsync with all request content. Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create("2022-05-10T14:57:31.2311892-04:00"); +using RequestContent content = RequestContent.Create("2022-05-10T14:57:31.2311892-04:00"); Response response = await client.DateTimeBodyAsync(content); Console.WriteLine(response.Status); @@ -1135,7 +1135,7 @@ This sample shows how to call DateTimeBody. Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create("2022-05-10T14:57:31.2311892-04:00"); +using RequestContent content = RequestContent.Create("2022-05-10T14:57:31.2311892-04:00"); Response response = client.DateTimeBody(content); Console.WriteLine(response.Status); @@ -1145,7 +1145,7 @@ This sample shows how to call DateTimeBody with all request content. Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create("2022-05-10T14:57:31.2311892-04:00"); +using RequestContent content = RequestContent.Create("2022-05-10T14:57:31.2311892-04:00"); Response response = client.DateTimeBody(content); Console.WriteLine(response.Status); @@ -1402,7 +1402,7 @@ This sample shows how to call HelloAgainAsync and parse the result. Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -1467,7 +1467,7 @@ This sample shows how to call HelloAgainAsync with all parameters and request co Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -1586,7 +1586,7 @@ This sample shows how to call HelloAgain and parse the result. Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -1651,7 +1651,7 @@ This sample shows how to call HelloAgain with all parameters and request content Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -1770,7 +1770,7 @@ This sample shows how to call NoContentTypeAsync and parse the result. Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -1835,7 +1835,7 @@ This sample shows how to call NoContentTypeAsync with all parameters and request Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -1954,7 +1954,7 @@ This sample shows how to call NoContentType and parse the result. Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -2019,7 +2019,7 @@ This sample shows how to call NoContentType with all parameters and request cont Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -2222,7 +2222,7 @@ This sample shows how to call CreateLiteralAsync and parse the result. Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", requiredUnion = "", @@ -2253,7 +2253,7 @@ This sample shows how to call CreateLiteralAsync with all request content and pa Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", requiredUnion = "", @@ -2300,7 +2300,7 @@ This sample shows how to call CreateLiteral and parse the result. Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", requiredUnion = "", @@ -2331,7 +2331,7 @@ This sample shows how to call CreateLiteral with all request content and parse t Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", requiredUnion = "", diff --git a/test/TestProjects/FirstTest-TypeSpec/src/Generated/FirstTestTypeSpecClient.cs b/test/TestProjects/FirstTest-TypeSpec/src/Generated/FirstTestTypeSpecClient.cs index ecd68737c8a..3e2c9dc34dc 100644 --- a/test/TestProjects/FirstTest-TypeSpec/src/Generated/FirstTestTypeSpecClient.cs +++ b/test/TestProjects/FirstTest-TypeSpec/src/Generated/FirstTestTypeSpecClient.cs @@ -311,7 +311,8 @@ internal virtual async Task> AnonymousBodyAsync(Thing thing, Can Argument.AssertNotNull(thing, nameof(thing)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await AnonymousBodyAsync(thing.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = thing.ToRequestContent(); + Response response = await AnonymousBodyAsync(content, context).ConfigureAwait(false); return Response.FromValue(Thing.FromResponse(response), response); } @@ -324,7 +325,8 @@ internal virtual Response AnonymousBody(Thing thing, CancellationToken ca Argument.AssertNotNull(thing, nameof(thing)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = AnonymousBody(thing.ToRequestContent(), context); + using RequestContent content = thing.ToRequestContent(); + Response response = AnonymousBody(content, context); return Response.FromValue(Thing.FromResponse(response), response); } @@ -408,7 +410,8 @@ public virtual async Task> FriendlyModelAsync(Friend notFriend, Argument.AssertNotNull(notFriend, nameof(notFriend)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await FriendlyModelAsync(notFriend.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = notFriend.ToRequestContent(); + Response response = await FriendlyModelAsync(content, context).ConfigureAwait(false); return Response.FromValue(Friend.FromResponse(response), response); } @@ -422,7 +425,8 @@ public virtual Response FriendlyModel(Friend notFriend, CancellationToke Argument.AssertNotNull(notFriend, nameof(notFriend)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = FriendlyModel(notFriend.ToRequestContent(), context); + using RequestContent content = notFriend.ToRequestContent(); + Response response = FriendlyModel(content, context); return Response.FromValue(Friend.FromResponse(response), response); } @@ -575,7 +579,8 @@ public virtual async Task StringFormatAsync(Guid subscriptionId, Model Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await StringFormatAsync(subscriptionId, body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await StringFormatAsync(subscriptionId, content, context).ConfigureAwait(false); return response; } @@ -590,7 +595,8 @@ public virtual Response StringFormat(Guid subscriptionId, ModelWithFormat body, Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = StringFormat(subscriptionId, body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = StringFormat(subscriptionId, content, context); return response; } @@ -684,7 +690,8 @@ public virtual async Task> ProjectedNameModelAsync(Proj Argument.AssertNotNull(modelWithProjectedName, nameof(modelWithProjectedName)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await ProjectedNameModelAsync(modelWithProjectedName.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = modelWithProjectedName.ToRequestContent(); + Response response = await ProjectedNameModelAsync(content, context).ConfigureAwait(false); return Response.FromValue(ProjectedModel.FromResponse(response), response); } @@ -698,7 +705,8 @@ public virtual Response ProjectedNameModel(ProjectedModel modelW Argument.AssertNotNull(modelWithProjectedName, nameof(modelWithProjectedName)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = ProjectedNameModel(modelWithProjectedName.ToRequestContent(), context); + using RequestContent content = modelWithProjectedName.ToRequestContent(); + Response response = ProjectedNameModel(content, context); return Response.FromValue(ProjectedModel.FromResponse(response), response); } @@ -925,7 +933,8 @@ public virtual async Task StringBodyAsync(string body, CancellationTok Argument.AssertNotNullOrEmpty(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await StringBodyAsync(RequestContentHelper.FromObject(body), context).ConfigureAwait(false); + using RequestContent content = RequestContentHelper.FromObject(body); + Response response = await StringBodyAsync(content, context).ConfigureAwait(false); return response; } @@ -940,7 +949,8 @@ public virtual Response StringBody(string body, CancellationToken cancellationTo Argument.AssertNotNullOrEmpty(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = StringBody(RequestContentHelper.FromObject(body), context); + using RequestContent content = RequestContentHelper.FromObject(body); + Response response = StringBody(content, context); return response; } @@ -1029,7 +1039,8 @@ public virtual Response StringBody(RequestContent content, RequestContext contex public virtual async Task BoolBodyAsync(bool body, CancellationToken cancellationToken = default) { RequestContext context = FromCancellationToken(cancellationToken); - Response response = await BoolBodyAsync(RequestContentHelper.FromObject(body), context).ConfigureAwait(false); + using RequestContent content = RequestContentHelper.FromObject(body); + Response response = await BoolBodyAsync(content, context).ConfigureAwait(false); return response; } @@ -1040,7 +1051,8 @@ public virtual async Task BoolBodyAsync(bool body, CancellationToken c public virtual Response BoolBody(bool body, CancellationToken cancellationToken = default) { RequestContext context = FromCancellationToken(cancellationToken); - Response response = BoolBody(RequestContentHelper.FromObject(body), context); + using RequestContent content = RequestContentHelper.FromObject(body); + Response response = BoolBody(content, context); return response; } @@ -1129,7 +1141,8 @@ public virtual Response BoolBody(RequestContent content, RequestContext context public virtual async Task DateTimeBodyAsync(DateTimeOffset body, CancellationToken cancellationToken = default) { RequestContext context = FromCancellationToken(cancellationToken); - Response response = await DateTimeBodyAsync(RequestContentHelper.FromObject(body), context).ConfigureAwait(false); + using RequestContent content = RequestContentHelper.FromObject(body); + Response response = await DateTimeBodyAsync(content, context).ConfigureAwait(false); return response; } @@ -1140,7 +1153,8 @@ public virtual async Task DateTimeBodyAsync(DateTimeOffset body, Cance public virtual Response DateTimeBody(DateTimeOffset body, CancellationToken cancellationToken = default) { RequestContext context = FromCancellationToken(cancellationToken); - Response response = DateTimeBody(RequestContentHelper.FromObject(body), context); + using RequestContent content = RequestContentHelper.FromObject(body); + Response response = DateTimeBody(content, context); return response; } @@ -1488,7 +1502,8 @@ internal virtual async Task> HelloAgainAsync(string p2, Argument.AssertNotNull(action, nameof(action)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await HelloAgainAsync(p2, p1, action.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = action.ToRequestContent(); + Response response = await HelloAgainAsync(p2, p1, content, context).ConfigureAwait(false); return Response.FromValue(RoundTripModel.FromResponse(response), response); } @@ -1506,7 +1521,8 @@ internal virtual Response HelloAgain(string p2, string p1, Round Argument.AssertNotNull(action, nameof(action)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = HelloAgain(p2, p1, action.ToRequestContent(), context); + using RequestContent content = action.ToRequestContent(); + Response response = HelloAgain(p2, p1, content, context); return Response.FromValue(RoundTripModel.FromResponse(response), response); } @@ -1757,7 +1773,8 @@ internal virtual async Task> CreateLiteralAsync(Thing body, Canc Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await CreateLiteralAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await CreateLiteralAsync(content, context).ConfigureAwait(false); return Response.FromValue(Thing.FromResponse(response), response); } @@ -1770,7 +1787,8 @@ internal virtual Response CreateLiteral(Thing body, CancellationToken can Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = CreateLiteral(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = CreateLiteral(content, context); return Response.FromValue(Thing.FromResponse(response), response); } @@ -1993,7 +2011,8 @@ internal virtual async Task> InternalProtocolAsync(Thing body, C Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await InternalProtocolAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await InternalProtocolAsync(content, context).ConfigureAwait(false); return Response.FromValue(Thing.FromResponse(response), response); } @@ -2006,7 +2025,8 @@ internal virtual Response InternalProtocol(Thing body, CancellationToken Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = InternalProtocol(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = InternalProtocol(content, context); return Response.FromValue(Thing.FromResponse(response), response); } diff --git a/test/TestProjects/FirstTest-TypeSpec/tests/Generated/Samples/Samples_FirstTestTypeSpecClient.cs b/test/TestProjects/FirstTest-TypeSpec/tests/Generated/Samples/Samples_FirstTestTypeSpecClient.cs index 264fab98ae0..ff1ff7b9b51 100644 --- a/test/TestProjects/FirstTest-TypeSpec/tests/Generated/Samples/Samples_FirstTestTypeSpecClient.cs +++ b/test/TestProjects/FirstTest-TypeSpec/tests/Generated/Samples/Samples_FirstTestTypeSpecClient.cs @@ -206,7 +206,7 @@ public void Example_PatchAction_ShortVersion() Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", requiredUnion = "", @@ -240,7 +240,7 @@ public async Task Example_PatchAction_ShortVersion_Async() Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", requiredUnion = "", @@ -274,7 +274,7 @@ public void Example_PatchAction_AllParameters() Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", requiredUnion = "", @@ -321,7 +321,7 @@ public async Task Example_PatchAction_AllParameters_Async() Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", requiredUnion = "", @@ -368,7 +368,7 @@ public void Example_AnonymousBody_ShortVersion() Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", requiredUnion = "", @@ -402,7 +402,7 @@ public async Task Example_AnonymousBody_ShortVersion_Async() Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", requiredUnion = "", @@ -436,7 +436,7 @@ public void Example_AnonymousBody_AllParameters() Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", requiredUnion = "", @@ -483,7 +483,7 @@ public async Task Example_AnonymousBody_AllParameters_Async() Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", requiredUnion = "", @@ -530,7 +530,7 @@ public void Example_FriendlyModel_ShortVersion() Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", }); @@ -547,7 +547,7 @@ public async Task Example_FriendlyModel_ShortVersion_Async() Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", }); @@ -586,7 +586,7 @@ public void Example_FriendlyModel_AllParameters() Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", }); @@ -603,7 +603,7 @@ public async Task Example_FriendlyModel_AllParameters_Async() Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", }); @@ -690,7 +690,7 @@ public void Example_StringFormat_ShortVersion() Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { sourceUrl = "http://localhost:3000", guid = "73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a", @@ -707,7 +707,7 @@ public async Task Example_StringFormat_ShortVersion_Async() Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { sourceUrl = "http://localhost:3000", guid = "73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a", @@ -746,7 +746,7 @@ public void Example_StringFormat_AllParameters() Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { sourceUrl = "http://localhost:3000", guid = "73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a", @@ -763,7 +763,7 @@ public async Task Example_StringFormat_AllParameters_Async() Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { sourceUrl = "http://localhost:3000", guid = "73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a", @@ -802,7 +802,7 @@ public void Example_ProjectedNameModel_ShortVersion() Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", }); @@ -819,7 +819,7 @@ public async Task Example_ProjectedNameModel_ShortVersion_Async() Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", }); @@ -858,7 +858,7 @@ public void Example_ProjectedNameModel_AllParameters() Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", }); @@ -875,7 +875,7 @@ public async Task Example_ProjectedNameModel_AllParameters_Async() Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", }); @@ -1014,7 +1014,7 @@ public void Example_StringBody_ShortVersion() Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(""); + using RequestContent content = RequestContent.Create(""); Response response = client.StringBody(content); Console.WriteLine(response.Status); @@ -1027,7 +1027,7 @@ public async Task Example_StringBody_ShortVersion_Async() Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(""); + using RequestContent content = RequestContent.Create(""); Response response = await client.StringBodyAsync(content); Console.WriteLine(response.Status); @@ -1060,7 +1060,7 @@ public void Example_StringBody_AllParameters() Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(""); + using RequestContent content = RequestContent.Create(""); Response response = client.StringBody(content); Console.WriteLine(response.Status); @@ -1073,7 +1073,7 @@ public async Task Example_StringBody_AllParameters_Async() Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(""); + using RequestContent content = RequestContent.Create(""); Response response = await client.StringBodyAsync(content); Console.WriteLine(response.Status); @@ -1106,7 +1106,7 @@ public void Example_BoolBody_ShortVersion() Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(true); + using RequestContent content = RequestContent.Create(true); Response response = client.BoolBody(content); Console.WriteLine(response.Status); @@ -1119,7 +1119,7 @@ public async Task Example_BoolBody_ShortVersion_Async() Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(true); + using RequestContent content = RequestContent.Create(true); Response response = await client.BoolBodyAsync(content); Console.WriteLine(response.Status); @@ -1152,7 +1152,7 @@ public void Example_BoolBody_AllParameters() Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(true); + using RequestContent content = RequestContent.Create(true); Response response = client.BoolBody(content); Console.WriteLine(response.Status); @@ -1165,7 +1165,7 @@ public async Task Example_BoolBody_AllParameters_Async() Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(true); + using RequestContent content = RequestContent.Create(true); Response response = await client.BoolBodyAsync(content); Console.WriteLine(response.Status); @@ -1198,7 +1198,7 @@ public void Example_DateTimeBody_ShortVersion() Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create("2022-05-10T14:57:31.2311892-04:00"); + using RequestContent content = RequestContent.Create("2022-05-10T14:57:31.2311892-04:00"); Response response = client.DateTimeBody(content); Console.WriteLine(response.Status); @@ -1211,7 +1211,7 @@ public async Task Example_DateTimeBody_ShortVersion_Async() Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create("2022-05-10T14:57:31.2311892-04:00"); + using RequestContent content = RequestContent.Create("2022-05-10T14:57:31.2311892-04:00"); Response response = await client.DateTimeBodyAsync(content); Console.WriteLine(response.Status); @@ -1244,7 +1244,7 @@ public void Example_DateTimeBody_AllParameters() Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create("2022-05-10T14:57:31.2311892-04:00"); + using RequestContent content = RequestContent.Create("2022-05-10T14:57:31.2311892-04:00"); Response response = client.DateTimeBody(content); Console.WriteLine(response.Status); @@ -1257,7 +1257,7 @@ public async Task Example_DateTimeBody_AllParameters_Async() Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create("2022-05-10T14:57:31.2311892-04:00"); + using RequestContent content = RequestContent.Create("2022-05-10T14:57:31.2311892-04:00"); Response response = await client.DateTimeBodyAsync(content); Console.WriteLine(response.Status); @@ -1564,7 +1564,7 @@ public void Example_HelloAgain_ShortVersion() Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -1632,7 +1632,7 @@ public async Task Example_HelloAgain_ShortVersion_Async() Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -1700,7 +1700,7 @@ public void Example_HelloAgain_AllParameters() Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -1819,7 +1819,7 @@ public async Task Example_HelloAgain_AllParameters_Async() Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -1938,7 +1938,7 @@ public void Example_NoContentType_ShortVersion() Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -2006,7 +2006,7 @@ public async Task Example_NoContentType_ShortVersion_Async() Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -2074,7 +2074,7 @@ public void Example_NoContentType_AllParameters() Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -2193,7 +2193,7 @@ public async Task Example_NoContentType_AllParameters_Async() Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -2402,7 +2402,7 @@ public void Example_CreateLiteral_ShortVersion() Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", requiredUnion = "", @@ -2436,7 +2436,7 @@ public async Task Example_CreateLiteral_ShortVersion_Async() Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", requiredUnion = "", @@ -2470,7 +2470,7 @@ public void Example_CreateLiteral_AllParameters() Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", requiredUnion = "", @@ -2517,7 +2517,7 @@ public async Task Example_CreateLiteral_AllParameters_Async() Uri endpoint = new Uri(""); FirstTestTypeSpecClient client = new FirstTestTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", requiredUnion = "", diff --git a/test/TestProjects/Lro-Basic-TypeSpec/src/Generated/Docs/LroBasicTypeSpecClient.xml b/test/TestProjects/Lro-Basic-TypeSpec/src/Generated/Docs/LroBasicTypeSpecClient.xml index cb191b269ca..97f00d96875 100644 --- a/test/TestProjects/Lro-Basic-TypeSpec/src/Generated/Docs/LroBasicTypeSpecClient.xml +++ b/test/TestProjects/Lro-Basic-TypeSpec/src/Generated/Docs/LroBasicTypeSpecClient.xml @@ -54,7 +54,7 @@ This sample shows how to call CreateProjectAsync. Uri endpoint = new Uri(""); LroBasicTypeSpecClient client = new LroBasicTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Operation operation = await client.CreateProjectAsync(WaitUntil.Completed, content); ]]> This sample shows how to call CreateProjectAsync with all parameters and request content. @@ -62,7 +62,7 @@ This sample shows how to call CreateProjectAsync with all parameters and request Uri endpoint = new Uri(""); LroBasicTypeSpecClient client = new LroBasicTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { description = "", name = "", @@ -77,7 +77,7 @@ This sample shows how to call CreateProject. Uri endpoint = new Uri(""); LroBasicTypeSpecClient client = new LroBasicTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Operation operation = client.CreateProject(WaitUntil.Completed, content); ]]> This sample shows how to call CreateProject with all parameters and request content. @@ -85,7 +85,7 @@ This sample shows how to call CreateProject with all parameters and request cont Uri endpoint = new Uri(""); LroBasicTypeSpecClient client = new LroBasicTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { description = "", name = "", @@ -150,7 +150,7 @@ This sample shows how to call UpdateProjectAsync and parse the result. Uri endpoint = new Uri(""); LroBasicTypeSpecClient client = new LroBasicTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Operation operation = await client.UpdateProjectAsync(WaitUntil.Completed, "", content); BinaryData responseData = operation.Value; @@ -162,7 +162,7 @@ This sample shows how to call UpdateProjectAsync with all parameters and request Uri endpoint = new Uri(""); LroBasicTypeSpecClient client = new LroBasicTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { description = "", name = "", @@ -183,7 +183,7 @@ This sample shows how to call UpdateProject and parse the result. Uri endpoint = new Uri(""); LroBasicTypeSpecClient client = new LroBasicTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Operation operation = client.UpdateProject(WaitUntil.Completed, "", content); BinaryData responseData = operation.Value; @@ -195,7 +195,7 @@ This sample shows how to call UpdateProject with all parameters and request cont Uri endpoint = new Uri(""); LroBasicTypeSpecClient client = new LroBasicTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { description = "", name = "", @@ -258,7 +258,7 @@ This sample shows how to call CreateThingAsync and parse the result. Uri endpoint = new Uri(""); LroBasicTypeSpecClient client = new LroBasicTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", }); @@ -273,7 +273,7 @@ This sample shows how to call CreateThingAsync with all parameters and request c Uri endpoint = new Uri(""); LroBasicTypeSpecClient client = new LroBasicTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", }); @@ -291,7 +291,7 @@ This sample shows how to call CreateThing and parse the result. Uri endpoint = new Uri(""); LroBasicTypeSpecClient client = new LroBasicTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", }); @@ -306,7 +306,7 @@ This sample shows how to call CreateThing with all parameters and request conten Uri endpoint = new Uri(""); LroBasicTypeSpecClient client = new LroBasicTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", }); diff --git a/test/TestProjects/Lro-Basic-TypeSpec/src/Generated/LroBasicTypeSpecClient.cs b/test/TestProjects/Lro-Basic-TypeSpec/src/Generated/LroBasicTypeSpecClient.cs index d4ad92ada7e..e79b0cfb74e 100644 --- a/test/TestProjects/Lro-Basic-TypeSpec/src/Generated/LroBasicTypeSpecClient.cs +++ b/test/TestProjects/Lro-Basic-TypeSpec/src/Generated/LroBasicTypeSpecClient.cs @@ -67,7 +67,8 @@ public virtual async Task CreateProjectAsync(WaitUntil waitUntil, Pro Argument.AssertNotNull(resource, nameof(resource)); RequestContext context = FromCancellationToken(cancellationToken); - return await CreateProjectAsync(waitUntil, resource.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = resource.ToRequestContent(); + return await CreateProjectAsync(waitUntil, content, context).ConfigureAwait(false); } /// Creates a project. @@ -81,7 +82,8 @@ public virtual Operation CreateProject(WaitUntil waitUntil, Project resource, Ca Argument.AssertNotNull(resource, nameof(resource)); RequestContext context = FromCancellationToken(cancellationToken); - return CreateProject(waitUntil, resource.ToRequestContent(), context); + using RequestContent content = resource.ToRequestContent(); + return CreateProject(waitUntil, content, context); } /// @@ -178,7 +180,8 @@ public virtual async Task> UpdateProjectAsync(WaitUntil waitU Argument.AssertNotNull(resource, nameof(resource)); RequestContext context = FromCancellationToken(cancellationToken); - Operation response = await UpdateProjectAsync(waitUntil, id, resource.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = resource.ToRequestContent(); + Operation response = await UpdateProjectAsync(waitUntil, id, content, context).ConfigureAwait(false); return ProtocolOperationHelpers.Convert(response, Project.FromResponse, ClientDiagnostics, "LroBasicTypeSpecClient.UpdateProject"); } @@ -196,7 +199,8 @@ public virtual Operation UpdateProject(WaitUntil waitUntil, string id, Argument.AssertNotNull(resource, nameof(resource)); RequestContext context = FromCancellationToken(cancellationToken); - Operation response = UpdateProject(waitUntil, id, resource.ToRequestContent(), context); + using RequestContent content = resource.ToRequestContent(); + Operation response = UpdateProject(waitUntil, id, content, context); return ProtocolOperationHelpers.Convert(response, Project.FromResponse, ClientDiagnostics, "LroBasicTypeSpecClient.UpdateProject"); } @@ -297,7 +301,8 @@ public virtual async Task> CreateThingAsync(WaitUntil waitUntil Argument.AssertNotNull(thing, nameof(thing)); RequestContext context = FromCancellationToken(cancellationToken); - Operation response = await CreateThingAsync(waitUntil, thing.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = thing.ToRequestContent(); + Operation response = await CreateThingAsync(waitUntil, content, context).ConfigureAwait(false); return ProtocolOperationHelpers.Convert(response, Thing.FromResponse, ClientDiagnostics, "LroBasicTypeSpecClient.CreateThing"); } @@ -312,7 +317,8 @@ public virtual Operation CreateThing(WaitUntil waitUntil, Thing thing, Ca Argument.AssertNotNull(thing, nameof(thing)); RequestContext context = FromCancellationToken(cancellationToken); - Operation response = CreateThing(waitUntil, thing.ToRequestContent(), context); + using RequestContent content = thing.ToRequestContent(); + Operation response = CreateThing(waitUntil, content, context); return ProtocolOperationHelpers.Convert(response, Thing.FromResponse, ClientDiagnostics, "LroBasicTypeSpecClient.CreateThing"); } diff --git a/test/TestProjects/Lro-Basic-TypeSpec/tests/Generated/Samples/Samples_LroBasicTypeSpecClient.cs b/test/TestProjects/Lro-Basic-TypeSpec/tests/Generated/Samples/Samples_LroBasicTypeSpecClient.cs index d608725ba4f..0098a19a05a 100644 --- a/test/TestProjects/Lro-Basic-TypeSpec/tests/Generated/Samples/Samples_LroBasicTypeSpecClient.cs +++ b/test/TestProjects/Lro-Basic-TypeSpec/tests/Generated/Samples/Samples_LroBasicTypeSpecClient.cs @@ -26,7 +26,7 @@ public void Example_CreateProject_ShortVersion() Uri endpoint = new Uri(""); LroBasicTypeSpecClient client = new LroBasicTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Operation operation = client.CreateProject(WaitUntil.Completed, content); } @@ -37,7 +37,7 @@ public async Task Example_CreateProject_ShortVersion_Async() Uri endpoint = new Uri(""); LroBasicTypeSpecClient client = new LroBasicTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Operation operation = await client.CreateProjectAsync(WaitUntil.Completed, content); } @@ -70,7 +70,7 @@ public void Example_CreateProject_AllParameters() Uri endpoint = new Uri(""); LroBasicTypeSpecClient client = new LroBasicTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { description = "", name = "", @@ -85,7 +85,7 @@ public async Task Example_CreateProject_AllParameters_Async() Uri endpoint = new Uri(""); LroBasicTypeSpecClient client = new LroBasicTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { description = "", name = "", @@ -130,7 +130,7 @@ public void Example_UpdateProject_ShortVersion() Uri endpoint = new Uri(""); LroBasicTypeSpecClient client = new LroBasicTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Operation operation = client.UpdateProject(WaitUntil.Completed, "", content); BinaryData responseData = operation.Value; @@ -145,7 +145,7 @@ public async Task Example_UpdateProject_ShortVersion_Async() Uri endpoint = new Uri(""); LroBasicTypeSpecClient client = new LroBasicTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Operation operation = await client.UpdateProjectAsync(WaitUntil.Completed, "", content); BinaryData responseData = operation.Value; @@ -184,7 +184,7 @@ public void Example_UpdateProject_AllParameters() Uri endpoint = new Uri(""); LroBasicTypeSpecClient client = new LroBasicTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { description = "", name = "", @@ -205,7 +205,7 @@ public async Task Example_UpdateProject_AllParameters_Async() Uri endpoint = new Uri(""); LroBasicTypeSpecClient client = new LroBasicTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { description = "", name = "", @@ -258,7 +258,7 @@ public void Example_CreateThing_ShortVersion() Uri endpoint = new Uri(""); LroBasicTypeSpecClient client = new LroBasicTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", }); @@ -276,7 +276,7 @@ public async Task Example_CreateThing_ShortVersion_Async() Uri endpoint = new Uri(""); LroBasicTypeSpecClient client = new LroBasicTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", }); @@ -318,7 +318,7 @@ public void Example_CreateThing_AllParameters() Uri endpoint = new Uri(""); LroBasicTypeSpecClient client = new LroBasicTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", }); @@ -336,7 +336,7 @@ public async Task Example_CreateThing_AllParameters_Async() Uri endpoint = new Uri(""); LroBasicTypeSpecClient client = new LroBasicTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", }); diff --git a/test/TestProjects/MediaTypes-TypeSpec/src/Generated/Docs/MultipleMediaTypesClient.xml b/test/TestProjects/MediaTypes-TypeSpec/src/Generated/Docs/MultipleMediaTypesClient.xml index 069fab6e959..125f960b6ce 100644 --- a/test/TestProjects/MediaTypes-TypeSpec/src/Generated/Docs/MultipleMediaTypesClient.xml +++ b/test/TestProjects/MediaTypes-TypeSpec/src/Generated/Docs/MultipleMediaTypesClient.xml @@ -42,7 +42,7 @@ This sample shows how to call OneBinaryBodyTwoContentTypesAsync. Uri endpoint = new Uri(""); MultipleMediaTypesClient client = new MultipleMediaTypesClient(endpoint); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.OneBinaryBodyTwoContentTypesAsync(content, new ContentType("application/json")); Console.WriteLine(response.Status); @@ -52,7 +52,7 @@ This sample shows how to call OneBinaryBodyTwoContentTypesAsync with all paramet Uri endpoint = new Uri(""); MultipleMediaTypesClient client = new MultipleMediaTypesClient(endpoint); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.OneBinaryBodyTwoContentTypesAsync(content, new ContentType("application/json")); Console.WriteLine(response.Status); @@ -65,7 +65,7 @@ This sample shows how to call OneBinaryBodyTwoContentTypes. Uri endpoint = new Uri(""); MultipleMediaTypesClient client = new MultipleMediaTypesClient(endpoint); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = client.OneBinaryBodyTwoContentTypes(content, new ContentType("application/json")); Console.WriteLine(response.Status); @@ -75,7 +75,7 @@ This sample shows how to call OneBinaryBodyTwoContentTypes with all parameters a Uri endpoint = new Uri(""); MultipleMediaTypesClient client = new MultipleMediaTypesClient(endpoint); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = client.OneBinaryBodyTwoContentTypes(content, new ContentType("application/json")); Console.WriteLine(response.Status); @@ -122,7 +122,7 @@ This sample shows how to call OneStringBodyThreeContentTypesAsync. Uri endpoint = new Uri(""); MultipleMediaTypesClient client = new MultipleMediaTypesClient(endpoint); -RequestContent content = RequestContent.Create(""); +using RequestContent content = RequestContent.Create(""); Response response = await client.OneStringBodyThreeContentTypesAsync(content, new ContentType("application/json")); Console.WriteLine(response.Status); @@ -132,7 +132,7 @@ This sample shows how to call OneStringBodyThreeContentTypesAsync with all param Uri endpoint = new Uri(""); MultipleMediaTypesClient client = new MultipleMediaTypesClient(endpoint); -RequestContent content = RequestContent.Create(""); +using RequestContent content = RequestContent.Create(""); Response response = await client.OneStringBodyThreeContentTypesAsync(content, new ContentType("application/json")); Console.WriteLine(response.Status); @@ -145,7 +145,7 @@ This sample shows how to call OneStringBodyThreeContentTypes. Uri endpoint = new Uri(""); MultipleMediaTypesClient client = new MultipleMediaTypesClient(endpoint); -RequestContent content = RequestContent.Create(""); +using RequestContent content = RequestContent.Create(""); Response response = client.OneStringBodyThreeContentTypes(content, new ContentType("application/json")); Console.WriteLine(response.Status); @@ -155,7 +155,7 @@ This sample shows how to call OneStringBodyThreeContentTypes with all parameters Uri endpoint = new Uri(""); MultipleMediaTypesClient client = new MultipleMediaTypesClient(endpoint); -RequestContent content = RequestContent.Create(""); +using RequestContent content = RequestContent.Create(""); Response response = client.OneStringBodyThreeContentTypes(content, new ContentType("application/json")); Console.WriteLine(response.Status); @@ -206,7 +206,7 @@ This sample shows how to call OneModelBodyOneContentTypeAsync. Uri endpoint = new Uri(""); MultipleMediaTypesClient client = new MultipleMediaTypesClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { id = "", }); @@ -219,7 +219,7 @@ This sample shows how to call OneModelBodyOneContentTypeAsync with all request c Uri endpoint = new Uri(""); MultipleMediaTypesClient client = new MultipleMediaTypesClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { id = "", }); @@ -235,7 +235,7 @@ This sample shows how to call OneModelBodyOneContentType. Uri endpoint = new Uri(""); MultipleMediaTypesClient client = new MultipleMediaTypesClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { id = "", }); @@ -248,7 +248,7 @@ This sample shows how to call OneModelBodyOneContentType with all request conten Uri endpoint = new Uri(""); MultipleMediaTypesClient client = new MultipleMediaTypesClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { id = "", }); diff --git a/test/TestProjects/MediaTypes-TypeSpec/src/Generated/MultipleMediaTypesClient.cs b/test/TestProjects/MediaTypes-TypeSpec/src/Generated/MultipleMediaTypesClient.cs index e68dc3da30a..d6f976bbb58 100644 --- a/test/TestProjects/MediaTypes-TypeSpec/src/Generated/MultipleMediaTypesClient.cs +++ b/test/TestProjects/MediaTypes-TypeSpec/src/Generated/MultipleMediaTypesClient.cs @@ -66,7 +66,8 @@ public virtual async Task OneBinaryBodyTwoContentTypesAsync(BinaryData Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await OneBinaryBodyTwoContentTypesAsync(RequestContentHelper.FromObject(body), contentType, context).ConfigureAwait(false); + using RequestContent content = RequestContentHelper.FromObject(body); + Response response = await OneBinaryBodyTwoContentTypesAsync(content, contentType, context).ConfigureAwait(false); return response; } @@ -80,7 +81,8 @@ public virtual Response OneBinaryBodyTwoContentTypes(BinaryData body, ContentTyp Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = OneBinaryBodyTwoContentTypes(RequestContentHelper.FromObject(body), contentType, context); + using RequestContent content = RequestContentHelper.FromObject(body); + Response response = OneBinaryBodyTwoContentTypes(content, contentType, context); return response; } @@ -175,7 +177,8 @@ public virtual async Task OneStringBodyThreeContentTypesAsync(string b Argument.AssertNotNullOrEmpty(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await OneStringBodyThreeContentTypesAsync(RequestContentHelper.FromObject(body), contentType, context).ConfigureAwait(false); + using RequestContent content = RequestContentHelper.FromObject(body); + Response response = await OneStringBodyThreeContentTypesAsync(content, contentType, context).ConfigureAwait(false); return response; } @@ -190,7 +193,8 @@ public virtual Response OneStringBodyThreeContentTypes(string body, ContentType Argument.AssertNotNullOrEmpty(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = OneStringBodyThreeContentTypes(RequestContentHelper.FromObject(body), contentType, context); + using RequestContent content = RequestContentHelper.FromObject(body); + Response response = OneStringBodyThreeContentTypes(content, contentType, context); return response; } @@ -283,7 +287,8 @@ public virtual async Task OneModelBodyOneContentTypeAsync(Body body, C Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await OneModelBodyOneContentTypeAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await OneModelBodyOneContentTypeAsync(content, context).ConfigureAwait(false); return response; } @@ -296,7 +301,8 @@ public virtual Response OneModelBodyOneContentType(Body body, CancellationToken Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = OneModelBodyOneContentType(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = OneModelBodyOneContentType(content, context); return response; } diff --git a/test/TestProjects/MediaTypes-TypeSpec/tests/Generated/Samples/Samples_MultipleMediaTypesClient.cs b/test/TestProjects/MediaTypes-TypeSpec/tests/Generated/Samples/Samples_MultipleMediaTypesClient.cs index fa525b23be4..043da0eb01d 100644 --- a/test/TestProjects/MediaTypes-TypeSpec/tests/Generated/Samples/Samples_MultipleMediaTypesClient.cs +++ b/test/TestProjects/MediaTypes-TypeSpec/tests/Generated/Samples/Samples_MultipleMediaTypesClient.cs @@ -25,7 +25,7 @@ public void Example_OneBinaryBodyTwoContentTypes_ShortVersion() Uri endpoint = new Uri(""); MultipleMediaTypesClient client = new MultipleMediaTypesClient(endpoint); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.OneBinaryBodyTwoContentTypes(content, new ContentType("application/json")); Console.WriteLine(response.Status); @@ -38,7 +38,7 @@ public async Task Example_OneBinaryBodyTwoContentTypes_ShortVersion_Async() Uri endpoint = new Uri(""); MultipleMediaTypesClient client = new MultipleMediaTypesClient(endpoint); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.OneBinaryBodyTwoContentTypesAsync(content, new ContentType("application/json")); Console.WriteLine(response.Status); @@ -71,7 +71,7 @@ public void Example_OneBinaryBodyTwoContentTypes_AllParameters() Uri endpoint = new Uri(""); MultipleMediaTypesClient client = new MultipleMediaTypesClient(endpoint); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.OneBinaryBodyTwoContentTypes(content, new ContentType("application/json")); Console.WriteLine(response.Status); @@ -84,7 +84,7 @@ public async Task Example_OneBinaryBodyTwoContentTypes_AllParameters_Async() Uri endpoint = new Uri(""); MultipleMediaTypesClient client = new MultipleMediaTypesClient(endpoint); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.OneBinaryBodyTwoContentTypesAsync(content, new ContentType("application/json")); Console.WriteLine(response.Status); @@ -117,7 +117,7 @@ public void Example_OneStringBodyThreeContentTypes_ShortVersion() Uri endpoint = new Uri(""); MultipleMediaTypesClient client = new MultipleMediaTypesClient(endpoint); - RequestContent content = RequestContent.Create(""); + using RequestContent content = RequestContent.Create(""); Response response = client.OneStringBodyThreeContentTypes(content, new ContentType("application/json")); Console.WriteLine(response.Status); @@ -130,7 +130,7 @@ public async Task Example_OneStringBodyThreeContentTypes_ShortVersion_Async() Uri endpoint = new Uri(""); MultipleMediaTypesClient client = new MultipleMediaTypesClient(endpoint); - RequestContent content = RequestContent.Create(""); + using RequestContent content = RequestContent.Create(""); Response response = await client.OneStringBodyThreeContentTypesAsync(content, new ContentType("application/json")); Console.WriteLine(response.Status); @@ -163,7 +163,7 @@ public void Example_OneStringBodyThreeContentTypes_AllParameters() Uri endpoint = new Uri(""); MultipleMediaTypesClient client = new MultipleMediaTypesClient(endpoint); - RequestContent content = RequestContent.Create(""); + using RequestContent content = RequestContent.Create(""); Response response = client.OneStringBodyThreeContentTypes(content, new ContentType("application/json")); Console.WriteLine(response.Status); @@ -176,7 +176,7 @@ public async Task Example_OneStringBodyThreeContentTypes_AllParameters_Async() Uri endpoint = new Uri(""); MultipleMediaTypesClient client = new MultipleMediaTypesClient(endpoint); - RequestContent content = RequestContent.Create(""); + using RequestContent content = RequestContent.Create(""); Response response = await client.OneStringBodyThreeContentTypesAsync(content, new ContentType("application/json")); Console.WriteLine(response.Status); @@ -209,7 +209,7 @@ public void Example_OneModelBodyOneContentType_ShortVersion() Uri endpoint = new Uri(""); MultipleMediaTypesClient client = new MultipleMediaTypesClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { id = "", }); @@ -225,7 +225,7 @@ public async Task Example_OneModelBodyOneContentType_ShortVersion_Async() Uri endpoint = new Uri(""); MultipleMediaTypesClient client = new MultipleMediaTypesClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { id = "", }); @@ -263,7 +263,7 @@ public void Example_OneModelBodyOneContentType_AllParameters() Uri endpoint = new Uri(""); MultipleMediaTypesClient client = new MultipleMediaTypesClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { id = "", }); @@ -279,7 +279,7 @@ public async Task Example_OneModelBodyOneContentType_AllParameters_Async() Uri endpoint = new Uri(""); MultipleMediaTypesClient client = new MultipleMediaTypesClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { id = "", }); diff --git a/test/TestProjects/MixAPIVersion-TypeSpec/src/Generated/Docs/MixApiVersionClient.xml b/test/TestProjects/MixAPIVersion-TypeSpec/src/Generated/Docs/MixApiVersionClient.xml index b6e9342d4a7..9682bc5b614 100644 --- a/test/TestProjects/MixAPIVersion-TypeSpec/src/Generated/Docs/MixApiVersionClient.xml +++ b/test/TestProjects/MixAPIVersion-TypeSpec/src/Generated/Docs/MixApiVersionClient.xml @@ -102,7 +102,7 @@ This sample shows how to call CreateAsync and parse the result. Uri endpoint = new Uri(""); MixApiVersionClient client = new MixApiVersionClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { age = 1234, }); @@ -117,7 +117,7 @@ This sample shows how to call CreateAsync with all request content and parse the Uri endpoint = new Uri(""); MixApiVersionClient client = new MixApiVersionClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { tag = "", age = 1234, @@ -137,7 +137,7 @@ This sample shows how to call Create and parse the result. Uri endpoint = new Uri(""); MixApiVersionClient client = new MixApiVersionClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { age = 1234, }); @@ -152,7 +152,7 @@ This sample shows how to call Create with all request content and parse the resu Uri endpoint = new Uri(""); MixApiVersionClient client = new MixApiVersionClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { tag = "", age = 1234, diff --git a/test/TestProjects/MixAPIVersion-TypeSpec/tests/Generated/Samples/Samples_MixApiVersionClient.cs b/test/TestProjects/MixAPIVersion-TypeSpec/tests/Generated/Samples/Samples_MixApiVersionClient.cs index 5477deedb9d..8ffdfcf3f37 100644 --- a/test/TestProjects/MixAPIVersion-TypeSpec/tests/Generated/Samples/Samples_MixApiVersionClient.cs +++ b/test/TestProjects/MixAPIVersion-TypeSpec/tests/Generated/Samples/Samples_MixApiVersionClient.cs @@ -131,7 +131,7 @@ public void Example_Create_ShortVersion() Uri endpoint = new Uri(""); MixApiVersionClient client = new MixApiVersionClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { age = 1234, }); @@ -149,7 +149,7 @@ public async Task Example_Create_ShortVersion_Async() Uri endpoint = new Uri(""); MixApiVersionClient client = new MixApiVersionClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { age = 1234, }); @@ -167,7 +167,7 @@ public void Example_Create_AllParameters() Uri endpoint = new Uri(""); MixApiVersionClient client = new MixApiVersionClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { tag = "", age = 1234, @@ -187,7 +187,7 @@ public async Task Example_Create_AllParameters_Async() Uri endpoint = new Uri(""); MixApiVersionClient client = new MixApiVersionClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { tag = "", age = 1234, diff --git a/test/TestProjects/Models-TypeSpec/src/Generated/Docs/ModelsTypeSpecClient.xml b/test/TestProjects/Models-TypeSpec/src/Generated/Docs/ModelsTypeSpecClient.xml index f1a63fadd36..276093920a0 100644 --- a/test/TestProjects/Models-TypeSpec/src/Generated/Docs/ModelsTypeSpecClient.xml +++ b/test/TestProjects/Models-TypeSpec/src/Generated/Docs/ModelsTypeSpecClient.xml @@ -206,7 +206,7 @@ This sample shows how to call InputToRoundTripAsync and parse the result. Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -286,7 +286,7 @@ This sample shows how to call InputToRoundTripAsync with all request content and Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -407,7 +407,7 @@ This sample shows how to call InputToRoundTrip and parse the result. Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -487,7 +487,7 @@ This sample shows how to call InputToRoundTrip with all request content and pars Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -726,7 +726,7 @@ This sample shows how to call InputToRoundTripPrimitiveAsync and parse the resul Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -798,7 +798,7 @@ This sample shows how to call InputToRoundTripPrimitiveAsync with all request co Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -899,7 +899,7 @@ This sample shows how to call InputToRoundTripPrimitive and parse the result. Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -971,7 +971,7 @@ This sample shows how to call InputToRoundTripPrimitive with all request content Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -1186,7 +1186,7 @@ This sample shows how to call InputToRoundTripOptionalAsync and parse the result Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.InputToRoundTripOptionalAsync(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -1197,7 +1197,7 @@ This sample shows how to call InputToRoundTripOptionalAsync with all request con Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { optionalString = "", optionalInt = 1234, @@ -1282,7 +1282,7 @@ This sample shows how to call InputToRoundTripOptional and parse the result. Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = client.InputToRoundTripOptional(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -1293,7 +1293,7 @@ This sample shows how to call InputToRoundTripOptional with all request content Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { optionalString = "", optionalInt = 1234, @@ -1518,7 +1518,7 @@ This sample shows how to call RoundTripToOutputAsync and parse the result. Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -1588,7 +1588,7 @@ This sample shows how to call RoundTripToOutputAsync with all request content an Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -1684,7 +1684,7 @@ This sample shows how to call RoundTripToOutput and parse the result. Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -1754,7 +1754,7 @@ This sample shows how to call RoundTripToOutput with all request content and par Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -1894,7 +1894,7 @@ This sample shows how to call InputRecursiveAsync. Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { message = "", }); @@ -1907,7 +1907,7 @@ This sample shows how to call InputRecursiveAsync with all request content. Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { message = "", }); @@ -1923,7 +1923,7 @@ This sample shows how to call InputRecursive. Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { message = "", }); @@ -1936,7 +1936,7 @@ This sample shows how to call InputRecursive with all request content. Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { message = "", }); @@ -1996,7 +1996,7 @@ This sample shows how to call RoundTripRecursiveAsync and parse the result. Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { message = "", }); @@ -2010,7 +2010,7 @@ This sample shows how to call RoundTripRecursiveAsync with all request content a Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { message = "", }); @@ -2028,7 +2028,7 @@ This sample shows how to call RoundTripRecursive and parse the result. Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { message = "", }); @@ -2042,7 +2042,7 @@ This sample shows how to call RoundTripRecursive with all request content and pa Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { message = "", }); @@ -2216,7 +2216,7 @@ This sample shows how to call RoundTripToOutputWithNoUseBaseAsync and parse the Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { requiredList = new object[] { @@ -2246,7 +2246,7 @@ This sample shows how to call RoundTripToOutputWithNoUseBaseAsync with all reque Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { requiredList = new object[] { @@ -2279,7 +2279,7 @@ This sample shows how to call RoundTripToOutputWithNoUseBase and parse the resul Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { requiredList = new object[] { @@ -2309,7 +2309,7 @@ This sample shows how to call RoundTripToOutputWithNoUseBase with all request co Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { requiredList = new object[] { @@ -2550,7 +2550,7 @@ This sample shows how to call GenericTypeAsync. Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { kind = "Int32Values", values = new object[] @@ -2569,7 +2569,7 @@ This sample shows how to call GenericTypeAsync with all request content. Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { kind = "Int32Values", values = new object[] @@ -2591,7 +2591,7 @@ This sample shows how to call GenericType. Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { kind = "Int32Values", values = new object[] @@ -2610,7 +2610,7 @@ This sample shows how to call GenericType with all request content. Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { kind = "Int32Values", values = new object[] diff --git a/test/TestProjects/Models-TypeSpec/src/Generated/ModelsTypeSpecClient.cs b/test/TestProjects/Models-TypeSpec/src/Generated/ModelsTypeSpecClient.cs index e8b097e1995..2077e796881 100644 --- a/test/TestProjects/Models-TypeSpec/src/Generated/ModelsTypeSpecClient.cs +++ b/test/TestProjects/Models-TypeSpec/src/Generated/ModelsTypeSpecClient.cs @@ -154,7 +154,8 @@ public virtual async Task> InputToRoundTripAsync(InputM Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await InputToRoundTripAsync(input.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = input.ToRequestContent(); + Response response = await InputToRoundTripAsync(content, context).ConfigureAwait(false); return Response.FromValue(RoundTripModel.FromResponse(response), response); } @@ -168,7 +169,8 @@ public virtual Response InputToRoundTrip(InputModel input, Cance Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = InputToRoundTrip(input.ToRequestContent(), context); + using RequestContent content = input.ToRequestContent(); + Response response = InputToRoundTrip(content, context); return Response.FromValue(RoundTripModel.FromResponse(response), response); } @@ -260,7 +262,8 @@ public virtual async Task> InputToRoundTripPri Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await InputToRoundTripPrimitiveAsync(input.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = input.ToRequestContent(); + Response response = await InputToRoundTripPrimitiveAsync(content, context).ConfigureAwait(false); return Response.FromValue(RoundTripPrimitiveModel.FromResponse(response), response); } @@ -274,7 +277,8 @@ public virtual Response InputToRoundTripPrimitive(Input Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = InputToRoundTripPrimitive(input.ToRequestContent(), context); + using RequestContent content = input.ToRequestContent(); + Response response = InputToRoundTripPrimitive(content, context); return Response.FromValue(RoundTripPrimitiveModel.FromResponse(response), response); } @@ -366,7 +370,8 @@ public virtual async Task> InputToRoundTripOpti Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await InputToRoundTripOptionalAsync(input.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = input.ToRequestContent(); + Response response = await InputToRoundTripOptionalAsync(content, context).ConfigureAwait(false); return Response.FromValue(RoundTripOptionalModel.FromResponse(response), response); } @@ -380,7 +385,8 @@ public virtual Response InputToRoundTripOptional(RoundTr Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = InputToRoundTripOptional(input.ToRequestContent(), context); + using RequestContent content = input.ToRequestContent(); + Response response = InputToRoundTripOptional(content, context); return Response.FromValue(RoundTripOptionalModel.FromResponse(response), response); } @@ -472,7 +478,8 @@ public virtual async Task> InputToRoundTripRead Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await InputToRoundTripReadOnlyAsync(input.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = input.ToRequestContent(); + Response response = await InputToRoundTripReadOnlyAsync(content, context).ConfigureAwait(false); return Response.FromValue(RoundTripReadOnlyModel.FromResponse(response), response); } @@ -486,7 +493,8 @@ public virtual Response InputToRoundTripReadOnly(InputMo Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = InputToRoundTripReadOnly(input.ToRequestContent(), context); + using RequestContent content = input.ToRequestContent(); + Response response = InputToRoundTripReadOnly(content, context); return Response.FromValue(RoundTripReadOnlyModel.FromResponse(response), response); } @@ -578,7 +586,8 @@ public virtual async Task> RoundTripToOutputAsync(RoundTri Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await RoundTripToOutputAsync(input.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = input.ToRequestContent(); + Response response = await RoundTripToOutputAsync(content, context).ConfigureAwait(false); return Response.FromValue(OutputModel.FromResponse(response), response); } @@ -592,7 +601,8 @@ public virtual Response RoundTripToOutput(RoundTripModel input, Can Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = RoundTripToOutput(input.ToRequestContent(), context); + using RequestContent content = input.ToRequestContent(); + Response response = RoundTripToOutput(content, context); return Response.FromValue(OutputModel.FromResponse(response), response); } @@ -684,7 +694,8 @@ public virtual async Task InputRecursiveAsync(InputRecursiveModel inpu Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await InputRecursiveAsync(input.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = input.ToRequestContent(); + Response response = await InputRecursiveAsync(content, context).ConfigureAwait(false); return response; } @@ -698,7 +709,8 @@ public virtual Response InputRecursive(InputRecursiveModel input, CancellationTo Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = InputRecursive(input.ToRequestContent(), context); + using RequestContent content = input.ToRequestContent(); + Response response = InputRecursive(content, context); return response; } @@ -790,7 +802,8 @@ public virtual async Task> RoundTripRecursiveA Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await RoundTripRecursiveAsync(input.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = input.ToRequestContent(); + Response response = await RoundTripRecursiveAsync(content, context).ConfigureAwait(false); return Response.FromValue(RoundTripRecursiveModel.FromResponse(response), response); } @@ -804,7 +817,8 @@ public virtual Response RoundTripRecursive(RoundTripRec Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = RoundTripRecursive(input.ToRequestContent(), context); + using RequestContent content = input.ToRequestContent(); + Response response = RoundTripRecursive(content, context); return Response.FromValue(RoundTripRecursiveModel.FromResponse(response), response); } @@ -986,7 +1000,8 @@ public virtual async Task> RoundTripToOutputWithNoUse Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await RoundTripToOutputWithNoUseBaseAsync(input.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = input.ToRequestContent(); + Response response = await RoundTripToOutputWithNoUseBaseAsync(content, context).ConfigureAwait(false); return Response.FromValue(RoundTripOnNoUse.FromResponse(response), response); } @@ -1000,7 +1015,8 @@ public virtual Response RoundTripToOutputWithNoUseBase(RoundTr Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = RoundTripToOutputWithNoUseBase(input.ToRequestContent(), context); + using RequestContent content = input.ToRequestContent(); + Response response = RoundTripToOutputWithNoUseBase(content, context); return Response.FromValue(RoundTripOnNoUse.FromResponse(response), response); } @@ -1269,7 +1285,8 @@ public virtual async Task GenericTypeAsync(Int32ValuesFacet input, Can Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GenericTypeAsync(input.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = input.ToRequestContent(); + Response response = await GenericTypeAsync(content, context).ConfigureAwait(false); return response; } @@ -1282,7 +1299,8 @@ public virtual Response GenericType(Int32ValuesFacet input, CancellationToken ca Argument.AssertNotNull(input, nameof(input)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = GenericType(input.ToRequestContent(), context); + using RequestContent content = input.ToRequestContent(); + Response response = GenericType(content, context); return response; } diff --git a/test/TestProjects/Models-TypeSpec/tests/Generated/Samples/Samples_ModelsTypeSpecClient.cs b/test/TestProjects/Models-TypeSpec/tests/Generated/Samples/Samples_ModelsTypeSpecClient.cs index f3dcda7079f..678c578c84f 100644 --- a/test/TestProjects/Models-TypeSpec/tests/Generated/Samples/Samples_ModelsTypeSpecClient.cs +++ b/test/TestProjects/Models-TypeSpec/tests/Generated/Samples/Samples_ModelsTypeSpecClient.cs @@ -119,7 +119,7 @@ public void Example_InputToRoundTrip_ShortVersion() Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -202,7 +202,7 @@ public async Task Example_InputToRoundTrip_ShortVersion_Async() Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -337,7 +337,7 @@ public void Example_InputToRoundTrip_AllParameters() Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -458,7 +458,7 @@ public async Task Example_InputToRoundTrip_AllParameters_Async() Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -651,7 +651,7 @@ public void Example_InputToRoundTripPrimitive_ShortVersion() Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -726,7 +726,7 @@ public async Task Example_InputToRoundTripPrimitive_ShortVersion_Async() Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -853,7 +853,7 @@ public void Example_InputToRoundTripPrimitive_AllParameters() Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -954,7 +954,7 @@ public async Task Example_InputToRoundTripPrimitive_AllParameters_Async() Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -1127,7 +1127,7 @@ public void Example_InputToRoundTripOptional_ShortVersion() Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.InputToRoundTripOptional(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -1141,7 +1141,7 @@ public async Task Example_InputToRoundTripOptional_ShortVersion_Async() Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.InputToRoundTripOptionalAsync(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -1177,7 +1177,7 @@ public void Example_InputToRoundTripOptional_AllParameters() Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { optionalString = "", optionalInt = 1234, @@ -1262,7 +1262,7 @@ public async Task Example_InputToRoundTripOptional_AllParameters_Async() Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { optionalString = "", optionalInt = 1234, @@ -1445,7 +1445,7 @@ public void Example_RoundTripToOutput_ShortVersion() Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -1518,7 +1518,7 @@ public async Task Example_RoundTripToOutput_ShortVersion_Async() Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -1649,7 +1649,7 @@ public void Example_RoundTripToOutput_AllParameters() Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -1745,7 +1745,7 @@ public async Task Example_RoundTripToOutput_AllParameters_Async() Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -1929,7 +1929,7 @@ public void Example_InputRecursive_ShortVersion() Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { message = "", }); @@ -1945,7 +1945,7 @@ public async Task Example_InputRecursive_ShortVersion_Async() Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { message = "", }); @@ -1983,7 +1983,7 @@ public void Example_InputRecursive_AllParameters() Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { message = "", }); @@ -1999,7 +1999,7 @@ public async Task Example_InputRecursive_AllParameters_Async() Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { message = "", }); @@ -2043,7 +2043,7 @@ public void Example_RoundTripRecursive_ShortVersion() Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { message = "", }); @@ -2060,7 +2060,7 @@ public async Task Example_RoundTripRecursive_ShortVersion_Async() Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { message = "", }); @@ -2099,7 +2099,7 @@ public void Example_RoundTripRecursive_AllParameters() Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { message = "", }); @@ -2117,7 +2117,7 @@ public async Task Example_RoundTripRecursive_AllParameters_Async() Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { message = "", }); @@ -2257,7 +2257,7 @@ public void Example_RoundTripToOutputWithNoUseBase_ShortVersion() Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredList = new object[] { @@ -2290,7 +2290,7 @@ public async Task Example_RoundTripToOutputWithNoUseBase_ShortVersion_Async() Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredList = new object[] { @@ -2363,7 +2363,7 @@ public void Example_RoundTripToOutputWithNoUseBase_AllParameters() Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredList = new object[] { @@ -2396,7 +2396,7 @@ public async Task Example_RoundTripToOutputWithNoUseBase_AllParameters_Async() Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredList = new object[] { @@ -2663,7 +2663,7 @@ public void Example_GenericType_ShortVersion() Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { kind = "Int32Values", values = new object[] @@ -2685,7 +2685,7 @@ public async Task Example_GenericType_ShortVersion_Async() Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { kind = "Int32Values", values = new object[] @@ -2729,7 +2729,7 @@ public void Example_GenericType_AllParameters() Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { kind = "Int32Values", values = new object[] @@ -2751,7 +2751,7 @@ public async Task Example_GenericType_AllParameters_Async() Uri endpoint = new Uri(""); ModelsTypeSpecClient client = new ModelsTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { kind = "Int32Values", values = new object[] diff --git a/test/TestProjects/Pagination-TypeSpec/src/Generated/Docs/PaginationClient.xml b/test/TestProjects/Pagination-TypeSpec/src/Generated/Docs/PaginationClient.xml index 37190f74b9b..858ef9efe1f 100644 --- a/test/TestProjects/Pagination-TypeSpec/src/Generated/Docs/PaginationClient.xml +++ b/test/TestProjects/Pagination-TypeSpec/src/Generated/Docs/PaginationClient.xml @@ -59,7 +59,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); PaginationClient client = new PaginationClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -78,7 +78,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); PaginationClient client = new PaginationClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -100,7 +100,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); PaginationClient client = new PaginationClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -119,7 +119,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); PaginationClient client = new PaginationClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, diff --git a/test/TestProjects/Pagination-TypeSpec/tests/Generated/Samples/Samples_PaginationClient.cs b/test/TestProjects/Pagination-TypeSpec/tests/Generated/Samples/Samples_PaginationClient.cs index 109e3949fa2..85d4ab9ffb6 100644 --- a/test/TestProjects/Pagination-TypeSpec/tests/Generated/Samples/Samples_PaginationClient.cs +++ b/test/TestProjects/Pagination-TypeSpec/tests/Generated/Samples/Samples_PaginationClient.cs @@ -26,7 +26,7 @@ public void Example_GetPaginationLedgerEntries_ShortVersion() TokenCredential credential = new DefaultAzureCredential(); PaginationClient client = new PaginationClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -48,7 +48,7 @@ public async Task Example_GetPaginationLedgerEntries_ShortVersion_Async() TokenCredential credential = new DefaultAzureCredential(); PaginationClient client = new PaginationClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -98,7 +98,7 @@ public void Example_GetPaginationLedgerEntries_AllParameters() TokenCredential credential = new DefaultAzureCredential(); PaginationClient client = new PaginationClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -120,7 +120,7 @@ public async Task Example_GetPaginationLedgerEntries_AllParameters_Async() TokenCredential credential = new DefaultAzureCredential(); PaginationClient client = new PaginationClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, diff --git a/test/TestProjects/Parameters-LowLevel/src/Generated/Docs/ParametersLowlevelClient.xml b/test/TestProjects/Parameters-LowLevel/src/Generated/Docs/ParametersLowlevelClient.xml index 67a69f01590..935cd7815b1 100644 --- a/test/TestProjects/Parameters-LowLevel/src/Generated/Docs/ParametersLowlevelClient.xml +++ b/test/TestProjects/Parameters-LowLevel/src/Generated/Docs/ParametersLowlevelClient.xml @@ -54,7 +54,7 @@ This sample shows how to call RequestBodyResponseBodyAsync and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); ParametersLowlevelClient client = new ParametersLowlevelClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.RequestBodyResponseBodyAsync(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -65,7 +65,7 @@ This sample shows how to call RequestBodyResponseBodyAsync with all request cont AzureKeyCredential credential = new AzureKeyCredential(""); ParametersLowlevelClient client = new ParametersLowlevelClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { Code = "", Status = "", @@ -84,7 +84,7 @@ This sample shows how to call RequestBodyResponseBody and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); ParametersLowlevelClient client = new ParametersLowlevelClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.RequestBodyResponseBody(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -95,7 +95,7 @@ This sample shows how to call RequestBodyResponseBody with all request content a AzureKeyCredential credential = new AzureKeyCredential(""); ParametersLowlevelClient client = new ParametersLowlevelClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { Code = "", Status = "", @@ -202,7 +202,7 @@ This sample shows how to call RequestBodyNoResponseBodyAsync. AzureKeyCredential credential = new AzureKeyCredential(""); ParametersLowlevelClient client = new ParametersLowlevelClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.RequestBodyNoResponseBodyAsync(content); Console.WriteLine(response.Status); @@ -212,7 +212,7 @@ This sample shows how to call RequestBodyNoResponseBodyAsync with all request co AzureKeyCredential credential = new AzureKeyCredential(""); ParametersLowlevelClient client = new ParametersLowlevelClient(credential); -RequestContent content = RequestContent.Create(""); +using RequestContent content = RequestContent.Create(""); Response response = await client.RequestBodyNoResponseBodyAsync(content); Console.WriteLine(response.Status); @@ -225,7 +225,7 @@ This sample shows how to call RequestBodyNoResponseBody. AzureKeyCredential credential = new AzureKeyCredential(""); ParametersLowlevelClient client = new ParametersLowlevelClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.RequestBodyNoResponseBody(content); Console.WriteLine(response.Status); @@ -235,7 +235,7 @@ This sample shows how to call RequestBodyNoResponseBody with all request content AzureKeyCredential credential = new AzureKeyCredential(""); ParametersLowlevelClient client = new ParametersLowlevelClient(credential); -RequestContent content = RequestContent.Create(""); +using RequestContent content = RequestContent.Create(""); Response response = client.RequestBodyNoResponseBody(content); Console.WriteLine(response.Status); @@ -332,7 +332,7 @@ This sample shows how to call OptionalPathBodyParametersWithMixedSequenceAsync. AzureKeyCredential credential = new AzureKeyCredential(""); ParametersLowlevelClient client = new ParametersLowlevelClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.OptionalPathBodyParametersWithMixedSequenceAsync(default, "", 1234, default, content); Console.WriteLine(response.Status); @@ -342,7 +342,7 @@ This sample shows how to call OptionalPathBodyParametersWithMixedSequenceAsync w AzureKeyCredential credential = new AzureKeyCredential(""); ParametersLowlevelClient client = new ParametersLowlevelClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { Code = "", Status = "", @@ -359,7 +359,7 @@ This sample shows how to call OptionalPathBodyParametersWithMixedSequence. AzureKeyCredential credential = new AzureKeyCredential(""); ParametersLowlevelClient client = new ParametersLowlevelClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.OptionalPathBodyParametersWithMixedSequence(default, "", 1234, default, content); Console.WriteLine(response.Status); @@ -369,7 +369,7 @@ This sample shows how to call OptionalPathBodyParametersWithMixedSequence with a AzureKeyCredential credential = new AzureKeyCredential(""); ParametersLowlevelClient client = new ParametersLowlevelClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { Code = "", Status = "", @@ -386,7 +386,7 @@ This sample shows how to call RepeatableActionAsync. AzureKeyCredential credential = new AzureKeyCredential(""); ParametersLowlevelClient client = new ParametersLowlevelClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.RepeatableActionAsync(default, "", content); Console.WriteLine(response.Status); @@ -396,7 +396,7 @@ This sample shows how to call RepeatableActionAsync with all parameters and requ AzureKeyCredential credential = new AzureKeyCredential(""); ParametersLowlevelClient client = new ParametersLowlevelClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { Code = "", Status = "", @@ -413,7 +413,7 @@ This sample shows how to call RepeatableAction. AzureKeyCredential credential = new AzureKeyCredential(""); ParametersLowlevelClient client = new ParametersLowlevelClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.RepeatableAction(default, "", content); Console.WriteLine(response.Status); @@ -423,7 +423,7 @@ This sample shows how to call RepeatableAction with all parameters and request c AzureKeyCredential credential = new AzureKeyCredential(""); ParametersLowlevelClient client = new ParametersLowlevelClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { Code = "", Status = "", diff --git a/test/TestProjects/Parameters-LowLevel/tests/Generated/Samples/Samples_ParametersLowlevelClient.cs b/test/TestProjects/Parameters-LowLevel/tests/Generated/Samples/Samples_ParametersLowlevelClient.cs index 009de85b59e..f58e547166f 100644 --- a/test/TestProjects/Parameters-LowLevel/tests/Generated/Samples/Samples_ParametersLowlevelClient.cs +++ b/test/TestProjects/Parameters-LowLevel/tests/Generated/Samples/Samples_ParametersLowlevelClient.cs @@ -77,7 +77,7 @@ public void Example_RequestBodyResponseBody_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); ParametersLowlevelClient client = new ParametersLowlevelClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.RequestBodyResponseBody(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -91,7 +91,7 @@ public async Task Example_RequestBodyResponseBody_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); ParametersLowlevelClient client = new ParametersLowlevelClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.RequestBodyResponseBodyAsync(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -105,7 +105,7 @@ public void Example_RequestBodyResponseBody_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); ParametersLowlevelClient client = new ParametersLowlevelClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { Code = "", Status = "", @@ -124,7 +124,7 @@ public async Task Example_RequestBodyResponseBody_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); ParametersLowlevelClient client = new ParametersLowlevelClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { Code = "", Status = "", @@ -243,7 +243,7 @@ public void Example_RequestBodyNoResponseBody_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); ParametersLowlevelClient client = new ParametersLowlevelClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.RequestBodyNoResponseBody(content); Console.WriteLine(response.Status); @@ -256,7 +256,7 @@ public async Task Example_RequestBodyNoResponseBody_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); ParametersLowlevelClient client = new ParametersLowlevelClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.RequestBodyNoResponseBodyAsync(content); Console.WriteLine(response.Status); @@ -269,7 +269,7 @@ public void Example_RequestBodyNoResponseBody_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); ParametersLowlevelClient client = new ParametersLowlevelClient(credential); - RequestContent content = RequestContent.Create(""); + using RequestContent content = RequestContent.Create(""); Response response = client.RequestBodyNoResponseBody(content); Console.WriteLine(response.Status); @@ -282,7 +282,7 @@ public async Task Example_RequestBodyNoResponseBody_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); ParametersLowlevelClient client = new ParametersLowlevelClient(credential); - RequestContent content = RequestContent.Create(""); + using RequestContent content = RequestContent.Create(""); Response response = await client.RequestBodyNoResponseBodyAsync(content); Console.WriteLine(response.Status); @@ -391,7 +391,7 @@ public void Example_OptionalPathBodyParametersWithMixedSequence_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); ParametersLowlevelClient client = new ParametersLowlevelClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.OptionalPathBodyParametersWithMixedSequence(default, "", 1234, default, content); Console.WriteLine(response.Status); @@ -404,7 +404,7 @@ public async Task Example_OptionalPathBodyParametersWithMixedSequence_ShortVersi AzureKeyCredential credential = new AzureKeyCredential(""); ParametersLowlevelClient client = new ParametersLowlevelClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.OptionalPathBodyParametersWithMixedSequenceAsync(default, "", 1234, default, content); Console.WriteLine(response.Status); @@ -417,7 +417,7 @@ public void Example_OptionalPathBodyParametersWithMixedSequence_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); ParametersLowlevelClient client = new ParametersLowlevelClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { Code = "", Status = "", @@ -434,7 +434,7 @@ public async Task Example_OptionalPathBodyParametersWithMixedSequence_AllParamet AzureKeyCredential credential = new AzureKeyCredential(""); ParametersLowlevelClient client = new ParametersLowlevelClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { Code = "", Status = "", @@ -451,7 +451,7 @@ public void Example_RepeatableAction_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); ParametersLowlevelClient client = new ParametersLowlevelClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.RepeatableAction(default, "", content); Console.WriteLine(response.Status); @@ -464,7 +464,7 @@ public async Task Example_RepeatableAction_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); ParametersLowlevelClient client = new ParametersLowlevelClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.RepeatableActionAsync(default, "", content); Console.WriteLine(response.Status); @@ -477,7 +477,7 @@ public void Example_RepeatableAction_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); ParametersLowlevelClient client = new ParametersLowlevelClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { Code = "", Status = "", @@ -494,7 +494,7 @@ public async Task Example_RepeatableAction_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); ParametersLowlevelClient client = new ParametersLowlevelClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { Code = "", Status = "", diff --git a/test/TestProjects/PetStore-TypeSpec/src/Generated/Docs/PetStoreClient.xml b/test/TestProjects/PetStore-TypeSpec/src/Generated/Docs/PetStoreClient.xml index 81103b9b86e..8f41dc73652 100644 --- a/test/TestProjects/PetStore-TypeSpec/src/Generated/Docs/PetStoreClient.xml +++ b/test/TestProjects/PetStore-TypeSpec/src/Generated/Docs/PetStoreClient.xml @@ -180,7 +180,7 @@ This sample shows how to call CreateAsync and parse the result. Uri endpoint = new Uri(""); PetStoreClient client = new PetStoreClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", age = 1234, @@ -196,7 +196,7 @@ This sample shows how to call CreateAsync with all request content and parse the Uri endpoint = new Uri(""); PetStoreClient client = new PetStoreClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", tag = "", @@ -217,7 +217,7 @@ This sample shows how to call Create and parse the result. Uri endpoint = new Uri(""); PetStoreClient client = new PetStoreClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", age = 1234, @@ -233,7 +233,7 @@ This sample shows how to call Create with all request content and parse the resu Uri endpoint = new Uri(""); PetStoreClient client = new PetStoreClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", tag = "", diff --git a/test/TestProjects/PetStore-TypeSpec/src/Generated/PetStoreClient.cs b/test/TestProjects/PetStore-TypeSpec/src/Generated/PetStoreClient.cs index 1b21816f9d5..17a7eb1b33b 100644 --- a/test/TestProjects/PetStore-TypeSpec/src/Generated/PetStoreClient.cs +++ b/test/TestProjects/PetStore-TypeSpec/src/Generated/PetStoreClient.cs @@ -223,7 +223,8 @@ public virtual async Task> CreateAsync(Pet pet, CancellationToken Argument.AssertNotNull(pet, nameof(pet)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await CreateAsync(pet.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = pet.ToRequestContent(); + Response response = await CreateAsync(content, context).ConfigureAwait(false); return Response.FromValue(Pet.FromResponse(response), response); } @@ -236,7 +237,8 @@ public virtual Response Create(Pet pet, CancellationToken cancellationToken Argument.AssertNotNull(pet, nameof(pet)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = Create(pet.ToRequestContent(), context); + using RequestContent content = pet.ToRequestContent(); + Response response = Create(content, context); return Response.FromValue(Pet.FromResponse(response), response); } diff --git a/test/TestProjects/PetStore-TypeSpec/tests/Generated/Samples/Samples_PetStoreClient.cs b/test/TestProjects/PetStore-TypeSpec/tests/Generated/Samples/Samples_PetStoreClient.cs index d694ba46915..1371dfbd3e3 100644 --- a/test/TestProjects/PetStore-TypeSpec/tests/Generated/Samples/Samples_PetStoreClient.cs +++ b/test/TestProjects/PetStore-TypeSpec/tests/Generated/Samples/Samples_PetStoreClient.cs @@ -172,7 +172,7 @@ public void Example_Create_ShortVersion() Uri endpoint = new Uri(""); PetStoreClient client = new PetStoreClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", age = 1234, @@ -191,7 +191,7 @@ public async Task Example_Create_ShortVersion_Async() Uri endpoint = new Uri(""); PetStoreClient client = new PetStoreClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", age = 1234, @@ -232,7 +232,7 @@ public void Example_Create_AllParameters() Uri endpoint = new Uri(""); PetStoreClient client = new PetStoreClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", tag = "", @@ -253,7 +253,7 @@ public async Task Example_Create_AllParameters_Async() Uri endpoint = new Uri(""); PetStoreClient client = new PetStoreClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", tag = "", diff --git a/test/TestProjects/SecurityDefinition-LowLevel/src/Generated/Docs/SecurityDefinitionClient.xml b/test/TestProjects/SecurityDefinition-LowLevel/src/Generated/Docs/SecurityDefinitionClient.xml index c13bf8b162e..6f118c62587 100644 --- a/test/TestProjects/SecurityDefinition-LowLevel/src/Generated/Docs/SecurityDefinitionClient.xml +++ b/test/TestProjects/SecurityDefinition-LowLevel/src/Generated/Docs/SecurityDefinitionClient.xml @@ -9,7 +9,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); SecurityDefinitionClient client = new SecurityDefinitionClient(endpoint, credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.OperationAsync(content); Console.WriteLine(response.Status); @@ -20,7 +20,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); SecurityDefinitionClient client = new SecurityDefinitionClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { Code = "", Status = "", @@ -38,7 +38,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); SecurityDefinitionClient client = new SecurityDefinitionClient(endpoint, credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = client.Operation(content); Console.WriteLine(response.Status); @@ -49,7 +49,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); SecurityDefinitionClient client = new SecurityDefinitionClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { Code = "", Status = "", diff --git a/test/TestProjects/SecurityDefinition-LowLevel/tests/Generated/Samples/Samples_SecurityDefinitionClient.cs b/test/TestProjects/SecurityDefinition-LowLevel/tests/Generated/Samples/Samples_SecurityDefinitionClient.cs index ef3ebed5746..ad1af792f1e 100644 --- a/test/TestProjects/SecurityDefinition-LowLevel/tests/Generated/Samples/Samples_SecurityDefinitionClient.cs +++ b/test/TestProjects/SecurityDefinition-LowLevel/tests/Generated/Samples/Samples_SecurityDefinitionClient.cs @@ -25,7 +25,7 @@ public void Example_Operation_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); SecurityDefinitionClient client = new SecurityDefinitionClient(endpoint, credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.Operation(content); Console.WriteLine(response.Status); @@ -39,7 +39,7 @@ public async Task Example_Operation_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); SecurityDefinitionClient client = new SecurityDefinitionClient(endpoint, credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.OperationAsync(content); Console.WriteLine(response.Status); @@ -53,7 +53,7 @@ public void Example_Operation_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); SecurityDefinitionClient client = new SecurityDefinitionClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { Code = "", Status = "", @@ -71,7 +71,7 @@ public async Task Example_Operation_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); SecurityDefinitionClient client = new SecurityDefinitionClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { Code = "", Status = "", diff --git a/test/TestProjects/Spread-TypeSpec/src/Generated/Docs/SpreadTypeSpecClient.xml b/test/TestProjects/Spread-TypeSpec/src/Generated/Docs/SpreadTypeSpecClient.xml index d02b3169fd7..dfc2f9892a0 100644 --- a/test/TestProjects/Spread-TypeSpec/src/Generated/Docs/SpreadTypeSpecClient.xml +++ b/test/TestProjects/Spread-TypeSpec/src/Generated/Docs/SpreadTypeSpecClient.xml @@ -46,7 +46,7 @@ This sample shows how to call SpreadModelAsync. Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", age = 1234, @@ -60,7 +60,7 @@ This sample shows how to call SpreadModelAsync with all request content. Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", age = 1234, @@ -77,7 +77,7 @@ This sample shows how to call SpreadModel. Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", age = 1234, @@ -91,7 +91,7 @@ This sample shows how to call SpreadModel with all request content. Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", age = 1234, @@ -142,7 +142,7 @@ This sample shows how to call SpreadAliasAsync. Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", age = 1234, @@ -156,7 +156,7 @@ This sample shows how to call SpreadAliasAsync with all request content. Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", age = 1234, @@ -173,7 +173,7 @@ This sample shows how to call SpreadAlias. Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", age = 1234, @@ -187,7 +187,7 @@ This sample shows how to call SpreadAlias with all request content. Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", age = 1234, @@ -238,7 +238,7 @@ This sample shows how to call SpreadMultiTargetAliasAsync. Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", age = 1234, @@ -252,7 +252,7 @@ This sample shows how to call SpreadMultiTargetAliasAsync with all parameters an Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", age = 1234, @@ -269,7 +269,7 @@ This sample shows how to call SpreadMultiTargetAlias. Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", age = 1234, @@ -283,7 +283,7 @@ This sample shows how to call SpreadMultiTargetAlias with all parameters and req Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", age = 1234, @@ -338,7 +338,7 @@ This sample shows how to call SpreadAliasWithModelAsync. Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", age = 1234, @@ -352,7 +352,7 @@ This sample shows how to call SpreadAliasWithModelAsync with all parameters and Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", age = 1234, @@ -369,7 +369,7 @@ This sample shows how to call SpreadAliasWithModel. Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", age = 1234, @@ -383,7 +383,7 @@ This sample shows how to call SpreadAliasWithModel with all parameters and reque Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", age = 1234, @@ -434,7 +434,7 @@ This sample shows how to call SpreadAliasWithSpreadAliasAsync. Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", age = 1234, @@ -448,7 +448,7 @@ This sample shows how to call SpreadAliasWithSpreadAliasAsync with all parameter Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", age = 1234, @@ -465,7 +465,7 @@ This sample shows how to call SpreadAliasWithSpreadAlias. Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", age = 1234, @@ -479,7 +479,7 @@ This sample shows how to call SpreadAliasWithSpreadAlias with all parameters and Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", age = 1234, @@ -530,7 +530,7 @@ This sample shows how to call SpreadAliasWithOptionalPropsAsync. Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", items = new object[] @@ -547,7 +547,7 @@ This sample shows how to call SpreadAliasWithOptionalPropsAsync with all paramet Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", color = "", @@ -573,7 +573,7 @@ This sample shows how to call SpreadAliasWithOptionalProps. Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", items = new object[] @@ -590,7 +590,7 @@ This sample shows how to call SpreadAliasWithOptionalProps with all parameters a Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", color = "", @@ -650,7 +650,7 @@ This sample shows how to call SpreadAliasWithCollectionsAsync. Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { requiredStringList = new object[] { @@ -666,7 +666,7 @@ This sample shows how to call SpreadAliasWithCollectionsAsync with all request c Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { requiredStringList = new object[] { @@ -689,7 +689,7 @@ This sample shows how to call SpreadAliasWithCollections. Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { requiredStringList = new object[] { @@ -705,7 +705,7 @@ This sample shows how to call SpreadAliasWithCollections with all request conten Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { requiredStringList = new object[] { diff --git a/test/TestProjects/Spread-TypeSpec/src/Generated/SpreadTypeSpecClient.cs b/test/TestProjects/Spread-TypeSpec/src/Generated/SpreadTypeSpecClient.cs index 43bea5e4fd0..013dcc5b636 100644 --- a/test/TestProjects/Spread-TypeSpec/src/Generated/SpreadTypeSpecClient.cs +++ b/test/TestProjects/Spread-TypeSpec/src/Generated/SpreadTypeSpecClient.cs @@ -68,7 +68,8 @@ public virtual async Task SpreadModelAsync(Thing thing, CancellationTo Argument.AssertNotNull(thing, nameof(thing)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await SpreadModelAsync(thing.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = thing.ToRequestContent(); + Response response = await SpreadModelAsync(content, context).ConfigureAwait(false); return response; } @@ -82,7 +83,8 @@ public virtual Response SpreadModel(Thing thing, CancellationToken cancellationT Argument.AssertNotNull(thing, nameof(thing)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = SpreadModel(thing.ToRequestContent(), context); + using RequestContent content = thing.ToRequestContent(); + Response response = SpreadModel(content, context); return response; } @@ -414,7 +416,8 @@ public virtual async Task SpreadAliasWithModelAsync(string id, int top Argument.AssertNotNull(thing, nameof(thing)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await SpreadAliasWithModelAsync(id, top, thing.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = thing.ToRequestContent(); + Response response = await SpreadAliasWithModelAsync(id, top, content, context).ConfigureAwait(false); return response; } @@ -432,7 +435,8 @@ public virtual Response SpreadAliasWithModel(string id, int top, Thing thing, Ca Argument.AssertNotNull(thing, nameof(thing)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = SpreadAliasWithModel(id, top, thing.ToRequestContent(), context); + using RequestContent content = thing.ToRequestContent(); + Response response = SpreadAliasWithModel(id, top, content, context); return response; } diff --git a/test/TestProjects/Spread-TypeSpec/tests/Generated/Samples/Samples_SpreadTypeSpecClient.cs b/test/TestProjects/Spread-TypeSpec/tests/Generated/Samples/Samples_SpreadTypeSpecClient.cs index 4c83e57a8f5..bb587698658 100644 --- a/test/TestProjects/Spread-TypeSpec/tests/Generated/Samples/Samples_SpreadTypeSpecClient.cs +++ b/test/TestProjects/Spread-TypeSpec/tests/Generated/Samples/Samples_SpreadTypeSpecClient.cs @@ -25,7 +25,7 @@ public void Example_SpreadModel_ShortVersion() Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", age = 1234, @@ -42,7 +42,7 @@ public async Task Example_SpreadModel_ShortVersion_Async() Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", age = 1234, @@ -81,7 +81,7 @@ public void Example_SpreadModel_AllParameters() Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", age = 1234, @@ -98,7 +98,7 @@ public async Task Example_SpreadModel_AllParameters_Async() Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", age = 1234, @@ -137,7 +137,7 @@ public void Example_SpreadAlias_ShortVersion() Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", age = 1234, @@ -154,7 +154,7 @@ public async Task Example_SpreadAlias_ShortVersion_Async() Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", age = 1234, @@ -191,7 +191,7 @@ public void Example_SpreadAlias_AllParameters() Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", age = 1234, @@ -208,7 +208,7 @@ public async Task Example_SpreadAlias_AllParameters_Async() Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", age = 1234, @@ -245,7 +245,7 @@ public void Example_SpreadMultiTargetAlias_ShortVersion() Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", age = 1234, @@ -262,7 +262,7 @@ public async Task Example_SpreadMultiTargetAlias_ShortVersion_Async() Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", age = 1234, @@ -299,7 +299,7 @@ public void Example_SpreadMultiTargetAlias_AllParameters() Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", age = 1234, @@ -316,7 +316,7 @@ public async Task Example_SpreadMultiTargetAlias_AllParameters_Async() Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", age = 1234, @@ -353,7 +353,7 @@ public void Example_SpreadAliasWithModel_ShortVersion() Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", age = 1234, @@ -370,7 +370,7 @@ public async Task Example_SpreadAliasWithModel_ShortVersion_Async() Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", age = 1234, @@ -409,7 +409,7 @@ public void Example_SpreadAliasWithModel_AllParameters() Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", age = 1234, @@ -426,7 +426,7 @@ public async Task Example_SpreadAliasWithModel_AllParameters_Async() Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", age = 1234, @@ -465,7 +465,7 @@ public void Example_SpreadAliasWithSpreadAlias_ShortVersion() Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", age = 1234, @@ -482,7 +482,7 @@ public async Task Example_SpreadAliasWithSpreadAlias_ShortVersion_Async() Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", age = 1234, @@ -519,7 +519,7 @@ public void Example_SpreadAliasWithSpreadAlias_AllParameters() Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", age = 1234, @@ -536,7 +536,7 @@ public async Task Example_SpreadAliasWithSpreadAlias_AllParameters_Async() Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", age = 1234, @@ -573,7 +573,7 @@ public void Example_SpreadAliasWithOptionalProps_ShortVersion() Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", items = new object[] @@ -593,7 +593,7 @@ public async Task Example_SpreadAliasWithOptionalProps_ShortVersion_Async() Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", items = new object[] @@ -633,7 +633,7 @@ public void Example_SpreadAliasWithOptionalProps_AllParameters() Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", color = "", @@ -659,7 +659,7 @@ public async Task Example_SpreadAliasWithOptionalProps_AllParameters_Async() Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", color = "", @@ -705,7 +705,7 @@ public void Example_SpreadAliasWithCollections_ShortVersion() Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredStringList = new object[] { @@ -724,7 +724,7 @@ public async Task Example_SpreadAliasWithCollections_ShortVersion_Async() Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredStringList = new object[] { @@ -763,7 +763,7 @@ public void Example_SpreadAliasWithCollections_AllParameters() Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredStringList = new object[] { @@ -786,7 +786,7 @@ public async Task Example_SpreadAliasWithCollections_AllParameters_Async() Uri endpoint = new Uri(""); SpreadTypeSpecClient client = new SpreadTypeSpecClient(endpoint); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredStringList = new object[] { diff --git a/test/TestProjects/sdk/newprojecttypespec/Azure.NewProject.TypeSpec/src/Generated/Docs/NewProjectTypeSpecClient.xml b/test/TestProjects/sdk/newprojecttypespec/Azure.NewProject.TypeSpec/src/Generated/Docs/NewProjectTypeSpecClient.xml index 1117c14562f..dab32c522e4 100644 --- a/test/TestProjects/sdk/newprojecttypespec/Azure.NewProject.TypeSpec/src/Generated/Docs/NewProjectTypeSpecClient.xml +++ b/test/TestProjects/sdk/newprojecttypespec/Azure.NewProject.TypeSpec/src/Generated/Docs/NewProjectTypeSpecClient.xml @@ -173,7 +173,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", requiredUnion = "", @@ -200,7 +200,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", requiredUnion = "", @@ -238,7 +238,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", requiredUnion = "", @@ -265,7 +265,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", requiredUnion = "", @@ -303,7 +303,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", requiredUnion = "", @@ -330,7 +330,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", requiredUnion = "", @@ -368,7 +368,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", requiredUnion = "", @@ -395,7 +395,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", requiredUnion = "", @@ -475,7 +475,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", }); @@ -490,7 +490,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", }); @@ -508,7 +508,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", }); @@ -523,7 +523,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", }); @@ -629,7 +629,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { sourceUrl = "http://localhost:3000", guid = "73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a", @@ -644,7 +644,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { sourceUrl = "http://localhost:3000", guid = "73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a", @@ -662,7 +662,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { sourceUrl = "http://localhost:3000", guid = "73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a", @@ -677,7 +677,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { sourceUrl = "http://localhost:3000", guid = "73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a", @@ -777,7 +777,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -829,7 +829,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -930,7 +930,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -982,7 +982,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -1083,7 +1083,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -1135,7 +1135,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -1236,7 +1236,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -1288,7 +1288,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -1471,7 +1471,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", requiredUnion = "", @@ -1498,7 +1498,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", requiredUnion = "", @@ -1536,7 +1536,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", requiredUnion = "", @@ -1563,7 +1563,7 @@ Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", requiredUnion = "", diff --git a/test/TestProjects/sdk/newprojecttypespec/Azure.NewProject.TypeSpec/src/Generated/NewProjectTypeSpecClient.cs b/test/TestProjects/sdk/newprojecttypespec/Azure.NewProject.TypeSpec/src/Generated/NewProjectTypeSpecClient.cs index 9b6ae13679c..a1f18741454 100644 --- a/test/TestProjects/sdk/newprojecttypespec/Azure.NewProject.TypeSpec/src/Generated/NewProjectTypeSpecClient.cs +++ b/test/TestProjects/sdk/newprojecttypespec/Azure.NewProject.TypeSpec/src/Generated/NewProjectTypeSpecClient.cs @@ -311,7 +311,8 @@ internal virtual async Task> AnonymousBodyAsync(Thing thing, Can Argument.AssertNotNull(thing, nameof(thing)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await AnonymousBodyAsync(thing.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = thing.ToRequestContent(); + Response response = await AnonymousBodyAsync(content, context).ConfigureAwait(false); return Response.FromValue(Thing.FromResponse(response), response); } @@ -324,7 +325,8 @@ internal virtual Response AnonymousBody(Thing thing, CancellationToken ca Argument.AssertNotNull(thing, nameof(thing)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = AnonymousBody(thing.ToRequestContent(), context); + using RequestContent content = thing.ToRequestContent(); + Response response = AnonymousBody(content, context); return Response.FromValue(Thing.FromResponse(response), response); } @@ -408,7 +410,8 @@ public virtual async Task> FriendlyModelAsync(Friend notFriend, Argument.AssertNotNull(notFriend, nameof(notFriend)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await FriendlyModelAsync(notFriend.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = notFriend.ToRequestContent(); + Response response = await FriendlyModelAsync(content, context).ConfigureAwait(false); return Response.FromValue(Friend.FromResponse(response), response); } @@ -422,7 +425,8 @@ public virtual Response FriendlyModel(Friend notFriend, CancellationToke Argument.AssertNotNull(notFriend, nameof(notFriend)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = FriendlyModel(notFriend.ToRequestContent(), context); + using RequestContent content = notFriend.ToRequestContent(); + Response response = FriendlyModel(content, context); return Response.FromValue(Friend.FromResponse(response), response); } @@ -575,7 +579,8 @@ public virtual async Task StringFormatAsync(Guid subscriptionId, Model Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await StringFormatAsync(subscriptionId, body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await StringFormatAsync(subscriptionId, content, context).ConfigureAwait(false); return response; } @@ -590,7 +595,8 @@ public virtual Response StringFormat(Guid subscriptionId, ModelWithFormat body, Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = StringFormat(subscriptionId, body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = StringFormat(subscriptionId, content, context); return response; } @@ -762,7 +768,8 @@ internal virtual async Task> HelloAgainAsync(string p2, Argument.AssertNotNull(action, nameof(action)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await HelloAgainAsync(p2, p1, action.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = action.ToRequestContent(); + Response response = await HelloAgainAsync(p2, p1, content, context).ConfigureAwait(false); return Response.FromValue(RoundTripModel.FromResponse(response), response); } @@ -780,7 +787,8 @@ internal virtual Response HelloAgain(string p2, string p1, Round Argument.AssertNotNull(action, nameof(action)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = HelloAgain(p2, p1, action.ToRequestContent(), context); + using RequestContent content = action.ToRequestContent(); + Response response = HelloAgain(p2, p1, content, context); return Response.FromValue(RoundTripModel.FromResponse(response), response); } @@ -1031,7 +1039,8 @@ internal virtual async Task> CreateLiteralAsync(Thing body, Canc Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await CreateLiteralAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await CreateLiteralAsync(content, context).ConfigureAwait(false); return Response.FromValue(Thing.FromResponse(response), response); } @@ -1044,7 +1053,8 @@ internal virtual Response CreateLiteral(Thing body, CancellationToken can Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = CreateLiteral(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = CreateLiteral(content, context); return Response.FromValue(Thing.FromResponse(response), response); } @@ -1267,7 +1277,8 @@ internal virtual async Task> InternalProtocolAsync(Thing body, C Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await InternalProtocolAsync(body.ToRequestContent(), context).ConfigureAwait(false); + using RequestContent content = body.ToRequestContent(); + Response response = await InternalProtocolAsync(content, context).ConfigureAwait(false); return Response.FromValue(Thing.FromResponse(response), response); } @@ -1280,7 +1291,8 @@ internal virtual Response InternalProtocol(Thing body, CancellationToken Argument.AssertNotNull(body, nameof(body)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = InternalProtocol(body.ToRequestContent(), context); + using RequestContent content = body.ToRequestContent(); + Response response = InternalProtocol(content, context); return Response.FromValue(Thing.FromResponse(response), response); } diff --git a/test/TestProjects/sdk/newprojecttypespec/Azure.NewProject.TypeSpec/tests/Generated/Samples/Samples_NewProjectTypeSpecClient.cs b/test/TestProjects/sdk/newprojecttypespec/Azure.NewProject.TypeSpec/tests/Generated/Samples/Samples_NewProjectTypeSpecClient.cs index a517b9b3429..cba0d2ce14a 100644 --- a/test/TestProjects/sdk/newprojecttypespec/Azure.NewProject.TypeSpec/tests/Generated/Samples/Samples_NewProjectTypeSpecClient.cs +++ b/test/TestProjects/sdk/newprojecttypespec/Azure.NewProject.TypeSpec/tests/Generated/Samples/Samples_NewProjectTypeSpecClient.cs @@ -203,7 +203,7 @@ public void Example_PatchAction_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", requiredUnion = "", @@ -233,7 +233,7 @@ public async Task Example_PatchAction_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", requiredUnion = "", @@ -263,7 +263,7 @@ public void Example_PatchAction_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", requiredUnion = "", @@ -301,7 +301,7 @@ public async Task Example_PatchAction_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", requiredUnion = "", @@ -339,7 +339,7 @@ public void Example_AnonymousBody_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", requiredUnion = "", @@ -369,7 +369,7 @@ public async Task Example_AnonymousBody_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", requiredUnion = "", @@ -399,7 +399,7 @@ public void Example_AnonymousBody_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", requiredUnion = "", @@ -437,7 +437,7 @@ public async Task Example_AnonymousBody_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", requiredUnion = "", @@ -475,7 +475,7 @@ public void Example_FriendlyModel_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", }); @@ -493,7 +493,7 @@ public async Task Example_FriendlyModel_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", }); @@ -535,7 +535,7 @@ public void Example_FriendlyModel_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", }); @@ -553,7 +553,7 @@ public async Task Example_FriendlyModel_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", }); @@ -647,7 +647,7 @@ public void Example_StringFormat_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { sourceUrl = "http://localhost:3000", guid = "73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a", @@ -665,7 +665,7 @@ public async Task Example_StringFormat_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { sourceUrl = "http://localhost:3000", guid = "73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a", @@ -707,7 +707,7 @@ public void Example_StringFormat_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { sourceUrl = "http://localhost:3000", guid = "73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a", @@ -725,7 +725,7 @@ public async Task Example_StringFormat_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { sourceUrl = "http://localhost:3000", guid = "73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a", @@ -855,7 +855,7 @@ public void Example_HelloAgain_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -910,7 +910,7 @@ public async Task Example_HelloAgain_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -965,7 +965,7 @@ public void Example_HelloAgain_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -1066,7 +1066,7 @@ public async Task Example_HelloAgain_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -1167,7 +1167,7 @@ public void Example_NoContentType_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -1222,7 +1222,7 @@ public async Task Example_NoContentType_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -1277,7 +1277,7 @@ public void Example_NoContentType_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -1378,7 +1378,7 @@ public async Task Example_NoContentType_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { requiredString = "", requiredInt = 1234, @@ -1567,7 +1567,7 @@ public void Example_CreateLiteral_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", requiredUnion = "", @@ -1597,7 +1597,7 @@ public async Task Example_CreateLiteral_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", requiredUnion = "", @@ -1627,7 +1627,7 @@ public void Example_CreateLiteral_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", requiredUnion = "", @@ -1665,7 +1665,7 @@ public async Task Example_CreateLiteral_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); NewProjectTypeSpecClient client = new NewProjectTypeSpecClient(endpoint, credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", requiredUnion = "", diff --git a/test/TestServerProjectsLowLevel/body-array/src/Generated/Docs/ArrayClient.xml b/test/TestServerProjectsLowLevel/body-array/src/Generated/Docs/ArrayClient.xml index 8be2e4b1ee4..480dd465f81 100644 --- a/test/TestServerProjectsLowLevel/body-array/src/Generated/Docs/ArrayClient.xml +++ b/test/TestServerProjectsLowLevel/body-array/src/Generated/Docs/ArrayClient.xml @@ -146,7 +146,7 @@ This sample shows how to call PutEmptyAsync. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { "" }); @@ -159,7 +159,7 @@ This sample shows how to call PutEmptyAsync with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { "" }); @@ -175,7 +175,7 @@ This sample shows how to call PutEmpty. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { "" }); @@ -188,7 +188,7 @@ This sample shows how to call PutEmpty with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { "" }); @@ -250,7 +250,7 @@ This sample shows how to call PutBooleanTfftAsync. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { true }); @@ -263,7 +263,7 @@ This sample shows how to call PutBooleanTfftAsync with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { true }); @@ -279,7 +279,7 @@ This sample shows how to call PutBooleanTfft. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { true }); @@ -292,7 +292,7 @@ This sample shows how to call PutBooleanTfft with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { true }); @@ -446,7 +446,7 @@ This sample shows how to call PutIntegerValidAsync. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { 1234 }); @@ -459,7 +459,7 @@ This sample shows how to call PutIntegerValidAsync with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { 1234 }); @@ -475,7 +475,7 @@ This sample shows how to call PutIntegerValid. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { 1234 }); @@ -488,7 +488,7 @@ This sample shows how to call PutIntegerValid with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { 1234 }); @@ -642,7 +642,7 @@ This sample shows how to call PutLongValidAsync. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { 1234L }); @@ -655,7 +655,7 @@ This sample shows how to call PutLongValidAsync with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { 1234L }); @@ -671,7 +671,7 @@ This sample shows how to call PutLongValid. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { 1234L }); @@ -684,7 +684,7 @@ This sample shows how to call PutLongValid with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { 1234L }); @@ -838,7 +838,7 @@ This sample shows how to call PutFloatValidAsync. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { 123.45F }); @@ -851,7 +851,7 @@ This sample shows how to call PutFloatValidAsync with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { 123.45F }); @@ -867,7 +867,7 @@ This sample shows how to call PutFloatValid. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { 123.45F }); @@ -880,7 +880,7 @@ This sample shows how to call PutFloatValid with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { 123.45F }); @@ -1034,7 +1034,7 @@ This sample shows how to call PutDoubleValidAsync. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { 123.45 }); @@ -1047,7 +1047,7 @@ This sample shows how to call PutDoubleValidAsync with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { 123.45 }); @@ -1063,7 +1063,7 @@ This sample shows how to call PutDoubleValid. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { 123.45 }); @@ -1076,7 +1076,7 @@ This sample shows how to call PutDoubleValid with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { 123.45 }); @@ -1230,7 +1230,7 @@ This sample shows how to call PutStringValidAsync. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { "" }); @@ -1243,7 +1243,7 @@ This sample shows how to call PutStringValidAsync with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { "" }); @@ -1259,7 +1259,7 @@ This sample shows how to call PutStringValid. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { "" }); @@ -1272,7 +1272,7 @@ This sample shows how to call PutStringValid with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { "" }); @@ -1334,7 +1334,7 @@ This sample shows how to call PutEnumValidAsync. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { "foo1" }); @@ -1347,7 +1347,7 @@ This sample shows how to call PutEnumValidAsync with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { "foo1" }); @@ -1363,7 +1363,7 @@ This sample shows how to call PutEnumValid. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { "foo1" }); @@ -1376,7 +1376,7 @@ This sample shows how to call PutEnumValid with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { "foo1" }); @@ -1438,7 +1438,7 @@ This sample shows how to call PutStringEnumValidAsync. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { "foo1" }); @@ -1451,7 +1451,7 @@ This sample shows how to call PutStringEnumValidAsync with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { "foo1" }); @@ -1467,7 +1467,7 @@ This sample shows how to call PutStringEnumValid. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { "foo1" }); @@ -1480,7 +1480,7 @@ This sample shows how to call PutStringEnumValid with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { "foo1" }); @@ -1634,7 +1634,7 @@ This sample shows how to call PutUuidValidAsync. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { "73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a" }); @@ -1647,7 +1647,7 @@ This sample shows how to call PutUuidValidAsync with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { "73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a" }); @@ -1663,7 +1663,7 @@ This sample shows how to call PutUuidValid. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { "73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a" }); @@ -1676,7 +1676,7 @@ This sample shows how to call PutUuidValid with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { "73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a" }); @@ -1784,7 +1784,7 @@ This sample shows how to call PutDateValidAsync. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { "2022-05-10" }); @@ -1797,7 +1797,7 @@ This sample shows how to call PutDateValidAsync with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { "2022-05-10" }); @@ -1813,7 +1813,7 @@ This sample shows how to call PutDateValid. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { "2022-05-10" }); @@ -1826,7 +1826,7 @@ This sample shows how to call PutDateValid with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { "2022-05-10" }); @@ -1980,7 +1980,7 @@ This sample shows how to call PutDateTimeValidAsync. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { "2022-05-10T18:57:31.2311892Z" }); @@ -1993,7 +1993,7 @@ This sample shows how to call PutDateTimeValidAsync with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { "2022-05-10T18:57:31.2311892Z" }); @@ -2009,7 +2009,7 @@ This sample shows how to call PutDateTimeValid. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { "2022-05-10T18:57:31.2311892Z" }); @@ -2022,7 +2022,7 @@ This sample shows how to call PutDateTimeValid with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { "2022-05-10T18:57:31.2311892Z" }); @@ -2176,7 +2176,7 @@ This sample shows how to call PutDateTimeRfc1123ValidAsync. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { "Tue, 10 May 2022 18:57:31 GMT" }); @@ -2189,7 +2189,7 @@ This sample shows how to call PutDateTimeRfc1123ValidAsync with all request cont AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { "Tue, 10 May 2022 18:57:31 GMT" }); @@ -2205,7 +2205,7 @@ This sample shows how to call PutDateTimeRfc1123Valid. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { "Tue, 10 May 2022 18:57:31 GMT" }); @@ -2218,7 +2218,7 @@ This sample shows how to call PutDateTimeRfc1123Valid with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { "Tue, 10 May 2022 18:57:31 GMT" }); @@ -2280,7 +2280,7 @@ This sample shows how to call PutDurationValidAsync. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { "PT1H23M45S" }); @@ -2293,7 +2293,7 @@ This sample shows how to call PutDurationValidAsync with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { "PT1H23M45S" }); @@ -2309,7 +2309,7 @@ This sample shows how to call PutDurationValid. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { "PT1H23M45S" }); @@ -2322,7 +2322,7 @@ This sample shows how to call PutDurationValid with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { "PT1H23M45S" }); @@ -2384,7 +2384,7 @@ This sample shows how to call PutByteValidAsync. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { new object() }); @@ -2397,7 +2397,7 @@ This sample shows how to call PutByteValidAsync with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { new object() }); @@ -2413,7 +2413,7 @@ This sample shows how to call PutByteValid. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { new object() }); @@ -2426,7 +2426,7 @@ This sample shows how to call PutByteValid with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { new object() }); @@ -2774,7 +2774,7 @@ This sample shows how to call PutComplexValidAsync. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { new object() }); @@ -2787,7 +2787,7 @@ This sample shows how to call PutComplexValidAsync with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { new Dictionary { @@ -2807,7 +2807,7 @@ This sample shows how to call PutComplexValid. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { new object() }); @@ -2820,7 +2820,7 @@ This sample shows how to call PutComplexValid with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { new Dictionary { @@ -3070,7 +3070,7 @@ This sample shows how to call PutArrayValidAsync. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { new object[] { @@ -3086,7 +3086,7 @@ This sample shows how to call PutArrayValidAsync with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { new object[] { @@ -3105,7 +3105,7 @@ This sample shows how to call PutArrayValid. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { new object[] { @@ -3121,7 +3121,7 @@ This sample shows how to call PutArrayValid with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { new object[] { @@ -3370,7 +3370,7 @@ This sample shows how to call PutDictionaryValidAsync. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { new { @@ -3386,7 +3386,7 @@ This sample shows how to call PutDictionaryValidAsync with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { new { @@ -3405,7 +3405,7 @@ This sample shows how to call PutDictionaryValid. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { new { @@ -3421,7 +3421,7 @@ This sample shows how to call PutDictionaryValid with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object[] +using RequestContent content = RequestContent.Create(new object[] { new { diff --git a/test/TestServerProjectsLowLevel/body-array/tests/Generated/Samples/Samples_ArrayClient.cs b/test/TestServerProjectsLowLevel/body-array/tests/Generated/Samples/Samples_ArrayClient.cs index 8e93d0803a9..824805a33c5 100644 --- a/test/TestServerProjectsLowLevel/body-array/tests/Generated/Samples/Samples_ArrayClient.cs +++ b/test/TestServerProjectsLowLevel/body-array/tests/Generated/Samples/Samples_ArrayClient.cs @@ -182,7 +182,7 @@ public void Example_PutEmpty_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { "" }); @@ -198,7 +198,7 @@ public async Task Example_PutEmpty_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { "" }); @@ -214,7 +214,7 @@ public void Example_PutEmpty_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { "" }); @@ -230,7 +230,7 @@ public async Task Example_PutEmpty_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { "" }); @@ -298,7 +298,7 @@ public void Example_PutBooleanTfft_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { true }); @@ -314,7 +314,7 @@ public async Task Example_PutBooleanTfft_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { true }); @@ -330,7 +330,7 @@ public void Example_PutBooleanTfft_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { true }); @@ -346,7 +346,7 @@ public async Task Example_PutBooleanTfft_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { true }); @@ -518,7 +518,7 @@ public void Example_PutIntegerValid_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { 1234 }); @@ -534,7 +534,7 @@ public async Task Example_PutIntegerValid_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { 1234 }); @@ -550,7 +550,7 @@ public void Example_PutIntegerValid_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { 1234 }); @@ -566,7 +566,7 @@ public async Task Example_PutIntegerValid_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { 1234 }); @@ -738,7 +738,7 @@ public void Example_PutLongValid_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { 1234L }); @@ -754,7 +754,7 @@ public async Task Example_PutLongValid_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { 1234L }); @@ -770,7 +770,7 @@ public void Example_PutLongValid_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { 1234L }); @@ -786,7 +786,7 @@ public async Task Example_PutLongValid_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { 1234L }); @@ -958,7 +958,7 @@ public void Example_PutFloatValid_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { 123.45F }); @@ -974,7 +974,7 @@ public async Task Example_PutFloatValid_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { 123.45F }); @@ -990,7 +990,7 @@ public void Example_PutFloatValid_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { 123.45F }); @@ -1006,7 +1006,7 @@ public async Task Example_PutFloatValid_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { 123.45F }); @@ -1178,7 +1178,7 @@ public void Example_PutDoubleValid_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { 123.45 }); @@ -1194,7 +1194,7 @@ public async Task Example_PutDoubleValid_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { 123.45 }); @@ -1210,7 +1210,7 @@ public void Example_PutDoubleValid_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { 123.45 }); @@ -1226,7 +1226,7 @@ public async Task Example_PutDoubleValid_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { 123.45 }); @@ -1398,7 +1398,7 @@ public void Example_PutStringValid_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { "" }); @@ -1414,7 +1414,7 @@ public async Task Example_PutStringValid_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { "" }); @@ -1430,7 +1430,7 @@ public void Example_PutStringValid_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { "" }); @@ -1446,7 +1446,7 @@ public async Task Example_PutStringValid_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { "" }); @@ -1514,7 +1514,7 @@ public void Example_PutEnumValid_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { "foo1" }); @@ -1530,7 +1530,7 @@ public async Task Example_PutEnumValid_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { "foo1" }); @@ -1546,7 +1546,7 @@ public void Example_PutEnumValid_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { "foo1" }); @@ -1562,7 +1562,7 @@ public async Task Example_PutEnumValid_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { "foo1" }); @@ -1630,7 +1630,7 @@ public void Example_PutStringEnumValid_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { "foo1" }); @@ -1646,7 +1646,7 @@ public async Task Example_PutStringEnumValid_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { "foo1" }); @@ -1662,7 +1662,7 @@ public void Example_PutStringEnumValid_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { "foo1" }); @@ -1678,7 +1678,7 @@ public async Task Example_PutStringEnumValid_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { "foo1" }); @@ -1850,7 +1850,7 @@ public void Example_PutUuidValid_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { "73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a" }); @@ -1866,7 +1866,7 @@ public async Task Example_PutUuidValid_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { "73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a" }); @@ -1882,7 +1882,7 @@ public void Example_PutUuidValid_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { "73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a" }); @@ -1898,7 +1898,7 @@ public async Task Example_PutUuidValid_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { "73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a" }); @@ -2018,7 +2018,7 @@ public void Example_PutDateValid_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { "2022-05-10" }); @@ -2034,7 +2034,7 @@ public async Task Example_PutDateValid_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { "2022-05-10" }); @@ -2050,7 +2050,7 @@ public void Example_PutDateValid_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { "2022-05-10" }); @@ -2066,7 +2066,7 @@ public async Task Example_PutDateValid_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { "2022-05-10" }); @@ -2238,7 +2238,7 @@ public void Example_PutDateTimeValid_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { "2022-05-10T18:57:31.2311892Z" }); @@ -2254,7 +2254,7 @@ public async Task Example_PutDateTimeValid_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { "2022-05-10T18:57:31.2311892Z" }); @@ -2270,7 +2270,7 @@ public void Example_PutDateTimeValid_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { "2022-05-10T18:57:31.2311892Z" }); @@ -2286,7 +2286,7 @@ public async Task Example_PutDateTimeValid_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { "2022-05-10T18:57:31.2311892Z" }); @@ -2458,7 +2458,7 @@ public void Example_PutDateTimeRfc1123Valid_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { "Tue, 10 May 2022 18:57:31 GMT" }); @@ -2474,7 +2474,7 @@ public async Task Example_PutDateTimeRfc1123Valid_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { "Tue, 10 May 2022 18:57:31 GMT" }); @@ -2490,7 +2490,7 @@ public void Example_PutDateTimeRfc1123Valid_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { "Tue, 10 May 2022 18:57:31 GMT" }); @@ -2506,7 +2506,7 @@ public async Task Example_PutDateTimeRfc1123Valid_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { "Tue, 10 May 2022 18:57:31 GMT" }); @@ -2574,7 +2574,7 @@ public void Example_PutDurationValid_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { "PT1H23M45S" }); @@ -2590,7 +2590,7 @@ public async Task Example_PutDurationValid_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { "PT1H23M45S" }); @@ -2606,7 +2606,7 @@ public void Example_PutDurationValid_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { "PT1H23M45S" }); @@ -2622,7 +2622,7 @@ public async Task Example_PutDurationValid_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { "PT1H23M45S" }); @@ -2690,7 +2690,7 @@ public void Example_PutByteValid_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { new object() }); @@ -2706,7 +2706,7 @@ public async Task Example_PutByteValid_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { new object() }); @@ -2722,7 +2722,7 @@ public void Example_PutByteValid_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { new object() }); @@ -2738,7 +2738,7 @@ public async Task Example_PutByteValid_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { new object() }); @@ -3128,7 +3128,7 @@ public void Example_PutComplexValid_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { new object() }); @@ -3144,7 +3144,7 @@ public async Task Example_PutComplexValid_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { new object() }); @@ -3160,7 +3160,7 @@ public void Example_PutComplexValid_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { new Dictionary { @@ -3180,7 +3180,7 @@ public async Task Example_PutComplexValid_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { new Dictionary { @@ -3460,7 +3460,7 @@ public void Example_PutArrayValid_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { new object[] { @@ -3479,7 +3479,7 @@ public async Task Example_PutArrayValid_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { new object[] { @@ -3498,7 +3498,7 @@ public void Example_PutArrayValid_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { new object[] { @@ -3517,7 +3517,7 @@ public async Task Example_PutArrayValid_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { new object[] { @@ -3796,7 +3796,7 @@ public void Example_PutDictionaryValid_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { new { @@ -3815,7 +3815,7 @@ public async Task Example_PutDictionaryValid_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { new { @@ -3834,7 +3834,7 @@ public void Example_PutDictionaryValid_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { new { @@ -3853,7 +3853,7 @@ public async Task Example_PutDictionaryValid_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object[] + using RequestContent content = RequestContent.Create(new object[] { new { diff --git a/test/TestServerProjectsLowLevel/body-complex/src/Generated/Docs/ArrayClient.xml b/test/TestServerProjectsLowLevel/body-complex/src/Generated/Docs/ArrayClient.xml index c0c884bf1b9..ff9b86dbef0 100644 --- a/test/TestServerProjectsLowLevel/body-complex/src/Generated/Docs/ArrayClient.xml +++ b/test/TestServerProjectsLowLevel/body-complex/src/Generated/Docs/ArrayClient.xml @@ -54,7 +54,7 @@ This sample shows how to call PutValidAsync. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutValidAsync(content); Console.WriteLine(response.Status); @@ -64,7 +64,7 @@ This sample shows how to call PutValidAsync with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { array = new object[] { @@ -83,7 +83,7 @@ This sample shows how to call PutValid. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = client.PutValid(content); Console.WriteLine(response.Status); @@ -93,7 +93,7 @@ This sample shows how to call PutValid with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { array = new object[] { @@ -158,7 +158,7 @@ This sample shows how to call PutEmptyAsync. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutEmptyAsync(content); Console.WriteLine(response.Status); @@ -168,7 +168,7 @@ This sample shows how to call PutEmptyAsync with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { array = new object[] { @@ -187,7 +187,7 @@ This sample shows how to call PutEmpty. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = client.PutEmpty(content); Console.WriteLine(response.Status); @@ -197,7 +197,7 @@ This sample shows how to call PutEmpty with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { array = new object[] { diff --git a/test/TestServerProjectsLowLevel/body-complex/src/Generated/Docs/BasicClient.xml b/test/TestServerProjectsLowLevel/body-complex/src/Generated/Docs/BasicClient.xml index b347132318f..d46e70d62d8 100644 --- a/test/TestServerProjectsLowLevel/body-complex/src/Generated/Docs/BasicClient.xml +++ b/test/TestServerProjectsLowLevel/body-complex/src/Generated/Docs/BasicClient.xml @@ -58,7 +58,7 @@ This sample shows how to call PutValidAsync. AzureKeyCredential credential = new AzureKeyCredential(""); BasicClient client = new BasicClient(credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutValidAsync(content); Console.WriteLine(response.Status); @@ -68,7 +68,7 @@ This sample shows how to call PutValidAsync with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); BasicClient client = new BasicClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { id = 1234, name = "", @@ -86,7 +86,7 @@ This sample shows how to call PutValid. AzureKeyCredential credential = new AzureKeyCredential(""); BasicClient client = new BasicClient(credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = client.PutValid(content); Console.WriteLine(response.Status); @@ -96,7 +96,7 @@ This sample shows how to call PutValid with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); BasicClient client = new BasicClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { id = 1234, name = "", diff --git a/test/TestServerProjectsLowLevel/body-complex/src/Generated/Docs/DictionaryClient.xml b/test/TestServerProjectsLowLevel/body-complex/src/Generated/Docs/DictionaryClient.xml index 64fc2e8aa1e..81cdd1f17cb 100644 --- a/test/TestServerProjectsLowLevel/body-complex/src/Generated/Docs/DictionaryClient.xml +++ b/test/TestServerProjectsLowLevel/body-complex/src/Generated/Docs/DictionaryClient.xml @@ -54,7 +54,7 @@ This sample shows how to call PutValidAsync. AzureKeyCredential credential = new AzureKeyCredential(""); DictionaryClient client = new DictionaryClient(credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutValidAsync(content); Console.WriteLine(response.Status); @@ -64,7 +64,7 @@ This sample shows how to call PutValidAsync with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); DictionaryClient client = new DictionaryClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { defaultProgram = new { @@ -83,7 +83,7 @@ This sample shows how to call PutValid. AzureKeyCredential credential = new AzureKeyCredential(""); DictionaryClient client = new DictionaryClient(credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = client.PutValid(content); Console.WriteLine(response.Status); @@ -93,7 +93,7 @@ This sample shows how to call PutValid with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); DictionaryClient client = new DictionaryClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { defaultProgram = new { @@ -158,7 +158,7 @@ This sample shows how to call PutEmptyAsync. AzureKeyCredential credential = new AzureKeyCredential(""); DictionaryClient client = new DictionaryClient(credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutEmptyAsync(content); Console.WriteLine(response.Status); @@ -168,7 +168,7 @@ This sample shows how to call PutEmptyAsync with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); DictionaryClient client = new DictionaryClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { defaultProgram = new { @@ -187,7 +187,7 @@ This sample shows how to call PutEmpty. AzureKeyCredential credential = new AzureKeyCredential(""); DictionaryClient client = new DictionaryClient(credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = client.PutEmpty(content); Console.WriteLine(response.Status); @@ -197,7 +197,7 @@ This sample shows how to call PutEmpty with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); DictionaryClient client = new DictionaryClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { defaultProgram = new { diff --git a/test/TestServerProjectsLowLevel/body-complex/src/Generated/Docs/InheritanceClient.xml b/test/TestServerProjectsLowLevel/body-complex/src/Generated/Docs/InheritanceClient.xml index 6c29c02cc74..fb4f3c24b07 100644 --- a/test/TestServerProjectsLowLevel/body-complex/src/Generated/Docs/InheritanceClient.xml +++ b/test/TestServerProjectsLowLevel/body-complex/src/Generated/Docs/InheritanceClient.xml @@ -66,7 +66,7 @@ This sample shows how to call PutValidAsync. AzureKeyCredential credential = new AzureKeyCredential(""); InheritanceClient client = new InheritanceClient(credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutValidAsync(content); Console.WriteLine(response.Status); @@ -76,7 +76,7 @@ This sample shows how to call PutValidAsync with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); InheritanceClient client = new InheritanceClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { breed = "", color = "", @@ -104,7 +104,7 @@ This sample shows how to call PutValid. AzureKeyCredential credential = new AzureKeyCredential(""); InheritanceClient client = new InheritanceClient(credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = client.PutValid(content); Console.WriteLine(response.Status); @@ -114,7 +114,7 @@ This sample shows how to call PutValid with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); InheritanceClient client = new InheritanceClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { breed = "", color = "", diff --git a/test/TestServerProjectsLowLevel/body-complex/src/Generated/Docs/PolymorphicrecursiveClient.xml b/test/TestServerProjectsLowLevel/body-complex/src/Generated/Docs/PolymorphicrecursiveClient.xml index 1bef3a1c343..bb3974b9e8e 100644 --- a/test/TestServerProjectsLowLevel/body-complex/src/Generated/Docs/PolymorphicrecursiveClient.xml +++ b/test/TestServerProjectsLowLevel/body-complex/src/Generated/Docs/PolymorphicrecursiveClient.xml @@ -66,7 +66,7 @@ This sample shows how to call PutValidAsync. AzureKeyCredential credential = new AzureKeyCredential(""); PolymorphicrecursiveClient client = new PolymorphicrecursiveClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { fishtype = "salmon", length = 123.45F, @@ -80,7 +80,7 @@ This sample shows how to call PutValidAsync with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); PolymorphicrecursiveClient client = new PolymorphicrecursiveClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { location = "", iswild = true, @@ -104,7 +104,7 @@ This sample shows how to call PutValid. AzureKeyCredential credential = new AzureKeyCredential(""); PolymorphicrecursiveClient client = new PolymorphicrecursiveClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { fishtype = "salmon", length = 123.45F, @@ -118,7 +118,7 @@ This sample shows how to call PutValid with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); PolymorphicrecursiveClient client = new PolymorphicrecursiveClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { location = "", iswild = true, diff --git a/test/TestServerProjectsLowLevel/body-complex/src/Generated/Docs/PolymorphismClient.xml b/test/TestServerProjectsLowLevel/body-complex/src/Generated/Docs/PolymorphismClient.xml index 41f0ccd1e85..01c64271861 100644 --- a/test/TestServerProjectsLowLevel/body-complex/src/Generated/Docs/PolymorphismClient.xml +++ b/test/TestServerProjectsLowLevel/body-complex/src/Generated/Docs/PolymorphismClient.xml @@ -66,7 +66,7 @@ This sample shows how to call PutValidAsync. AzureKeyCredential credential = new AzureKeyCredential(""); PolymorphismClient client = new PolymorphismClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { fishtype = "salmon", length = 123.45F, @@ -80,7 +80,7 @@ This sample shows how to call PutValidAsync with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); PolymorphismClient client = new PolymorphismClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { location = "", iswild = true, @@ -104,7 +104,7 @@ This sample shows how to call PutValid. AzureKeyCredential credential = new AzureKeyCredential(""); PolymorphismClient client = new PolymorphismClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { fishtype = "salmon", length = 123.45F, @@ -118,7 +118,7 @@ This sample shows how to call PutValid with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); PolymorphismClient client = new PolymorphismClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { location = "", iswild = true, @@ -388,7 +388,7 @@ This sample shows how to call PutComplicatedAsync. AzureKeyCredential credential = new AzureKeyCredential(""); PolymorphismClient client = new PolymorphismClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { fishtype = "smart_salmon", length = 123.45F, @@ -402,7 +402,7 @@ This sample shows how to call PutComplicatedAsync with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); PolymorphismClient client = new PolymorphismClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { college_degree = "", location = "", @@ -438,7 +438,7 @@ This sample shows how to call PutComplicated. AzureKeyCredential credential = new AzureKeyCredential(""); PolymorphismClient client = new PolymorphismClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { fishtype = "smart_salmon", length = 123.45F, @@ -452,7 +452,7 @@ This sample shows how to call PutComplicated with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); PolymorphismClient client = new PolymorphismClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { college_degree = "", location = "", @@ -488,7 +488,7 @@ This sample shows how to call PutMissingDiscriminatorAsync and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); PolymorphismClient client = new PolymorphismClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { fishtype = "smart_salmon", length = 123.45F, @@ -504,7 +504,7 @@ This sample shows how to call PutMissingDiscriminatorAsync with all request cont AzureKeyCredential credential = new AzureKeyCredential(""); PolymorphismClient client = new PolymorphismClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { college_degree = "", location = "", @@ -548,7 +548,7 @@ This sample shows how to call PutMissingDiscriminator and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); PolymorphismClient client = new PolymorphismClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { fishtype = "smart_salmon", length = 123.45F, @@ -564,7 +564,7 @@ This sample shows how to call PutMissingDiscriminator with all request content a AzureKeyCredential credential = new AzureKeyCredential(""); PolymorphismClient client = new PolymorphismClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { college_degree = "", location = "", @@ -608,7 +608,7 @@ This sample shows how to call PutValidMissingRequiredAsync. AzureKeyCredential credential = new AzureKeyCredential(""); PolymorphismClient client = new PolymorphismClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { fishtype = "salmon", length = 123.45F, @@ -622,7 +622,7 @@ This sample shows how to call PutValidMissingRequiredAsync with all request cont AzureKeyCredential credential = new AzureKeyCredential(""); PolymorphismClient client = new PolymorphismClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { location = "", iswild = true, @@ -646,7 +646,7 @@ This sample shows how to call PutValidMissingRequired. AzureKeyCredential credential = new AzureKeyCredential(""); PolymorphismClient client = new PolymorphismClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { fishtype = "salmon", length = 123.45F, @@ -660,7 +660,7 @@ This sample shows how to call PutValidMissingRequired with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); PolymorphismClient client = new PolymorphismClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { location = "", iswild = true, diff --git a/test/TestServerProjectsLowLevel/body-complex/src/Generated/Docs/PrimitiveClient.xml b/test/TestServerProjectsLowLevel/body-complex/src/Generated/Docs/PrimitiveClient.xml index 6ef753cf472..81aa44f38dd 100644 --- a/test/TestServerProjectsLowLevel/body-complex/src/Generated/Docs/PrimitiveClient.xml +++ b/test/TestServerProjectsLowLevel/body-complex/src/Generated/Docs/PrimitiveClient.xml @@ -56,7 +56,7 @@ This sample shows how to call PutIntAsync. AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutIntAsync(content); Console.WriteLine(response.Status); @@ -66,7 +66,7 @@ This sample shows how to call PutIntAsync with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { field1 = 1234, field2 = 1234, @@ -83,7 +83,7 @@ This sample shows how to call PutInt. AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = client.PutInt(content); Console.WriteLine(response.Status); @@ -93,7 +93,7 @@ This sample shows how to call PutInt with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { field1 = 1234, field2 = 1234, @@ -158,7 +158,7 @@ This sample shows how to call PutLongAsync. AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutLongAsync(content); Console.WriteLine(response.Status); @@ -168,7 +168,7 @@ This sample shows how to call PutLongAsync with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { field1 = 1234L, field2 = 1234L, @@ -185,7 +185,7 @@ This sample shows how to call PutLong. AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = client.PutLong(content); Console.WriteLine(response.Status); @@ -195,7 +195,7 @@ This sample shows how to call PutLong with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { field1 = 1234L, field2 = 1234L, @@ -260,7 +260,7 @@ This sample shows how to call PutFloatAsync. AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutFloatAsync(content); Console.WriteLine(response.Status); @@ -270,7 +270,7 @@ This sample shows how to call PutFloatAsync with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { field1 = 123.45F, field2 = 123.45F, @@ -287,7 +287,7 @@ This sample shows how to call PutFloat. AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = client.PutFloat(content); Console.WriteLine(response.Status); @@ -297,7 +297,7 @@ This sample shows how to call PutFloat with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { field1 = 123.45F, field2 = 123.45F, @@ -362,7 +362,7 @@ This sample shows how to call PutDoubleAsync. AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutDoubleAsync(content); Console.WriteLine(response.Status); @@ -372,7 +372,7 @@ This sample shows how to call PutDoubleAsync with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { field1 = 123.45, field_56_zeros_after_the_dot_and_negative_zero_before_dot_and_this_is_a_long_field_name_on_purpose = 123.45, @@ -389,7 +389,7 @@ This sample shows how to call PutDouble. AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = client.PutDouble(content); Console.WriteLine(response.Status); @@ -399,7 +399,7 @@ This sample shows how to call PutDouble with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { field1 = 123.45, field_56_zeros_after_the_dot_and_negative_zero_before_dot_and_this_is_a_long_field_name_on_purpose = 123.45, @@ -464,7 +464,7 @@ This sample shows how to call PutBoolAsync. AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutBoolAsync(content); Console.WriteLine(response.Status); @@ -474,7 +474,7 @@ This sample shows how to call PutBoolAsync with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { field_true = true, field_false = true, @@ -491,7 +491,7 @@ This sample shows how to call PutBool. AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = client.PutBool(content); Console.WriteLine(response.Status); @@ -501,7 +501,7 @@ This sample shows how to call PutBool with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { field_true = true, field_false = true, @@ -568,7 +568,7 @@ This sample shows how to call PutStringAsync. AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutStringAsync(content); Console.WriteLine(response.Status); @@ -578,7 +578,7 @@ This sample shows how to call PutStringAsync with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); -RequestContent content = RequestContent.Create(new Dictionary +using RequestContent content = RequestContent.Create(new Dictionary { ["field"] = "", ["empty"] = "", @@ -596,7 +596,7 @@ This sample shows how to call PutString. AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = client.PutString(content); Console.WriteLine(response.Status); @@ -606,7 +606,7 @@ This sample shows how to call PutString with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); -RequestContent content = RequestContent.Create(new Dictionary +using RequestContent content = RequestContent.Create(new Dictionary { ["field"] = "", ["empty"] = "", @@ -672,7 +672,7 @@ This sample shows how to call PutDateAsync. AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutDateAsync(content); Console.WriteLine(response.Status); @@ -682,7 +682,7 @@ This sample shows how to call PutDateAsync with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { field = "2022-05-10", leap = "2022-05-10", @@ -699,7 +699,7 @@ This sample shows how to call PutDate. AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = client.PutDate(content); Console.WriteLine(response.Status); @@ -709,7 +709,7 @@ This sample shows how to call PutDate with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { field = "2022-05-10", leap = "2022-05-10", @@ -774,7 +774,7 @@ This sample shows how to call PutDateTimeAsync. AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutDateTimeAsync(content); Console.WriteLine(response.Status); @@ -784,7 +784,7 @@ This sample shows how to call PutDateTimeAsync with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { field = "2022-05-10T18:57:31.2311892Z", now = "2022-05-10T18:57:31.2311892Z", @@ -801,7 +801,7 @@ This sample shows how to call PutDateTime. AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = client.PutDateTime(content); Console.WriteLine(response.Status); @@ -811,7 +811,7 @@ This sample shows how to call PutDateTime with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { field = "2022-05-10T18:57:31.2311892Z", now = "2022-05-10T18:57:31.2311892Z", @@ -876,7 +876,7 @@ This sample shows how to call PutDateTimeRfc1123Async. AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutDateTimeRfc1123Async(content); Console.WriteLine(response.Status); @@ -886,7 +886,7 @@ This sample shows how to call PutDateTimeRfc1123Async with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { field = "Tue, 10 May 2022 18:57:31 GMT", now = "Tue, 10 May 2022 18:57:31 GMT", @@ -903,7 +903,7 @@ This sample shows how to call PutDateTimeRfc1123. AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = client.PutDateTimeRfc1123(content); Console.WriteLine(response.Status); @@ -913,7 +913,7 @@ This sample shows how to call PutDateTimeRfc1123 with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { field = "Tue, 10 May 2022 18:57:31 GMT", now = "Tue, 10 May 2022 18:57:31 GMT", @@ -976,7 +976,7 @@ This sample shows how to call PutDurationAsync. AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutDurationAsync(content); Console.WriteLine(response.Status); @@ -986,7 +986,7 @@ This sample shows how to call PutDurationAsync with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { field = "PT1H23M45S", }); @@ -1002,7 +1002,7 @@ This sample shows how to call PutDuration. AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = client.PutDuration(content); Console.WriteLine(response.Status); @@ -1012,7 +1012,7 @@ This sample shows how to call PutDuration with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { field = "PT1H23M45S", }); @@ -1074,7 +1074,7 @@ This sample shows how to call PutByteAsync. AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutByteAsync(content); Console.WriteLine(response.Status); @@ -1084,7 +1084,7 @@ This sample shows how to call PutByteAsync with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { field = new object(), }); @@ -1100,7 +1100,7 @@ This sample shows how to call PutByte. AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = client.PutByte(content); Console.WriteLine(response.Status); @@ -1110,7 +1110,7 @@ This sample shows how to call PutByte with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { field = new object(), }); diff --git a/test/TestServerProjectsLowLevel/body-complex/src/Generated/Docs/ReadonlypropertyClient.xml b/test/TestServerProjectsLowLevel/body-complex/src/Generated/Docs/ReadonlypropertyClient.xml index eb8669ef7a6..e1a957393b0 100644 --- a/test/TestServerProjectsLowLevel/body-complex/src/Generated/Docs/ReadonlypropertyClient.xml +++ b/test/TestServerProjectsLowLevel/body-complex/src/Generated/Docs/ReadonlypropertyClient.xml @@ -56,7 +56,7 @@ This sample shows how to call PutValidAsync. AzureKeyCredential credential = new AzureKeyCredential(""); ReadonlypropertyClient client = new ReadonlypropertyClient(credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutValidAsync(content); Console.WriteLine(response.Status); @@ -66,7 +66,7 @@ This sample shows how to call PutValidAsync with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); ReadonlypropertyClient client = new ReadonlypropertyClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { size = 1234, }); @@ -82,7 +82,7 @@ This sample shows how to call PutValid. AzureKeyCredential credential = new AzureKeyCredential(""); ReadonlypropertyClient client = new ReadonlypropertyClient(credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = client.PutValid(content); Console.WriteLine(response.Status); @@ -92,7 +92,7 @@ This sample shows how to call PutValid with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); ReadonlypropertyClient client = new ReadonlypropertyClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { size = 1234, }); diff --git a/test/TestServerProjectsLowLevel/body-complex/tests/Generated/Samples/Samples_ArrayClient.cs b/test/TestServerProjectsLowLevel/body-complex/tests/Generated/Samples/Samples_ArrayClient.cs index 31c62381b77..0b581759a9d 100644 --- a/test/TestServerProjectsLowLevel/body-complex/tests/Generated/Samples/Samples_ArrayClient.cs +++ b/test/TestServerProjectsLowLevel/body-complex/tests/Generated/Samples/Samples_ArrayClient.cs @@ -77,7 +77,7 @@ public void Example_PutValid_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.PutValid(content); Console.WriteLine(response.Status); @@ -90,7 +90,7 @@ public async Task Example_PutValid_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutValidAsync(content); Console.WriteLine(response.Status); @@ -103,7 +103,7 @@ public void Example_PutValid_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { array = new object[] { @@ -122,7 +122,7 @@ public async Task Example_PutValid_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { array = new object[] { @@ -193,7 +193,7 @@ public void Example_PutEmpty_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.PutEmpty(content); Console.WriteLine(response.Status); @@ -206,7 +206,7 @@ public async Task Example_PutEmpty_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutEmptyAsync(content); Console.WriteLine(response.Status); @@ -219,7 +219,7 @@ public void Example_PutEmpty_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { array = new object[] { @@ -238,7 +238,7 @@ public async Task Example_PutEmpty_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); ArrayClient client = new ArrayClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { array = new object[] { diff --git a/test/TestServerProjectsLowLevel/body-complex/tests/Generated/Samples/Samples_BasicClient.cs b/test/TestServerProjectsLowLevel/body-complex/tests/Generated/Samples/Samples_BasicClient.cs index 4e5c0d5367d..47f06ef7633 100644 --- a/test/TestServerProjectsLowLevel/body-complex/tests/Generated/Samples/Samples_BasicClient.cs +++ b/test/TestServerProjectsLowLevel/body-complex/tests/Generated/Samples/Samples_BasicClient.cs @@ -81,7 +81,7 @@ public void Example_PutValid_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); BasicClient client = new BasicClient(credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.PutValid(content); Console.WriteLine(response.Status); @@ -94,7 +94,7 @@ public async Task Example_PutValid_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); BasicClient client = new BasicClient(credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutValidAsync(content); Console.WriteLine(response.Status); @@ -107,7 +107,7 @@ public void Example_PutValid_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); BasicClient client = new BasicClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { id = 1234, name = "", @@ -125,7 +125,7 @@ public async Task Example_PutValid_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); BasicClient client = new BasicClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { id = 1234, name = "", diff --git a/test/TestServerProjectsLowLevel/body-complex/tests/Generated/Samples/Samples_DictionaryClient.cs b/test/TestServerProjectsLowLevel/body-complex/tests/Generated/Samples/Samples_DictionaryClient.cs index a42a00087eb..bb66f02807f 100644 --- a/test/TestServerProjectsLowLevel/body-complex/tests/Generated/Samples/Samples_DictionaryClient.cs +++ b/test/TestServerProjectsLowLevel/body-complex/tests/Generated/Samples/Samples_DictionaryClient.cs @@ -77,7 +77,7 @@ public void Example_PutValid_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); DictionaryClient client = new DictionaryClient(credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.PutValid(content); Console.WriteLine(response.Status); @@ -90,7 +90,7 @@ public async Task Example_PutValid_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); DictionaryClient client = new DictionaryClient(credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutValidAsync(content); Console.WriteLine(response.Status); @@ -103,7 +103,7 @@ public void Example_PutValid_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); DictionaryClient client = new DictionaryClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { defaultProgram = new { @@ -122,7 +122,7 @@ public async Task Example_PutValid_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); DictionaryClient client = new DictionaryClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { defaultProgram = new { @@ -193,7 +193,7 @@ public void Example_PutEmpty_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); DictionaryClient client = new DictionaryClient(credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.PutEmpty(content); Console.WriteLine(response.Status); @@ -206,7 +206,7 @@ public async Task Example_PutEmpty_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); DictionaryClient client = new DictionaryClient(credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutEmptyAsync(content); Console.WriteLine(response.Status); @@ -219,7 +219,7 @@ public void Example_PutEmpty_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); DictionaryClient client = new DictionaryClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { defaultProgram = new { @@ -238,7 +238,7 @@ public async Task Example_PutEmpty_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); DictionaryClient client = new DictionaryClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { defaultProgram = new { diff --git a/test/TestServerProjectsLowLevel/body-complex/tests/Generated/Samples/Samples_InheritanceClient.cs b/test/TestServerProjectsLowLevel/body-complex/tests/Generated/Samples/Samples_InheritanceClient.cs index c4a8810b163..abc5fe413c8 100644 --- a/test/TestServerProjectsLowLevel/body-complex/tests/Generated/Samples/Samples_InheritanceClient.cs +++ b/test/TestServerProjectsLowLevel/body-complex/tests/Generated/Samples/Samples_InheritanceClient.cs @@ -89,7 +89,7 @@ public void Example_PutValid_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); InheritanceClient client = new InheritanceClient(credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.PutValid(content); Console.WriteLine(response.Status); @@ -102,7 +102,7 @@ public async Task Example_PutValid_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); InheritanceClient client = new InheritanceClient(credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutValidAsync(content); Console.WriteLine(response.Status); @@ -115,7 +115,7 @@ public void Example_PutValid_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); InheritanceClient client = new InheritanceClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { breed = "", color = "", @@ -143,7 +143,7 @@ public async Task Example_PutValid_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); InheritanceClient client = new InheritanceClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { breed = "", color = "", diff --git a/test/TestServerProjectsLowLevel/body-complex/tests/Generated/Samples/Samples_PolymorphicrecursiveClient.cs b/test/TestServerProjectsLowLevel/body-complex/tests/Generated/Samples/Samples_PolymorphicrecursiveClient.cs index 96aabc9cd7b..980ce88121b 100644 --- a/test/TestServerProjectsLowLevel/body-complex/tests/Generated/Samples/Samples_PolymorphicrecursiveClient.cs +++ b/test/TestServerProjectsLowLevel/body-complex/tests/Generated/Samples/Samples_PolymorphicrecursiveClient.cs @@ -89,7 +89,7 @@ public void Example_PutValid_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); PolymorphicrecursiveClient client = new PolymorphicrecursiveClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { fishtype = "salmon", length = 123.45F, @@ -106,7 +106,7 @@ public async Task Example_PutValid_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); PolymorphicrecursiveClient client = new PolymorphicrecursiveClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { fishtype = "salmon", length = 123.45F, @@ -123,7 +123,7 @@ public void Example_PutValid_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); PolymorphicrecursiveClient client = new PolymorphicrecursiveClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { location = "", iswild = true, @@ -147,7 +147,7 @@ public async Task Example_PutValid_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); PolymorphicrecursiveClient client = new PolymorphicrecursiveClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { location = "", iswild = true, diff --git a/test/TestServerProjectsLowLevel/body-complex/tests/Generated/Samples/Samples_PolymorphismClient.cs b/test/TestServerProjectsLowLevel/body-complex/tests/Generated/Samples/Samples_PolymorphismClient.cs index 49d0b894ac0..b1da5abc8ed 100644 --- a/test/TestServerProjectsLowLevel/body-complex/tests/Generated/Samples/Samples_PolymorphismClient.cs +++ b/test/TestServerProjectsLowLevel/body-complex/tests/Generated/Samples/Samples_PolymorphismClient.cs @@ -89,7 +89,7 @@ public void Example_PutValid_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); PolymorphismClient client = new PolymorphismClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { fishtype = "salmon", length = 123.45F, @@ -106,7 +106,7 @@ public async Task Example_PutValid_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); PolymorphismClient client = new PolymorphismClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { fishtype = "salmon", length = 123.45F, @@ -123,7 +123,7 @@ public void Example_PutValid_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); PolymorphismClient client = new PolymorphismClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { location = "", iswild = true, @@ -147,7 +147,7 @@ public async Task Example_PutValid_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); PolymorphismClient client = new PolymorphismClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { location = "", iswild = true, @@ -441,7 +441,7 @@ public void Example_PutComplicated_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); PolymorphismClient client = new PolymorphismClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { fishtype = "smart_salmon", length = 123.45F, @@ -458,7 +458,7 @@ public async Task Example_PutComplicated_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); PolymorphismClient client = new PolymorphismClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { fishtype = "smart_salmon", length = 123.45F, @@ -475,7 +475,7 @@ public void Example_PutComplicated_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); PolymorphismClient client = new PolymorphismClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { college_degree = "", location = "", @@ -511,7 +511,7 @@ public async Task Example_PutComplicated_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); PolymorphismClient client = new PolymorphismClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { college_degree = "", location = "", @@ -547,7 +547,7 @@ public void Example_PutMissingDiscriminator_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); PolymorphismClient client = new PolymorphismClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { fishtype = "smart_salmon", length = 123.45F, @@ -566,7 +566,7 @@ public async Task Example_PutMissingDiscriminator_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); PolymorphismClient client = new PolymorphismClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { fishtype = "smart_salmon", length = 123.45F, @@ -585,7 +585,7 @@ public void Example_PutMissingDiscriminator_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); PolymorphismClient client = new PolymorphismClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { college_degree = "", location = "", @@ -629,7 +629,7 @@ public async Task Example_PutMissingDiscriminator_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); PolymorphismClient client = new PolymorphismClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { college_degree = "", location = "", @@ -673,7 +673,7 @@ public void Example_PutValidMissingRequired_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); PolymorphismClient client = new PolymorphismClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { fishtype = "salmon", length = 123.45F, @@ -690,7 +690,7 @@ public async Task Example_PutValidMissingRequired_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); PolymorphismClient client = new PolymorphismClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { fishtype = "salmon", length = 123.45F, @@ -707,7 +707,7 @@ public void Example_PutValidMissingRequired_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); PolymorphismClient client = new PolymorphismClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { location = "", iswild = true, @@ -731,7 +731,7 @@ public async Task Example_PutValidMissingRequired_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); PolymorphismClient client = new PolymorphismClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { location = "", iswild = true, diff --git a/test/TestServerProjectsLowLevel/body-complex/tests/Generated/Samples/Samples_PrimitiveClient.cs b/test/TestServerProjectsLowLevel/body-complex/tests/Generated/Samples/Samples_PrimitiveClient.cs index 28624afbe5c..0bfcb99e4e1 100644 --- a/test/TestServerProjectsLowLevel/body-complex/tests/Generated/Samples/Samples_PrimitiveClient.cs +++ b/test/TestServerProjectsLowLevel/body-complex/tests/Generated/Samples/Samples_PrimitiveClient.cs @@ -80,7 +80,7 @@ public void Example_PutInt_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.PutInt(content); Console.WriteLine(response.Status); @@ -93,7 +93,7 @@ public async Task Example_PutInt_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutIntAsync(content); Console.WriteLine(response.Status); @@ -106,7 +106,7 @@ public void Example_PutInt_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { field1 = 1234, field2 = 1234, @@ -123,7 +123,7 @@ public async Task Example_PutInt_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { field1 = 1234, field2 = 1234, @@ -194,7 +194,7 @@ public void Example_PutLong_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.PutLong(content); Console.WriteLine(response.Status); @@ -207,7 +207,7 @@ public async Task Example_PutLong_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutLongAsync(content); Console.WriteLine(response.Status); @@ -220,7 +220,7 @@ public void Example_PutLong_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { field1 = 1234L, field2 = 1234L, @@ -237,7 +237,7 @@ public async Task Example_PutLong_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { field1 = 1234L, field2 = 1234L, @@ -308,7 +308,7 @@ public void Example_PutFloat_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.PutFloat(content); Console.WriteLine(response.Status); @@ -321,7 +321,7 @@ public async Task Example_PutFloat_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutFloatAsync(content); Console.WriteLine(response.Status); @@ -334,7 +334,7 @@ public void Example_PutFloat_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { field1 = 123.45F, field2 = 123.45F, @@ -351,7 +351,7 @@ public async Task Example_PutFloat_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { field1 = 123.45F, field2 = 123.45F, @@ -422,7 +422,7 @@ public void Example_PutDouble_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.PutDouble(content); Console.WriteLine(response.Status); @@ -435,7 +435,7 @@ public async Task Example_PutDouble_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutDoubleAsync(content); Console.WriteLine(response.Status); @@ -448,7 +448,7 @@ public void Example_PutDouble_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { field1 = 123.45, field_56_zeros_after_the_dot_and_negative_zero_before_dot_and_this_is_a_long_field_name_on_purpose = 123.45, @@ -465,7 +465,7 @@ public async Task Example_PutDouble_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { field1 = 123.45, field_56_zeros_after_the_dot_and_negative_zero_before_dot_and_this_is_a_long_field_name_on_purpose = 123.45, @@ -536,7 +536,7 @@ public void Example_PutBool_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.PutBool(content); Console.WriteLine(response.Status); @@ -549,7 +549,7 @@ public async Task Example_PutBool_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutBoolAsync(content); Console.WriteLine(response.Status); @@ -562,7 +562,7 @@ public void Example_PutBool_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { field_true = true, field_false = true, @@ -579,7 +579,7 @@ public async Task Example_PutBool_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { field_true = true, field_false = true, @@ -652,7 +652,7 @@ public void Example_PutString_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.PutString(content); Console.WriteLine(response.Status); @@ -665,7 +665,7 @@ public async Task Example_PutString_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutStringAsync(content); Console.WriteLine(response.Status); @@ -678,7 +678,7 @@ public void Example_PutString_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); - RequestContent content = RequestContent.Create(new Dictionary + using RequestContent content = RequestContent.Create(new Dictionary { ["field"] = "", ["empty"] = "", @@ -696,7 +696,7 @@ public async Task Example_PutString_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); - RequestContent content = RequestContent.Create(new Dictionary + using RequestContent content = RequestContent.Create(new Dictionary { ["field"] = "", ["empty"] = "", @@ -768,7 +768,7 @@ public void Example_PutDate_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.PutDate(content); Console.WriteLine(response.Status); @@ -781,7 +781,7 @@ public async Task Example_PutDate_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutDateAsync(content); Console.WriteLine(response.Status); @@ -794,7 +794,7 @@ public void Example_PutDate_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { field = "2022-05-10", leap = "2022-05-10", @@ -811,7 +811,7 @@ public async Task Example_PutDate_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { field = "2022-05-10", leap = "2022-05-10", @@ -882,7 +882,7 @@ public void Example_PutDateTime_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.PutDateTime(content); Console.WriteLine(response.Status); @@ -895,7 +895,7 @@ public async Task Example_PutDateTime_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutDateTimeAsync(content); Console.WriteLine(response.Status); @@ -908,7 +908,7 @@ public void Example_PutDateTime_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { field = "2022-05-10T18:57:31.2311892Z", now = "2022-05-10T18:57:31.2311892Z", @@ -925,7 +925,7 @@ public async Task Example_PutDateTime_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { field = "2022-05-10T18:57:31.2311892Z", now = "2022-05-10T18:57:31.2311892Z", @@ -996,7 +996,7 @@ public void Example_PutDateTimeRfc1123_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.PutDateTimeRfc1123(content); Console.WriteLine(response.Status); @@ -1009,7 +1009,7 @@ public async Task Example_PutDateTimeRfc1123_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutDateTimeRfc1123Async(content); Console.WriteLine(response.Status); @@ -1022,7 +1022,7 @@ public void Example_PutDateTimeRfc1123_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { field = "Tue, 10 May 2022 18:57:31 GMT", now = "Tue, 10 May 2022 18:57:31 GMT", @@ -1039,7 +1039,7 @@ public async Task Example_PutDateTimeRfc1123_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { field = "Tue, 10 May 2022 18:57:31 GMT", now = "Tue, 10 May 2022 18:57:31 GMT", @@ -1108,7 +1108,7 @@ public void Example_PutDuration_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.PutDuration(content); Console.WriteLine(response.Status); @@ -1121,7 +1121,7 @@ public async Task Example_PutDuration_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutDurationAsync(content); Console.WriteLine(response.Status); @@ -1134,7 +1134,7 @@ public void Example_PutDuration_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { field = "PT1H23M45S", }); @@ -1150,7 +1150,7 @@ public async Task Example_PutDuration_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { field = "PT1H23M45S", }); @@ -1218,7 +1218,7 @@ public void Example_PutByte_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.PutByte(content); Console.WriteLine(response.Status); @@ -1231,7 +1231,7 @@ public async Task Example_PutByte_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutByteAsync(content); Console.WriteLine(response.Status); @@ -1244,7 +1244,7 @@ public void Example_PutByte_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { field = new object(), }); @@ -1260,7 +1260,7 @@ public async Task Example_PutByte_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); PrimitiveClient client = new PrimitiveClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { field = new object(), }); diff --git a/test/TestServerProjectsLowLevel/body-complex/tests/Generated/Samples/Samples_ReadonlypropertyClient.cs b/test/TestServerProjectsLowLevel/body-complex/tests/Generated/Samples/Samples_ReadonlypropertyClient.cs index fe3fc3d7bba..0e5a100e517 100644 --- a/test/TestServerProjectsLowLevel/body-complex/tests/Generated/Samples/Samples_ReadonlypropertyClient.cs +++ b/test/TestServerProjectsLowLevel/body-complex/tests/Generated/Samples/Samples_ReadonlypropertyClient.cs @@ -79,7 +79,7 @@ public void Example_PutValid_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); ReadonlypropertyClient client = new ReadonlypropertyClient(credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.PutValid(content); Console.WriteLine(response.Status); @@ -92,7 +92,7 @@ public async Task Example_PutValid_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); ReadonlypropertyClient client = new ReadonlypropertyClient(credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutValidAsync(content); Console.WriteLine(response.Status); @@ -105,7 +105,7 @@ public void Example_PutValid_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); ReadonlypropertyClient client = new ReadonlypropertyClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { size = 1234, }); @@ -121,7 +121,7 @@ public async Task Example_PutValid_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); ReadonlypropertyClient client = new ReadonlypropertyClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { size = 1234, }); diff --git a/test/TestServerProjectsLowLevel/body-string/src/Generated/Docs/EnumClient.xml b/test/TestServerProjectsLowLevel/body-string/src/Generated/Docs/EnumClient.xml index a74f7fc7211..ee9f4157a38 100644 --- a/test/TestServerProjectsLowLevel/body-string/src/Generated/Docs/EnumClient.xml +++ b/test/TestServerProjectsLowLevel/body-string/src/Generated/Docs/EnumClient.xml @@ -54,7 +54,7 @@ This sample shows how to call PutNotExpandableAsync. AzureKeyCredential credential = new AzureKeyCredential(""); EnumClient client = new EnumClient(credential); -RequestContent content = RequestContent.Create("red color"); +using RequestContent content = RequestContent.Create("red color"); Response response = await client.PutNotExpandableAsync(content); Console.WriteLine(response.Status); @@ -64,7 +64,7 @@ This sample shows how to call PutNotExpandableAsync with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); EnumClient client = new EnumClient(credential); -RequestContent content = RequestContent.Create("red color"); +using RequestContent content = RequestContent.Create("red color"); Response response = await client.PutNotExpandableAsync(content); Console.WriteLine(response.Status); @@ -77,7 +77,7 @@ This sample shows how to call PutNotExpandable. AzureKeyCredential credential = new AzureKeyCredential(""); EnumClient client = new EnumClient(credential); -RequestContent content = RequestContent.Create("red color"); +using RequestContent content = RequestContent.Create("red color"); Response response = client.PutNotExpandable(content); Console.WriteLine(response.Status); @@ -87,7 +87,7 @@ This sample shows how to call PutNotExpandable with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); EnumClient client = new EnumClient(credential); -RequestContent content = RequestContent.Create("red color"); +using RequestContent content = RequestContent.Create("red color"); Response response = client.PutNotExpandable(content); Console.WriteLine(response.Status); @@ -146,7 +146,7 @@ This sample shows how to call PutReferencedAsync. AzureKeyCredential credential = new AzureKeyCredential(""); EnumClient client = new EnumClient(credential); -RequestContent content = RequestContent.Create("red color"); +using RequestContent content = RequestContent.Create("red color"); Response response = await client.PutReferencedAsync(content); Console.WriteLine(response.Status); @@ -156,7 +156,7 @@ This sample shows how to call PutReferencedAsync with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); EnumClient client = new EnumClient(credential); -RequestContent content = RequestContent.Create("red color"); +using RequestContent content = RequestContent.Create("red color"); Response response = await client.PutReferencedAsync(content); Console.WriteLine(response.Status); @@ -169,7 +169,7 @@ This sample shows how to call PutReferenced. AzureKeyCredential credential = new AzureKeyCredential(""); EnumClient client = new EnumClient(credential); -RequestContent content = RequestContent.Create("red color"); +using RequestContent content = RequestContent.Create("red color"); Response response = client.PutReferenced(content); Console.WriteLine(response.Status); @@ -179,7 +179,7 @@ This sample shows how to call PutReferenced with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); EnumClient client = new EnumClient(credential); -RequestContent content = RequestContent.Create("red color"); +using RequestContent content = RequestContent.Create("red color"); Response response = client.PutReferenced(content); Console.WriteLine(response.Status); @@ -240,7 +240,7 @@ This sample shows how to call PutReferencedConstantAsync. AzureKeyCredential credential = new AzureKeyCredential(""); EnumClient client = new EnumClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { ColorConstant = "green-color", }); @@ -253,7 +253,7 @@ This sample shows how to call PutReferencedConstantAsync with all request conten AzureKeyCredential credential = new AzureKeyCredential(""); EnumClient client = new EnumClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { ColorConstant = "green-color", field1 = "", @@ -270,7 +270,7 @@ This sample shows how to call PutReferencedConstant. AzureKeyCredential credential = new AzureKeyCredential(""); EnumClient client = new EnumClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { ColorConstant = "green-color", }); @@ -283,7 +283,7 @@ This sample shows how to call PutReferencedConstant with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); EnumClient client = new EnumClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { ColorConstant = "green-color", field1 = "", diff --git a/test/TestServerProjectsLowLevel/body-string/src/Generated/Docs/StringClient.xml b/test/TestServerProjectsLowLevel/body-string/src/Generated/Docs/StringClient.xml index 16be17fb998..00f48e0d74e 100644 --- a/test/TestServerProjectsLowLevel/body-string/src/Generated/Docs/StringClient.xml +++ b/test/TestServerProjectsLowLevel/body-string/src/Generated/Docs/StringClient.xml @@ -54,7 +54,7 @@ This sample shows how to call PutNullAsync. AzureKeyCredential credential = new AzureKeyCredential(""); StringClient client = new StringClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.PutNullAsync(content); Console.WriteLine(response.Status); @@ -64,7 +64,7 @@ This sample shows how to call PutNullAsync with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); StringClient client = new StringClient(credential); -RequestContent content = RequestContent.Create(""); +using RequestContent content = RequestContent.Create(""); Response response = await client.PutNullAsync(content); Console.WriteLine(response.Status); @@ -77,7 +77,7 @@ This sample shows how to call PutNull. AzureKeyCredential credential = new AzureKeyCredential(""); StringClient client = new StringClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.PutNull(content); Console.WriteLine(response.Status); @@ -87,7 +87,7 @@ This sample shows how to call PutNull with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); StringClient client = new StringClient(credential); -RequestContent content = RequestContent.Create(""); +using RequestContent content = RequestContent.Create(""); Response response = client.PutNull(content); Console.WriteLine(response.Status); @@ -146,7 +146,7 @@ This sample shows how to call PutEmptyAsync. AzureKeyCredential credential = new AzureKeyCredential(""); StringClient client = new StringClient(credential); -RequestContent content = RequestContent.Create(""); +using RequestContent content = RequestContent.Create(""); Response response = await client.PutEmptyAsync(content); Console.WriteLine(response.Status); @@ -156,7 +156,7 @@ This sample shows how to call PutEmptyAsync with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); StringClient client = new StringClient(credential); -RequestContent content = RequestContent.Create(""); +using RequestContent content = RequestContent.Create(""); Response response = await client.PutEmptyAsync(content); Console.WriteLine(response.Status); @@ -169,7 +169,7 @@ This sample shows how to call PutEmpty. AzureKeyCredential credential = new AzureKeyCredential(""); StringClient client = new StringClient(credential); -RequestContent content = RequestContent.Create(""); +using RequestContent content = RequestContent.Create(""); Response response = client.PutEmpty(content); Console.WriteLine(response.Status); @@ -179,7 +179,7 @@ This sample shows how to call PutEmpty with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); StringClient client = new StringClient(credential); -RequestContent content = RequestContent.Create(""); +using RequestContent content = RequestContent.Create(""); Response response = client.PutEmpty(content); Console.WriteLine(response.Status); @@ -238,7 +238,7 @@ This sample shows how to call PutMbcsAsync. AzureKeyCredential credential = new AzureKeyCredential(""); StringClient client = new StringClient(credential); -RequestContent content = RequestContent.Create("啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€"); +using RequestContent content = RequestContent.Create("啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€"); Response response = await client.PutMbcsAsync(content); Console.WriteLine(response.Status); @@ -248,7 +248,7 @@ This sample shows how to call PutMbcsAsync with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); StringClient client = new StringClient(credential); -RequestContent content = RequestContent.Create("啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€"); +using RequestContent content = RequestContent.Create("啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€"); Response response = await client.PutMbcsAsync(content); Console.WriteLine(response.Status); @@ -261,7 +261,7 @@ This sample shows how to call PutMbcs. AzureKeyCredential credential = new AzureKeyCredential(""); StringClient client = new StringClient(credential); -RequestContent content = RequestContent.Create("啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€"); +using RequestContent content = RequestContent.Create("啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€"); Response response = client.PutMbcs(content); Console.WriteLine(response.Status); @@ -271,7 +271,7 @@ This sample shows how to call PutMbcs with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); StringClient client = new StringClient(credential); -RequestContent content = RequestContent.Create("啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€"); +using RequestContent content = RequestContent.Create("啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€"); Response response = client.PutMbcs(content); Console.WriteLine(response.Status); @@ -330,7 +330,7 @@ This sample shows how to call PutWhitespaceAsync. AzureKeyCredential credential = new AzureKeyCredential(""); StringClient client = new StringClient(credential); -RequestContent content = RequestContent.Create(" Now is the time for all good men to come to the aid of their country "); +using RequestContent content = RequestContent.Create(" Now is the time for all good men to come to the aid of their country "); Response response = await client.PutWhitespaceAsync(content); Console.WriteLine(response.Status); @@ -340,7 +340,7 @@ This sample shows how to call PutWhitespaceAsync with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); StringClient client = new StringClient(credential); -RequestContent content = RequestContent.Create(" Now is the time for all good men to come to the aid of their country "); +using RequestContent content = RequestContent.Create(" Now is the time for all good men to come to the aid of their country "); Response response = await client.PutWhitespaceAsync(content); Console.WriteLine(response.Status); @@ -353,7 +353,7 @@ This sample shows how to call PutWhitespace. AzureKeyCredential credential = new AzureKeyCredential(""); StringClient client = new StringClient(credential); -RequestContent content = RequestContent.Create(" Now is the time for all good men to come to the aid of their country "); +using RequestContent content = RequestContent.Create(" Now is the time for all good men to come to the aid of their country "); Response response = client.PutWhitespace(content); Console.WriteLine(response.Status); @@ -363,7 +363,7 @@ This sample shows how to call PutWhitespace with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); StringClient client = new StringClient(credential); -RequestContent content = RequestContent.Create(" Now is the time for all good men to come to the aid of their country "); +using RequestContent content = RequestContent.Create(" Now is the time for all good men to come to the aid of their country "); Response response = client.PutWhitespace(content); Console.WriteLine(response.Status); @@ -514,7 +514,7 @@ This sample shows how to call PutBase64UrlEncodedAsync. AzureKeyCredential credential = new AzureKeyCredential(""); StringClient client = new StringClient(credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutBase64UrlEncodedAsync(content); Console.WriteLine(response.Status); @@ -524,7 +524,7 @@ This sample shows how to call PutBase64UrlEncodedAsync with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); StringClient client = new StringClient(credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutBase64UrlEncodedAsync(content); Console.WriteLine(response.Status); @@ -537,7 +537,7 @@ This sample shows how to call PutBase64UrlEncoded. AzureKeyCredential credential = new AzureKeyCredential(""); StringClient client = new StringClient(credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = client.PutBase64UrlEncoded(content); Console.WriteLine(response.Status); @@ -547,7 +547,7 @@ This sample shows how to call PutBase64UrlEncoded with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); StringClient client = new StringClient(credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); Response response = client.PutBase64UrlEncoded(content); Console.WriteLine(response.Status); diff --git a/test/TestServerProjectsLowLevel/body-string/tests/Generated/Samples/Samples_EnumClient.cs b/test/TestServerProjectsLowLevel/body-string/tests/Generated/Samples/Samples_EnumClient.cs index 40e754ec9b7..41f182a202a 100644 --- a/test/TestServerProjectsLowLevel/body-string/tests/Generated/Samples/Samples_EnumClient.cs +++ b/test/TestServerProjectsLowLevel/body-string/tests/Generated/Samples/Samples_EnumClient.cs @@ -77,7 +77,7 @@ public void Example_PutNotExpandable_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); EnumClient client = new EnumClient(credential); - RequestContent content = RequestContent.Create("red color"); + using RequestContent content = RequestContent.Create("red color"); Response response = client.PutNotExpandable(content); Console.WriteLine(response.Status); @@ -90,7 +90,7 @@ public async Task Example_PutNotExpandable_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); EnumClient client = new EnumClient(credential); - RequestContent content = RequestContent.Create("red color"); + using RequestContent content = RequestContent.Create("red color"); Response response = await client.PutNotExpandableAsync(content); Console.WriteLine(response.Status); @@ -103,7 +103,7 @@ public void Example_PutNotExpandable_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); EnumClient client = new EnumClient(credential); - RequestContent content = RequestContent.Create("red color"); + using RequestContent content = RequestContent.Create("red color"); Response response = client.PutNotExpandable(content); Console.WriteLine(response.Status); @@ -116,7 +116,7 @@ public async Task Example_PutNotExpandable_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); EnumClient client = new EnumClient(credential); - RequestContent content = RequestContent.Create("red color"); + using RequestContent content = RequestContent.Create("red color"); Response response = await client.PutNotExpandableAsync(content); Console.WriteLine(response.Status); @@ -181,7 +181,7 @@ public void Example_PutReferenced_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); EnumClient client = new EnumClient(credential); - RequestContent content = RequestContent.Create("red color"); + using RequestContent content = RequestContent.Create("red color"); Response response = client.PutReferenced(content); Console.WriteLine(response.Status); @@ -194,7 +194,7 @@ public async Task Example_PutReferenced_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); EnumClient client = new EnumClient(credential); - RequestContent content = RequestContent.Create("red color"); + using RequestContent content = RequestContent.Create("red color"); Response response = await client.PutReferencedAsync(content); Console.WriteLine(response.Status); @@ -207,7 +207,7 @@ public void Example_PutReferenced_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); EnumClient client = new EnumClient(credential); - RequestContent content = RequestContent.Create("red color"); + using RequestContent content = RequestContent.Create("red color"); Response response = client.PutReferenced(content); Console.WriteLine(response.Status); @@ -220,7 +220,7 @@ public async Task Example_PutReferenced_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); EnumClient client = new EnumClient(credential); - RequestContent content = RequestContent.Create("red color"); + using RequestContent content = RequestContent.Create("red color"); Response response = await client.PutReferencedAsync(content); Console.WriteLine(response.Status); @@ -287,7 +287,7 @@ public void Example_PutReferencedConstant_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); EnumClient client = new EnumClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { ColorConstant = "green-color", }); @@ -303,7 +303,7 @@ public async Task Example_PutReferencedConstant_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); EnumClient client = new EnumClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { ColorConstant = "green-color", }); @@ -319,7 +319,7 @@ public void Example_PutReferencedConstant_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); EnumClient client = new EnumClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { ColorConstant = "green-color", field1 = "", @@ -336,7 +336,7 @@ public async Task Example_PutReferencedConstant_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); EnumClient client = new EnumClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { ColorConstant = "green-color", field1 = "", diff --git a/test/TestServerProjectsLowLevel/body-string/tests/Generated/Samples/Samples_StringClient.cs b/test/TestServerProjectsLowLevel/body-string/tests/Generated/Samples/Samples_StringClient.cs index db4d442b25d..40f6bba016d 100644 --- a/test/TestServerProjectsLowLevel/body-string/tests/Generated/Samples/Samples_StringClient.cs +++ b/test/TestServerProjectsLowLevel/body-string/tests/Generated/Samples/Samples_StringClient.cs @@ -77,7 +77,7 @@ public void Example_PutNull_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); StringClient client = new StringClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.PutNull(content); Console.WriteLine(response.Status); @@ -90,7 +90,7 @@ public async Task Example_PutNull_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); StringClient client = new StringClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.PutNullAsync(content); Console.WriteLine(response.Status); @@ -103,7 +103,7 @@ public void Example_PutNull_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); StringClient client = new StringClient(credential); - RequestContent content = RequestContent.Create(""); + using RequestContent content = RequestContent.Create(""); Response response = client.PutNull(content); Console.WriteLine(response.Status); @@ -116,7 +116,7 @@ public async Task Example_PutNull_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); StringClient client = new StringClient(credential); - RequestContent content = RequestContent.Create(""); + using RequestContent content = RequestContent.Create(""); Response response = await client.PutNullAsync(content); Console.WriteLine(response.Status); @@ -181,7 +181,7 @@ public void Example_PutEmpty_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); StringClient client = new StringClient(credential); - RequestContent content = RequestContent.Create(""); + using RequestContent content = RequestContent.Create(""); Response response = client.PutEmpty(content); Console.WriteLine(response.Status); @@ -194,7 +194,7 @@ public async Task Example_PutEmpty_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); StringClient client = new StringClient(credential); - RequestContent content = RequestContent.Create(""); + using RequestContent content = RequestContent.Create(""); Response response = await client.PutEmptyAsync(content); Console.WriteLine(response.Status); @@ -207,7 +207,7 @@ public void Example_PutEmpty_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); StringClient client = new StringClient(credential); - RequestContent content = RequestContent.Create(""); + using RequestContent content = RequestContent.Create(""); Response response = client.PutEmpty(content); Console.WriteLine(response.Status); @@ -220,7 +220,7 @@ public async Task Example_PutEmpty_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); StringClient client = new StringClient(credential); - RequestContent content = RequestContent.Create(""); + using RequestContent content = RequestContent.Create(""); Response response = await client.PutEmptyAsync(content); Console.WriteLine(response.Status); @@ -285,7 +285,7 @@ public void Example_PutMbcs_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); StringClient client = new StringClient(credential); - RequestContent content = RequestContent.Create("啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€"); + using RequestContent content = RequestContent.Create("啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€"); Response response = client.PutMbcs(content); Console.WriteLine(response.Status); @@ -298,7 +298,7 @@ public async Task Example_PutMbcs_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); StringClient client = new StringClient(credential); - RequestContent content = RequestContent.Create("啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€"); + using RequestContent content = RequestContent.Create("啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€"); Response response = await client.PutMbcsAsync(content); Console.WriteLine(response.Status); @@ -311,7 +311,7 @@ public void Example_PutMbcs_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); StringClient client = new StringClient(credential); - RequestContent content = RequestContent.Create("啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€"); + using RequestContent content = RequestContent.Create("啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€"); Response response = client.PutMbcs(content); Console.WriteLine(response.Status); @@ -324,7 +324,7 @@ public async Task Example_PutMbcs_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); StringClient client = new StringClient(credential); - RequestContent content = RequestContent.Create("啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€"); + using RequestContent content = RequestContent.Create("啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€"); Response response = await client.PutMbcsAsync(content); Console.WriteLine(response.Status); @@ -389,7 +389,7 @@ public void Example_PutWhitespace_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); StringClient client = new StringClient(credential); - RequestContent content = RequestContent.Create(" Now is the time for all good men to come to the aid of their country "); + using RequestContent content = RequestContent.Create(" Now is the time for all good men to come to the aid of their country "); Response response = client.PutWhitespace(content); Console.WriteLine(response.Status); @@ -402,7 +402,7 @@ public async Task Example_PutWhitespace_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); StringClient client = new StringClient(credential); - RequestContent content = RequestContent.Create(" Now is the time for all good men to come to the aid of their country "); + using RequestContent content = RequestContent.Create(" Now is the time for all good men to come to the aid of their country "); Response response = await client.PutWhitespaceAsync(content); Console.WriteLine(response.Status); @@ -415,7 +415,7 @@ public void Example_PutWhitespace_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); StringClient client = new StringClient(credential); - RequestContent content = RequestContent.Create(" Now is the time for all good men to come to the aid of their country "); + using RequestContent content = RequestContent.Create(" Now is the time for all good men to come to the aid of their country "); Response response = client.PutWhitespace(content); Console.WriteLine(response.Status); @@ -428,7 +428,7 @@ public async Task Example_PutWhitespace_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); StringClient client = new StringClient(credential); - RequestContent content = RequestContent.Create(" Now is the time for all good men to come to the aid of their country "); + using RequestContent content = RequestContent.Create(" Now is the time for all good men to come to the aid of their country "); Response response = await client.PutWhitespaceAsync(content); Console.WriteLine(response.Status); @@ -597,7 +597,7 @@ public void Example_PutBase64UrlEncoded_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); StringClient client = new StringClient(credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.PutBase64UrlEncoded(content); Console.WriteLine(response.Status); @@ -610,7 +610,7 @@ public async Task Example_PutBase64UrlEncoded_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); StringClient client = new StringClient(credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutBase64UrlEncodedAsync(content); Console.WriteLine(response.Status); @@ -623,7 +623,7 @@ public void Example_PutBase64UrlEncoded_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); StringClient client = new StringClient(credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = client.PutBase64UrlEncoded(content); Console.WriteLine(response.Status); @@ -636,7 +636,7 @@ public async Task Example_PutBase64UrlEncoded_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); StringClient client = new StringClient(credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); Response response = await client.PutBase64UrlEncodedAsync(content); Console.WriteLine(response.Status); diff --git a/test/TestServerProjectsLowLevel/dpg-customization/src/Generated/Docs/DPGClient.xml b/test/TestServerProjectsLowLevel/dpg-customization/src/Generated/Docs/DPGClient.xml index ec09be69c9f..7624dc30415 100644 --- a/test/TestServerProjectsLowLevel/dpg-customization/src/Generated/Docs/DPGClient.xml +++ b/test/TestServerProjectsLowLevel/dpg-customization/src/Generated/Docs/DPGClient.xml @@ -54,7 +54,7 @@ This sample shows how to call PostModelAsync and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); DPGClient client = new DPGClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { hello = "", }); @@ -68,7 +68,7 @@ This sample shows how to call PostModelAsync with all parameters and request con AzureKeyCredential credential = new AzureKeyCredential(""); DPGClient client = new DPGClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { hello = "", }); @@ -85,7 +85,7 @@ This sample shows how to call PostModel and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); DPGClient client = new DPGClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { hello = "", }); @@ -99,7 +99,7 @@ This sample shows how to call PostModel with all parameters and request content AzureKeyCredential credential = new AzureKeyCredential(""); DPGClient client = new DPGClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { hello = "", }); diff --git a/test/TestServerProjectsLowLevel/dpg-customization/tests/Generated/Samples/Samples_DPGClient.cs b/test/TestServerProjectsLowLevel/dpg-customization/tests/Generated/Samples/Samples_DPGClient.cs index aaa40eeefab..39d14366a41 100644 --- a/test/TestServerProjectsLowLevel/dpg-customization/tests/Generated/Samples/Samples_DPGClient.cs +++ b/test/TestServerProjectsLowLevel/dpg-customization/tests/Generated/Samples/Samples_DPGClient.cs @@ -77,7 +77,7 @@ public void Example_PostModel_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); DPGClient client = new DPGClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { hello = "", }); @@ -94,7 +94,7 @@ public async Task Example_PostModel_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); DPGClient client = new DPGClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { hello = "", }); @@ -111,7 +111,7 @@ public void Example_PostModel_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); DPGClient client = new DPGClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { hello = "", }); @@ -128,7 +128,7 @@ public async Task Example_PostModel_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); DPGClient client = new DPGClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { hello = "", }); diff --git a/test/TestServerProjectsLowLevel/dpg-initial/src/Generated/Docs/ParamsClient.xml b/test/TestServerProjectsLowLevel/dpg-initial/src/Generated/Docs/ParamsClient.xml index 9be2e7ad1e4..7b9e9b4304b 100644 --- a/test/TestServerProjectsLowLevel/dpg-initial/src/Generated/Docs/ParamsClient.xml +++ b/test/TestServerProjectsLowLevel/dpg-initial/src/Generated/Docs/ParamsClient.xml @@ -146,7 +146,7 @@ This sample shows how to call PostParametersAsync and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); ParamsClient client = new ParamsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { url = "", }); @@ -160,7 +160,7 @@ This sample shows how to call PostParametersAsync with all request content and p AzureKeyCredential credential = new AzureKeyCredential(""); ParamsClient client = new ParamsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { url = "", }); @@ -177,7 +177,7 @@ This sample shows how to call PostParameters and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); ParamsClient client = new ParamsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { url = "", }); @@ -191,7 +191,7 @@ This sample shows how to call PostParameters with all request content and parse AzureKeyCredential credential = new AzureKeyCredential(""); ParamsClient client = new ParamsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { url = "", }); diff --git a/test/TestServerProjectsLowLevel/dpg-initial/tests/Generated/Samples/Samples_ParamsClient.cs b/test/TestServerProjectsLowLevel/dpg-initial/tests/Generated/Samples/Samples_ParamsClient.cs index f19e857dab7..8badea9bd2b 100644 --- a/test/TestServerProjectsLowLevel/dpg-initial/tests/Generated/Samples/Samples_ParamsClient.cs +++ b/test/TestServerProjectsLowLevel/dpg-initial/tests/Generated/Samples/Samples_ParamsClient.cs @@ -181,7 +181,7 @@ public void Example_PostParameters_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); ParamsClient client = new ParamsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { url = "", }); @@ -198,7 +198,7 @@ public async Task Example_PostParameters_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); ParamsClient client = new ParamsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { url = "", }); @@ -215,7 +215,7 @@ public void Example_PostParameters_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); ParamsClient client = new ParamsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { url = "", }); @@ -232,7 +232,7 @@ public async Task Example_PostParameters_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); ParamsClient client = new ParamsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { url = "", }); diff --git a/test/TestServerProjectsLowLevel/dpg-update1/src/Generated/Docs/ParamsClient.xml b/test/TestServerProjectsLowLevel/dpg-update1/src/Generated/Docs/ParamsClient.xml index e78eea52b18..a2bac8c7414 100644 --- a/test/TestServerProjectsLowLevel/dpg-update1/src/Generated/Docs/ParamsClient.xml +++ b/test/TestServerProjectsLowLevel/dpg-update1/src/Generated/Docs/ParamsClient.xml @@ -146,7 +146,7 @@ This sample shows how to call PostParametersAsync and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); ParamsClient client = new ParamsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { url = "", }); @@ -160,7 +160,7 @@ This sample shows how to call PostParametersAsync with all parameters and reques AzureKeyCredential credential = new AzureKeyCredential(""); ParamsClient client = new ParamsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { url = "", }); @@ -177,7 +177,7 @@ This sample shows how to call PostParameters and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); ParamsClient client = new ParamsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { url = "", }); @@ -191,7 +191,7 @@ This sample shows how to call PostParameters with all parameters and request con AzureKeyCredential credential = new AzureKeyCredential(""); ParamsClient client = new ParamsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { url = "", }); diff --git a/test/TestServerProjectsLowLevel/dpg-update1/tests/Generated/Samples/Samples_ParamsClient.cs b/test/TestServerProjectsLowLevel/dpg-update1/tests/Generated/Samples/Samples_ParamsClient.cs index c4d7df991e4..45f5bd0e9c1 100644 --- a/test/TestServerProjectsLowLevel/dpg-update1/tests/Generated/Samples/Samples_ParamsClient.cs +++ b/test/TestServerProjectsLowLevel/dpg-update1/tests/Generated/Samples/Samples_ParamsClient.cs @@ -181,7 +181,7 @@ public void Example_PostParameters_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); ParamsClient client = new ParamsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { url = "", }); @@ -198,7 +198,7 @@ public async Task Example_PostParameters_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); ParamsClient client = new ParamsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { url = "", }); @@ -215,7 +215,7 @@ public void Example_PostParameters_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); ParamsClient client = new ParamsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { url = "", }); @@ -232,7 +232,7 @@ public async Task Example_PostParameters_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); ParamsClient client = new ParamsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { url = "", }); diff --git a/test/TestServerProjectsLowLevel/httpInfrastructure/src/Generated/Docs/HttpClientFailureClient.xml b/test/TestServerProjectsLowLevel/httpInfrastructure/src/Generated/Docs/HttpClientFailureClient.xml index aad67509cb2..d6ec912f4b2 100644 --- a/test/TestServerProjectsLowLevel/httpInfrastructure/src/Generated/Docs/HttpClientFailureClient.xml +++ b/test/TestServerProjectsLowLevel/httpInfrastructure/src/Generated/Docs/HttpClientFailureClient.xml @@ -134,7 +134,7 @@ This sample shows how to call Put400Async. AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.Put400Async(content); Console.WriteLine(response.Status); @@ -144,7 +144,7 @@ This sample shows how to call Put400Async with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = await client.Put400Async(content); Console.WriteLine(response.Status); @@ -157,7 +157,7 @@ This sample shows how to call Put400. AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.Put400(content); Console.WriteLine(response.Status); @@ -167,7 +167,7 @@ This sample shows how to call Put400 with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = client.Put400(content); Console.WriteLine(response.Status); @@ -180,7 +180,7 @@ This sample shows how to call Patch400Async. AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.Patch400Async(content); Console.WriteLine(response.Status); @@ -190,7 +190,7 @@ This sample shows how to call Patch400Async with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = await client.Patch400Async(content); Console.WriteLine(response.Status); @@ -203,7 +203,7 @@ This sample shows how to call Patch400. AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.Patch400(content); Console.WriteLine(response.Status); @@ -213,7 +213,7 @@ This sample shows how to call Patch400 with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = client.Patch400(content); Console.WriteLine(response.Status); @@ -226,7 +226,7 @@ This sample shows how to call Post400Async. AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.Post400Async(content); Console.WriteLine(response.Status); @@ -236,7 +236,7 @@ This sample shows how to call Post400Async with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = await client.Post400Async(content); Console.WriteLine(response.Status); @@ -249,7 +249,7 @@ This sample shows how to call Post400. AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.Post400(content); Console.WriteLine(response.Status); @@ -259,7 +259,7 @@ This sample shows how to call Post400 with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = client.Post400(content); Console.WriteLine(response.Status); @@ -272,7 +272,7 @@ This sample shows how to call Delete400Async. AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.Delete400Async(content); Console.WriteLine(response.Status); @@ -282,7 +282,7 @@ This sample shows how to call Delete400Async with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = await client.Delete400Async(content); Console.WriteLine(response.Status); @@ -295,7 +295,7 @@ This sample shows how to call Delete400. AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.Delete400(content); Console.WriteLine(response.Status); @@ -305,7 +305,7 @@ This sample shows how to call Delete400 with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = client.Delete400(content); Console.WriteLine(response.Status); @@ -486,7 +486,7 @@ This sample shows how to call Put404Async. AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.Put404Async(content); Console.WriteLine(response.Status); @@ -496,7 +496,7 @@ This sample shows how to call Put404Async with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = await client.Put404Async(content); Console.WriteLine(response.Status); @@ -509,7 +509,7 @@ This sample shows how to call Put404. AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.Put404(content); Console.WriteLine(response.Status); @@ -519,7 +519,7 @@ This sample shows how to call Put404 with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = client.Put404(content); Console.WriteLine(response.Status); @@ -532,7 +532,7 @@ This sample shows how to call Patch405Async. AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.Patch405Async(content); Console.WriteLine(response.Status); @@ -542,7 +542,7 @@ This sample shows how to call Patch405Async with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = await client.Patch405Async(content); Console.WriteLine(response.Status); @@ -555,7 +555,7 @@ This sample shows how to call Patch405. AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.Patch405(content); Console.WriteLine(response.Status); @@ -565,7 +565,7 @@ This sample shows how to call Patch405 with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = client.Patch405(content); Console.WriteLine(response.Status); @@ -578,7 +578,7 @@ This sample shows how to call Post406Async. AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.Post406Async(content); Console.WriteLine(response.Status); @@ -588,7 +588,7 @@ This sample shows how to call Post406Async with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = await client.Post406Async(content); Console.WriteLine(response.Status); @@ -601,7 +601,7 @@ This sample shows how to call Post406. AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.Post406(content); Console.WriteLine(response.Status); @@ -611,7 +611,7 @@ This sample shows how to call Post406 with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = client.Post406(content); Console.WriteLine(response.Status); @@ -624,7 +624,7 @@ This sample shows how to call Delete407Async. AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.Delete407Async(content); Console.WriteLine(response.Status); @@ -634,7 +634,7 @@ This sample shows how to call Delete407Async with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = await client.Delete407Async(content); Console.WriteLine(response.Status); @@ -647,7 +647,7 @@ This sample shows how to call Delete407. AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.Delete407(content); Console.WriteLine(response.Status); @@ -657,7 +657,7 @@ This sample shows how to call Delete407 with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = client.Delete407(content); Console.WriteLine(response.Status); @@ -670,7 +670,7 @@ This sample shows how to call Put409Async. AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.Put409Async(content); Console.WriteLine(response.Status); @@ -680,7 +680,7 @@ This sample shows how to call Put409Async with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = await client.Put409Async(content); Console.WriteLine(response.Status); @@ -693,7 +693,7 @@ This sample shows how to call Put409. AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.Put409(content); Console.WriteLine(response.Status); @@ -703,7 +703,7 @@ This sample shows how to call Put409 with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = client.Put409(content); Console.WriteLine(response.Status); @@ -884,7 +884,7 @@ This sample shows how to call Put413Async. AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.Put413Async(content); Console.WriteLine(response.Status); @@ -894,7 +894,7 @@ This sample shows how to call Put413Async with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = await client.Put413Async(content); Console.WriteLine(response.Status); @@ -907,7 +907,7 @@ This sample shows how to call Put413. AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.Put413(content); Console.WriteLine(response.Status); @@ -917,7 +917,7 @@ This sample shows how to call Put413 with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = client.Put413(content); Console.WriteLine(response.Status); @@ -930,7 +930,7 @@ This sample shows how to call Patch414Async. AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.Patch414Async(content); Console.WriteLine(response.Status); @@ -940,7 +940,7 @@ This sample shows how to call Patch414Async with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = await client.Patch414Async(content); Console.WriteLine(response.Status); @@ -953,7 +953,7 @@ This sample shows how to call Patch414. AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.Patch414(content); Console.WriteLine(response.Status); @@ -963,7 +963,7 @@ This sample shows how to call Patch414 with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = client.Patch414(content); Console.WriteLine(response.Status); @@ -976,7 +976,7 @@ This sample shows how to call Post415Async. AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.Post415Async(content); Console.WriteLine(response.Status); @@ -986,7 +986,7 @@ This sample shows how to call Post415Async with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = await client.Post415Async(content); Console.WriteLine(response.Status); @@ -999,7 +999,7 @@ This sample shows how to call Post415. AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.Post415(content); Console.WriteLine(response.Status); @@ -1009,7 +1009,7 @@ This sample shows how to call Post415 with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = client.Post415(content); Console.WriteLine(response.Status); @@ -1064,7 +1064,7 @@ This sample shows how to call Delete417Async. AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.Delete417Async(content); Console.WriteLine(response.Status); @@ -1074,7 +1074,7 @@ This sample shows how to call Delete417Async with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = await client.Delete417Async(content); Console.WriteLine(response.Status); @@ -1087,7 +1087,7 @@ This sample shows how to call Delete417. AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.Delete417(content); Console.WriteLine(response.Status); @@ -1097,7 +1097,7 @@ This sample shows how to call Delete417 with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = client.Delete417(content); Console.WriteLine(response.Status); diff --git a/test/TestServerProjectsLowLevel/httpInfrastructure/src/Generated/Docs/HttpRedirectsClient.xml b/test/TestServerProjectsLowLevel/httpInfrastructure/src/Generated/Docs/HttpRedirectsClient.xml index aabb0ca947e..813e4de6683 100644 --- a/test/TestServerProjectsLowLevel/httpInfrastructure/src/Generated/Docs/HttpRedirectsClient.xml +++ b/test/TestServerProjectsLowLevel/httpInfrastructure/src/Generated/Docs/HttpRedirectsClient.xml @@ -176,7 +176,7 @@ This sample shows how to call Put301Async. AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.Put301Async(content); Console.WriteLine(response.Status); @@ -186,7 +186,7 @@ This sample shows how to call Put301Async with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = await client.Put301Async(content); Console.WriteLine(response.Status); @@ -199,7 +199,7 @@ This sample shows how to call Put301. AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.Put301(content); Console.WriteLine(response.Status); @@ -209,7 +209,7 @@ This sample shows how to call Put301 with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = client.Put301(content); Console.WriteLine(response.Status); @@ -306,7 +306,7 @@ This sample shows how to call Patch302Async. AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.Patch302Async(content); Console.WriteLine(response.Status); @@ -316,7 +316,7 @@ This sample shows how to call Patch302Async with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = await client.Patch302Async(content); Console.WriteLine(response.Status); @@ -329,7 +329,7 @@ This sample shows how to call Patch302. AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.Patch302(content); Console.WriteLine(response.Status); @@ -339,7 +339,7 @@ This sample shows how to call Patch302 with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = client.Patch302(content); Console.WriteLine(response.Status); @@ -352,7 +352,7 @@ This sample shows how to call Post303Async. AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.Post303Async(content); Console.WriteLine(response.Status); @@ -362,7 +362,7 @@ This sample shows how to call Post303Async with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = await client.Post303Async(content); Console.WriteLine(response.Status); @@ -375,7 +375,7 @@ This sample shows how to call Post303. AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.Post303(content); Console.WriteLine(response.Status); @@ -385,7 +385,7 @@ This sample shows how to call Post303 with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = client.Post303(content); Console.WriteLine(response.Status); @@ -524,7 +524,7 @@ This sample shows how to call Put307Async. AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.Put307Async(content); Console.WriteLine(response.Status); @@ -534,7 +534,7 @@ This sample shows how to call Put307Async with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = await client.Put307Async(content); Console.WriteLine(response.Status); @@ -547,7 +547,7 @@ This sample shows how to call Put307. AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.Put307(content); Console.WriteLine(response.Status); @@ -557,7 +557,7 @@ This sample shows how to call Put307 with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = client.Put307(content); Console.WriteLine(response.Status); @@ -570,7 +570,7 @@ This sample shows how to call Patch307Async. AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.Patch307Async(content); Console.WriteLine(response.Status); @@ -580,7 +580,7 @@ This sample shows how to call Patch307Async with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = await client.Patch307Async(content); Console.WriteLine(response.Status); @@ -593,7 +593,7 @@ This sample shows how to call Patch307. AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.Patch307(content); Console.WriteLine(response.Status); @@ -603,7 +603,7 @@ This sample shows how to call Patch307 with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = client.Patch307(content); Console.WriteLine(response.Status); @@ -616,7 +616,7 @@ This sample shows how to call Post307Async. AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.Post307Async(content); Console.WriteLine(response.Status); @@ -626,7 +626,7 @@ This sample shows how to call Post307Async with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = await client.Post307Async(content); Console.WriteLine(response.Status); @@ -639,7 +639,7 @@ This sample shows how to call Post307. AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.Post307(content); Console.WriteLine(response.Status); @@ -649,7 +649,7 @@ This sample shows how to call Post307 with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = client.Post307(content); Console.WriteLine(response.Status); @@ -662,7 +662,7 @@ This sample shows how to call Delete307Async. AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.Delete307Async(content); Console.WriteLine(response.Status); @@ -672,7 +672,7 @@ This sample shows how to call Delete307Async with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = await client.Delete307Async(content); Console.WriteLine(response.Status); @@ -685,7 +685,7 @@ This sample shows how to call Delete307. AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.Delete307(content); Console.WriteLine(response.Status); @@ -695,7 +695,7 @@ This sample shows how to call Delete307 with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = client.Delete307(content); Console.WriteLine(response.Status); diff --git a/test/TestServerProjectsLowLevel/httpInfrastructure/src/Generated/Docs/HttpRetryClient.xml b/test/TestServerProjectsLowLevel/httpInfrastructure/src/Generated/Docs/HttpRetryClient.xml index 56b88eebd27..593333739ae 100644 --- a/test/TestServerProjectsLowLevel/httpInfrastructure/src/Generated/Docs/HttpRetryClient.xml +++ b/test/TestServerProjectsLowLevel/httpInfrastructure/src/Generated/Docs/HttpRetryClient.xml @@ -50,7 +50,7 @@ This sample shows how to call Put500Async. AzureKeyCredential credential = new AzureKeyCredential(""); HttpRetryClient client = new HttpRetryClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.Put500Async(content); Console.WriteLine(response.Status); @@ -60,7 +60,7 @@ This sample shows how to call Put500Async with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpRetryClient client = new HttpRetryClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = await client.Put500Async(content); Console.WriteLine(response.Status); @@ -73,7 +73,7 @@ This sample shows how to call Put500. AzureKeyCredential credential = new AzureKeyCredential(""); HttpRetryClient client = new HttpRetryClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.Put500(content); Console.WriteLine(response.Status); @@ -83,7 +83,7 @@ This sample shows how to call Put500 with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpRetryClient client = new HttpRetryClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = client.Put500(content); Console.WriteLine(response.Status); @@ -96,7 +96,7 @@ This sample shows how to call Patch500Async. AzureKeyCredential credential = new AzureKeyCredential(""); HttpRetryClient client = new HttpRetryClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.Patch500Async(content); Console.WriteLine(response.Status); @@ -106,7 +106,7 @@ This sample shows how to call Patch500Async with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpRetryClient client = new HttpRetryClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = await client.Patch500Async(content); Console.WriteLine(response.Status); @@ -119,7 +119,7 @@ This sample shows how to call Patch500. AzureKeyCredential credential = new AzureKeyCredential(""); HttpRetryClient client = new HttpRetryClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.Patch500(content); Console.WriteLine(response.Status); @@ -129,7 +129,7 @@ This sample shows how to call Patch500 with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpRetryClient client = new HttpRetryClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = client.Patch500(content); Console.WriteLine(response.Status); @@ -230,7 +230,7 @@ This sample shows how to call Post503Async. AzureKeyCredential credential = new AzureKeyCredential(""); HttpRetryClient client = new HttpRetryClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.Post503Async(content); Console.WriteLine(response.Status); @@ -240,7 +240,7 @@ This sample shows how to call Post503Async with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpRetryClient client = new HttpRetryClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = await client.Post503Async(content); Console.WriteLine(response.Status); @@ -253,7 +253,7 @@ This sample shows how to call Post503. AzureKeyCredential credential = new AzureKeyCredential(""); HttpRetryClient client = new HttpRetryClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.Post503(content); Console.WriteLine(response.Status); @@ -263,7 +263,7 @@ This sample shows how to call Post503 with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpRetryClient client = new HttpRetryClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = client.Post503(content); Console.WriteLine(response.Status); @@ -276,7 +276,7 @@ This sample shows how to call Delete503Async. AzureKeyCredential credential = new AzureKeyCredential(""); HttpRetryClient client = new HttpRetryClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.Delete503Async(content); Console.WriteLine(response.Status); @@ -286,7 +286,7 @@ This sample shows how to call Delete503Async with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpRetryClient client = new HttpRetryClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = await client.Delete503Async(content); Console.WriteLine(response.Status); @@ -299,7 +299,7 @@ This sample shows how to call Delete503. AzureKeyCredential credential = new AzureKeyCredential(""); HttpRetryClient client = new HttpRetryClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.Delete503(content); Console.WriteLine(response.Status); @@ -309,7 +309,7 @@ This sample shows how to call Delete503 with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpRetryClient client = new HttpRetryClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = client.Delete503(content); Console.WriteLine(response.Status); @@ -322,7 +322,7 @@ This sample shows how to call Put504Async. AzureKeyCredential credential = new AzureKeyCredential(""); HttpRetryClient client = new HttpRetryClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.Put504Async(content); Console.WriteLine(response.Status); @@ -332,7 +332,7 @@ This sample shows how to call Put504Async with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpRetryClient client = new HttpRetryClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = await client.Put504Async(content); Console.WriteLine(response.Status); @@ -345,7 +345,7 @@ This sample shows how to call Put504. AzureKeyCredential credential = new AzureKeyCredential(""); HttpRetryClient client = new HttpRetryClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.Put504(content); Console.WriteLine(response.Status); @@ -355,7 +355,7 @@ This sample shows how to call Put504 with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpRetryClient client = new HttpRetryClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = client.Put504(content); Console.WriteLine(response.Status); @@ -368,7 +368,7 @@ This sample shows how to call Patch504Async. AzureKeyCredential credential = new AzureKeyCredential(""); HttpRetryClient client = new HttpRetryClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.Patch504Async(content); Console.WriteLine(response.Status); @@ -378,7 +378,7 @@ This sample shows how to call Patch504Async with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpRetryClient client = new HttpRetryClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = await client.Patch504Async(content); Console.WriteLine(response.Status); @@ -391,7 +391,7 @@ This sample shows how to call Patch504. AzureKeyCredential credential = new AzureKeyCredential(""); HttpRetryClient client = new HttpRetryClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.Patch504(content); Console.WriteLine(response.Status); @@ -401,7 +401,7 @@ This sample shows how to call Patch504 with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpRetryClient client = new HttpRetryClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = client.Patch504(content); Console.WriteLine(response.Status); diff --git a/test/TestServerProjectsLowLevel/httpInfrastructure/src/Generated/Docs/HttpServerFailureClient.xml b/test/TestServerProjectsLowLevel/httpInfrastructure/src/Generated/Docs/HttpServerFailureClient.xml index fc07b49c243..08db96aba8e 100644 --- a/test/TestServerProjectsLowLevel/httpInfrastructure/src/Generated/Docs/HttpServerFailureClient.xml +++ b/test/TestServerProjectsLowLevel/httpInfrastructure/src/Generated/Docs/HttpServerFailureClient.xml @@ -92,7 +92,7 @@ This sample shows how to call Post505Async. AzureKeyCredential credential = new AzureKeyCredential(""); HttpServerFailureClient client = new HttpServerFailureClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.Post505Async(content); Console.WriteLine(response.Status); @@ -102,7 +102,7 @@ This sample shows how to call Post505Async with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpServerFailureClient client = new HttpServerFailureClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = await client.Post505Async(content); Console.WriteLine(response.Status); @@ -115,7 +115,7 @@ This sample shows how to call Post505. AzureKeyCredential credential = new AzureKeyCredential(""); HttpServerFailureClient client = new HttpServerFailureClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.Post505(content); Console.WriteLine(response.Status); @@ -125,7 +125,7 @@ This sample shows how to call Post505 with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpServerFailureClient client = new HttpServerFailureClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = client.Post505(content); Console.WriteLine(response.Status); @@ -138,7 +138,7 @@ This sample shows how to call Delete505Async. AzureKeyCredential credential = new AzureKeyCredential(""); HttpServerFailureClient client = new HttpServerFailureClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.Delete505Async(content); Console.WriteLine(response.Status); @@ -148,7 +148,7 @@ This sample shows how to call Delete505Async with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpServerFailureClient client = new HttpServerFailureClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = await client.Delete505Async(content); Console.WriteLine(response.Status); @@ -161,7 +161,7 @@ This sample shows how to call Delete505. AzureKeyCredential credential = new AzureKeyCredential(""); HttpServerFailureClient client = new HttpServerFailureClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.Delete505(content); Console.WriteLine(response.Status); @@ -171,7 +171,7 @@ This sample shows how to call Delete505 with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpServerFailureClient client = new HttpServerFailureClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = client.Delete505(content); Console.WriteLine(response.Status); diff --git a/test/TestServerProjectsLowLevel/httpInfrastructure/src/Generated/Docs/HttpSuccessClient.xml b/test/TestServerProjectsLowLevel/httpInfrastructure/src/Generated/Docs/HttpSuccessClient.xml index 0365fb722fe..ab73de03ebc 100644 --- a/test/TestServerProjectsLowLevel/httpInfrastructure/src/Generated/Docs/HttpSuccessClient.xml +++ b/test/TestServerProjectsLowLevel/httpInfrastructure/src/Generated/Docs/HttpSuccessClient.xml @@ -142,7 +142,7 @@ This sample shows how to call Put200Async. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.Put200Async(content); Console.WriteLine(response.Status); @@ -152,7 +152,7 @@ This sample shows how to call Put200Async with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = await client.Put200Async(content); Console.WriteLine(response.Status); @@ -165,7 +165,7 @@ This sample shows how to call Put200. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.Put200(content); Console.WriteLine(response.Status); @@ -175,7 +175,7 @@ This sample shows how to call Put200 with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = client.Put200(content); Console.WriteLine(response.Status); @@ -188,7 +188,7 @@ This sample shows how to call Patch200Async. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.Patch200Async(content); Console.WriteLine(response.Status); @@ -198,7 +198,7 @@ This sample shows how to call Patch200Async with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = await client.Patch200Async(content); Console.WriteLine(response.Status); @@ -211,7 +211,7 @@ This sample shows how to call Patch200. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.Patch200(content); Console.WriteLine(response.Status); @@ -221,7 +221,7 @@ This sample shows how to call Patch200 with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = client.Patch200(content); Console.WriteLine(response.Status); @@ -234,7 +234,7 @@ This sample shows how to call Post200Async. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.Post200Async(content); Console.WriteLine(response.Status); @@ -244,7 +244,7 @@ This sample shows how to call Post200Async with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = await client.Post200Async(content); Console.WriteLine(response.Status); @@ -257,7 +257,7 @@ This sample shows how to call Post200. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.Post200(content); Console.WriteLine(response.Status); @@ -267,7 +267,7 @@ This sample shows how to call Post200 with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = client.Post200(content); Console.WriteLine(response.Status); @@ -280,7 +280,7 @@ This sample shows how to call Delete200Async. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.Delete200Async(content); Console.WriteLine(response.Status); @@ -290,7 +290,7 @@ This sample shows how to call Delete200Async with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = await client.Delete200Async(content); Console.WriteLine(response.Status); @@ -303,7 +303,7 @@ This sample shows how to call Delete200. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.Delete200(content); Console.WriteLine(response.Status); @@ -313,7 +313,7 @@ This sample shows how to call Delete200 with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = client.Delete200(content); Console.WriteLine(response.Status); @@ -326,7 +326,7 @@ This sample shows how to call Put201Async. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.Put201Async(content); Console.WriteLine(response.Status); @@ -336,7 +336,7 @@ This sample shows how to call Put201Async with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = await client.Put201Async(content); Console.WriteLine(response.Status); @@ -349,7 +349,7 @@ This sample shows how to call Put201. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.Put201(content); Console.WriteLine(response.Status); @@ -359,7 +359,7 @@ This sample shows how to call Put201 with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = client.Put201(content); Console.WriteLine(response.Status); @@ -372,7 +372,7 @@ This sample shows how to call Post201Async. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.Post201Async(content); Console.WriteLine(response.Status); @@ -382,7 +382,7 @@ This sample shows how to call Post201Async with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = await client.Post201Async(content); Console.WriteLine(response.Status); @@ -395,7 +395,7 @@ This sample shows how to call Post201. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.Post201(content); Console.WriteLine(response.Status); @@ -405,7 +405,7 @@ This sample shows how to call Post201 with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = client.Post201(content); Console.WriteLine(response.Status); @@ -418,7 +418,7 @@ This sample shows how to call Put202Async. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.Put202Async(content); Console.WriteLine(response.Status); @@ -428,7 +428,7 @@ This sample shows how to call Put202Async with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = await client.Put202Async(content); Console.WriteLine(response.Status); @@ -441,7 +441,7 @@ This sample shows how to call Put202. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.Put202(content); Console.WriteLine(response.Status); @@ -451,7 +451,7 @@ This sample shows how to call Put202 with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = client.Put202(content); Console.WriteLine(response.Status); @@ -464,7 +464,7 @@ This sample shows how to call Patch202Async. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.Patch202Async(content); Console.WriteLine(response.Status); @@ -474,7 +474,7 @@ This sample shows how to call Patch202Async with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = await client.Patch202Async(content); Console.WriteLine(response.Status); @@ -487,7 +487,7 @@ This sample shows how to call Patch202. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.Patch202(content); Console.WriteLine(response.Status); @@ -497,7 +497,7 @@ This sample shows how to call Patch202 with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = client.Patch202(content); Console.WriteLine(response.Status); @@ -510,7 +510,7 @@ This sample shows how to call Post202Async. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.Post202Async(content); Console.WriteLine(response.Status); @@ -520,7 +520,7 @@ This sample shows how to call Post202Async with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = await client.Post202Async(content); Console.WriteLine(response.Status); @@ -533,7 +533,7 @@ This sample shows how to call Post202. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.Post202(content); Console.WriteLine(response.Status); @@ -543,7 +543,7 @@ This sample shows how to call Post202 with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = client.Post202(content); Console.WriteLine(response.Status); @@ -556,7 +556,7 @@ This sample shows how to call Delete202Async. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.Delete202Async(content); Console.WriteLine(response.Status); @@ -566,7 +566,7 @@ This sample shows how to call Delete202Async with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = await client.Delete202Async(content); Console.WriteLine(response.Status); @@ -579,7 +579,7 @@ This sample shows how to call Delete202. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.Delete202(content); Console.WriteLine(response.Status); @@ -589,7 +589,7 @@ This sample shows how to call Delete202 with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = client.Delete202(content); Console.WriteLine(response.Status); @@ -644,7 +644,7 @@ This sample shows how to call Put204Async. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.Put204Async(content); Console.WriteLine(response.Status); @@ -654,7 +654,7 @@ This sample shows how to call Put204Async with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = await client.Put204Async(content); Console.WriteLine(response.Status); @@ -667,7 +667,7 @@ This sample shows how to call Put204. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.Put204(content); Console.WriteLine(response.Status); @@ -677,7 +677,7 @@ This sample shows how to call Put204 with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = client.Put204(content); Console.WriteLine(response.Status); @@ -690,7 +690,7 @@ This sample shows how to call Patch204Async. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.Patch204Async(content); Console.WriteLine(response.Status); @@ -700,7 +700,7 @@ This sample shows how to call Patch204Async with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = await client.Patch204Async(content); Console.WriteLine(response.Status); @@ -713,7 +713,7 @@ This sample shows how to call Patch204. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.Patch204(content); Console.WriteLine(response.Status); @@ -723,7 +723,7 @@ This sample shows how to call Patch204 with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = client.Patch204(content); Console.WriteLine(response.Status); @@ -736,7 +736,7 @@ This sample shows how to call Post204Async. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.Post204Async(content); Console.WriteLine(response.Status); @@ -746,7 +746,7 @@ This sample shows how to call Post204Async with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = await client.Post204Async(content); Console.WriteLine(response.Status); @@ -759,7 +759,7 @@ This sample shows how to call Post204. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.Post204(content); Console.WriteLine(response.Status); @@ -769,7 +769,7 @@ This sample shows how to call Post204 with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = client.Post204(content); Console.WriteLine(response.Status); @@ -782,7 +782,7 @@ This sample shows how to call Delete204Async. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.Delete204Async(content); Console.WriteLine(response.Status); @@ -792,7 +792,7 @@ This sample shows how to call Delete204Async with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = await client.Delete204Async(content); Console.WriteLine(response.Status); @@ -805,7 +805,7 @@ This sample shows how to call Delete204. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.Delete204(content); Console.WriteLine(response.Status); @@ -815,7 +815,7 @@ This sample shows how to call Delete204 with all request content. AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); -RequestContent content = RequestContent.Create("true"); +using RequestContent content = RequestContent.Create("true"); Response response = client.Delete204(content); Console.WriteLine(response.Status); diff --git a/test/TestServerProjectsLowLevel/httpInfrastructure/tests/Generated/Samples/Samples_HttpClientFailureClient.cs b/test/TestServerProjectsLowLevel/httpInfrastructure/tests/Generated/Samples/Samples_HttpClientFailureClient.cs index 418dc0c0f94..0475c4bd4a1 100644 --- a/test/TestServerProjectsLowLevel/httpInfrastructure/tests/Generated/Samples/Samples_HttpClientFailureClient.cs +++ b/test/TestServerProjectsLowLevel/httpInfrastructure/tests/Generated/Samples/Samples_HttpClientFailureClient.cs @@ -168,7 +168,7 @@ public void Example_Put400_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.Put400(content); Console.WriteLine(response.Status); @@ -181,7 +181,7 @@ public async Task Example_Put400_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.Put400Async(content); Console.WriteLine(response.Status); @@ -194,7 +194,7 @@ public void Example_Put400_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = client.Put400(content); Console.WriteLine(response.Status); @@ -207,7 +207,7 @@ public async Task Example_Put400_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = await client.Put400Async(content); Console.WriteLine(response.Status); @@ -220,7 +220,7 @@ public void Example_Patch400_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.Patch400(content); Console.WriteLine(response.Status); @@ -233,7 +233,7 @@ public async Task Example_Patch400_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.Patch400Async(content); Console.WriteLine(response.Status); @@ -246,7 +246,7 @@ public void Example_Patch400_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = client.Patch400(content); Console.WriteLine(response.Status); @@ -259,7 +259,7 @@ public async Task Example_Patch400_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = await client.Patch400Async(content); Console.WriteLine(response.Status); @@ -272,7 +272,7 @@ public void Example_Post400_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.Post400(content); Console.WriteLine(response.Status); @@ -285,7 +285,7 @@ public async Task Example_Post400_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.Post400Async(content); Console.WriteLine(response.Status); @@ -298,7 +298,7 @@ public void Example_Post400_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = client.Post400(content); Console.WriteLine(response.Status); @@ -311,7 +311,7 @@ public async Task Example_Post400_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = await client.Post400Async(content); Console.WriteLine(response.Status); @@ -324,7 +324,7 @@ public void Example_Delete400_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.Delete400(content); Console.WriteLine(response.Status); @@ -337,7 +337,7 @@ public async Task Example_Delete400_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.Delete400Async(content); Console.WriteLine(response.Status); @@ -350,7 +350,7 @@ public void Example_Delete400_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = client.Delete400(content); Console.WriteLine(response.Status); @@ -363,7 +363,7 @@ public async Task Example_Delete400_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = await client.Delete400Async(content); Console.WriteLine(response.Status); @@ -568,7 +568,7 @@ public void Example_Put404_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.Put404(content); Console.WriteLine(response.Status); @@ -581,7 +581,7 @@ public async Task Example_Put404_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.Put404Async(content); Console.WriteLine(response.Status); @@ -594,7 +594,7 @@ public void Example_Put404_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = client.Put404(content); Console.WriteLine(response.Status); @@ -607,7 +607,7 @@ public async Task Example_Put404_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = await client.Put404Async(content); Console.WriteLine(response.Status); @@ -620,7 +620,7 @@ public void Example_Patch405_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.Patch405(content); Console.WriteLine(response.Status); @@ -633,7 +633,7 @@ public async Task Example_Patch405_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.Patch405Async(content); Console.WriteLine(response.Status); @@ -646,7 +646,7 @@ public void Example_Patch405_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = client.Patch405(content); Console.WriteLine(response.Status); @@ -659,7 +659,7 @@ public async Task Example_Patch405_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = await client.Patch405Async(content); Console.WriteLine(response.Status); @@ -672,7 +672,7 @@ public void Example_Post406_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.Post406(content); Console.WriteLine(response.Status); @@ -685,7 +685,7 @@ public async Task Example_Post406_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.Post406Async(content); Console.WriteLine(response.Status); @@ -698,7 +698,7 @@ public void Example_Post406_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = client.Post406(content); Console.WriteLine(response.Status); @@ -711,7 +711,7 @@ public async Task Example_Post406_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = await client.Post406Async(content); Console.WriteLine(response.Status); @@ -724,7 +724,7 @@ public void Example_Delete407_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.Delete407(content); Console.WriteLine(response.Status); @@ -737,7 +737,7 @@ public async Task Example_Delete407_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.Delete407Async(content); Console.WriteLine(response.Status); @@ -750,7 +750,7 @@ public void Example_Delete407_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = client.Delete407(content); Console.WriteLine(response.Status); @@ -763,7 +763,7 @@ public async Task Example_Delete407_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = await client.Delete407Async(content); Console.WriteLine(response.Status); @@ -776,7 +776,7 @@ public void Example_Put409_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.Put409(content); Console.WriteLine(response.Status); @@ -789,7 +789,7 @@ public async Task Example_Put409_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.Put409Async(content); Console.WriteLine(response.Status); @@ -802,7 +802,7 @@ public void Example_Put409_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = client.Put409(content); Console.WriteLine(response.Status); @@ -815,7 +815,7 @@ public async Task Example_Put409_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = await client.Put409Async(content); Console.WriteLine(response.Status); @@ -1020,7 +1020,7 @@ public void Example_Put413_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.Put413(content); Console.WriteLine(response.Status); @@ -1033,7 +1033,7 @@ public async Task Example_Put413_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.Put413Async(content); Console.WriteLine(response.Status); @@ -1046,7 +1046,7 @@ public void Example_Put413_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = client.Put413(content); Console.WriteLine(response.Status); @@ -1059,7 +1059,7 @@ public async Task Example_Put413_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = await client.Put413Async(content); Console.WriteLine(response.Status); @@ -1072,7 +1072,7 @@ public void Example_Patch414_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.Patch414(content); Console.WriteLine(response.Status); @@ -1085,7 +1085,7 @@ public async Task Example_Patch414_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.Patch414Async(content); Console.WriteLine(response.Status); @@ -1098,7 +1098,7 @@ public void Example_Patch414_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = client.Patch414(content); Console.WriteLine(response.Status); @@ -1111,7 +1111,7 @@ public async Task Example_Patch414_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = await client.Patch414Async(content); Console.WriteLine(response.Status); @@ -1124,7 +1124,7 @@ public void Example_Post415_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.Post415(content); Console.WriteLine(response.Status); @@ -1137,7 +1137,7 @@ public async Task Example_Post415_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.Post415Async(content); Console.WriteLine(response.Status); @@ -1150,7 +1150,7 @@ public void Example_Post415_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = client.Post415(content); Console.WriteLine(response.Status); @@ -1163,7 +1163,7 @@ public async Task Example_Post415_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = await client.Post415Async(content); Console.WriteLine(response.Status); @@ -1224,7 +1224,7 @@ public void Example_Delete417_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.Delete417(content); Console.WriteLine(response.Status); @@ -1237,7 +1237,7 @@ public async Task Example_Delete417_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.Delete417Async(content); Console.WriteLine(response.Status); @@ -1250,7 +1250,7 @@ public void Example_Delete417_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = client.Delete417(content); Console.WriteLine(response.Status); @@ -1263,7 +1263,7 @@ public async Task Example_Delete417_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpClientFailureClient client = new HttpClientFailureClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = await client.Delete417Async(content); Console.WriteLine(response.Status); diff --git a/test/TestServerProjectsLowLevel/httpInfrastructure/tests/Generated/Samples/Samples_HttpRedirectsClient.cs b/test/TestServerProjectsLowLevel/httpInfrastructure/tests/Generated/Samples/Samples_HttpRedirectsClient.cs index 5d79eeb8f28..9a6ae4ca4a9 100644 --- a/test/TestServerProjectsLowLevel/httpInfrastructure/tests/Generated/Samples/Samples_HttpRedirectsClient.cs +++ b/test/TestServerProjectsLowLevel/httpInfrastructure/tests/Generated/Samples/Samples_HttpRedirectsClient.cs @@ -216,7 +216,7 @@ public void Example_Put301_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.Put301(content); Console.WriteLine(response.Status); @@ -229,7 +229,7 @@ public async Task Example_Put301_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.Put301Async(content); Console.WriteLine(response.Status); @@ -242,7 +242,7 @@ public void Example_Put301_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = client.Put301(content); Console.WriteLine(response.Status); @@ -255,7 +255,7 @@ public async Task Example_Put301_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = await client.Put301Async(content); Console.WriteLine(response.Status); @@ -364,7 +364,7 @@ public void Example_Patch302_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.Patch302(content); Console.WriteLine(response.Status); @@ -377,7 +377,7 @@ public async Task Example_Patch302_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.Patch302Async(content); Console.WriteLine(response.Status); @@ -390,7 +390,7 @@ public void Example_Patch302_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = client.Patch302(content); Console.WriteLine(response.Status); @@ -403,7 +403,7 @@ public async Task Example_Patch302_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = await client.Patch302Async(content); Console.WriteLine(response.Status); @@ -416,7 +416,7 @@ public void Example_Post303_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.Post303(content); Console.WriteLine(response.Status); @@ -429,7 +429,7 @@ public async Task Example_Post303_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.Post303Async(content); Console.WriteLine(response.Status); @@ -442,7 +442,7 @@ public void Example_Post303_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = client.Post303(content); Console.WriteLine(response.Status); @@ -455,7 +455,7 @@ public async Task Example_Post303_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = await client.Post303Async(content); Console.WriteLine(response.Status); @@ -612,7 +612,7 @@ public void Example_Put307_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.Put307(content); Console.WriteLine(response.Status); @@ -625,7 +625,7 @@ public async Task Example_Put307_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.Put307Async(content); Console.WriteLine(response.Status); @@ -638,7 +638,7 @@ public void Example_Put307_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = client.Put307(content); Console.WriteLine(response.Status); @@ -651,7 +651,7 @@ public async Task Example_Put307_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = await client.Put307Async(content); Console.WriteLine(response.Status); @@ -664,7 +664,7 @@ public void Example_Patch307_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.Patch307(content); Console.WriteLine(response.Status); @@ -677,7 +677,7 @@ public async Task Example_Patch307_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.Patch307Async(content); Console.WriteLine(response.Status); @@ -690,7 +690,7 @@ public void Example_Patch307_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = client.Patch307(content); Console.WriteLine(response.Status); @@ -703,7 +703,7 @@ public async Task Example_Patch307_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = await client.Patch307Async(content); Console.WriteLine(response.Status); @@ -716,7 +716,7 @@ public void Example_Post307_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.Post307(content); Console.WriteLine(response.Status); @@ -729,7 +729,7 @@ public async Task Example_Post307_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.Post307Async(content); Console.WriteLine(response.Status); @@ -742,7 +742,7 @@ public void Example_Post307_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = client.Post307(content); Console.WriteLine(response.Status); @@ -755,7 +755,7 @@ public async Task Example_Post307_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = await client.Post307Async(content); Console.WriteLine(response.Status); @@ -768,7 +768,7 @@ public void Example_Delete307_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.Delete307(content); Console.WriteLine(response.Status); @@ -781,7 +781,7 @@ public async Task Example_Delete307_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.Delete307Async(content); Console.WriteLine(response.Status); @@ -794,7 +794,7 @@ public void Example_Delete307_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = client.Delete307(content); Console.WriteLine(response.Status); @@ -807,7 +807,7 @@ public async Task Example_Delete307_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpRedirectsClient client = new HttpRedirectsClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = await client.Delete307Async(content); Console.WriteLine(response.Status); diff --git a/test/TestServerProjectsLowLevel/httpInfrastructure/tests/Generated/Samples/Samples_HttpRetryClient.cs b/test/TestServerProjectsLowLevel/httpInfrastructure/tests/Generated/Samples/Samples_HttpRetryClient.cs index d1d7b69e42c..3c3c5845562 100644 --- a/test/TestServerProjectsLowLevel/httpInfrastructure/tests/Generated/Samples/Samples_HttpRetryClient.cs +++ b/test/TestServerProjectsLowLevel/httpInfrastructure/tests/Generated/Samples/Samples_HttpRetryClient.cs @@ -73,7 +73,7 @@ public void Example_Put500_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); HttpRetryClient client = new HttpRetryClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.Put500(content); Console.WriteLine(response.Status); @@ -86,7 +86,7 @@ public async Task Example_Put500_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpRetryClient client = new HttpRetryClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.Put500Async(content); Console.WriteLine(response.Status); @@ -99,7 +99,7 @@ public void Example_Put500_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); HttpRetryClient client = new HttpRetryClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = client.Put500(content); Console.WriteLine(response.Status); @@ -112,7 +112,7 @@ public async Task Example_Put500_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpRetryClient client = new HttpRetryClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = await client.Put500Async(content); Console.WriteLine(response.Status); @@ -125,7 +125,7 @@ public void Example_Patch500_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); HttpRetryClient client = new HttpRetryClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.Patch500(content); Console.WriteLine(response.Status); @@ -138,7 +138,7 @@ public async Task Example_Patch500_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpRetryClient client = new HttpRetryClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.Patch500Async(content); Console.WriteLine(response.Status); @@ -151,7 +151,7 @@ public void Example_Patch500_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); HttpRetryClient client = new HttpRetryClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = client.Patch500(content); Console.WriteLine(response.Status); @@ -164,7 +164,7 @@ public async Task Example_Patch500_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpRetryClient client = new HttpRetryClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = await client.Patch500Async(content); Console.WriteLine(response.Status); @@ -277,7 +277,7 @@ public void Example_Post503_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); HttpRetryClient client = new HttpRetryClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.Post503(content); Console.WriteLine(response.Status); @@ -290,7 +290,7 @@ public async Task Example_Post503_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpRetryClient client = new HttpRetryClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.Post503Async(content); Console.WriteLine(response.Status); @@ -303,7 +303,7 @@ public void Example_Post503_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); HttpRetryClient client = new HttpRetryClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = client.Post503(content); Console.WriteLine(response.Status); @@ -316,7 +316,7 @@ public async Task Example_Post503_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpRetryClient client = new HttpRetryClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = await client.Post503Async(content); Console.WriteLine(response.Status); @@ -329,7 +329,7 @@ public void Example_Delete503_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); HttpRetryClient client = new HttpRetryClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.Delete503(content); Console.WriteLine(response.Status); @@ -342,7 +342,7 @@ public async Task Example_Delete503_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpRetryClient client = new HttpRetryClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.Delete503Async(content); Console.WriteLine(response.Status); @@ -355,7 +355,7 @@ public void Example_Delete503_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); HttpRetryClient client = new HttpRetryClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = client.Delete503(content); Console.WriteLine(response.Status); @@ -368,7 +368,7 @@ public async Task Example_Delete503_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpRetryClient client = new HttpRetryClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = await client.Delete503Async(content); Console.WriteLine(response.Status); @@ -381,7 +381,7 @@ public void Example_Put504_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); HttpRetryClient client = new HttpRetryClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.Put504(content); Console.WriteLine(response.Status); @@ -394,7 +394,7 @@ public async Task Example_Put504_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpRetryClient client = new HttpRetryClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.Put504Async(content); Console.WriteLine(response.Status); @@ -407,7 +407,7 @@ public void Example_Put504_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); HttpRetryClient client = new HttpRetryClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = client.Put504(content); Console.WriteLine(response.Status); @@ -420,7 +420,7 @@ public async Task Example_Put504_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpRetryClient client = new HttpRetryClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = await client.Put504Async(content); Console.WriteLine(response.Status); @@ -433,7 +433,7 @@ public void Example_Patch504_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); HttpRetryClient client = new HttpRetryClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.Patch504(content); Console.WriteLine(response.Status); @@ -446,7 +446,7 @@ public async Task Example_Patch504_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpRetryClient client = new HttpRetryClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.Patch504Async(content); Console.WriteLine(response.Status); @@ -459,7 +459,7 @@ public void Example_Patch504_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); HttpRetryClient client = new HttpRetryClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = client.Patch504(content); Console.WriteLine(response.Status); @@ -472,7 +472,7 @@ public async Task Example_Patch504_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpRetryClient client = new HttpRetryClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = await client.Patch504Async(content); Console.WriteLine(response.Status); diff --git a/test/TestServerProjectsLowLevel/httpInfrastructure/tests/Generated/Samples/Samples_HttpServerFailureClient.cs b/test/TestServerProjectsLowLevel/httpInfrastructure/tests/Generated/Samples/Samples_HttpServerFailureClient.cs index bad0234f598..fb592020961 100644 --- a/test/TestServerProjectsLowLevel/httpInfrastructure/tests/Generated/Samples/Samples_HttpServerFailureClient.cs +++ b/test/TestServerProjectsLowLevel/httpInfrastructure/tests/Generated/Samples/Samples_HttpServerFailureClient.cs @@ -120,7 +120,7 @@ public void Example_Post505_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); HttpServerFailureClient client = new HttpServerFailureClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.Post505(content); Console.WriteLine(response.Status); @@ -133,7 +133,7 @@ public async Task Example_Post505_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpServerFailureClient client = new HttpServerFailureClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.Post505Async(content); Console.WriteLine(response.Status); @@ -146,7 +146,7 @@ public void Example_Post505_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); HttpServerFailureClient client = new HttpServerFailureClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = client.Post505(content); Console.WriteLine(response.Status); @@ -159,7 +159,7 @@ public async Task Example_Post505_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpServerFailureClient client = new HttpServerFailureClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = await client.Post505Async(content); Console.WriteLine(response.Status); @@ -172,7 +172,7 @@ public void Example_Delete505_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); HttpServerFailureClient client = new HttpServerFailureClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.Delete505(content); Console.WriteLine(response.Status); @@ -185,7 +185,7 @@ public async Task Example_Delete505_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpServerFailureClient client = new HttpServerFailureClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.Delete505Async(content); Console.WriteLine(response.Status); @@ -198,7 +198,7 @@ public void Example_Delete505_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); HttpServerFailureClient client = new HttpServerFailureClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = client.Delete505(content); Console.WriteLine(response.Status); @@ -211,7 +211,7 @@ public async Task Example_Delete505_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpServerFailureClient client = new HttpServerFailureClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = await client.Delete505Async(content); Console.WriteLine(response.Status); diff --git a/test/TestServerProjectsLowLevel/httpInfrastructure/tests/Generated/Samples/Samples_HttpSuccessClient.cs b/test/TestServerProjectsLowLevel/httpInfrastructure/tests/Generated/Samples/Samples_HttpSuccessClient.cs index b0b37e45ce8..6a3cae53bad 100644 --- a/test/TestServerProjectsLowLevel/httpInfrastructure/tests/Generated/Samples/Samples_HttpSuccessClient.cs +++ b/test/TestServerProjectsLowLevel/httpInfrastructure/tests/Generated/Samples/Samples_HttpSuccessClient.cs @@ -177,7 +177,7 @@ public void Example_Put200_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.Put200(content); Console.WriteLine(response.Status); @@ -190,7 +190,7 @@ public async Task Example_Put200_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.Put200Async(content); Console.WriteLine(response.Status); @@ -203,7 +203,7 @@ public void Example_Put200_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = client.Put200(content); Console.WriteLine(response.Status); @@ -216,7 +216,7 @@ public async Task Example_Put200_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = await client.Put200Async(content); Console.WriteLine(response.Status); @@ -229,7 +229,7 @@ public void Example_Patch200_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.Patch200(content); Console.WriteLine(response.Status); @@ -242,7 +242,7 @@ public async Task Example_Patch200_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.Patch200Async(content); Console.WriteLine(response.Status); @@ -255,7 +255,7 @@ public void Example_Patch200_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = client.Patch200(content); Console.WriteLine(response.Status); @@ -268,7 +268,7 @@ public async Task Example_Patch200_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = await client.Patch200Async(content); Console.WriteLine(response.Status); @@ -281,7 +281,7 @@ public void Example_Post200_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.Post200(content); Console.WriteLine(response.Status); @@ -294,7 +294,7 @@ public async Task Example_Post200_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.Post200Async(content); Console.WriteLine(response.Status); @@ -307,7 +307,7 @@ public void Example_Post200_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = client.Post200(content); Console.WriteLine(response.Status); @@ -320,7 +320,7 @@ public async Task Example_Post200_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = await client.Post200Async(content); Console.WriteLine(response.Status); @@ -333,7 +333,7 @@ public void Example_Delete200_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.Delete200(content); Console.WriteLine(response.Status); @@ -346,7 +346,7 @@ public async Task Example_Delete200_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.Delete200Async(content); Console.WriteLine(response.Status); @@ -359,7 +359,7 @@ public void Example_Delete200_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = client.Delete200(content); Console.WriteLine(response.Status); @@ -372,7 +372,7 @@ public async Task Example_Delete200_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = await client.Delete200Async(content); Console.WriteLine(response.Status); @@ -385,7 +385,7 @@ public void Example_Put201_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.Put201(content); Console.WriteLine(response.Status); @@ -398,7 +398,7 @@ public async Task Example_Put201_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.Put201Async(content); Console.WriteLine(response.Status); @@ -411,7 +411,7 @@ public void Example_Put201_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = client.Put201(content); Console.WriteLine(response.Status); @@ -424,7 +424,7 @@ public async Task Example_Put201_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = await client.Put201Async(content); Console.WriteLine(response.Status); @@ -437,7 +437,7 @@ public void Example_Post201_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.Post201(content); Console.WriteLine(response.Status); @@ -450,7 +450,7 @@ public async Task Example_Post201_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.Post201Async(content); Console.WriteLine(response.Status); @@ -463,7 +463,7 @@ public void Example_Post201_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = client.Post201(content); Console.WriteLine(response.Status); @@ -476,7 +476,7 @@ public async Task Example_Post201_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = await client.Post201Async(content); Console.WriteLine(response.Status); @@ -489,7 +489,7 @@ public void Example_Put202_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.Put202(content); Console.WriteLine(response.Status); @@ -502,7 +502,7 @@ public async Task Example_Put202_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.Put202Async(content); Console.WriteLine(response.Status); @@ -515,7 +515,7 @@ public void Example_Put202_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = client.Put202(content); Console.WriteLine(response.Status); @@ -528,7 +528,7 @@ public async Task Example_Put202_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = await client.Put202Async(content); Console.WriteLine(response.Status); @@ -541,7 +541,7 @@ public void Example_Patch202_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.Patch202(content); Console.WriteLine(response.Status); @@ -554,7 +554,7 @@ public async Task Example_Patch202_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.Patch202Async(content); Console.WriteLine(response.Status); @@ -567,7 +567,7 @@ public void Example_Patch202_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = client.Patch202(content); Console.WriteLine(response.Status); @@ -580,7 +580,7 @@ public async Task Example_Patch202_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = await client.Patch202Async(content); Console.WriteLine(response.Status); @@ -593,7 +593,7 @@ public void Example_Post202_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.Post202(content); Console.WriteLine(response.Status); @@ -606,7 +606,7 @@ public async Task Example_Post202_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.Post202Async(content); Console.WriteLine(response.Status); @@ -619,7 +619,7 @@ public void Example_Post202_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = client.Post202(content); Console.WriteLine(response.Status); @@ -632,7 +632,7 @@ public async Task Example_Post202_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = await client.Post202Async(content); Console.WriteLine(response.Status); @@ -645,7 +645,7 @@ public void Example_Delete202_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.Delete202(content); Console.WriteLine(response.Status); @@ -658,7 +658,7 @@ public async Task Example_Delete202_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.Delete202Async(content); Console.WriteLine(response.Status); @@ -671,7 +671,7 @@ public void Example_Delete202_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = client.Delete202(content); Console.WriteLine(response.Status); @@ -684,7 +684,7 @@ public async Task Example_Delete202_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = await client.Delete202Async(content); Console.WriteLine(response.Status); @@ -745,7 +745,7 @@ public void Example_Put204_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.Put204(content); Console.WriteLine(response.Status); @@ -758,7 +758,7 @@ public async Task Example_Put204_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.Put204Async(content); Console.WriteLine(response.Status); @@ -771,7 +771,7 @@ public void Example_Put204_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = client.Put204(content); Console.WriteLine(response.Status); @@ -784,7 +784,7 @@ public async Task Example_Put204_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = await client.Put204Async(content); Console.WriteLine(response.Status); @@ -797,7 +797,7 @@ public void Example_Patch204_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.Patch204(content); Console.WriteLine(response.Status); @@ -810,7 +810,7 @@ public async Task Example_Patch204_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.Patch204Async(content); Console.WriteLine(response.Status); @@ -823,7 +823,7 @@ public void Example_Patch204_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = client.Patch204(content); Console.WriteLine(response.Status); @@ -836,7 +836,7 @@ public async Task Example_Patch204_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = await client.Patch204Async(content); Console.WriteLine(response.Status); @@ -849,7 +849,7 @@ public void Example_Post204_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.Post204(content); Console.WriteLine(response.Status); @@ -862,7 +862,7 @@ public async Task Example_Post204_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.Post204Async(content); Console.WriteLine(response.Status); @@ -875,7 +875,7 @@ public void Example_Post204_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = client.Post204(content); Console.WriteLine(response.Status); @@ -888,7 +888,7 @@ public async Task Example_Post204_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = await client.Post204Async(content); Console.WriteLine(response.Status); @@ -901,7 +901,7 @@ public void Example_Delete204_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.Delete204(content); Console.WriteLine(response.Status); @@ -914,7 +914,7 @@ public async Task Example_Delete204_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.Delete204Async(content); Console.WriteLine(response.Status); @@ -927,7 +927,7 @@ public void Example_Delete204_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = client.Delete204(content); Console.WriteLine(response.Status); @@ -940,7 +940,7 @@ public async Task Example_Delete204_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); HttpSuccessClient client = new HttpSuccessClient(credential); - RequestContent content = RequestContent.Create("true"); + using RequestContent content = RequestContent.Create("true"); Response response = await client.Delete204Async(content); Console.WriteLine(response.Status); diff --git a/test/TestServerProjectsLowLevel/lro/src/Generated/Docs/LRORetrysClient.xml b/test/TestServerProjectsLowLevel/lro/src/Generated/Docs/LRORetrysClient.xml index 10d2a6be675..bd9ec50e373 100644 --- a/test/TestServerProjectsLowLevel/lro/src/Generated/Docs/LRORetrysClient.xml +++ b/test/TestServerProjectsLowLevel/lro/src/Generated/Docs/LRORetrysClient.xml @@ -8,7 +8,7 @@ This sample shows how to call Put201CreatingSucceeded200Async and parse the resu AzureKeyCredential credential = new AzureKeyCredential(""); LRORetrysClient client = new LRORetrysClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = await client.Put201CreatingSucceeded200Async(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -20,7 +20,7 @@ This sample shows how to call Put201CreatingSucceeded200Async with all parameter AzureKeyCredential credential = new AzureKeyCredential(""); LRORetrysClient client = new LRORetrysClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -52,7 +52,7 @@ This sample shows how to call Put201CreatingSucceeded200 and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); LRORetrysClient client = new LRORetrysClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = client.Put201CreatingSucceeded200(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -64,7 +64,7 @@ This sample shows how to call Put201CreatingSucceeded200 with all parameters and AzureKeyCredential credential = new AzureKeyCredential(""); LRORetrysClient client = new LRORetrysClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -96,7 +96,7 @@ This sample shows how to call PutAsyncRelativeRetrySucceededAsync and parse the AzureKeyCredential credential = new AzureKeyCredential(""); LRORetrysClient client = new LRORetrysClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = await client.PutAsyncRelativeRetrySucceededAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -108,7 +108,7 @@ This sample shows how to call PutAsyncRelativeRetrySucceededAsync with all param AzureKeyCredential credential = new AzureKeyCredential(""); LRORetrysClient client = new LRORetrysClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -140,7 +140,7 @@ This sample shows how to call PutAsyncRelativeRetrySucceeded and parse the resul AzureKeyCredential credential = new AzureKeyCredential(""); LRORetrysClient client = new LRORetrysClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = client.PutAsyncRelativeRetrySucceeded(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -152,7 +152,7 @@ This sample shows how to call PutAsyncRelativeRetrySucceeded with all parameters AzureKeyCredential credential = new AzureKeyCredential(""); LRORetrysClient client = new LRORetrysClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -314,7 +314,7 @@ This sample shows how to call Post202Retry200Async. AzureKeyCredential credential = new AzureKeyCredential(""); LRORetrysClient client = new LRORetrysClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = await client.Post202Retry200Async(WaitUntil.Completed, content); ]]> This sample shows how to call Post202Retry200Async with all parameters and request content. @@ -322,7 +322,7 @@ This sample shows how to call Post202Retry200Async with all parameters and reque AzureKeyCredential credential = new AzureKeyCredential(""); LRORetrysClient client = new LRORetrysClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -344,7 +344,7 @@ This sample shows how to call Post202Retry200. AzureKeyCredential credential = new AzureKeyCredential(""); LRORetrysClient client = new LRORetrysClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = client.Post202Retry200(WaitUntil.Completed, content); ]]> This sample shows how to call Post202Retry200 with all parameters and request content. @@ -352,7 +352,7 @@ This sample shows how to call Post202Retry200 with all parameters and request co AzureKeyCredential credential = new AzureKeyCredential(""); LRORetrysClient client = new LRORetrysClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -374,7 +374,7 @@ This sample shows how to call PostAsyncRelativeRetrySucceededAsync. AzureKeyCredential credential = new AzureKeyCredential(""); LRORetrysClient client = new LRORetrysClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = await client.PostAsyncRelativeRetrySucceededAsync(WaitUntil.Completed, content); ]]> This sample shows how to call PostAsyncRelativeRetrySucceededAsync with all parameters and request content. @@ -382,7 +382,7 @@ This sample shows how to call PostAsyncRelativeRetrySucceededAsync with all para AzureKeyCredential credential = new AzureKeyCredential(""); LRORetrysClient client = new LRORetrysClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -404,7 +404,7 @@ This sample shows how to call PostAsyncRelativeRetrySucceeded. AzureKeyCredential credential = new AzureKeyCredential(""); LRORetrysClient client = new LRORetrysClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = client.PostAsyncRelativeRetrySucceeded(WaitUntil.Completed, content); ]]> This sample shows how to call PostAsyncRelativeRetrySucceeded with all parameters and request content. @@ -412,7 +412,7 @@ This sample shows how to call PostAsyncRelativeRetrySucceeded with all parameter AzureKeyCredential credential = new AzureKeyCredential(""); LRORetrysClient client = new LRORetrysClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { diff --git a/test/TestServerProjectsLowLevel/lro/src/Generated/Docs/LROsClient.xml b/test/TestServerProjectsLowLevel/lro/src/Generated/Docs/LROsClient.xml index 41e03acdccf..1939a4375d1 100644 --- a/test/TestServerProjectsLowLevel/lro/src/Generated/Docs/LROsClient.xml +++ b/test/TestServerProjectsLowLevel/lro/src/Generated/Docs/LROsClient.xml @@ -8,7 +8,7 @@ This sample shows how to call Put200SucceededAsync and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = await client.Put200SucceededAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -20,7 +20,7 @@ This sample shows how to call Put200SucceededAsync with all parameters and reque AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -52,7 +52,7 @@ This sample shows how to call Put200Succeeded and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = client.Put200Succeeded(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -64,7 +64,7 @@ This sample shows how to call Put200Succeeded with all parameters and request co AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -96,7 +96,7 @@ This sample shows how to call Patch200SucceededIgnoreHeadersAsync and parse the AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = await client.Patch200SucceededIgnoreHeadersAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -108,7 +108,7 @@ This sample shows how to call Patch200SucceededIgnoreHeadersAsync with all param AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -140,7 +140,7 @@ This sample shows how to call Patch200SucceededIgnoreHeaders and parse the resul AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = client.Patch200SucceededIgnoreHeaders(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -152,7 +152,7 @@ This sample shows how to call Patch200SucceededIgnoreHeaders with all parameters AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -184,7 +184,7 @@ This sample shows how to call Patch201RetryWithAsyncHeaderAsync and parse the re AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = await client.Patch201RetryWithAsyncHeaderAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -196,7 +196,7 @@ This sample shows how to call Patch201RetryWithAsyncHeaderAsync with all paramet AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -228,7 +228,7 @@ This sample shows how to call Patch201RetryWithAsyncHeader and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = client.Patch201RetryWithAsyncHeader(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -240,7 +240,7 @@ This sample shows how to call Patch201RetryWithAsyncHeader with all parameters a AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -272,7 +272,7 @@ This sample shows how to call Patch202RetryWithAsyncAndLocationHeaderAsync and p AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = await client.Patch202RetryWithAsyncAndLocationHeaderAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -284,7 +284,7 @@ This sample shows how to call Patch202RetryWithAsyncAndLocationHeaderAsync with AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -316,7 +316,7 @@ This sample shows how to call Patch202RetryWithAsyncAndLocationHeader and parse AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = client.Patch202RetryWithAsyncAndLocationHeader(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -328,7 +328,7 @@ This sample shows how to call Patch202RetryWithAsyncAndLocationHeader with all p AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -360,7 +360,7 @@ This sample shows how to call Put201SucceededAsync and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = await client.Put201SucceededAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -372,7 +372,7 @@ This sample shows how to call Put201SucceededAsync with all parameters and reque AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -404,7 +404,7 @@ This sample shows how to call Put201Succeeded and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = client.Put201Succeeded(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -416,7 +416,7 @@ This sample shows how to call Put201Succeeded with all parameters and request co AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -510,7 +510,7 @@ This sample shows how to call Put200SucceededNoStateAsync and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = await client.Put200SucceededNoStateAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -522,7 +522,7 @@ This sample shows how to call Put200SucceededNoStateAsync with all parameters an AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -554,7 +554,7 @@ This sample shows how to call Put200SucceededNoState and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = client.Put200SucceededNoState(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -566,7 +566,7 @@ This sample shows how to call Put200SucceededNoState with all parameters and req AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -598,7 +598,7 @@ This sample shows how to call Put202Retry200Async and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = await client.Put202Retry200Async(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -610,7 +610,7 @@ This sample shows how to call Put202Retry200Async with all parameters and reques AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -642,7 +642,7 @@ This sample shows how to call Put202Retry200 and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = client.Put202Retry200(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -654,7 +654,7 @@ This sample shows how to call Put202Retry200 with all parameters and request con AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -686,7 +686,7 @@ This sample shows how to call Put201CreatingSucceeded200Async and parse the resu AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = await client.Put201CreatingSucceeded200Async(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -698,7 +698,7 @@ This sample shows how to call Put201CreatingSucceeded200Async with all parameter AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -730,7 +730,7 @@ This sample shows how to call Put201CreatingSucceeded200 and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = client.Put201CreatingSucceeded200(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -742,7 +742,7 @@ This sample shows how to call Put201CreatingSucceeded200 with all parameters and AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -774,7 +774,7 @@ This sample shows how to call Put200UpdatingSucceeded204Async and parse the resu AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = await client.Put200UpdatingSucceeded204Async(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -786,7 +786,7 @@ This sample shows how to call Put200UpdatingSucceeded204Async with all parameter AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -818,7 +818,7 @@ This sample shows how to call Put200UpdatingSucceeded204 and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = client.Put200UpdatingSucceeded204(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -830,7 +830,7 @@ This sample shows how to call Put200UpdatingSucceeded204 with all parameters and AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -862,7 +862,7 @@ This sample shows how to call Put201CreatingFailed200Async and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = await client.Put201CreatingFailed200Async(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -874,7 +874,7 @@ This sample shows how to call Put201CreatingFailed200Async with all parameters a AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -906,7 +906,7 @@ This sample shows how to call Put201CreatingFailed200 and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = client.Put201CreatingFailed200(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -918,7 +918,7 @@ This sample shows how to call Put201CreatingFailed200 with all parameters and re AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -950,7 +950,7 @@ This sample shows how to call Put200Acceptedcanceled200Async and parse the resul AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = await client.Put200Acceptedcanceled200Async(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -962,7 +962,7 @@ This sample shows how to call Put200Acceptedcanceled200Async with all parameters AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -994,7 +994,7 @@ This sample shows how to call Put200Acceptedcanceled200 and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = client.Put200Acceptedcanceled200(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -1006,7 +1006,7 @@ This sample shows how to call Put200Acceptedcanceled200 with all parameters and AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -1038,7 +1038,7 @@ This sample shows how to call PutNoHeaderInRetryAsync and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = await client.PutNoHeaderInRetryAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -1050,7 +1050,7 @@ This sample shows how to call PutNoHeaderInRetryAsync with all parameters and re AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -1082,7 +1082,7 @@ This sample shows how to call PutNoHeaderInRetry and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = client.PutNoHeaderInRetry(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -1094,7 +1094,7 @@ This sample shows how to call PutNoHeaderInRetry with all parameters and request AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -1126,7 +1126,7 @@ This sample shows how to call PutAsyncRetrySucceededAsync and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = await client.PutAsyncRetrySucceededAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -1138,7 +1138,7 @@ This sample shows how to call PutAsyncRetrySucceededAsync with all parameters an AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -1170,7 +1170,7 @@ This sample shows how to call PutAsyncRetrySucceeded and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = client.PutAsyncRetrySucceeded(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -1182,7 +1182,7 @@ This sample shows how to call PutAsyncRetrySucceeded with all parameters and req AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -1214,7 +1214,7 @@ This sample shows how to call PutAsyncNoRetrySucceededAsync and parse the result AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = await client.PutAsyncNoRetrySucceededAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -1226,7 +1226,7 @@ This sample shows how to call PutAsyncNoRetrySucceededAsync with all parameters AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -1258,7 +1258,7 @@ This sample shows how to call PutAsyncNoRetrySucceeded and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = client.PutAsyncNoRetrySucceeded(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -1270,7 +1270,7 @@ This sample shows how to call PutAsyncNoRetrySucceeded with all parameters and r AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -1302,7 +1302,7 @@ This sample shows how to call PutAsyncRetryFailedAsync and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = await client.PutAsyncRetryFailedAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -1314,7 +1314,7 @@ This sample shows how to call PutAsyncRetryFailedAsync with all parameters and r AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -1346,7 +1346,7 @@ This sample shows how to call PutAsyncRetryFailed and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = client.PutAsyncRetryFailed(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -1358,7 +1358,7 @@ This sample shows how to call PutAsyncRetryFailed with all parameters and reques AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -1390,7 +1390,7 @@ This sample shows how to call PutAsyncNoRetrycanceledAsync and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = await client.PutAsyncNoRetrycanceledAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -1402,7 +1402,7 @@ This sample shows how to call PutAsyncNoRetrycanceledAsync with all parameters a AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -1434,7 +1434,7 @@ This sample shows how to call PutAsyncNoRetrycanceled and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = client.PutAsyncNoRetrycanceled(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -1446,7 +1446,7 @@ This sample shows how to call PutAsyncNoRetrycanceled with all parameters and re AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -1478,7 +1478,7 @@ This sample shows how to call PutAsyncNoHeaderInRetryAsync and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = await client.PutAsyncNoHeaderInRetryAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -1490,7 +1490,7 @@ This sample shows how to call PutAsyncNoHeaderInRetryAsync with all parameters a AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -1522,7 +1522,7 @@ This sample shows how to call PutAsyncNoHeaderInRetry and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = client.PutAsyncNoHeaderInRetry(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -1534,7 +1534,7 @@ This sample shows how to call PutAsyncNoHeaderInRetry with all parameters and re AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -1566,7 +1566,7 @@ This sample shows how to call PutNonResourceAsync and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = await client.PutNonResourceAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -1578,7 +1578,7 @@ This sample shows how to call PutNonResourceAsync with all parameters and reques AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", id = "", @@ -1598,7 +1598,7 @@ This sample shows how to call PutNonResource and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = client.PutNonResource(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -1610,7 +1610,7 @@ This sample shows how to call PutNonResource with all parameters and request con AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", id = "", @@ -1630,7 +1630,7 @@ This sample shows how to call PutAsyncNonResourceAsync and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = await client.PutAsyncNonResourceAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -1642,7 +1642,7 @@ This sample shows how to call PutAsyncNonResourceAsync with all parameters and r AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", id = "", @@ -1662,7 +1662,7 @@ This sample shows how to call PutAsyncNonResource and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = client.PutAsyncNonResource(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -1674,7 +1674,7 @@ This sample shows how to call PutAsyncNonResource with all parameters and reques AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", id = "", @@ -1694,7 +1694,7 @@ This sample shows how to call PutSubResourceAsync and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = await client.PutSubResourceAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -1706,7 +1706,7 @@ This sample shows how to call PutSubResourceAsync with all parameters and reques AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -1729,7 +1729,7 @@ This sample shows how to call PutSubResource and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = client.PutSubResource(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -1741,7 +1741,7 @@ This sample shows how to call PutSubResource with all parameters and request con AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -1764,7 +1764,7 @@ This sample shows how to call PutAsyncSubResourceAsync and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = await client.PutAsyncSubResourceAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -1776,7 +1776,7 @@ This sample shows how to call PutAsyncSubResourceAsync with all parameters and r AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -1799,7 +1799,7 @@ This sample shows how to call PutAsyncSubResource and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = client.PutAsyncSubResource(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -1811,7 +1811,7 @@ This sample shows how to call PutAsyncSubResource with all parameters and reques AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -2434,7 +2434,7 @@ This sample shows how to call Post202Retry200Async. AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = await client.Post202Retry200Async(WaitUntil.Completed, content); ]]> This sample shows how to call Post202Retry200Async with all parameters and request content. @@ -2442,7 +2442,7 @@ This sample shows how to call Post202Retry200Async with all parameters and reque AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -2464,7 +2464,7 @@ This sample shows how to call Post202Retry200. AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = client.Post202Retry200(WaitUntil.Completed, content); ]]> This sample shows how to call Post202Retry200 with all parameters and request content. @@ -2472,7 +2472,7 @@ This sample shows how to call Post202Retry200 with all parameters and request co AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -2494,7 +2494,7 @@ This sample shows how to call Post202NoRetry204Async and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = await client.Post202NoRetry204Async(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -2506,7 +2506,7 @@ This sample shows how to call Post202NoRetry204Async with all parameters and req AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -2538,7 +2538,7 @@ This sample shows how to call Post202NoRetry204 and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = client.Post202NoRetry204(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -2550,7 +2550,7 @@ This sample shows how to call Post202NoRetry204 with all parameters and request AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -2768,7 +2768,7 @@ This sample shows how to call PostAsyncRetrySucceededAsync and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = await client.PostAsyncRetrySucceededAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -2780,7 +2780,7 @@ This sample shows how to call PostAsyncRetrySucceededAsync with all parameters a AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -2812,7 +2812,7 @@ This sample shows how to call PostAsyncRetrySucceeded and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = client.PostAsyncRetrySucceeded(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -2824,7 +2824,7 @@ This sample shows how to call PostAsyncRetrySucceeded with all parameters and re AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -2856,7 +2856,7 @@ This sample shows how to call PostAsyncNoRetrySucceededAsync and parse the resul AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = await client.PostAsyncNoRetrySucceededAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -2868,7 +2868,7 @@ This sample shows how to call PostAsyncNoRetrySucceededAsync with all parameters AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -2900,7 +2900,7 @@ This sample shows how to call PostAsyncNoRetrySucceeded and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = client.PostAsyncNoRetrySucceeded(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -2912,7 +2912,7 @@ This sample shows how to call PostAsyncNoRetrySucceeded with all parameters and AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -2944,7 +2944,7 @@ This sample shows how to call PostAsyncRetryFailedAsync. AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = await client.PostAsyncRetryFailedAsync(WaitUntil.Completed, content); ]]> This sample shows how to call PostAsyncRetryFailedAsync with all parameters and request content. @@ -2952,7 +2952,7 @@ This sample shows how to call PostAsyncRetryFailedAsync with all parameters and AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -2974,7 +2974,7 @@ This sample shows how to call PostAsyncRetryFailed. AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = client.PostAsyncRetryFailed(WaitUntil.Completed, content); ]]> This sample shows how to call PostAsyncRetryFailed with all parameters and request content. @@ -2982,7 +2982,7 @@ This sample shows how to call PostAsyncRetryFailed with all parameters and reque AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -3004,7 +3004,7 @@ This sample shows how to call PostAsyncRetrycanceledAsync. AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = await client.PostAsyncRetrycanceledAsync(WaitUntil.Completed, content); ]]> This sample shows how to call PostAsyncRetrycanceledAsync with all parameters and request content. @@ -3012,7 +3012,7 @@ This sample shows how to call PostAsyncRetrycanceledAsync with all parameters an AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -3034,7 +3034,7 @@ This sample shows how to call PostAsyncRetrycanceled. AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = client.PostAsyncRetrycanceled(WaitUntil.Completed, content); ]]> This sample shows how to call PostAsyncRetrycanceled with all parameters and request content. @@ -3042,7 +3042,7 @@ This sample shows how to call PostAsyncRetrycanceled with all parameters and req AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { diff --git a/test/TestServerProjectsLowLevel/lro/src/Generated/Docs/LROsCustomHeaderClient.xml b/test/TestServerProjectsLowLevel/lro/src/Generated/Docs/LROsCustomHeaderClient.xml index e857ed93054..27dbf1dfc20 100644 --- a/test/TestServerProjectsLowLevel/lro/src/Generated/Docs/LROsCustomHeaderClient.xml +++ b/test/TestServerProjectsLowLevel/lro/src/Generated/Docs/LROsCustomHeaderClient.xml @@ -8,7 +8,7 @@ This sample shows how to call PutAsyncRetrySucceededAsync and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); LROsCustomHeaderClient client = new LROsCustomHeaderClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = await client.PutAsyncRetrySucceededAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -20,7 +20,7 @@ This sample shows how to call PutAsyncRetrySucceededAsync with all parameters an AzureKeyCredential credential = new AzureKeyCredential(""); LROsCustomHeaderClient client = new LROsCustomHeaderClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -52,7 +52,7 @@ This sample shows how to call PutAsyncRetrySucceeded and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); LROsCustomHeaderClient client = new LROsCustomHeaderClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = client.PutAsyncRetrySucceeded(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -64,7 +64,7 @@ This sample shows how to call PutAsyncRetrySucceeded with all parameters and req AzureKeyCredential credential = new AzureKeyCredential(""); LROsCustomHeaderClient client = new LROsCustomHeaderClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -96,7 +96,7 @@ This sample shows how to call Put201CreatingSucceeded200Async and parse the resu AzureKeyCredential credential = new AzureKeyCredential(""); LROsCustomHeaderClient client = new LROsCustomHeaderClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = await client.Put201CreatingSucceeded200Async(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -108,7 +108,7 @@ This sample shows how to call Put201CreatingSucceeded200Async with all parameter AzureKeyCredential credential = new AzureKeyCredential(""); LROsCustomHeaderClient client = new LROsCustomHeaderClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -140,7 +140,7 @@ This sample shows how to call Put201CreatingSucceeded200 and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); LROsCustomHeaderClient client = new LROsCustomHeaderClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = client.Put201CreatingSucceeded200(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -152,7 +152,7 @@ This sample shows how to call Put201CreatingSucceeded200 with all parameters and AzureKeyCredential credential = new AzureKeyCredential(""); LROsCustomHeaderClient client = new LROsCustomHeaderClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -184,7 +184,7 @@ This sample shows how to call Post202Retry200Async. AzureKeyCredential credential = new AzureKeyCredential(""); LROsCustomHeaderClient client = new LROsCustomHeaderClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = await client.Post202Retry200Async(WaitUntil.Completed, content); ]]> This sample shows how to call Post202Retry200Async with all parameters and request content. @@ -192,7 +192,7 @@ This sample shows how to call Post202Retry200Async with all parameters and reque AzureKeyCredential credential = new AzureKeyCredential(""); LROsCustomHeaderClient client = new LROsCustomHeaderClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -214,7 +214,7 @@ This sample shows how to call Post202Retry200. AzureKeyCredential credential = new AzureKeyCredential(""); LROsCustomHeaderClient client = new LROsCustomHeaderClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = client.Post202Retry200(WaitUntil.Completed, content); ]]> This sample shows how to call Post202Retry200 with all parameters and request content. @@ -222,7 +222,7 @@ This sample shows how to call Post202Retry200 with all parameters and request co AzureKeyCredential credential = new AzureKeyCredential(""); LROsCustomHeaderClient client = new LROsCustomHeaderClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -244,7 +244,7 @@ This sample shows how to call PostAsyncRetrySucceededAsync. AzureKeyCredential credential = new AzureKeyCredential(""); LROsCustomHeaderClient client = new LROsCustomHeaderClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = await client.PostAsyncRetrySucceededAsync(WaitUntil.Completed, content); ]]> This sample shows how to call PostAsyncRetrySucceededAsync with all parameters and request content. @@ -252,7 +252,7 @@ This sample shows how to call PostAsyncRetrySucceededAsync with all parameters a AzureKeyCredential credential = new AzureKeyCredential(""); LROsCustomHeaderClient client = new LROsCustomHeaderClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -274,7 +274,7 @@ This sample shows how to call PostAsyncRetrySucceeded. AzureKeyCredential credential = new AzureKeyCredential(""); LROsCustomHeaderClient client = new LROsCustomHeaderClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = client.PostAsyncRetrySucceeded(WaitUntil.Completed, content); ]]> This sample shows how to call PostAsyncRetrySucceeded with all parameters and request content. @@ -282,7 +282,7 @@ This sample shows how to call PostAsyncRetrySucceeded with all parameters and re AzureKeyCredential credential = new AzureKeyCredential(""); LROsCustomHeaderClient client = new LROsCustomHeaderClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { diff --git a/test/TestServerProjectsLowLevel/lro/src/Generated/Docs/LrosaDsClient.xml b/test/TestServerProjectsLowLevel/lro/src/Generated/Docs/LrosaDsClient.xml index 883a59c334f..023ccf8f045 100644 --- a/test/TestServerProjectsLowLevel/lro/src/Generated/Docs/LrosaDsClient.xml +++ b/test/TestServerProjectsLowLevel/lro/src/Generated/Docs/LrosaDsClient.xml @@ -8,7 +8,7 @@ This sample shows how to call PutNonRetry400Async and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = await client.PutNonRetry400Async(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -20,7 +20,7 @@ This sample shows how to call PutNonRetry400Async with all parameters and reques AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -52,7 +52,7 @@ This sample shows how to call PutNonRetry400 and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = client.PutNonRetry400(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -64,7 +64,7 @@ This sample shows how to call PutNonRetry400 with all parameters and request con AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -96,7 +96,7 @@ This sample shows how to call PutNonRetry201Creating400Async and parse the resul AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = await client.PutNonRetry201Creating400Async(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -108,7 +108,7 @@ This sample shows how to call PutNonRetry201Creating400Async with all parameters AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -140,7 +140,7 @@ This sample shows how to call PutNonRetry201Creating400 and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = client.PutNonRetry201Creating400(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -152,7 +152,7 @@ This sample shows how to call PutNonRetry201Creating400 with all parameters and AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -184,7 +184,7 @@ This sample shows how to call PutNonRetry201Creating400InvalidJsonAsync and pars AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = await client.PutNonRetry201Creating400InvalidJsonAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -196,7 +196,7 @@ This sample shows how to call PutNonRetry201Creating400InvalidJsonAsync with all AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -228,7 +228,7 @@ This sample shows how to call PutNonRetry201Creating400InvalidJson and parse the AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = client.PutNonRetry201Creating400InvalidJson(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -240,7 +240,7 @@ This sample shows how to call PutNonRetry201Creating400InvalidJson with all para AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -272,7 +272,7 @@ This sample shows how to call PutAsyncRelativeRetry400Async and parse the result AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = await client.PutAsyncRelativeRetry400Async(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -284,7 +284,7 @@ This sample shows how to call PutAsyncRelativeRetry400Async with all parameters AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -316,7 +316,7 @@ This sample shows how to call PutAsyncRelativeRetry400 and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = client.PutAsyncRelativeRetry400(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -328,7 +328,7 @@ This sample shows how to call PutAsyncRelativeRetry400 with all parameters and r AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -462,7 +462,7 @@ This sample shows how to call PostNonRetry400Async. AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = await client.PostNonRetry400Async(WaitUntil.Completed, content); ]]> This sample shows how to call PostNonRetry400Async with all parameters and request content. @@ -470,7 +470,7 @@ This sample shows how to call PostNonRetry400Async with all parameters and reque AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -492,7 +492,7 @@ This sample shows how to call PostNonRetry400. AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = client.PostNonRetry400(WaitUntil.Completed, content); ]]> This sample shows how to call PostNonRetry400 with all parameters and request content. @@ -500,7 +500,7 @@ This sample shows how to call PostNonRetry400 with all parameters and request co AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -522,7 +522,7 @@ This sample shows how to call Post202NonRetry400Async. AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = await client.Post202NonRetry400Async(WaitUntil.Completed, content); ]]> This sample shows how to call Post202NonRetry400Async with all parameters and request content. @@ -530,7 +530,7 @@ This sample shows how to call Post202NonRetry400Async with all parameters and re AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -552,7 +552,7 @@ This sample shows how to call Post202NonRetry400. AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = client.Post202NonRetry400(WaitUntil.Completed, content); ]]> This sample shows how to call Post202NonRetry400 with all parameters and request content. @@ -560,7 +560,7 @@ This sample shows how to call Post202NonRetry400 with all parameters and request AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -582,7 +582,7 @@ This sample shows how to call PostAsyncRelativeRetry400Async. AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = await client.PostAsyncRelativeRetry400Async(WaitUntil.Completed, content); ]]> This sample shows how to call PostAsyncRelativeRetry400Async with all parameters and request content. @@ -590,7 +590,7 @@ This sample shows how to call PostAsyncRelativeRetry400Async with all parameters AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -612,7 +612,7 @@ This sample shows how to call PostAsyncRelativeRetry400. AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = client.PostAsyncRelativeRetry400(WaitUntil.Completed, content); ]]> This sample shows how to call PostAsyncRelativeRetry400 with all parameters and request content. @@ -620,7 +620,7 @@ This sample shows how to call PostAsyncRelativeRetry400 with all parameters and AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -642,7 +642,7 @@ This sample shows how to call PutError201NoProvisioningStatePayloadAsync and par AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = await client.PutError201NoProvisioningStatePayloadAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -654,7 +654,7 @@ This sample shows how to call PutError201NoProvisioningStatePayloadAsync with al AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -686,7 +686,7 @@ This sample shows how to call PutError201NoProvisioningStatePayload and parse th AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = client.PutError201NoProvisioningStatePayload(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -698,7 +698,7 @@ This sample shows how to call PutError201NoProvisioningStatePayload with all par AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -730,7 +730,7 @@ This sample shows how to call PutAsyncRelativeRetryNoStatusAsync and parse the r AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = await client.PutAsyncRelativeRetryNoStatusAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -742,7 +742,7 @@ This sample shows how to call PutAsyncRelativeRetryNoStatusAsync with all parame AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -774,7 +774,7 @@ This sample shows how to call PutAsyncRelativeRetryNoStatus and parse the result AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = client.PutAsyncRelativeRetryNoStatus(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -786,7 +786,7 @@ This sample shows how to call PutAsyncRelativeRetryNoStatus with all parameters AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -818,7 +818,7 @@ This sample shows how to call PutAsyncRelativeRetryNoStatusPayloadAsync and pars AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = await client.PutAsyncRelativeRetryNoStatusPayloadAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -830,7 +830,7 @@ This sample shows how to call PutAsyncRelativeRetryNoStatusPayloadAsync with all AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -862,7 +862,7 @@ This sample shows how to call PutAsyncRelativeRetryNoStatusPayload and parse the AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = client.PutAsyncRelativeRetryNoStatusPayload(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -874,7 +874,7 @@ This sample shows how to call PutAsyncRelativeRetryNoStatusPayload with all para AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -974,7 +974,7 @@ This sample shows how to call Post202NoLocationAsync. AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = await client.Post202NoLocationAsync(WaitUntil.Completed, content); ]]> This sample shows how to call Post202NoLocationAsync with all parameters and request content. @@ -982,7 +982,7 @@ This sample shows how to call Post202NoLocationAsync with all parameters and req AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -1004,7 +1004,7 @@ This sample shows how to call Post202NoLocation. AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = client.Post202NoLocation(WaitUntil.Completed, content); ]]> This sample shows how to call Post202NoLocation with all parameters and request content. @@ -1012,7 +1012,7 @@ This sample shows how to call Post202NoLocation with all parameters and request AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -1034,7 +1034,7 @@ This sample shows how to call PostAsyncRelativeRetryNoPayloadAsync. AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = await client.PostAsyncRelativeRetryNoPayloadAsync(WaitUntil.Completed, content); ]]> This sample shows how to call PostAsyncRelativeRetryNoPayloadAsync with all parameters and request content. @@ -1042,7 +1042,7 @@ This sample shows how to call PostAsyncRelativeRetryNoPayloadAsync with all para AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -1064,7 +1064,7 @@ This sample shows how to call PostAsyncRelativeRetryNoPayload. AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = client.PostAsyncRelativeRetryNoPayload(WaitUntil.Completed, content); ]]> This sample shows how to call PostAsyncRelativeRetryNoPayload with all parameters and request content. @@ -1072,7 +1072,7 @@ This sample shows how to call PostAsyncRelativeRetryNoPayload with all parameter AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -1094,7 +1094,7 @@ This sample shows how to call Put200InvalidJsonAsync and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = await client.Put200InvalidJsonAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -1106,7 +1106,7 @@ This sample shows how to call Put200InvalidJsonAsync with all parameters and req AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -1138,7 +1138,7 @@ This sample shows how to call Put200InvalidJson and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = client.Put200InvalidJson(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -1150,7 +1150,7 @@ This sample shows how to call Put200InvalidJson with all parameters and request AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -1182,7 +1182,7 @@ This sample shows how to call PutAsyncRelativeRetryInvalidHeaderAsync and parse AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = await client.PutAsyncRelativeRetryInvalidHeaderAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -1194,7 +1194,7 @@ This sample shows how to call PutAsyncRelativeRetryInvalidHeaderAsync with all p AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -1226,7 +1226,7 @@ This sample shows how to call PutAsyncRelativeRetryInvalidHeader and parse the r AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = client.PutAsyncRelativeRetryInvalidHeader(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -1238,7 +1238,7 @@ This sample shows how to call PutAsyncRelativeRetryInvalidHeader with all parame AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -1270,7 +1270,7 @@ This sample shows how to call PutAsyncRelativeRetryInvalidJsonPollingAsync and p AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = await client.PutAsyncRelativeRetryInvalidJsonPollingAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -1282,7 +1282,7 @@ This sample shows how to call PutAsyncRelativeRetryInvalidJsonPollingAsync with AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -1314,7 +1314,7 @@ This sample shows how to call PutAsyncRelativeRetryInvalidJsonPolling and parse AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = client.PutAsyncRelativeRetryInvalidJsonPolling(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -1326,7 +1326,7 @@ This sample shows how to call PutAsyncRelativeRetryInvalidJsonPolling with all p AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -1460,7 +1460,7 @@ This sample shows how to call Post202RetryInvalidHeaderAsync. AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = await client.Post202RetryInvalidHeaderAsync(WaitUntil.Completed, content); ]]> This sample shows how to call Post202RetryInvalidHeaderAsync with all parameters and request content. @@ -1468,7 +1468,7 @@ This sample shows how to call Post202RetryInvalidHeaderAsync with all parameters AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -1490,7 +1490,7 @@ This sample shows how to call Post202RetryInvalidHeader. AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = client.Post202RetryInvalidHeader(WaitUntil.Completed, content); ]]> This sample shows how to call Post202RetryInvalidHeader with all parameters and request content. @@ -1498,7 +1498,7 @@ This sample shows how to call Post202RetryInvalidHeader with all parameters and AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -1520,7 +1520,7 @@ This sample shows how to call PostAsyncRelativeRetryInvalidHeaderAsync. AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = await client.PostAsyncRelativeRetryInvalidHeaderAsync(WaitUntil.Completed, content); ]]> This sample shows how to call PostAsyncRelativeRetryInvalidHeaderAsync with all parameters and request content. @@ -1528,7 +1528,7 @@ This sample shows how to call PostAsyncRelativeRetryInvalidHeaderAsync with all AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -1550,7 +1550,7 @@ This sample shows how to call PostAsyncRelativeRetryInvalidHeader. AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = client.PostAsyncRelativeRetryInvalidHeader(WaitUntil.Completed, content); ]]> This sample shows how to call PostAsyncRelativeRetryInvalidHeader with all parameters and request content. @@ -1558,7 +1558,7 @@ This sample shows how to call PostAsyncRelativeRetryInvalidHeader with all param AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -1580,7 +1580,7 @@ This sample shows how to call PostAsyncRelativeRetryInvalidJsonPollingAsync. AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = await client.PostAsyncRelativeRetryInvalidJsonPollingAsync(WaitUntil.Completed, content); ]]> This sample shows how to call PostAsyncRelativeRetryInvalidJsonPollingAsync with all parameters and request content. @@ -1588,7 +1588,7 @@ This sample shows how to call PostAsyncRelativeRetryInvalidJsonPollingAsync with AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { @@ -1610,7 +1610,7 @@ This sample shows how to call PostAsyncRelativeRetryInvalidJsonPolling. AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = null; +using RequestContent content = null; Operation operation = client.PostAsyncRelativeRetryInvalidJsonPolling(WaitUntil.Completed, content); ]]> This sample shows how to call PostAsyncRelativeRetryInvalidJsonPolling with all parameters and request content. @@ -1618,7 +1618,7 @@ This sample shows how to call PostAsyncRelativeRetryInvalidJsonPolling with all AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { properties = new { diff --git a/test/TestServerProjectsLowLevel/lro/tests/Generated/Samples/Samples_LRORetrysClient.cs b/test/TestServerProjectsLowLevel/lro/tests/Generated/Samples/Samples_LRORetrysClient.cs index 29dc6b5e83e..e926364b0ae 100644 --- a/test/TestServerProjectsLowLevel/lro/tests/Generated/Samples/Samples_LRORetrysClient.cs +++ b/test/TestServerProjectsLowLevel/lro/tests/Generated/Samples/Samples_LRORetrysClient.cs @@ -25,7 +25,7 @@ public void Example_Put201CreatingSucceeded200_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); LRORetrysClient client = new LRORetrysClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = client.Put201CreatingSucceeded200(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -40,7 +40,7 @@ public async Task Example_Put201CreatingSucceeded200_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LRORetrysClient client = new LRORetrysClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = await client.Put201CreatingSucceeded200Async(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -55,7 +55,7 @@ public void Example_Put201CreatingSucceeded200_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); LRORetrysClient client = new LRORetrysClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -87,7 +87,7 @@ public async Task Example_Put201CreatingSucceeded200_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LRORetrysClient client = new LRORetrysClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -119,7 +119,7 @@ public void Example_PutAsyncRelativeRetrySucceeded_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); LRORetrysClient client = new LRORetrysClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = client.PutAsyncRelativeRetrySucceeded(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -134,7 +134,7 @@ public async Task Example_PutAsyncRelativeRetrySucceeded_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LRORetrysClient client = new LRORetrysClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = await client.PutAsyncRelativeRetrySucceededAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -149,7 +149,7 @@ public void Example_PutAsyncRelativeRetrySucceeded_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); LRORetrysClient client = new LRORetrysClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -181,7 +181,7 @@ public async Task Example_PutAsyncRelativeRetrySucceeded_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LRORetrysClient client = new LRORetrysClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -361,7 +361,7 @@ public void Example_Post202Retry200_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); LRORetrysClient client = new LRORetrysClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = client.Post202Retry200(WaitUntil.Completed, content); } @@ -372,7 +372,7 @@ public async Task Example_Post202Retry200_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LRORetrysClient client = new LRORetrysClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = await client.Post202Retry200Async(WaitUntil.Completed, content); } @@ -383,7 +383,7 @@ public void Example_Post202Retry200_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); LRORetrysClient client = new LRORetrysClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -405,7 +405,7 @@ public async Task Example_Post202Retry200_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LRORetrysClient client = new LRORetrysClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -427,7 +427,7 @@ public void Example_PostAsyncRelativeRetrySucceeded_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); LRORetrysClient client = new LRORetrysClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = client.PostAsyncRelativeRetrySucceeded(WaitUntil.Completed, content); } @@ -438,7 +438,7 @@ public async Task Example_PostAsyncRelativeRetrySucceeded_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LRORetrysClient client = new LRORetrysClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = await client.PostAsyncRelativeRetrySucceededAsync(WaitUntil.Completed, content); } @@ -449,7 +449,7 @@ public void Example_PostAsyncRelativeRetrySucceeded_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); LRORetrysClient client = new LRORetrysClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -471,7 +471,7 @@ public async Task Example_PostAsyncRelativeRetrySucceeded_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LRORetrysClient client = new LRORetrysClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { diff --git a/test/TestServerProjectsLowLevel/lro/tests/Generated/Samples/Samples_LROsClient.cs b/test/TestServerProjectsLowLevel/lro/tests/Generated/Samples/Samples_LROsClient.cs index cb589f47eb0..e5807c55c0f 100644 --- a/test/TestServerProjectsLowLevel/lro/tests/Generated/Samples/Samples_LROsClient.cs +++ b/test/TestServerProjectsLowLevel/lro/tests/Generated/Samples/Samples_LROsClient.cs @@ -25,7 +25,7 @@ public void Example_Put200Succeeded_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = client.Put200Succeeded(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -40,7 +40,7 @@ public async Task Example_Put200Succeeded_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = await client.Put200SucceededAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -55,7 +55,7 @@ public void Example_Put200Succeeded_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -87,7 +87,7 @@ public async Task Example_Put200Succeeded_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -119,7 +119,7 @@ public void Example_Patch200SucceededIgnoreHeaders_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = client.Patch200SucceededIgnoreHeaders(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -134,7 +134,7 @@ public async Task Example_Patch200SucceededIgnoreHeaders_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = await client.Patch200SucceededIgnoreHeadersAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -149,7 +149,7 @@ public void Example_Patch200SucceededIgnoreHeaders_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -181,7 +181,7 @@ public async Task Example_Patch200SucceededIgnoreHeaders_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -213,7 +213,7 @@ public void Example_Patch201RetryWithAsyncHeader_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = client.Patch201RetryWithAsyncHeader(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -228,7 +228,7 @@ public async Task Example_Patch201RetryWithAsyncHeader_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = await client.Patch201RetryWithAsyncHeaderAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -243,7 +243,7 @@ public void Example_Patch201RetryWithAsyncHeader_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -275,7 +275,7 @@ public async Task Example_Patch201RetryWithAsyncHeader_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -307,7 +307,7 @@ public void Example_Patch202RetryWithAsyncAndLocationHeader_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = client.Patch202RetryWithAsyncAndLocationHeader(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -322,7 +322,7 @@ public async Task Example_Patch202RetryWithAsyncAndLocationHeader_ShortVersion_A AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = await client.Patch202RetryWithAsyncAndLocationHeaderAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -337,7 +337,7 @@ public void Example_Patch202RetryWithAsyncAndLocationHeader_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -369,7 +369,7 @@ public async Task Example_Patch202RetryWithAsyncAndLocationHeader_AllParameters_ AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -401,7 +401,7 @@ public void Example_Put201Succeeded_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = client.Put201Succeeded(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -416,7 +416,7 @@ public async Task Example_Put201Succeeded_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = await client.Put201SucceededAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -431,7 +431,7 @@ public void Example_Put201Succeeded_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -463,7 +463,7 @@ public async Task Example_Put201Succeeded_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -563,7 +563,7 @@ public void Example_Put200SucceededNoState_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = client.Put200SucceededNoState(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -578,7 +578,7 @@ public async Task Example_Put200SucceededNoState_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = await client.Put200SucceededNoStateAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -593,7 +593,7 @@ public void Example_Put200SucceededNoState_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -625,7 +625,7 @@ public async Task Example_Put200SucceededNoState_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -657,7 +657,7 @@ public void Example_Put202Retry200_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = client.Put202Retry200(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -672,7 +672,7 @@ public async Task Example_Put202Retry200_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = await client.Put202Retry200Async(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -687,7 +687,7 @@ public void Example_Put202Retry200_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -719,7 +719,7 @@ public async Task Example_Put202Retry200_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -751,7 +751,7 @@ public void Example_Put201CreatingSucceeded200_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = client.Put201CreatingSucceeded200(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -766,7 +766,7 @@ public async Task Example_Put201CreatingSucceeded200_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = await client.Put201CreatingSucceeded200Async(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -781,7 +781,7 @@ public void Example_Put201CreatingSucceeded200_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -813,7 +813,7 @@ public async Task Example_Put201CreatingSucceeded200_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -845,7 +845,7 @@ public void Example_Put200UpdatingSucceeded204_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = client.Put200UpdatingSucceeded204(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -860,7 +860,7 @@ public async Task Example_Put200UpdatingSucceeded204_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = await client.Put200UpdatingSucceeded204Async(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -875,7 +875,7 @@ public void Example_Put200UpdatingSucceeded204_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -907,7 +907,7 @@ public async Task Example_Put200UpdatingSucceeded204_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -939,7 +939,7 @@ public void Example_Put201CreatingFailed200_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = client.Put201CreatingFailed200(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -954,7 +954,7 @@ public async Task Example_Put201CreatingFailed200_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = await client.Put201CreatingFailed200Async(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -969,7 +969,7 @@ public void Example_Put201CreatingFailed200_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -1001,7 +1001,7 @@ public async Task Example_Put201CreatingFailed200_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -1033,7 +1033,7 @@ public void Example_Put200Acceptedcanceled200_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = client.Put200Acceptedcanceled200(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -1048,7 +1048,7 @@ public async Task Example_Put200Acceptedcanceled200_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = await client.Put200Acceptedcanceled200Async(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -1063,7 +1063,7 @@ public void Example_Put200Acceptedcanceled200_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -1095,7 +1095,7 @@ public async Task Example_Put200Acceptedcanceled200_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -1127,7 +1127,7 @@ public void Example_PutNoHeaderInRetry_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = client.PutNoHeaderInRetry(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -1142,7 +1142,7 @@ public async Task Example_PutNoHeaderInRetry_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = await client.PutNoHeaderInRetryAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -1157,7 +1157,7 @@ public void Example_PutNoHeaderInRetry_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -1189,7 +1189,7 @@ public async Task Example_PutNoHeaderInRetry_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -1221,7 +1221,7 @@ public void Example_PutAsyncRetrySucceeded_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = client.PutAsyncRetrySucceeded(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -1236,7 +1236,7 @@ public async Task Example_PutAsyncRetrySucceeded_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = await client.PutAsyncRetrySucceededAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -1251,7 +1251,7 @@ public void Example_PutAsyncRetrySucceeded_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -1283,7 +1283,7 @@ public async Task Example_PutAsyncRetrySucceeded_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -1315,7 +1315,7 @@ public void Example_PutAsyncNoRetrySucceeded_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = client.PutAsyncNoRetrySucceeded(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -1330,7 +1330,7 @@ public async Task Example_PutAsyncNoRetrySucceeded_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = await client.PutAsyncNoRetrySucceededAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -1345,7 +1345,7 @@ public void Example_PutAsyncNoRetrySucceeded_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -1377,7 +1377,7 @@ public async Task Example_PutAsyncNoRetrySucceeded_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -1409,7 +1409,7 @@ public void Example_PutAsyncRetryFailed_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = client.PutAsyncRetryFailed(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -1424,7 +1424,7 @@ public async Task Example_PutAsyncRetryFailed_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = await client.PutAsyncRetryFailedAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -1439,7 +1439,7 @@ public void Example_PutAsyncRetryFailed_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -1471,7 +1471,7 @@ public async Task Example_PutAsyncRetryFailed_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -1503,7 +1503,7 @@ public void Example_PutAsyncNoRetrycanceled_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = client.PutAsyncNoRetrycanceled(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -1518,7 +1518,7 @@ public async Task Example_PutAsyncNoRetrycanceled_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = await client.PutAsyncNoRetrycanceledAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -1533,7 +1533,7 @@ public void Example_PutAsyncNoRetrycanceled_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -1565,7 +1565,7 @@ public async Task Example_PutAsyncNoRetrycanceled_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -1597,7 +1597,7 @@ public void Example_PutAsyncNoHeaderInRetry_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = client.PutAsyncNoHeaderInRetry(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -1612,7 +1612,7 @@ public async Task Example_PutAsyncNoHeaderInRetry_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = await client.PutAsyncNoHeaderInRetryAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -1627,7 +1627,7 @@ public void Example_PutAsyncNoHeaderInRetry_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -1659,7 +1659,7 @@ public async Task Example_PutAsyncNoHeaderInRetry_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -1691,7 +1691,7 @@ public void Example_PutNonResource_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = client.PutNonResource(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -1706,7 +1706,7 @@ public async Task Example_PutNonResource_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = await client.PutNonResourceAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -1721,7 +1721,7 @@ public void Example_PutNonResource_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", id = "", @@ -1741,7 +1741,7 @@ public async Task Example_PutNonResource_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", id = "", @@ -1761,7 +1761,7 @@ public void Example_PutAsyncNonResource_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = client.PutAsyncNonResource(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -1776,7 +1776,7 @@ public async Task Example_PutAsyncNonResource_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = await client.PutAsyncNonResourceAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -1791,7 +1791,7 @@ public void Example_PutAsyncNonResource_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", id = "", @@ -1811,7 +1811,7 @@ public async Task Example_PutAsyncNonResource_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", id = "", @@ -1831,7 +1831,7 @@ public void Example_PutSubResource_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = client.PutSubResource(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -1846,7 +1846,7 @@ public async Task Example_PutSubResource_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = await client.PutSubResourceAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -1861,7 +1861,7 @@ public void Example_PutSubResource_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -1884,7 +1884,7 @@ public async Task Example_PutSubResource_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -1907,7 +1907,7 @@ public void Example_PutAsyncSubResource_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = client.PutAsyncSubResource(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -1922,7 +1922,7 @@ public async Task Example_PutAsyncSubResource_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = await client.PutAsyncSubResourceAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -1937,7 +1937,7 @@ public void Example_PutAsyncSubResource_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -1960,7 +1960,7 @@ public async Task Example_PutAsyncSubResource_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -2661,7 +2661,7 @@ public void Example_Post202Retry200_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = client.Post202Retry200(WaitUntil.Completed, content); } @@ -2672,7 +2672,7 @@ public async Task Example_Post202Retry200_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = await client.Post202Retry200Async(WaitUntil.Completed, content); } @@ -2683,7 +2683,7 @@ public void Example_Post202Retry200_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -2705,7 +2705,7 @@ public async Task Example_Post202Retry200_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -2727,7 +2727,7 @@ public void Example_Post202NoRetry204_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = client.Post202NoRetry204(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -2742,7 +2742,7 @@ public async Task Example_Post202NoRetry204_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = await client.Post202NoRetry204Async(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -2757,7 +2757,7 @@ public void Example_Post202NoRetry204_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -2789,7 +2789,7 @@ public async Task Example_Post202NoRetry204_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -3025,7 +3025,7 @@ public void Example_PostAsyncRetrySucceeded_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = client.PostAsyncRetrySucceeded(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -3040,7 +3040,7 @@ public async Task Example_PostAsyncRetrySucceeded_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = await client.PostAsyncRetrySucceededAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -3055,7 +3055,7 @@ public void Example_PostAsyncRetrySucceeded_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -3087,7 +3087,7 @@ public async Task Example_PostAsyncRetrySucceeded_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -3119,7 +3119,7 @@ public void Example_PostAsyncNoRetrySucceeded_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = client.PostAsyncNoRetrySucceeded(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -3134,7 +3134,7 @@ public async Task Example_PostAsyncNoRetrySucceeded_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = await client.PostAsyncNoRetrySucceededAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -3149,7 +3149,7 @@ public void Example_PostAsyncNoRetrySucceeded_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -3181,7 +3181,7 @@ public async Task Example_PostAsyncNoRetrySucceeded_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -3213,7 +3213,7 @@ public void Example_PostAsyncRetryFailed_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = client.PostAsyncRetryFailed(WaitUntil.Completed, content); } @@ -3224,7 +3224,7 @@ public async Task Example_PostAsyncRetryFailed_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = await client.PostAsyncRetryFailedAsync(WaitUntil.Completed, content); } @@ -3235,7 +3235,7 @@ public void Example_PostAsyncRetryFailed_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -3257,7 +3257,7 @@ public async Task Example_PostAsyncRetryFailed_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -3279,7 +3279,7 @@ public void Example_PostAsyncRetrycanceled_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = client.PostAsyncRetrycanceled(WaitUntil.Completed, content); } @@ -3290,7 +3290,7 @@ public async Task Example_PostAsyncRetrycanceled_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = await client.PostAsyncRetrycanceledAsync(WaitUntil.Completed, content); } @@ -3301,7 +3301,7 @@ public void Example_PostAsyncRetrycanceled_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -3323,7 +3323,7 @@ public async Task Example_PostAsyncRetrycanceled_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsClient client = new LROsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { diff --git a/test/TestServerProjectsLowLevel/lro/tests/Generated/Samples/Samples_LROsCustomHeaderClient.cs b/test/TestServerProjectsLowLevel/lro/tests/Generated/Samples/Samples_LROsCustomHeaderClient.cs index f70c2a352ef..3fc73bc7ef9 100644 --- a/test/TestServerProjectsLowLevel/lro/tests/Generated/Samples/Samples_LROsCustomHeaderClient.cs +++ b/test/TestServerProjectsLowLevel/lro/tests/Generated/Samples/Samples_LROsCustomHeaderClient.cs @@ -25,7 +25,7 @@ public void Example_PutAsyncRetrySucceeded_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); LROsCustomHeaderClient client = new LROsCustomHeaderClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = client.PutAsyncRetrySucceeded(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -40,7 +40,7 @@ public async Task Example_PutAsyncRetrySucceeded_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsCustomHeaderClient client = new LROsCustomHeaderClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = await client.PutAsyncRetrySucceededAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -55,7 +55,7 @@ public void Example_PutAsyncRetrySucceeded_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); LROsCustomHeaderClient client = new LROsCustomHeaderClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -87,7 +87,7 @@ public async Task Example_PutAsyncRetrySucceeded_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsCustomHeaderClient client = new LROsCustomHeaderClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -119,7 +119,7 @@ public void Example_Put201CreatingSucceeded200_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); LROsCustomHeaderClient client = new LROsCustomHeaderClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = client.Put201CreatingSucceeded200(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -134,7 +134,7 @@ public async Task Example_Put201CreatingSucceeded200_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsCustomHeaderClient client = new LROsCustomHeaderClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = await client.Put201CreatingSucceeded200Async(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -149,7 +149,7 @@ public void Example_Put201CreatingSucceeded200_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); LROsCustomHeaderClient client = new LROsCustomHeaderClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -181,7 +181,7 @@ public async Task Example_Put201CreatingSucceeded200_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsCustomHeaderClient client = new LROsCustomHeaderClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -213,7 +213,7 @@ public void Example_Post202Retry200_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); LROsCustomHeaderClient client = new LROsCustomHeaderClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = client.Post202Retry200(WaitUntil.Completed, content); } @@ -224,7 +224,7 @@ public async Task Example_Post202Retry200_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsCustomHeaderClient client = new LROsCustomHeaderClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = await client.Post202Retry200Async(WaitUntil.Completed, content); } @@ -235,7 +235,7 @@ public void Example_Post202Retry200_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); LROsCustomHeaderClient client = new LROsCustomHeaderClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -257,7 +257,7 @@ public async Task Example_Post202Retry200_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsCustomHeaderClient client = new LROsCustomHeaderClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -279,7 +279,7 @@ public void Example_PostAsyncRetrySucceeded_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); LROsCustomHeaderClient client = new LROsCustomHeaderClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = client.PostAsyncRetrySucceeded(WaitUntil.Completed, content); } @@ -290,7 +290,7 @@ public async Task Example_PostAsyncRetrySucceeded_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsCustomHeaderClient client = new LROsCustomHeaderClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = await client.PostAsyncRetrySucceededAsync(WaitUntil.Completed, content); } @@ -301,7 +301,7 @@ public void Example_PostAsyncRetrySucceeded_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); LROsCustomHeaderClient client = new LROsCustomHeaderClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -323,7 +323,7 @@ public async Task Example_PostAsyncRetrySucceeded_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LROsCustomHeaderClient client = new LROsCustomHeaderClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { diff --git a/test/TestServerProjectsLowLevel/lro/tests/Generated/Samples/Samples_LrosaDsClient.cs b/test/TestServerProjectsLowLevel/lro/tests/Generated/Samples/Samples_LrosaDsClient.cs index 554c9158244..7254392640a 100644 --- a/test/TestServerProjectsLowLevel/lro/tests/Generated/Samples/Samples_LrosaDsClient.cs +++ b/test/TestServerProjectsLowLevel/lro/tests/Generated/Samples/Samples_LrosaDsClient.cs @@ -25,7 +25,7 @@ public void Example_PutNonRetry400_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = client.PutNonRetry400(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -40,7 +40,7 @@ public async Task Example_PutNonRetry400_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = await client.PutNonRetry400Async(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -55,7 +55,7 @@ public void Example_PutNonRetry400_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -87,7 +87,7 @@ public async Task Example_PutNonRetry400_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -119,7 +119,7 @@ public void Example_PutNonRetry201Creating400_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = client.PutNonRetry201Creating400(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -134,7 +134,7 @@ public async Task Example_PutNonRetry201Creating400_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = await client.PutNonRetry201Creating400Async(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -149,7 +149,7 @@ public void Example_PutNonRetry201Creating400_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -181,7 +181,7 @@ public async Task Example_PutNonRetry201Creating400_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -213,7 +213,7 @@ public void Example_PutNonRetry201Creating400InvalidJson_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = client.PutNonRetry201Creating400InvalidJson(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -228,7 +228,7 @@ public async Task Example_PutNonRetry201Creating400InvalidJson_ShortVersion_Asyn AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = await client.PutNonRetry201Creating400InvalidJsonAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -243,7 +243,7 @@ public void Example_PutNonRetry201Creating400InvalidJson_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -275,7 +275,7 @@ public async Task Example_PutNonRetry201Creating400InvalidJson_AllParameters_Asy AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -307,7 +307,7 @@ public void Example_PutAsyncRelativeRetry400_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = client.PutAsyncRelativeRetry400(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -322,7 +322,7 @@ public async Task Example_PutAsyncRelativeRetry400_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = await client.PutAsyncRelativeRetry400Async(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -337,7 +337,7 @@ public void Example_PutAsyncRelativeRetry400_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -369,7 +369,7 @@ public async Task Example_PutAsyncRelativeRetry400_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -521,7 +521,7 @@ public void Example_PostNonRetry400_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = client.PostNonRetry400(WaitUntil.Completed, content); } @@ -532,7 +532,7 @@ public async Task Example_PostNonRetry400_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = await client.PostNonRetry400Async(WaitUntil.Completed, content); } @@ -543,7 +543,7 @@ public void Example_PostNonRetry400_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -565,7 +565,7 @@ public async Task Example_PostNonRetry400_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -587,7 +587,7 @@ public void Example_Post202NonRetry400_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = client.Post202NonRetry400(WaitUntil.Completed, content); } @@ -598,7 +598,7 @@ public async Task Example_Post202NonRetry400_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = await client.Post202NonRetry400Async(WaitUntil.Completed, content); } @@ -609,7 +609,7 @@ public void Example_Post202NonRetry400_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -631,7 +631,7 @@ public async Task Example_Post202NonRetry400_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -653,7 +653,7 @@ public void Example_PostAsyncRelativeRetry400_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = client.PostAsyncRelativeRetry400(WaitUntil.Completed, content); } @@ -664,7 +664,7 @@ public async Task Example_PostAsyncRelativeRetry400_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = await client.PostAsyncRelativeRetry400Async(WaitUntil.Completed, content); } @@ -675,7 +675,7 @@ public void Example_PostAsyncRelativeRetry400_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -697,7 +697,7 @@ public async Task Example_PostAsyncRelativeRetry400_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -719,7 +719,7 @@ public void Example_PutError201NoProvisioningStatePayload_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = client.PutError201NoProvisioningStatePayload(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -734,7 +734,7 @@ public async Task Example_PutError201NoProvisioningStatePayload_ShortVersion_Asy AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = await client.PutError201NoProvisioningStatePayloadAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -749,7 +749,7 @@ public void Example_PutError201NoProvisioningStatePayload_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -781,7 +781,7 @@ public async Task Example_PutError201NoProvisioningStatePayload_AllParameters_As AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -813,7 +813,7 @@ public void Example_PutAsyncRelativeRetryNoStatus_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = client.PutAsyncRelativeRetryNoStatus(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -828,7 +828,7 @@ public async Task Example_PutAsyncRelativeRetryNoStatus_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = await client.PutAsyncRelativeRetryNoStatusAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -843,7 +843,7 @@ public void Example_PutAsyncRelativeRetryNoStatus_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -875,7 +875,7 @@ public async Task Example_PutAsyncRelativeRetryNoStatus_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -907,7 +907,7 @@ public void Example_PutAsyncRelativeRetryNoStatusPayload_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = client.PutAsyncRelativeRetryNoStatusPayload(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -922,7 +922,7 @@ public async Task Example_PutAsyncRelativeRetryNoStatusPayload_ShortVersion_Asyn AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = await client.PutAsyncRelativeRetryNoStatusPayloadAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -937,7 +937,7 @@ public void Example_PutAsyncRelativeRetryNoStatusPayload_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -969,7 +969,7 @@ public async Task Example_PutAsyncRelativeRetryNoStatusPayload_AllParameters_Asy AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -1081,7 +1081,7 @@ public void Example_Post202NoLocation_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = client.Post202NoLocation(WaitUntil.Completed, content); } @@ -1092,7 +1092,7 @@ public async Task Example_Post202NoLocation_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = await client.Post202NoLocationAsync(WaitUntil.Completed, content); } @@ -1103,7 +1103,7 @@ public void Example_Post202NoLocation_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -1125,7 +1125,7 @@ public async Task Example_Post202NoLocation_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -1147,7 +1147,7 @@ public void Example_PostAsyncRelativeRetryNoPayload_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = client.PostAsyncRelativeRetryNoPayload(WaitUntil.Completed, content); } @@ -1158,7 +1158,7 @@ public async Task Example_PostAsyncRelativeRetryNoPayload_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = await client.PostAsyncRelativeRetryNoPayloadAsync(WaitUntil.Completed, content); } @@ -1169,7 +1169,7 @@ public void Example_PostAsyncRelativeRetryNoPayload_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -1191,7 +1191,7 @@ public async Task Example_PostAsyncRelativeRetryNoPayload_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -1213,7 +1213,7 @@ public void Example_Put200InvalidJson_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = client.Put200InvalidJson(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -1228,7 +1228,7 @@ public async Task Example_Put200InvalidJson_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = await client.Put200InvalidJsonAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -1243,7 +1243,7 @@ public void Example_Put200InvalidJson_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -1275,7 +1275,7 @@ public async Task Example_Put200InvalidJson_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -1307,7 +1307,7 @@ public void Example_PutAsyncRelativeRetryInvalidHeader_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = client.PutAsyncRelativeRetryInvalidHeader(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -1322,7 +1322,7 @@ public async Task Example_PutAsyncRelativeRetryInvalidHeader_ShortVersion_Async( AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = await client.PutAsyncRelativeRetryInvalidHeaderAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -1337,7 +1337,7 @@ public void Example_PutAsyncRelativeRetryInvalidHeader_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -1369,7 +1369,7 @@ public async Task Example_PutAsyncRelativeRetryInvalidHeader_AllParameters_Async AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -1401,7 +1401,7 @@ public void Example_PutAsyncRelativeRetryInvalidJsonPolling_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = client.PutAsyncRelativeRetryInvalidJsonPolling(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -1416,7 +1416,7 @@ public async Task Example_PutAsyncRelativeRetryInvalidJsonPolling_ShortVersion_A AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = await client.PutAsyncRelativeRetryInvalidJsonPollingAsync(WaitUntil.Completed, content); BinaryData responseData = operation.Value; @@ -1431,7 +1431,7 @@ public void Example_PutAsyncRelativeRetryInvalidJsonPolling_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -1463,7 +1463,7 @@ public async Task Example_PutAsyncRelativeRetryInvalidJsonPolling_AllParameters_ AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -1615,7 +1615,7 @@ public void Example_Post202RetryInvalidHeader_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = client.Post202RetryInvalidHeader(WaitUntil.Completed, content); } @@ -1626,7 +1626,7 @@ public async Task Example_Post202RetryInvalidHeader_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = await client.Post202RetryInvalidHeaderAsync(WaitUntil.Completed, content); } @@ -1637,7 +1637,7 @@ public void Example_Post202RetryInvalidHeader_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -1659,7 +1659,7 @@ public async Task Example_Post202RetryInvalidHeader_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -1681,7 +1681,7 @@ public void Example_PostAsyncRelativeRetryInvalidHeader_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = client.PostAsyncRelativeRetryInvalidHeader(WaitUntil.Completed, content); } @@ -1692,7 +1692,7 @@ public async Task Example_PostAsyncRelativeRetryInvalidHeader_ShortVersion_Async AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = await client.PostAsyncRelativeRetryInvalidHeaderAsync(WaitUntil.Completed, content); } @@ -1703,7 +1703,7 @@ public void Example_PostAsyncRelativeRetryInvalidHeader_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -1725,7 +1725,7 @@ public async Task Example_PostAsyncRelativeRetryInvalidHeader_AllParameters_Asyn AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -1747,7 +1747,7 @@ public void Example_PostAsyncRelativeRetryInvalidJsonPolling_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = client.PostAsyncRelativeRetryInvalidJsonPolling(WaitUntil.Completed, content); } @@ -1758,7 +1758,7 @@ public async Task Example_PostAsyncRelativeRetryInvalidJsonPolling_ShortVersion_ AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = null; + using RequestContent content = null; Operation operation = await client.PostAsyncRelativeRetryInvalidJsonPollingAsync(WaitUntil.Completed, content); } @@ -1769,7 +1769,7 @@ public void Example_PostAsyncRelativeRetryInvalidJsonPolling_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { @@ -1791,7 +1791,7 @@ public async Task Example_PostAsyncRelativeRetryInvalidJsonPolling_AllParameters AzureKeyCredential credential = new AzureKeyCredential(""); LrosaDsClient client = new LrosaDsClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { properties = new { diff --git a/test/TestServerProjectsLowLevel/media_types/src/Generated/Docs/MediaTypesClient.xml b/test/TestServerProjectsLowLevel/media_types/src/Generated/Docs/MediaTypesClient.xml index 12769e33bbf..10e381d3362 100644 --- a/test/TestServerProjectsLowLevel/media_types/src/Generated/Docs/MediaTypesClient.xml +++ b/test/TestServerProjectsLowLevel/media_types/src/Generated/Docs/MediaTypesClient.xml @@ -8,7 +8,7 @@ This sample shows how to call AnalyzeBodyAsync and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.AnalyzeBodyAsync(content, new ContentType("application/pdf")); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -19,7 +19,7 @@ This sample shows how to call AnalyzeBodyAsync with all parameters and request c AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); -RequestContent content = RequestContent.Create(File.OpenRead("")); +using RequestContent content = RequestContent.Create(File.OpenRead("")); Response response = await client.AnalyzeBodyAsync(content, new ContentType("application/pdf")); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -33,7 +33,7 @@ This sample shows how to call AnalyzeBody and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.AnalyzeBody(content, new ContentType("application/pdf")); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -44,7 +44,7 @@ This sample shows how to call AnalyzeBody with all parameters and request conten AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); -RequestContent content = RequestContent.Create(File.OpenRead("")); +using RequestContent content = RequestContent.Create(File.OpenRead("")); Response response = client.AnalyzeBody(content, new ContentType("application/pdf")); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -58,7 +58,7 @@ This sample shows how to call AnalyzeBodyNoAcceptHeaderAsync. AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.AnalyzeBodyNoAcceptHeaderAsync(content, new ContentType("application/pdf")); Console.WriteLine(response.Status); @@ -68,7 +68,7 @@ This sample shows how to call AnalyzeBodyNoAcceptHeaderAsync with all parameters AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); -RequestContent content = RequestContent.Create(File.OpenRead("")); +using RequestContent content = RequestContent.Create(File.OpenRead("")); Response response = await client.AnalyzeBodyNoAcceptHeaderAsync(content, new ContentType("application/pdf")); Console.WriteLine(response.Status); @@ -81,7 +81,7 @@ This sample shows how to call AnalyzeBodyNoAcceptHeader. AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.AnalyzeBodyNoAcceptHeader(content, new ContentType("application/pdf")); Console.WriteLine(response.Status); @@ -91,7 +91,7 @@ This sample shows how to call AnalyzeBodyNoAcceptHeader with all parameters and AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); -RequestContent content = RequestContent.Create(File.OpenRead("")); +using RequestContent content = RequestContent.Create(File.OpenRead("")); Response response = client.AnalyzeBodyNoAcceptHeader(content, new ContentType("application/pdf")); Console.WriteLine(response.Status); @@ -104,7 +104,7 @@ This sample shows how to call ContentTypeWithEncodingAsync and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = await client.ContentTypeWithEncodingAsync(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -115,7 +115,7 @@ This sample shows how to call ContentTypeWithEncodingAsync with all request cont AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); -RequestContent content = RequestContent.Create(""); +using RequestContent content = RequestContent.Create(""); Response response = await client.ContentTypeWithEncodingAsync(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -129,7 +129,7 @@ This sample shows how to call ContentTypeWithEncoding and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); -RequestContent content = null; +using RequestContent content = null; Response response = client.ContentTypeWithEncoding(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -140,7 +140,7 @@ This sample shows how to call ContentTypeWithEncoding with all request content a AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); -RequestContent content = RequestContent.Create(""); +using RequestContent content = RequestContent.Create(""); Response response = client.ContentTypeWithEncoding(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -154,7 +154,7 @@ This sample shows how to call BinaryBodyWithTwoContentTypesAsync and parse the r AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); -RequestContent content = RequestContent.Create(File.OpenRead("")); +using RequestContent content = RequestContent.Create(File.OpenRead("")); Response response = await client.BinaryBodyWithTwoContentTypesAsync(content, new ContentType("application/json")); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -165,7 +165,7 @@ This sample shows how to call BinaryBodyWithTwoContentTypesAsync with all parame AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); -RequestContent content = RequestContent.Create(File.OpenRead("")); +using RequestContent content = RequestContent.Create(File.OpenRead("")); Response response = await client.BinaryBodyWithTwoContentTypesAsync(content, new ContentType("application/json")); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -179,7 +179,7 @@ This sample shows how to call BinaryBodyWithTwoContentTypes and parse the result AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); -RequestContent content = RequestContent.Create(File.OpenRead("")); +using RequestContent content = RequestContent.Create(File.OpenRead("")); Response response = client.BinaryBodyWithTwoContentTypes(content, new ContentType("application/json")); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -190,7 +190,7 @@ This sample shows how to call BinaryBodyWithTwoContentTypes with all parameters AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); -RequestContent content = RequestContent.Create(File.OpenRead("")); +using RequestContent content = RequestContent.Create(File.OpenRead("")); Response response = client.BinaryBodyWithTwoContentTypes(content, new ContentType("application/json")); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -204,7 +204,7 @@ This sample shows how to call BinaryBodyWithThreeContentTypesAsync and parse the AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); -RequestContent content = RequestContent.Create(File.OpenRead("")); +using RequestContent content = RequestContent.Create(File.OpenRead("")); Response response = await client.BinaryBodyWithThreeContentTypesAsync(content, new ContentType("application/json")); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -215,7 +215,7 @@ This sample shows how to call BinaryBodyWithThreeContentTypesAsync with all para AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); -RequestContent content = RequestContent.Create(File.OpenRead("")); +using RequestContent content = RequestContent.Create(File.OpenRead("")); Response response = await client.BinaryBodyWithThreeContentTypesAsync(content, new ContentType("application/json")); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -229,7 +229,7 @@ This sample shows how to call BinaryBodyWithThreeContentTypes and parse the resu AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); -RequestContent content = RequestContent.Create(File.OpenRead("")); +using RequestContent content = RequestContent.Create(File.OpenRead("")); Response response = client.BinaryBodyWithThreeContentTypes(content, new ContentType("application/json")); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -240,7 +240,7 @@ This sample shows how to call BinaryBodyWithThreeContentTypes with all parameter AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); -RequestContent content = RequestContent.Create(File.OpenRead("")); +using RequestContent content = RequestContent.Create(File.OpenRead("")); Response response = client.BinaryBodyWithThreeContentTypes(content, new ContentType("application/json")); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -254,7 +254,7 @@ This sample shows how to call BodyThreeTypesAsync and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); -RequestContent content = RequestContent.Create(File.OpenRead("")); +using RequestContent content = RequestContent.Create(File.OpenRead("")); Response response = await client.BodyThreeTypesAsync(content, new ContentType("application/octet-stream")); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -265,7 +265,7 @@ This sample shows how to call BodyThreeTypesAsync with all parameters and reques AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); -RequestContent content = RequestContent.Create(File.OpenRead("")); +using RequestContent content = RequestContent.Create(File.OpenRead("")); Response response = await client.BodyThreeTypesAsync(content, new ContentType("application/octet-stream")); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -279,7 +279,7 @@ This sample shows how to call BodyThreeTypes and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); -RequestContent content = RequestContent.Create(File.OpenRead("")); +using RequestContent content = RequestContent.Create(File.OpenRead("")); Response response = client.BodyThreeTypes(content, new ContentType("application/octet-stream")); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -290,7 +290,7 @@ This sample shows how to call BodyThreeTypes with all parameters and request con AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); -RequestContent content = RequestContent.Create(File.OpenRead("")); +using RequestContent content = RequestContent.Create(File.OpenRead("")); Response response = client.BodyThreeTypes(content, new ContentType("application/octet-stream")); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -304,7 +304,7 @@ This sample shows how to call PutTextAndJsonBodyAsync and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); -RequestContent content = RequestContent.Create(""); +using RequestContent content = RequestContent.Create(""); Response response = await client.PutTextAndJsonBodyAsync(content, new ContentType("application/json")); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -315,7 +315,7 @@ This sample shows how to call PutTextAndJsonBodyAsync with all parameters and re AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); -RequestContent content = RequestContent.Create(""); +using RequestContent content = RequestContent.Create(""); Response response = await client.PutTextAndJsonBodyAsync(content, new ContentType("application/json")); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -329,7 +329,7 @@ This sample shows how to call PutTextAndJsonBody and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); -RequestContent content = RequestContent.Create(""); +using RequestContent content = RequestContent.Create(""); Response response = client.PutTextAndJsonBody(content, new ContentType("application/json")); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -340,7 +340,7 @@ This sample shows how to call PutTextAndJsonBody with all parameters and request AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); -RequestContent content = RequestContent.Create(""); +using RequestContent content = RequestContent.Create(""); Response response = client.PutTextAndJsonBody(content, new ContentType("application/json")); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; diff --git a/test/TestServerProjectsLowLevel/media_types/tests/Generated/Samples/Samples_MediaTypesClient.cs b/test/TestServerProjectsLowLevel/media_types/tests/Generated/Samples/Samples_MediaTypesClient.cs index 1ab0f844a3c..0f4ac35ed84 100644 --- a/test/TestServerProjectsLowLevel/media_types/tests/Generated/Samples/Samples_MediaTypesClient.cs +++ b/test/TestServerProjectsLowLevel/media_types/tests/Generated/Samples/Samples_MediaTypesClient.cs @@ -26,7 +26,7 @@ public void Example_AnalyzeBody_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.AnalyzeBody(content, new ContentType("application/pdf")); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -40,7 +40,7 @@ public async Task Example_AnalyzeBody_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.AnalyzeBodyAsync(content, new ContentType("application/pdf")); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -54,7 +54,7 @@ public void Example_AnalyzeBody_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); - RequestContent content = RequestContent.Create(File.OpenRead("")); + using RequestContent content = RequestContent.Create(File.OpenRead("")); Response response = client.AnalyzeBody(content, new ContentType("application/pdf")); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -68,7 +68,7 @@ public async Task Example_AnalyzeBody_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); - RequestContent content = RequestContent.Create(File.OpenRead("")); + using RequestContent content = RequestContent.Create(File.OpenRead("")); Response response = await client.AnalyzeBodyAsync(content, new ContentType("application/pdf")); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -82,7 +82,7 @@ public void Example_AnalyzeBodyNoAcceptHeader_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.AnalyzeBodyNoAcceptHeader(content, new ContentType("application/pdf")); Console.WriteLine(response.Status); @@ -95,7 +95,7 @@ public async Task Example_AnalyzeBodyNoAcceptHeader_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.AnalyzeBodyNoAcceptHeaderAsync(content, new ContentType("application/pdf")); Console.WriteLine(response.Status); @@ -108,7 +108,7 @@ public void Example_AnalyzeBodyNoAcceptHeader_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); - RequestContent content = RequestContent.Create(File.OpenRead("")); + using RequestContent content = RequestContent.Create(File.OpenRead("")); Response response = client.AnalyzeBodyNoAcceptHeader(content, new ContentType("application/pdf")); Console.WriteLine(response.Status); @@ -121,7 +121,7 @@ public async Task Example_AnalyzeBodyNoAcceptHeader_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); - RequestContent content = RequestContent.Create(File.OpenRead("")); + using RequestContent content = RequestContent.Create(File.OpenRead("")); Response response = await client.AnalyzeBodyNoAcceptHeaderAsync(content, new ContentType("application/pdf")); Console.WriteLine(response.Status); @@ -134,7 +134,7 @@ public void Example_ContentTypeWithEncoding_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = client.ContentTypeWithEncoding(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -148,7 +148,7 @@ public async Task Example_ContentTypeWithEncoding_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); - RequestContent content = null; + using RequestContent content = null; Response response = await client.ContentTypeWithEncodingAsync(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -162,7 +162,7 @@ public void Example_ContentTypeWithEncoding_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); - RequestContent content = RequestContent.Create(""); + using RequestContent content = RequestContent.Create(""); Response response = client.ContentTypeWithEncoding(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -176,7 +176,7 @@ public async Task Example_ContentTypeWithEncoding_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); - RequestContent content = RequestContent.Create(""); + using RequestContent content = RequestContent.Create(""); Response response = await client.ContentTypeWithEncodingAsync(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -190,7 +190,7 @@ public void Example_BinaryBodyWithTwoContentTypes_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); - RequestContent content = RequestContent.Create(File.OpenRead("")); + using RequestContent content = RequestContent.Create(File.OpenRead("")); Response response = client.BinaryBodyWithTwoContentTypes(content, new ContentType("application/json")); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -204,7 +204,7 @@ public async Task Example_BinaryBodyWithTwoContentTypes_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); - RequestContent content = RequestContent.Create(File.OpenRead("")); + using RequestContent content = RequestContent.Create(File.OpenRead("")); Response response = await client.BinaryBodyWithTwoContentTypesAsync(content, new ContentType("application/json")); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -218,7 +218,7 @@ public void Example_BinaryBodyWithTwoContentTypes_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); - RequestContent content = RequestContent.Create(File.OpenRead("")); + using RequestContent content = RequestContent.Create(File.OpenRead("")); Response response = client.BinaryBodyWithTwoContentTypes(content, new ContentType("application/json")); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -232,7 +232,7 @@ public async Task Example_BinaryBodyWithTwoContentTypes_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); - RequestContent content = RequestContent.Create(File.OpenRead("")); + using RequestContent content = RequestContent.Create(File.OpenRead("")); Response response = await client.BinaryBodyWithTwoContentTypesAsync(content, new ContentType("application/json")); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -246,7 +246,7 @@ public void Example_BinaryBodyWithThreeContentTypes_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); - RequestContent content = RequestContent.Create(File.OpenRead("")); + using RequestContent content = RequestContent.Create(File.OpenRead("")); Response response = client.BinaryBodyWithThreeContentTypes(content, new ContentType("application/json")); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -260,7 +260,7 @@ public async Task Example_BinaryBodyWithThreeContentTypes_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); - RequestContent content = RequestContent.Create(File.OpenRead("")); + using RequestContent content = RequestContent.Create(File.OpenRead("")); Response response = await client.BinaryBodyWithThreeContentTypesAsync(content, new ContentType("application/json")); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -274,7 +274,7 @@ public void Example_BinaryBodyWithThreeContentTypes_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); - RequestContent content = RequestContent.Create(File.OpenRead("")); + using RequestContent content = RequestContent.Create(File.OpenRead("")); Response response = client.BinaryBodyWithThreeContentTypes(content, new ContentType("application/json")); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -288,7 +288,7 @@ public async Task Example_BinaryBodyWithThreeContentTypes_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); - RequestContent content = RequestContent.Create(File.OpenRead("")); + using RequestContent content = RequestContent.Create(File.OpenRead("")); Response response = await client.BinaryBodyWithThreeContentTypesAsync(content, new ContentType("application/json")); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -302,7 +302,7 @@ public void Example_BodyThreeTypes_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); - RequestContent content = RequestContent.Create(File.OpenRead("")); + using RequestContent content = RequestContent.Create(File.OpenRead("")); Response response = client.BodyThreeTypes(content, new ContentType("application/octet-stream")); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -316,7 +316,7 @@ public async Task Example_BodyThreeTypes_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); - RequestContent content = RequestContent.Create(File.OpenRead("")); + using RequestContent content = RequestContent.Create(File.OpenRead("")); Response response = await client.BodyThreeTypesAsync(content, new ContentType("application/octet-stream")); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -330,7 +330,7 @@ public void Example_BodyThreeTypes_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); - RequestContent content = RequestContent.Create(File.OpenRead("")); + using RequestContent content = RequestContent.Create(File.OpenRead("")); Response response = client.BodyThreeTypes(content, new ContentType("application/octet-stream")); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -344,7 +344,7 @@ public async Task Example_BodyThreeTypes_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); - RequestContent content = RequestContent.Create(File.OpenRead("")); + using RequestContent content = RequestContent.Create(File.OpenRead("")); Response response = await client.BodyThreeTypesAsync(content, new ContentType("application/octet-stream")); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -358,7 +358,7 @@ public void Example_PutTextAndJsonBody_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); - RequestContent content = RequestContent.Create(""); + using RequestContent content = RequestContent.Create(""); Response response = client.PutTextAndJsonBody(content, new ContentType("application/json")); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -372,7 +372,7 @@ public async Task Example_PutTextAndJsonBody_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); - RequestContent content = RequestContent.Create(""); + using RequestContent content = RequestContent.Create(""); Response response = await client.PutTextAndJsonBodyAsync(content, new ContentType("application/json")); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -386,7 +386,7 @@ public void Example_PutTextAndJsonBody_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); - RequestContent content = RequestContent.Create(""); + using RequestContent content = RequestContent.Create(""); Response response = client.PutTextAndJsonBody(content, new ContentType("application/json")); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -400,7 +400,7 @@ public async Task Example_PutTextAndJsonBody_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); MediaTypesClient client = new MediaTypesClient(credential); - RequestContent content = RequestContent.Create(""); + using RequestContent content = RequestContent.Create(""); Response response = await client.PutTextAndJsonBodyAsync(content, new ContentType("application/json")); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; diff --git a/test/TestServerProjectsLowLevel/paging/src/Generated/Docs/PagingClient.xml b/test/TestServerProjectsLowLevel/paging/src/Generated/Docs/PagingClient.xml index 6b6d04e308a..f81266ce6bd 100644 --- a/test/TestServerProjectsLowLevel/paging/src/Generated/Docs/PagingClient.xml +++ b/test/TestServerProjectsLowLevel/paging/src/Generated/Docs/PagingClient.xml @@ -216,7 +216,7 @@ This sample shows how to call GetSinglePagesWithBodyParamsAsync and parse the re AzureKeyCredential credential = new AzureKeyCredential(""); PagingClient client = new PagingClient(credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); await foreach (BinaryData item in client.GetSinglePagesWithBodyParamsAsync(content)) { JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; @@ -228,7 +228,7 @@ This sample shows how to call GetSinglePagesWithBodyParamsAsync with all request AzureKeyCredential credential = new AzureKeyCredential(""); PagingClient client = new PagingClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", }); @@ -247,7 +247,7 @@ This sample shows how to call GetSinglePagesWithBodyParams and parse the result. AzureKeyCredential credential = new AzureKeyCredential(""); PagingClient client = new PagingClient(credential); -RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new object()); foreach (BinaryData item in client.GetSinglePagesWithBodyParams(content)) { JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; @@ -259,7 +259,7 @@ This sample shows how to call GetSinglePagesWithBodyParams with all request cont AzureKeyCredential credential = new AzureKeyCredential(""); PagingClient client = new PagingClient(credential); -RequestContent content = RequestContent.Create(new +using RequestContent content = RequestContent.Create(new { name = "", }); diff --git a/test/TestServerProjectsLowLevel/paging/tests/Generated/Samples/Samples_PagingClient.cs b/test/TestServerProjectsLowLevel/paging/tests/Generated/Samples/Samples_PagingClient.cs index 94d3ccfd811..6a81b1aad3c 100644 --- a/test/TestServerProjectsLowLevel/paging/tests/Generated/Samples/Samples_PagingClient.cs +++ b/test/TestServerProjectsLowLevel/paging/tests/Generated/Samples/Samples_PagingClient.cs @@ -257,7 +257,7 @@ public void Example_GetSinglePagesWithBodyParams_ShortVersion() AzureKeyCredential credential = new AzureKeyCredential(""); PagingClient client = new PagingClient(credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); foreach (BinaryData item in client.GetSinglePagesWithBodyParams(content)) { JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; @@ -272,7 +272,7 @@ public async Task Example_GetSinglePagesWithBodyParams_ShortVersion_Async() AzureKeyCredential credential = new AzureKeyCredential(""); PagingClient client = new PagingClient(credential); - RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new object()); await foreach (BinaryData item in client.GetSinglePagesWithBodyParamsAsync(content)) { JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; @@ -287,7 +287,7 @@ public void Example_GetSinglePagesWithBodyParams_AllParameters() AzureKeyCredential credential = new AzureKeyCredential(""); PagingClient client = new PagingClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", }); @@ -306,7 +306,7 @@ public async Task Example_GetSinglePagesWithBodyParams_AllParameters_Async() AzureKeyCredential credential = new AzureKeyCredential(""); PagingClient client = new PagingClient(credential); - RequestContent content = RequestContent.Create(new + using RequestContent content = RequestContent.Create(new { name = "", });