@using System.Globalization @using System.Linq; @using System @using AutoRest.Core.Model @using AutoRest.Core.Utilities @using AutoRest.CSharp @using AutoRest.CSharp.Model @using AutoRest.Extensions @inherits AutoRest.Core.Template @if (!string.IsNullOrWhiteSpace(Model.Description) || !string.IsNullOrEmpty(Model.Summary)) { @:/// @:@WrapComment("/// ", String.IsNullOrEmpty(Model.Summary) ? Model.Description.EscapeXmlComment() : Model.Summary.EscapeXmlComment()) if (!string.IsNullOrEmpty(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())@: @:/// } /// /// Headers that will be added to request. /// /// /// The cancellation token. /// /// /// Thrown when the operation returned an invalid status code /// @if (Model.Responses.Where(r => r.Value.Body != null).Any()) { @:/// @:/// Thrown when unable to deserialize the response @:/// } @if (Model.Parameters.Cast().Any(p => !p.IsConstant && p.IsRequired &&p.IsNullable())) { @:/// @:/// Thrown when a required parameter is null @:/// @:/// @:/// Thrown when a required parameter is null @:/// } /// /// A response object containing the response body and response headers. /// @(Model.GetObsoleteAttribute()) @(Model.AccessModifier) async System.Threading.Tasks.Task<@(Model.OperationResponseReturnTypeString)> @(Model.Name)WithHttpMessagesAsync(@(Model.GetAsyncMethodParameterDeclaration(true))) { @switch (Model.Flavor) { case MethodFlavor.RestCall: @:@(Include(new MethodBodyTemplateRestCall(), Model)) break; case MethodFlavor.ForwardTo: @:@(Include(new MethodBodyTemplateForwardTo(), Model)) break; case MethodFlavor.Implementation: @:@(Model.GetImplementation("csharp") ?? "throw new System.NotImplementedException();") break; default: throw new System.NotImplementedException(); } }