-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Rollout] Production rollout 2024-09-19 (#3972)
- Loading branch information
Showing
14 changed files
with
273 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
222 changes: 222 additions & 0 deletions
222
src/ProductConstructionService/ProductConstructionService.Client/Generated/Status.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,222 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System; | ||
using System.IO; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Azure; | ||
using Azure.Core; | ||
|
||
|
||
|
||
namespace ProductConstructionService.Client | ||
{ | ||
public partial interface IStatus | ||
{ | ||
Task StopPcsWorkItemProcessorAsync( | ||
CancellationToken cancellationToken = default | ||
); | ||
|
||
Task StartPcsWorkItemProcessorAsync( | ||
CancellationToken cancellationToken = default | ||
); | ||
|
||
Task GetPcsWorkItemProcessorStatusAsync( | ||
CancellationToken cancellationToken = default | ||
); | ||
|
||
} | ||
|
||
internal partial class Status : IServiceOperations<ProductConstructionServiceApi>, IStatus | ||
{ | ||
public Status(ProductConstructionServiceApi client) | ||
{ | ||
Client = client ?? throw new ArgumentNullException(nameof(client)); | ||
} | ||
|
||
public ProductConstructionServiceApi Client { get; } | ||
|
||
partial void HandleFailedRequest(RestApiException ex); | ||
|
||
partial void HandleFailedStopPcsWorkItemProcessorRequest(RestApiException ex); | ||
|
||
public async Task StopPcsWorkItemProcessorAsync( | ||
CancellationToken cancellationToken = default | ||
) | ||
{ | ||
|
||
const string apiVersion = "2020-02-20"; | ||
|
||
var _baseUri = Client.Options.BaseUri; | ||
var _url = new RequestUriBuilder(); | ||
_url.Reset(_baseUri); | ||
_url.AppendPath( | ||
"/api/status/stop", | ||
false); | ||
|
||
_url.AppendQuery("api-version", Client.Serialize(apiVersion)); | ||
|
||
|
||
using (var _req = Client.Pipeline.CreateRequest()) | ||
{ | ||
_req.Uri = _url; | ||
_req.Method = RequestMethod.Put; | ||
|
||
using (var _res = await Client.SendAsync(_req, cancellationToken).ConfigureAwait(false)) | ||
{ | ||
if (_res.Status < 200 || _res.Status >= 300) | ||
{ | ||
await OnStopPcsWorkItemProcessorFailed(_req, _res).ConfigureAwait(false); | ||
} | ||
|
||
|
||
return; | ||
} | ||
} | ||
} | ||
|
||
internal async Task OnStopPcsWorkItemProcessorFailed(Request req, Response res) | ||
{ | ||
string content = null; | ||
if (res.ContentStream != null) | ||
{ | ||
using (var reader = new StreamReader(res.ContentStream)) | ||
{ | ||
content = await reader.ReadToEndAsync().ConfigureAwait(false); | ||
} | ||
} | ||
|
||
var ex = new RestApiException<Models.ApiError>( | ||
req, | ||
res, | ||
content, | ||
Client.Deserialize<Models.ApiError>(content) | ||
); | ||
HandleFailedStopPcsWorkItemProcessorRequest(ex); | ||
HandleFailedRequest(ex); | ||
Client.OnFailedRequest(ex); | ||
throw ex; | ||
} | ||
|
||
partial void HandleFailedStartPcsWorkItemProcessorRequest(RestApiException ex); | ||
|
||
public async Task StartPcsWorkItemProcessorAsync( | ||
CancellationToken cancellationToken = default | ||
) | ||
{ | ||
|
||
const string apiVersion = "2020-02-20"; | ||
|
||
var _baseUri = Client.Options.BaseUri; | ||
var _url = new RequestUriBuilder(); | ||
_url.Reset(_baseUri); | ||
_url.AppendPath( | ||
"/api/status/start", | ||
false); | ||
|
||
_url.AppendQuery("api-version", Client.Serialize(apiVersion)); | ||
|
||
|
||
using (var _req = Client.Pipeline.CreateRequest()) | ||
{ | ||
_req.Uri = _url; | ||
_req.Method = RequestMethod.Put; | ||
|
||
using (var _res = await Client.SendAsync(_req, cancellationToken).ConfigureAwait(false)) | ||
{ | ||
if (_res.Status < 200 || _res.Status >= 300) | ||
{ | ||
await OnStartPcsWorkItemProcessorFailed(_req, _res).ConfigureAwait(false); | ||
} | ||
|
||
|
||
return; | ||
} | ||
} | ||
} | ||
|
||
internal async Task OnStartPcsWorkItemProcessorFailed(Request req, Response res) | ||
{ | ||
string content = null; | ||
if (res.ContentStream != null) | ||
{ | ||
using (var reader = new StreamReader(res.ContentStream)) | ||
{ | ||
content = await reader.ReadToEndAsync().ConfigureAwait(false); | ||
} | ||
} | ||
|
||
var ex = new RestApiException<Models.ApiError>( | ||
req, | ||
res, | ||
content, | ||
Client.Deserialize<Models.ApiError>(content) | ||
); | ||
HandleFailedStartPcsWorkItemProcessorRequest(ex); | ||
HandleFailedRequest(ex); | ||
Client.OnFailedRequest(ex); | ||
throw ex; | ||
} | ||
|
||
partial void HandleFailedGetPcsWorkItemProcessorStatusRequest(RestApiException ex); | ||
|
||
public async Task GetPcsWorkItemProcessorStatusAsync( | ||
CancellationToken cancellationToken = default | ||
) | ||
{ | ||
|
||
const string apiVersion = "2020-02-20"; | ||
|
||
var _baseUri = Client.Options.BaseUri; | ||
var _url = new RequestUriBuilder(); | ||
_url.Reset(_baseUri); | ||
_url.AppendPath( | ||
"/api/status", | ||
false); | ||
|
||
_url.AppendQuery("api-version", Client.Serialize(apiVersion)); | ||
|
||
|
||
using (var _req = Client.Pipeline.CreateRequest()) | ||
{ | ||
_req.Uri = _url; | ||
_req.Method = RequestMethod.Get; | ||
|
||
using (var _res = await Client.SendAsync(_req, cancellationToken).ConfigureAwait(false)) | ||
{ | ||
if (_res.Status < 200 || _res.Status >= 300) | ||
{ | ||
await OnGetPcsWorkItemProcessorStatusFailed(_req, _res).ConfigureAwait(false); | ||
} | ||
|
||
|
||
return; | ||
} | ||
} | ||
} | ||
|
||
internal async Task OnGetPcsWorkItemProcessorStatusFailed(Request req, Response res) | ||
{ | ||
string content = null; | ||
if (res.ContentStream != null) | ||
{ | ||
using (var reader = new StreamReader(res.ContentStream)) | ||
{ | ||
content = await reader.ReadToEndAsync().ConfigureAwait(false); | ||
} | ||
} | ||
|
||
var ex = new RestApiException<Models.ApiError>( | ||
req, | ||
res, | ||
content, | ||
Client.Deserialize<Models.ApiError>(content) | ||
); | ||
HandleFailedGetPcsWorkItemProcessorStatusRequest(ex); | ||
HandleFailedRequest(ex); | ||
Client.OnFailedRequest(ex); | ||
throw ex; | ||
} | ||
} | ||
} |
Oops, something went wrong.