This commit is contained in:
Michael Yanni 2020-02-26 13:55:02 -08:00
Родитель 6f82a57f88
Коммит c3ad473e20
6 изменённых файлов: 164 добавлений и 165 удалений

Просмотреть файл

@ -385,7 +385,7 @@ namespace AutoRest.CSharp.V3.Generation.Writers
w => w.Append($"document.RootElement"),
ref valueVariable
);
writer.Line($"return {typeof(Response)}.FromValue({valueVariable}, response);");
writer.Line($"return {valueVariable};");
break;
case XmlElementSerialization xmlSerialization:
writer.Line($"var {document:D} = {typeof(XDocument)}.Load(response.ContentStream, LoadOptions.PreserveWhitespace);");
@ -394,10 +394,10 @@ namespace AutoRest.CSharp.V3.Generation.Writers
w => w.Append($"document"),
ref valueVariable
);
writer.Line($"return {typeof(Response)}.FromValue({valueVariable}, response);");
writer.Line($"return {valueVariable};");
break;
default:
writer.Line($"return Response.FromValue(response, response);");
writer.Line($"return response;");
break;
}
}
@ -414,7 +414,7 @@ namespace AutoRest.CSharp.V3.Generation.Writers
w => w.Append($"document.RootElement"),
ref valueVariable
);
writer.Line($"return {typeof(Response)}.FromValue({valueVariable}, response);");
writer.Line($"return {valueVariable};");
break;
case XmlElementSerialization xmlSerialization:
writer.Line($"var {document:D} = {typeof(XDocument)}.Load(response.ContentStream, LoadOptions.PreserveWhitespace);");
@ -423,12 +423,12 @@ namespace AutoRest.CSharp.V3.Generation.Writers
w => w.Append($"document"),
ref valueVariable
);
writer.Line($"return {typeof(Response)}.FromValue({valueVariable}, response);");
writer.Line($"return {valueVariable};");
break;
default:
//TODO: Need this await or it won't compile since we didn't use an await in async lambda.
writer.Line($"await Task.CompletedTask;");
writer.Line($"return Response.FromValue(response, response);");
writer.Line($"return response;");
break;
}
}

Просмотреть файл

@ -52,7 +52,7 @@ namespace Azure.Core
}
internal static Operation<T> Create<T>(HttpPipeline pipeline, ClientDiagnostics clientDiagnostics, Response originalResponse, RequestMethod requestMethod, string scopeName, OperationFinalStateVia finalStateVia,
Func<HttpMessage> createOriginalHttpMessage, Func<Response, CancellationToken, Response<T>> createFinalResponse, Func<Response, CancellationToken, ValueTask<Response<T>>> createFinalResponseAsync) where T : notnull
Func<HttpMessage> createOriginalHttpMessage, Func<Response, CancellationToken, T> createFinalResponse, Func<Response, CancellationToken, ValueTask<T>> createFinalResponseAsync) where T : notnull
{
using HttpMessage originalHttpMethod = createOriginalHttpMessage();
string originalUri = originalHttpMethod.Request.Uri.ToString();
@ -79,8 +79,8 @@ namespace Azure.Core
private readonly HttpPipeline _pipeline;
private readonly ClientDiagnostics _clientDiagnostics;
private readonly string _scopeName;
private readonly Func<Response, CancellationToken, Response<T>> _createFinalResponse;
private readonly Func<Response, CancellationToken, ValueTask<Response<T>>> _createFinalResponseAsync;
private readonly Func<Response, CancellationToken, T> _createFinalResponse;
private readonly Func<Response, CancellationToken, ValueTask<T>> _createFinalResponseAsync;
private readonly ScenarioInfo _info;
private Response _rawResponse;
@ -90,7 +90,7 @@ namespace Azure.Core
private bool _shouldPoll;
public ArmOperation(HttpPipeline pipeline, ClientDiagnostics clientDiagnostics, Response originalResponse, string scopeName, ScenarioInfo info,
Func<Response, CancellationToken, Response<T>> createFinalResponse, Func<Response, CancellationToken, ValueTask<Response<T>>> createFinalResponseAsync)
Func<Response, CancellationToken, T> createFinalResponse, Func<Response, CancellationToken, ValueTask<T>> createFinalResponseAsync)
{
_rawResponse = originalResponse;
_pipeline = pipeline;
@ -145,11 +145,10 @@ namespace Azure.Core
case 200:
case 204 when !(_info.RequestMethod == RequestMethod.Put || _info.RequestMethod == RequestMethod.Patch):
{
Response<T> typedResponse = async
_value = async
? await _createFinalResponseAsync(finalResponse, cancellationToken).ConfigureAwait(false)
: _createFinalResponse(finalResponse, cancellationToken);
_rawResponse = typedResponse.GetRawResponse();
_value = typedResponse.Value;
_rawResponse = finalResponse;
_hasValue = true;
break;
}

Просмотреть файл

@ -495,13 +495,13 @@ namespace lro
{
using var document = JsonDocument.Parse(response.ContentStream);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
},
async (response, cancellationToken) =>
{
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
});
}
/// <summary> Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=Creating. Polls return this value until the last poll returns a 200 with ProvisioningState=Succeeded. </summary>
@ -541,13 +541,13 @@ namespace lro
{
using var document = JsonDocument.Parse(response.ContentStream);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
},
async (response, cancellationToken) =>
{
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
});
}
/// <summary> Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=Creating. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. </summary>
@ -587,13 +587,13 @@ namespace lro
{
using var document = JsonDocument.Parse(response.ContentStream);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
},
async (response, cancellationToken) =>
{
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
});
}
/// <summary> Long running delete request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=Accepted. Polls return this value until the last poll returns a 200 with ProvisioningState=Succeeded. </summary>
@ -627,12 +627,12 @@ namespace lro
return ArmOperationHelpers.Create(pipeline, clientDiagnostics, originalResponse, RequestMethod.Delete, "LroRetrysOperations.Delete202Retry200", OperationFinalStateVia.Location, createOriginalHttpMessage,
(response, cancellationToken) =>
{
return Response.FromValue(response, response);
return response;
},
async (response, cancellationToken) =>
{
await Task.CompletedTask;
return Response.FromValue(response, response);
return response;
});
}
/// <summary> Long running delete request, service returns a 500, then a 202 to the initial request. Polls return this value until the last poll returns a 200 with ProvisioningState=Succeeded. </summary>
@ -666,12 +666,12 @@ namespace lro
return ArmOperationHelpers.Create(pipeline, clientDiagnostics, originalResponse, RequestMethod.Delete, "LroRetrysOperations.DeleteAsyncRelativeRetrySucceeded", OperationFinalStateVia.Location, createOriginalHttpMessage,
(response, cancellationToken) =>
{
return Response.FromValue(response, response);
return response;
},
async (response, cancellationToken) =>
{
await Task.CompletedTask;
return Response.FromValue(response, response);
return response;
});
}
/// <summary> Long running delete request, service returns a 500, then a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. </summary>
@ -705,12 +705,12 @@ namespace lro
return ArmOperationHelpers.Create(pipeline, clientDiagnostics, originalResponse, RequestMethod.Post, "LroRetrysOperations.Post202Retry200", OperationFinalStateVia.Location, createOriginalHttpMessage,
(response, cancellationToken) =>
{
return Response.FromValue(response, response);
return response;
},
async (response, cancellationToken) =>
{
await Task.CompletedTask;
return Response.FromValue(response, response);
return response;
});
}
/// <summary> Long running post request, service returns a 500, then a 202 to the initial request, with &apos;Location&apos; and &apos;Retry-After&apos; headers, Polls return a 200 with a response body after success. </summary>
@ -748,12 +748,12 @@ namespace lro
return ArmOperationHelpers.Create(pipeline, clientDiagnostics, originalResponse, RequestMethod.Post, "LroRetrysOperations.PostAsyncRelativeRetrySucceeded", OperationFinalStateVia.Location, createOriginalHttpMessage,
(response, cancellationToken) =>
{
return Response.FromValue(response, response);
return response;
},
async (response, cancellationToken) =>
{
await Task.CompletedTask;
return Response.FromValue(response, response);
return response;
});
}
/// <summary> Long running post request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=Creating. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. </summary>

Просмотреть файл

@ -1728,13 +1728,13 @@ namespace lro
{
using var document = JsonDocument.Parse(response.ContentStream);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
},
async (response, cancellationToken) =>
{
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
});
}
/// <summary> Long running put request, service returns a 400 to the initial request. </summary>
@ -1774,13 +1774,13 @@ namespace lro
{
using var document = JsonDocument.Parse(response.ContentStream);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
},
async (response, cancellationToken) =>
{
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
});
}
/// <summary> Long running put request, service returns a Product with &apos;ProvisioningState&apos; = &apos;Creating&apos; and 201 response code. </summary>
@ -1820,13 +1820,13 @@ namespace lro
{
using var document = JsonDocument.Parse(response.ContentStream);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
},
async (response, cancellationToken) =>
{
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
});
}
/// <summary> Long running put request, service returns a Product with &apos;ProvisioningState&apos; = &apos;Creating&apos; and 201 response code. </summary>
@ -1866,13 +1866,13 @@ namespace lro
{
using var document = JsonDocument.Parse(response.ContentStream);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
},
async (response, cancellationToken) =>
{
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
});
}
/// <summary> Long running put request, service returns a 200 with ProvisioningState=Creating. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. </summary>
@ -1910,12 +1910,12 @@ namespace lro
return ArmOperationHelpers.Create(pipeline, clientDiagnostics, originalResponse, RequestMethod.Delete, "LrosaDsOperations.DeleteNonRetry400", OperationFinalStateVia.Location, createOriginalHttpMessage,
(response, cancellationToken) =>
{
return Response.FromValue(response, response);
return response;
},
async (response, cancellationToken) =>
{
await Task.CompletedTask;
return Response.FromValue(response, response);
return response;
});
}
/// <summary> Long running delete request, service returns a 400 with an error body. </summary>
@ -1949,12 +1949,12 @@ namespace lro
return ArmOperationHelpers.Create(pipeline, clientDiagnostics, originalResponse, RequestMethod.Delete, "LrosaDsOperations.Delete202NonRetry400", OperationFinalStateVia.Location, createOriginalHttpMessage,
(response, cancellationToken) =>
{
return Response.FromValue(response, response);
return response;
},
async (response, cancellationToken) =>
{
await Task.CompletedTask;
return Response.FromValue(response, response);
return response;
});
}
/// <summary> Long running delete request, service returns a 202 with a location header. </summary>
@ -1988,12 +1988,12 @@ namespace lro
return ArmOperationHelpers.Create(pipeline, clientDiagnostics, originalResponse, RequestMethod.Delete, "LrosaDsOperations.DeleteAsyncRelativeRetry400", OperationFinalStateVia.Location, createOriginalHttpMessage,
(response, cancellationToken) =>
{
return Response.FromValue(response, response);
return response;
},
async (response, cancellationToken) =>
{
await Task.CompletedTask;
return Response.FromValue(response, response);
return response;
});
}
/// <summary> Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. </summary>
@ -2027,12 +2027,12 @@ namespace lro
return ArmOperationHelpers.Create(pipeline, clientDiagnostics, originalResponse, RequestMethod.Post, "LrosaDsOperations.PostNonRetry400", OperationFinalStateVia.Location, createOriginalHttpMessage,
(response, cancellationToken) =>
{
return Response.FromValue(response, response);
return response;
},
async (response, cancellationToken) =>
{
await Task.CompletedTask;
return Response.FromValue(response, response);
return response;
});
}
/// <summary> Long running post request, service returns a 400 with no error body. </summary>
@ -2070,12 +2070,12 @@ namespace lro
return ArmOperationHelpers.Create(pipeline, clientDiagnostics, originalResponse, RequestMethod.Post, "LrosaDsOperations.Post202NonRetry400", OperationFinalStateVia.Location, createOriginalHttpMessage,
(response, cancellationToken) =>
{
return Response.FromValue(response, response);
return response;
},
async (response, cancellationToken) =>
{
await Task.CompletedTask;
return Response.FromValue(response, response);
return response;
});
}
/// <summary> Long running post request, service returns a 202 with a location header. </summary>
@ -2113,12 +2113,12 @@ namespace lro
return ArmOperationHelpers.Create(pipeline, clientDiagnostics, originalResponse, RequestMethod.Post, "LrosaDsOperations.PostAsyncRelativeRetry400", OperationFinalStateVia.Location, createOriginalHttpMessage,
(response, cancellationToken) =>
{
return Response.FromValue(response, response);
return response;
},
async (response, cancellationToken) =>
{
await Task.CompletedTask;
return Response.FromValue(response, response);
return response;
});
}
/// <summary> Long running post request, service returns a 202 to the initial request Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. </summary>
@ -2158,13 +2158,13 @@ namespace lro
{
using var document = JsonDocument.Parse(response.ContentStream);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
},
async (response, cancellationToken) =>
{
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
});
}
/// <summary> Long running put request, service returns a 201 to the initial request with no payload. </summary>
@ -2204,13 +2204,13 @@ namespace lro
{
using var document = JsonDocument.Parse(response.ContentStream);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
},
async (response, cancellationToken) =>
{
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
});
}
/// <summary> Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=Creating. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. </summary>
@ -2250,13 +2250,13 @@ namespace lro
{
using var document = JsonDocument.Parse(response.ContentStream);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
},
async (response, cancellationToken) =>
{
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
});
}
/// <summary> Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=Creating. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. </summary>
@ -2294,12 +2294,12 @@ namespace lro
return ArmOperationHelpers.Create(pipeline, clientDiagnostics, originalResponse, RequestMethod.Delete, "LrosaDsOperations.Delete204Succeeded", OperationFinalStateVia.Location, createOriginalHttpMessage,
(response, cancellationToken) =>
{
return Response.FromValue(response, response);
return response;
},
async (response, cancellationToken) =>
{
await Task.CompletedTask;
return Response.FromValue(response, response);
return response;
});
}
/// <summary> Long running delete request, service returns a 204 to the initial request, indicating success. </summary>
@ -2333,12 +2333,12 @@ namespace lro
return ArmOperationHelpers.Create(pipeline, clientDiagnostics, originalResponse, RequestMethod.Delete, "LrosaDsOperations.DeleteAsyncRelativeRetryNoStatus", OperationFinalStateVia.Location, createOriginalHttpMessage,
(response, cancellationToken) =>
{
return Response.FromValue(response, response);
return response;
},
async (response, cancellationToken) =>
{
await Task.CompletedTask;
return Response.FromValue(response, response);
return response;
});
}
/// <summary> Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. </summary>
@ -2372,12 +2372,12 @@ namespace lro
return ArmOperationHelpers.Create(pipeline, clientDiagnostics, originalResponse, RequestMethod.Post, "LrosaDsOperations.Post202NoLocation", OperationFinalStateVia.Location, createOriginalHttpMessage,
(response, cancellationToken) =>
{
return Response.FromValue(response, response);
return response;
},
async (response, cancellationToken) =>
{
await Task.CompletedTask;
return Response.FromValue(response, response);
return response;
});
}
/// <summary> Long running post request, service returns a 202 to the initial request, without a location header. </summary>
@ -2415,12 +2415,12 @@ namespace lro
return ArmOperationHelpers.Create(pipeline, clientDiagnostics, originalResponse, RequestMethod.Post, "LrosaDsOperations.PostAsyncRelativeRetryNoPayload", OperationFinalStateVia.Location, createOriginalHttpMessage,
(response, cancellationToken) =>
{
return Response.FromValue(response, response);
return response;
},
async (response, cancellationToken) =>
{
await Task.CompletedTask;
return Response.FromValue(response, response);
return response;
});
}
/// <summary> Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=Creating. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. </summary>
@ -2460,13 +2460,13 @@ namespace lro
{
using var document = JsonDocument.Parse(response.ContentStream);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
},
async (response, cancellationToken) =>
{
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
});
}
/// <summary> Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json. </summary>
@ -2506,13 +2506,13 @@ namespace lro
{
using var document = JsonDocument.Parse(response.ContentStream);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
},
async (response, cancellationToken) =>
{
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
});
}
/// <summary> Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=Creating. The endpoint indicated in the Azure-AsyncOperation header is invalid. </summary>
@ -2552,13 +2552,13 @@ namespace lro
{
using var document = JsonDocument.Parse(response.ContentStream);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
},
async (response, cancellationToken) =>
{
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
});
}
/// <summary> Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=Creating. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. </summary>
@ -2596,12 +2596,12 @@ namespace lro
return ArmOperationHelpers.Create(pipeline, clientDiagnostics, originalResponse, RequestMethod.Delete, "LrosaDsOperations.Delete202RetryInvalidHeader", OperationFinalStateVia.Location, createOriginalHttpMessage,
(response, cancellationToken) =>
{
return Response.FromValue(response, response);
return response;
},
async (response, cancellationToken) =>
{
await Task.CompletedTask;
return Response.FromValue(response, response);
return response;
});
}
/// <summary> Long running delete request, service returns a 202 to the initial request receing a reponse with an invalid &apos;Location&apos; and &apos;Retry-After&apos; headers. </summary>
@ -2635,12 +2635,12 @@ namespace lro
return ArmOperationHelpers.Create(pipeline, clientDiagnostics, originalResponse, RequestMethod.Delete, "LrosaDsOperations.DeleteAsyncRelativeRetryInvalidHeader", OperationFinalStateVia.Location, createOriginalHttpMessage,
(response, cancellationToken) =>
{
return Response.FromValue(response, response);
return response;
},
async (response, cancellationToken) =>
{
await Task.CompletedTask;
return Response.FromValue(response, response);
return response;
});
}
/// <summary> Long running delete request, service returns a 202 to the initial request. The endpoint indicated in the Azure-AsyncOperation header is invalid. </summary>
@ -2674,12 +2674,12 @@ namespace lro
return ArmOperationHelpers.Create(pipeline, clientDiagnostics, originalResponse, RequestMethod.Delete, "LrosaDsOperations.DeleteAsyncRelativeRetryInvalidJsonPolling", OperationFinalStateVia.Location, createOriginalHttpMessage,
(response, cancellationToken) =>
{
return Response.FromValue(response, response);
return response;
},
async (response, cancellationToken) =>
{
await Task.CompletedTask;
return Response.FromValue(response, response);
return response;
});
}
/// <summary> Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. </summary>
@ -2713,12 +2713,12 @@ namespace lro
return ArmOperationHelpers.Create(pipeline, clientDiagnostics, originalResponse, RequestMethod.Post, "LrosaDsOperations.Post202RetryInvalidHeader", OperationFinalStateVia.Location, createOriginalHttpMessage,
(response, cancellationToken) =>
{
return Response.FromValue(response, response);
return response;
},
async (response, cancellationToken) =>
{
await Task.CompletedTask;
return Response.FromValue(response, response);
return response;
});
}
/// <summary> Long running post request, service returns a 202 to the initial request, with invalid &apos;Location&apos; and &apos;Retry-After&apos; headers. </summary>
@ -2756,12 +2756,12 @@ namespace lro
return ArmOperationHelpers.Create(pipeline, clientDiagnostics, originalResponse, RequestMethod.Post, "LrosaDsOperations.PostAsyncRelativeRetryInvalidHeader", OperationFinalStateVia.Location, createOriginalHttpMessage,
(response, cancellationToken) =>
{
return Response.FromValue(response, response);
return response;
},
async (response, cancellationToken) =>
{
await Task.CompletedTask;
return Response.FromValue(response, response);
return response;
});
}
/// <summary> Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=Creating. The endpoint indicated in the Azure-AsyncOperation header is invalid. </summary>
@ -2799,12 +2799,12 @@ namespace lro
return ArmOperationHelpers.Create(pipeline, clientDiagnostics, originalResponse, RequestMethod.Post, "LrosaDsOperations.PostAsyncRelativeRetryInvalidJsonPolling", OperationFinalStateVia.Location, createOriginalHttpMessage,
(response, cancellationToken) =>
{
return Response.FromValue(response, response);
return response;
},
async (response, cancellationToken) =>
{
await Task.CompletedTask;
return Response.FromValue(response, response);
return response;
});
}
/// <summary> Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=Creating. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. </summary>

Просмотреть файл

@ -318,13 +318,13 @@ namespace lro
{
using var document = JsonDocument.Parse(response.ContentStream);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
},
async (response, cancellationToken) =>
{
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
});
}
/// <summary> x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=Creating. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. </summary>
@ -364,13 +364,13 @@ namespace lro
{
using var document = JsonDocument.Parse(response.ContentStream);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
},
async (response, cancellationToken) =>
{
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
});
}
/// <summary> x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=Creating. Polls return this value until the last poll returns a 200 with ProvisioningState=Succeeded. </summary>
@ -408,12 +408,12 @@ namespace lro
return ArmOperationHelpers.Create(pipeline, clientDiagnostics, originalResponse, RequestMethod.Post, "LrOSCustomHeaderOperations.Post202Retry200", OperationFinalStateVia.Location, createOriginalHttpMessage,
(response, cancellationToken) =>
{
return Response.FromValue(response, response);
return response;
},
async (response, cancellationToken) =>
{
await Task.CompletedTask;
return Response.FromValue(response, response);
return response;
});
}
/// <summary> x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with &apos;Location&apos; and &apos;Retry-After&apos; headers, Polls return a 200 with a response body after success. </summary>
@ -451,12 +451,12 @@ namespace lro
return ArmOperationHelpers.Create(pipeline, clientDiagnostics, originalResponse, RequestMethod.Post, "LrOSCustomHeaderOperations.PostAsyncRetrySucceeded", OperationFinalStateVia.Location, createOriginalHttpMessage,
(response, cancellationToken) =>
{
return Response.FromValue(response, response);
return response;
},
async (response, cancellationToken) =>
{
await Task.CompletedTask;
return Response.FromValue(response, response);
return response;
});
}
/// <summary> x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=Creating. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. </summary>

Просмотреть файл

@ -2535,13 +2535,13 @@ namespace lro
{
using var document = JsonDocument.Parse(response.ContentStream);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
},
async (response, cancellationToken) =>
{
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
});
}
/// <summary> Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=Succeeded. </summary>
@ -2581,13 +2581,13 @@ namespace lro
{
using var document = JsonDocument.Parse(response.ContentStream);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
},
async (response, cancellationToken) =>
{
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
});
}
/// <summary> Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=Succeeded. </summary>
@ -2627,13 +2627,13 @@ namespace lro
{
using var document = JsonDocument.Parse(response.ContentStream);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
},
async (response, cancellationToken) =>
{
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
});
}
/// <summary> Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn&apos;t contains ProvisioningState. </summary>
@ -2673,13 +2673,13 @@ namespace lro
{
using var document = JsonDocument.Parse(response.ContentStream);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
},
async (response, cancellationToken) =>
{
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
});
}
/// <summary> Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=Creating. Polls return this value until the last poll returns a 200 with ProvisioningState=Succeeded. </summary>
@ -2719,13 +2719,13 @@ namespace lro
{
using var document = JsonDocument.Parse(response.ContentStream);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
},
async (response, cancellationToken) =>
{
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
});
}
/// <summary> Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=Updating. Polls return this value until the last poll returns a 200 with ProvisioningState=Succeeded. </summary>
@ -2765,13 +2765,13 @@ namespace lro
{
using var document = JsonDocument.Parse(response.ContentStream);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
},
async (response, cancellationToken) =>
{
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
});
}
/// <summary> Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=Created. Polls return this value until the last poll returns a 200 with ProvisioningState=Failed. </summary>
@ -2811,13 +2811,13 @@ namespace lro
{
using var document = JsonDocument.Parse(response.ContentStream);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
},
async (response, cancellationToken) =>
{
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
});
}
/// <summary> Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=Creating. Polls return this value until the last poll returns a 200 with ProvisioningState=Canceled. </summary>
@ -2857,13 +2857,13 @@ namespace lro
{
using var document = JsonDocument.Parse(response.ContentStream);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
},
async (response, cancellationToken) =>
{
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
});
}
/// <summary> Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. </summary>
@ -2903,13 +2903,13 @@ namespace lro
{
using var document = JsonDocument.Parse(response.ContentStream);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
},
async (response, cancellationToken) =>
{
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
});
}
/// <summary> Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=Creating. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. </summary>
@ -2949,13 +2949,13 @@ namespace lro
{
using var document = JsonDocument.Parse(response.ContentStream);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
},
async (response, cancellationToken) =>
{
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
});
}
/// <summary> Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=Creating. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. </summary>
@ -2995,13 +2995,13 @@ namespace lro
{
using var document = JsonDocument.Parse(response.ContentStream);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
},
async (response, cancellationToken) =>
{
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
});
}
/// <summary> Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=Creating. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. </summary>
@ -3041,13 +3041,13 @@ namespace lro
{
using var document = JsonDocument.Parse(response.ContentStream);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
},
async (response, cancellationToken) =>
{
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
});
}
/// <summary> Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=Creating. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. </summary>
@ -3087,13 +3087,13 @@ namespace lro
{
using var document = JsonDocument.Parse(response.ContentStream);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
},
async (response, cancellationToken) =>
{
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
});
}
/// <summary> Long running put request, service returns a 202 to the initial request with Azure-AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. </summary>
@ -3133,13 +3133,13 @@ namespace lro
{
using var document = JsonDocument.Parse(response.ContentStream);
var value = Sku.DeserializeSku(document.RootElement);
return Response.FromValue(value, response);
return value;
},
async (response, cancellationToken) =>
{
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
var value = Sku.DeserializeSku(document.RootElement);
return Response.FromValue(value, response);
return value;
});
}
/// <summary> Long running put request with non resource. </summary>
@ -3179,13 +3179,13 @@ namespace lro
{
using var document = JsonDocument.Parse(response.ContentStream);
var value = Sku.DeserializeSku(document.RootElement);
return Response.FromValue(value, response);
return value;
},
async (response, cancellationToken) =>
{
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
var value = Sku.DeserializeSku(document.RootElement);
return Response.FromValue(value, response);
return value;
});
}
/// <summary> Long running put request with non resource. </summary>
@ -3225,13 +3225,13 @@ namespace lro
{
using var document = JsonDocument.Parse(response.ContentStream);
var value = SubProduct.DeserializeSubProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
},
async (response, cancellationToken) =>
{
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
var value = SubProduct.DeserializeSubProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
});
}
/// <summary> Long running put request with sub resource. </summary>
@ -3271,13 +3271,13 @@ namespace lro
{
using var document = JsonDocument.Parse(response.ContentStream);
var value = SubProduct.DeserializeSubProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
},
async (response, cancellationToken) =>
{
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
var value = SubProduct.DeserializeSubProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
});
}
/// <summary> Long running put request with sub resource. </summary>
@ -3317,13 +3317,13 @@ namespace lro
{
using var document = JsonDocument.Parse(response.ContentStream);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
},
async (response, cancellationToken) =>
{
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
});
}
/// <summary> Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=Accepted. Polls return this value until the last poll returns a 200 with ProvisioningState=Succeeded. </summary>
@ -3359,13 +3359,13 @@ namespace lro
{
using var document = JsonDocument.Parse(response.ContentStream);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
},
async (response, cancellationToken) =>
{
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
});
}
/// <summary> Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=Creating. Polls return this value until the last poll returns a 200 with ProvisioningState=Failed. </summary>
@ -3401,13 +3401,13 @@ namespace lro
{
using var document = JsonDocument.Parse(response.ContentStream);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
},
async (response, cancellationToken) =>
{
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
});
}
/// <summary> Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=Creating. Polls return this value until the last poll returns a 200 with ProvisioningState=Canceled. </summary>
@ -3441,12 +3441,12 @@ namespace lro
return ArmOperationHelpers.Create(pipeline, clientDiagnostics, originalResponse, RequestMethod.Delete, "LrOSOperations.Delete204Succeeded", OperationFinalStateVia.Location, createOriginalHttpMessage,
(response, cancellationToken) =>
{
return Response.FromValue(response, response);
return response;
},
async (response, cancellationToken) =>
{
await Task.CompletedTask;
return Response.FromValue(response, response);
return response;
});
}
/// <summary> Long running delete succeeds and returns right away. </summary>
@ -3482,13 +3482,13 @@ namespace lro
{
using var document = JsonDocument.Parse(response.ContentStream);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
},
async (response, cancellationToken) =>
{
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
});
}
/// <summary> Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a 200 with ProvisioningState=Succeeded. </summary>
@ -3524,13 +3524,13 @@ namespace lro
{
using var document = JsonDocument.Parse(response.ContentStream);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
},
async (response, cancellationToken) =>
{
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
});
}
/// <summary> Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a 200 with ProvisioningState=Succeeded. </summary>
@ -3564,12 +3564,12 @@ namespace lro
return ArmOperationHelpers.Create(pipeline, clientDiagnostics, originalResponse, RequestMethod.Delete, "LrOSOperations.DeleteNoHeaderInRetry", OperationFinalStateVia.Location, createOriginalHttpMessage,
(response, cancellationToken) =>
{
return Response.FromValue(response, response);
return response;
},
async (response, cancellationToken) =>
{
await Task.CompletedTask;
return Response.FromValue(response, response);
return response;
});
}
/// <summary> Long running delete request, service returns a location header in the initial request. Subsequent calls to operation status do not contain location header. </summary>
@ -3603,12 +3603,12 @@ namespace lro
return ArmOperationHelpers.Create(pipeline, clientDiagnostics, originalResponse, RequestMethod.Delete, "LrOSOperations.DeleteAsyncNoHeaderInRetry", OperationFinalStateVia.Location, createOriginalHttpMessage,
(response, cancellationToken) =>
{
return Response.FromValue(response, response);
return response;
},
async (response, cancellationToken) =>
{
await Task.CompletedTask;
return Response.FromValue(response, response);
return response;
});
}
/// <summary> Long running delete request, service returns an Azure-AsyncOperation header in the initial request. Subsequent calls to operation status do not contain Azure-AsyncOperation header. </summary>
@ -3642,12 +3642,12 @@ namespace lro
return ArmOperationHelpers.Create(pipeline, clientDiagnostics, originalResponse, RequestMethod.Delete, "LrOSOperations.DeleteAsyncRetrySucceeded", OperationFinalStateVia.Location, createOriginalHttpMessage,
(response, cancellationToken) =>
{
return Response.FromValue(response, response);
return response;
},
async (response, cancellationToken) =>
{
await Task.CompletedTask;
return Response.FromValue(response, response);
return response;
});
}
/// <summary> Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. </summary>
@ -3681,12 +3681,12 @@ namespace lro
return ArmOperationHelpers.Create(pipeline, clientDiagnostics, originalResponse, RequestMethod.Delete, "LrOSOperations.DeleteAsyncNoRetrySucceeded", OperationFinalStateVia.Location, createOriginalHttpMessage,
(response, cancellationToken) =>
{
return Response.FromValue(response, response);
return response;
},
async (response, cancellationToken) =>
{
await Task.CompletedTask;
return Response.FromValue(response, response);
return response;
});
}
/// <summary> Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. </summary>
@ -3720,12 +3720,12 @@ namespace lro
return ArmOperationHelpers.Create(pipeline, clientDiagnostics, originalResponse, RequestMethod.Delete, "LrOSOperations.DeleteAsyncRetryFailed", OperationFinalStateVia.Location, createOriginalHttpMessage,
(response, cancellationToken) =>
{
return Response.FromValue(response, response);
return response;
},
async (response, cancellationToken) =>
{
await Task.CompletedTask;
return Response.FromValue(response, response);
return response;
});
}
/// <summary> Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. </summary>
@ -3759,12 +3759,12 @@ namespace lro
return ArmOperationHelpers.Create(pipeline, clientDiagnostics, originalResponse, RequestMethod.Delete, "LrOSOperations.DeleteAsyncRetrycanceled", OperationFinalStateVia.Location, createOriginalHttpMessage,
(response, cancellationToken) =>
{
return Response.FromValue(response, response);
return response;
},
async (response, cancellationToken) =>
{
await Task.CompletedTask;
return Response.FromValue(response, response);
return response;
});
}
/// <summary> Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. </summary>
@ -3800,13 +3800,13 @@ namespace lro
{
using var document = JsonDocument.Parse(response.ContentStream);
var value = Sku.DeserializeSku(document.RootElement);
return Response.FromValue(value, response);
return value;
},
async (response, cancellationToken) =>
{
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
var value = Sku.DeserializeSku(document.RootElement);
return Response.FromValue(value, response);
return value;
});
}
/// <summary> Long running post request, service returns a 202 to the initial request, with &apos;Location&apos; header. Poll returns a 200 with a response body after success. </summary>
@ -3840,12 +3840,12 @@ namespace lro
return ArmOperationHelpers.Create(pipeline, clientDiagnostics, originalResponse, RequestMethod.Post, "LrOSOperations.Post202Retry200", OperationFinalStateVia.Location, createOriginalHttpMessage,
(response, cancellationToken) =>
{
return Response.FromValue(response, response);
return response;
},
async (response, cancellationToken) =>
{
await Task.CompletedTask;
return Response.FromValue(response, response);
return response;
});
}
/// <summary> Long running post request, service returns a 202 to the initial request, with &apos;Location&apos; and &apos;Retry-After&apos; headers, Polls return a 200 with a response body after success. </summary>
@ -3885,13 +3885,13 @@ namespace lro
{
using var document = JsonDocument.Parse(response.ContentStream);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
},
async (response, cancellationToken) =>
{
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
});
}
/// <summary> Long running post request, service returns a 202 to the initial request, with &apos;Location&apos; header, 204 with noresponse body after success. </summary>
@ -3931,13 +3931,13 @@ namespace lro
{
using var document = JsonDocument.Parse(response.ContentStream);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
},
async (response, cancellationToken) =>
{
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
});
}
/// <summary> Long running post request, service returns a 202 to the initial request with both Location and Azure-Async header. Poll Azure-Async and it&apos;s success. Should poll Location to get the final object. </summary>
@ -3973,13 +3973,13 @@ namespace lro
{
using var document = JsonDocument.Parse(response.ContentStream);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
},
async (response, cancellationToken) =>
{
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
});
}
/// <summary> Long running post request, service returns a 202 to the initial request with both Location and Azure-Async header. Poll Azure-Async and it&apos;s success. Should NOT poll Location to get the final object. </summary>
@ -4015,13 +4015,13 @@ namespace lro
{
using var document = JsonDocument.Parse(response.ContentStream);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
},
async (response, cancellationToken) =>
{
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
});
}
/// <summary> Long running post request, service returns a 202 to the initial request with both Location and Azure-Async header. Poll Azure-Async and it&apos;s success. Should NOT poll Location to get the final object if you support initial Autorest behavior. </summary>
@ -4057,13 +4057,13 @@ namespace lro
{
using var document = JsonDocument.Parse(response.ContentStream);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
},
async (response, cancellationToken) =>
{
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
});
}
/// <summary> Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=Creating. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. </summary>
@ -4103,13 +4103,13 @@ namespace lro
{
using var document = JsonDocument.Parse(response.ContentStream);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
},
async (response, cancellationToken) =>
{
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
var value = Product.DeserializeProduct(document.RootElement);
return Response.FromValue(value, response);
return value;
});
}
/// <summary> Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=Creating. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. </summary>
@ -4147,12 +4147,12 @@ namespace lro
return ArmOperationHelpers.Create(pipeline, clientDiagnostics, originalResponse, RequestMethod.Post, "LrOSOperations.PostAsyncRetryFailed", OperationFinalStateVia.Location, createOriginalHttpMessage,
(response, cancellationToken) =>
{
return Response.FromValue(response, response);
return response;
},
async (response, cancellationToken) =>
{
await Task.CompletedTask;
return Response.FromValue(response, response);
return response;
});
}
/// <summary> Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=Creating. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. </summary>
@ -4190,12 +4190,12 @@ namespace lro
return ArmOperationHelpers.Create(pipeline, clientDiagnostics, originalResponse, RequestMethod.Post, "LrOSOperations.PostAsyncRetrycanceled", OperationFinalStateVia.Location, createOriginalHttpMessage,
(response, cancellationToken) =>
{
return Response.FromValue(response, response);
return response;
},
async (response, cancellationToken) =>
{
await Task.CompletedTask;
return Response.FromValue(response, response);
return response;
});
}
/// <summary> Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=Creating. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. </summary>