@using System @using System.Linq @using AutoRest.Core.Model @using AutoRest.Core.Utilities @using AutoRest.CSharp.Model @using AutoRest.CSharp.vanilla.Templates.Rest.Client @inherits AutoRest.Core.Template @if (!Model.IsLongRunningOperation) { @:@(Include(new MethodTemplate(), (MethodCs)Model)) } else if (Model.HttpMethod == HttpMethod.Post || Model.HttpMethod == HttpMethod.Delete) { if (!string.IsNullOrWhiteSpace(Model.Description) || !string.IsNullOrWhiteSpace(Model.Summary)) { @:/// @:@WrapComment("/// ", String.IsNullOrEmpty(Model.Summary) ? Model.Description.EscapeXmlComment() : Model.Summary.EscapeXmlComment()) if (!string.IsNullOrWhiteSpace(Model.ExternalDocsUrl)) { @:/// } @:/// } if (!String.IsNullOrEmpty(Model.Description) && !String.IsNullOrEmpty(Model.Summary)) { @:/// @:@WrapComment("/// ", Model.Description.EscapeXmlComment()) @:/// } foreach (ParameterCs parameter in Model.LocalParameters) { @:/// @WrapComment("/// ", parameter.DocumentationString.EscapeXmlComment())@: @:/// } @:/// @:/// The headers that will be added to request. @:/// @:/// @:/// The cancellation token. @:/// @(Model.GetObsoleteAttribute()) @((Model as MethodCs).AccessModifier) async System.Threading.Tasks.Task<@(Model.OperationResponseReturnTypeString)> @(Model.Name)WithHttpMessagesAsync(@(Model.GetAsyncMethodParameterDeclaration(true))) { // Send request @(Model.OperationResponseReturnTypeString) _response = await Begin@(Model.Name)WithHttpMessagesAsync(@(Model.GetAsyncMethodInvocationArgs("customHeaders"))).ConfigureAwait(false); return await @(Model.ClientReference).GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } } else if (Model.HttpMethod == HttpMethod.Put || Model.HttpMethod == HttpMethod.Patch) { if (!String.IsNullOrEmpty(Model.Description) || !String.IsNullOrEmpty(Model.Summary)) { @:/// @:@WrapComment("/// ", String.IsNullOrEmpty(Model.Summary) ? Model.Description.EscapeXmlComment() : Model.Summary.EscapeXmlComment()) if (!string.IsNullOrWhiteSpace(Model.ExternalDocsUrl)) { @:/// } @:/// } if (!String.IsNullOrEmpty(Model.Description) && !String.IsNullOrEmpty(Model.Summary)) { @:/// @:@WrapComment("/// ", Model.Description.EscapeXmlComment()) @:/// } foreach (ParameterCs parameter in Model.LocalParameters) { @:/// @WrapComment("/// ", parameter.DocumentationString.EscapeXmlComment())@: @:/// } @:/// @:/// The headers that will be added to request. @:/// @:/// @:/// The cancellation token. @:/// @(Model.GetObsoleteAttribute()) @((Model as MethodCs).AccessModifier) async System.Threading.Tasks.Task<@(Model.OperationResponseReturnTypeString)> @(Model.Name)WithHttpMessagesAsync(@(Model.GetAsyncMethodParameterDeclaration(true))) { // Send Request @(Model.OperationResponseReturnTypeString) _response = await Begin@(Model.Name)WithHttpMessagesAsync(@(Model.GetAsyncMethodInvocationArgs("customHeaders"))).ConfigureAwait(false); return await @(Model.ClientReference).GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } }