Merge branch 'feature/v3' into datetime-format-fixes-body-complex
This commit is contained in:
Коммит
8e455ee5d9
|
@ -1,82 +1,18 @@
|
|||
#requires -version 5
|
||||
|
||||
[CmdletBinding()]
|
||||
param (
|
||||
[Parameter(Position=0)]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[string] $ServiceDirectory
|
||||
)
|
||||
#Requires -Version 6.0
|
||||
param($name, [switch]$noDebug, [switch]$reset)
|
||||
|
||||
$ErrorActionPreference = 'Stop'
|
||||
Set-StrictMode -Version 1
|
||||
|
||||
$repoRoot = Resolve-Path "$PSScriptRoot/.."
|
||||
Write-Host 'Downloading shared source files...'
|
||||
& (Join-Path $PSScriptRoot 'DownloadSharedSource.ps1')
|
||||
|
||||
[string[]] $errors = @()
|
||||
Write-Host 'Generating test clients...'
|
||||
& (Join-Path $PSScriptRoot 'Generate.ps1')
|
||||
|
||||
function LogError([string]$message) {
|
||||
if ($env:TF_BUILD) {
|
||||
Write-Host "##vso[task.logissue type=error]$message"
|
||||
}
|
||||
Write-Host -f Red "error: $message"
|
||||
$script:errors += $message
|
||||
}
|
||||
|
||||
function Invoke-Block([scriptblock]$cmd) {
|
||||
$cmd | Out-String | Write-Verbose
|
||||
try
|
||||
{
|
||||
& $cmd
|
||||
|
||||
# Need to check both of these cases for errors as they represent different items
|
||||
# - $?: did the powershell script block throw an error
|
||||
# - $lastexitcode: did a windows command executed by the script block end in error
|
||||
if ((-not $?) -or ($lastexitcode -ne 0)) {
|
||||
if ($error -ne $null)
|
||||
{
|
||||
Write-Warning $error[0]
|
||||
}
|
||||
throw "Command failed to execute: $cmd"
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
LogError $_
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
Write-Host "Downloading files"
|
||||
Invoke-Block {
|
||||
& $PSScriptRoot\DownloadSharedSource.ps1 @script:PSBoundParameters
|
||||
}
|
||||
|
||||
Write-Host "Generate test clients"
|
||||
Invoke-Block {
|
||||
& $PSScriptRoot\Generate.ps1 @script:PSBoundParameters
|
||||
}
|
||||
|
||||
Write-Host "git diff"
|
||||
& git -c core.safecrlf=false diff --ignore-space-at-eol --exit-code
|
||||
if ($LastExitCode -ne 0) {
|
||||
$status = git status -s | Out-String
|
||||
$status = $status -replace "`n","`n "
|
||||
LogError "Generated code is not up to date. You may need to run eng\Update-Snippets.ps1 or sdk\storage\generate.ps1 or eng\Export-API.ps1"
|
||||
}
|
||||
}
|
||||
finally {
|
||||
Write-Host ""
|
||||
Write-Host "Summary:"
|
||||
Write-Host ""
|
||||
Write-Host " $($errors.Length) error(s)"
|
||||
Write-Host ""
|
||||
|
||||
foreach ($err in $errors) {
|
||||
Write-Host -f Red "error : $err"
|
||||
}
|
||||
|
||||
if ($errors.Length -ne 0) {
|
||||
exit 1
|
||||
}
|
||||
exit 0
|
||||
}
|
||||
Write-Host 'Checking generated file differences...'
|
||||
git -c core.safecrlf=false diff --ignore-space-at-eol --exit-code
|
||||
if ($LastExitCode -ne 0)
|
||||
{
|
||||
Write-Error 'Generated code is not up to date. Please run: eng/Generate.ps1'
|
||||
}
|
|
@ -1,11 +1,13 @@
|
|||
#Requires -Version 6.0
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$ProgressPreference = 'SilentlyContinue'
|
||||
|
||||
$downloadPath = Resolve-Path (Join-Path $PSScriptRoot '..' 'src' 'assets' 'Azure.Core.Shared')
|
||||
$files = "ClientDiagnostics.cs", "ArrayBufferWriter.cs", "DiagnosticScope.cs"
|
||||
$baseUrl = "https://raw.githubusercontent.com/Azure/azure-sdk-for-net/master/sdk/core/Azure.Core/src/Shared/"
|
||||
$files = 'ClientDiagnostics.cs', 'ArrayBufferWriter.cs', 'DiagnosticScope.cs'
|
||||
$baseUrl = 'https://raw.githubusercontent.com/Azure/azure-sdk-for-net/master/sdk/core/Azure.Core/src/Shared/'
|
||||
|
||||
foreach ($file in $files)
|
||||
{
|
||||
$text = Invoke-WebRequest -Uri "$baseUrl/$file";
|
||||
$text.Content.Replace("#nullable enable", "#pragma warning disable CS8600, CS8604, CS8605").Trim() | Out-File "$downloadPath/$file"
|
||||
}
|
||||
|
||||
exit 0
|
||||
$text.Content.Replace('#nullable enable', '#pragma warning disable CS8600, CS8604, CS8605').Trim() | Out-File (Join-Path $downloadPath $file)
|
||||
}
|
|
@ -1,31 +1,22 @@
|
|||
param($name, [switch]$noDebug, [switch]$NoReset)
|
||||
#Requires -Version 6.0
|
||||
param($name, [switch]$noDebug, [switch]$reset)
|
||||
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
function Invoke-Block([scriptblock]$cmd) {
|
||||
$cmd | Out-String | Write-Verbose
|
||||
& $cmd
|
||||
|
||||
# Need to check both of these cases for errors as they represent different items
|
||||
# - $?: did the powershell script block throw an error
|
||||
# - $lastexitcode: did a windows command executed by the script block end in error
|
||||
if ((-not $?) -or ($lastexitcode -ne 0)) {
|
||||
if ($error -ne $null)
|
||||
{
|
||||
Write-Warning $error[0]
|
||||
}
|
||||
throw "Command failed to execute: $cmd"
|
||||
function Invoke-AutoRest($autoRestArguments)
|
||||
{
|
||||
$command = "npx autorest-beta $autoRestArguments"
|
||||
Write-Host "> $command"
|
||||
cmd /c "$command 2>&1"
|
||||
if($LastExitCode -ne 0)
|
||||
{
|
||||
Write-Error "Command failed to execute: $command"
|
||||
}
|
||||
}
|
||||
|
||||
function Invoke-AutoRest($autoRestArguments, $repoRoot) {
|
||||
Invoke-Block {
|
||||
$command = "npx autorest-beta $autoRestArguments"
|
||||
$commandText = $command.Replace($repoRoot, "`$(SolutionDir)")
|
||||
|
||||
Write-Host ">" $commandText
|
||||
|
||||
& cmd /c "$command 2>&1"
|
||||
}
|
||||
if ($reset -or $env:TF_BUILD)
|
||||
{
|
||||
Invoke-AutoRest '--reset'
|
||||
}
|
||||
|
||||
# General configuration
|
||||
|
@ -36,11 +27,18 @@ $debugFlags = if (-not $noDebug) { '--debug', '--verbose' }
|
|||
$testServerDirectory = Join-Path $repoRoot 'test' 'TestServerProjects'
|
||||
$configurationPath = Join-Path $testServerDirectory 'readme.tests.md'
|
||||
$testServerSwaggerPath = Join-Path $repoRoot 'node_modules' '@microsoft.azure' 'autorest.testserver' 'swagger'
|
||||
$testNames = if ($name) { $name } else { 'url-multi-collectionFormat', 'url', 'body-string', 'body-complex', 'custom-baseUrl', 'custom-baseUrl-more-options', 'header' }
|
||||
|
||||
if (!$NoReset)
|
||||
$testNames = if ($name) { $name } else
|
||||
{
|
||||
Invoke-AutoRest "--reset" $repoRoot
|
||||
'body-integer',
|
||||
'body-number',
|
||||
'body-string',
|
||||
'extensible-enums-swagger',
|
||||
'url-multi-collectionFormat',
|
||||
'url',
|
||||
'body-complex',
|
||||
'custom-baseUrl',
|
||||
'custom-baseUrl-more-options',
|
||||
'header'
|
||||
}
|
||||
|
||||
foreach ($testName in $testNames)
|
||||
|
@ -48,7 +46,7 @@ foreach ($testName in $testNames)
|
|||
$inputFile = Join-Path $testServerSwaggerPath "$testName.json"
|
||||
$namespace = $testName.Replace('-', '_')
|
||||
$autoRestArguments = "$debugFlags --require=$configurationPath --input-file=$inputFile --title=$testName --namespace=$namespace"
|
||||
Invoke-AutoRest $autoRestArguments $repoRoot
|
||||
Invoke-AutoRest $autoRestArguments
|
||||
}
|
||||
|
||||
# Sample configuration
|
||||
|
@ -60,5 +58,5 @@ foreach ($projectName in $projectNames)
|
|||
$projectDirectory = Join-Path $sampleDirectory $projectName
|
||||
$configurationPath = Join-Path $projectDirectory 'readme.md'
|
||||
$autoRestArguments = "$debugFlags --require=$configurationPath"
|
||||
Invoke-AutoRest $autoRestArguments $repoRoot
|
||||
Invoke-AutoRest $autoRestArguments
|
||||
}
|
|
@ -29,7 +29,7 @@ jobs:
|
|||
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
|
||||
DOTNET_CLI_TELEMETRY_OPTOUT: 1
|
||||
DOTNET_MULTILEVEL_LOOKUP: 0
|
||||
- pwsh: .\eng\CodeChecks.ps1
|
||||
- pwsh: ./eng/CodeChecks.ps1
|
||||
displayName: "Check if code is up-to-date"
|
||||
- script: |
|
||||
dotnet test AutoRest.CSharp.V3.sln
|
||||
|
|
|
@ -18,9 +18,9 @@
|
|||
}
|
||||
},
|
||||
"@microsoft.azure/autorest.testserver": {
|
||||
"version": "2.7.1",
|
||||
"resolved": "https://registry.npmjs.org/@microsoft.azure/autorest.testserver/-/autorest.testserver-2.7.1.tgz",
|
||||
"integrity": "sha512-j4E9Wx3WVwzc2rfl5OutsW3lOtVsd2lEaLUh1k/uJj0qhwUHmQI0ObLW4fxikfA3k8I5sWqBkakoHjuB93TwUg==",
|
||||
"version": "2.7.2",
|
||||
"resolved": "https://registry.npmjs.org/@microsoft.azure/autorest.testserver/-/autorest.testserver-2.7.2.tgz",
|
||||
"integrity": "sha512-bWnc5FCBh6vV3tU36qPmEZIPOWa6bdVcXV0/cDIf6GlXt6gBR8FU+tmq1JJgMX7uqinrxCANJb1HxnM9bGmm5Q==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"azure-storage": "^2.4.0",
|
||||
|
@ -518,9 +518,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"core-js": {
|
||||
"version": "2.6.10",
|
||||
"resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.10.tgz",
|
||||
"integrity": "sha512-I39t74+4t+zau64EN1fE5v2W31Adtc/REhzWN+gWRRXg6WH5qAsZm62DHpQ1+Yhe4047T55jvzz7MUqF/dBBlA==",
|
||||
"version": "2.6.11",
|
||||
"resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.11.tgz",
|
||||
"integrity": "sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg==",
|
||||
"dev": true
|
||||
},
|
||||
"core-util-is": {
|
||||
|
@ -725,9 +725,9 @@
|
|||
}
|
||||
},
|
||||
"es-abstract": {
|
||||
"version": "1.16.2",
|
||||
"resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.16.2.tgz",
|
||||
"integrity": "sha512-jYo/J8XU2emLXl3OLwfwtuFfuF2w6DYPs+xy9ZfVyPkDcrauu6LYrw/q2TyCtrbc/KUdCiC5e9UajRhgNkVopA==",
|
||||
"version": "1.16.3",
|
||||
"resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.16.3.tgz",
|
||||
"integrity": "sha512-WtY7Fx5LiOnSYgF5eg/1T+GONaGmpvpPdCpSnYij+U2gDTL0UPfWrhDw7b2IYb+9NQJsYpCA0wOQvZfsd6YwRw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"es-to-primitive": "^1.2.1",
|
||||
|
@ -1495,9 +1495,9 @@
|
|||
}
|
||||
},
|
||||
"psl": {
|
||||
"version": "1.5.0",
|
||||
"resolved": "https://registry.npmjs.org/psl/-/psl-1.5.0.tgz",
|
||||
"integrity": "sha512-4vqUjKi2huMu1OJiLhi3jN6jeeKvMZdI1tYgi/njW5zV52jNLgSAZSdN16m9bJFe61/cT8ulmw4qFitV9QRsEA==",
|
||||
"version": "1.6.0",
|
||||
"resolved": "https://registry.npmjs.org/psl/-/psl-1.6.0.tgz",
|
||||
"integrity": "sha512-SYKKmVel98NCOYXpkwUqZqh0ahZeeKfmisiLIcEZdsb+WbLv02g/dI5BUmZnIyOe7RzZtLax81nnb2HbvC2tzA==",
|
||||
"dev": true
|
||||
},
|
||||
"pug": {
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
"devDependencies": {
|
||||
"@autorest/autorest": "https://github.com/Azure/autorest/releases/download/autorest-3.0.6146/autorest-autorest-3.0.6146.tgz",
|
||||
"@autorest/test-server": "3.0.27",
|
||||
"@microsoft.azure/autorest.testserver": "^2.7.1"
|
||||
"@microsoft.azure/autorest.testserver": "^2.7.2"
|
||||
},
|
||||
"dependencies": {}
|
||||
}
|
||||
|
|
11
readme.md
11
readme.md
|
@ -1,6 +1,17 @@
|
|||
# AutoRest.CSharp.V3
|
||||
> see https://aka.ms/autorest
|
||||
|
||||
## Setup
|
||||
- [NodeJS](https://nodejs.org/en/) (10.x.x or 12.x.x)
|
||||
- `npm install` (at root)
|
||||
- `npm install -g @autorest/autorest`
|
||||
- [.NET Core SDK](https://dotnet.microsoft.com/download/dotnet-core/3.0) (3.0.100)
|
||||
- [PowerShell Core](https://github.com/PowerShell/PowerShell/releases/latest)
|
||||
|
||||
## Build
|
||||
- `dotnet build` (at root)
|
||||
- `./eng/Generate.ps1` (at root in PowerShell Core)
|
||||
|
||||
## Configuration
|
||||
```yaml
|
||||
use-extension:
|
||||
|
|
|
@ -5,15 +5,17 @@ namespace AutoRest.CSharp.V3.ClientModels
|
|||
{
|
||||
internal class ServiceClientMethodParameter
|
||||
{
|
||||
public ServiceClientMethodParameter(string name, ClientTypeReference type, ClientConstant? defaultValue)
|
||||
public ServiceClientMethodParameter(string name, ClientTypeReference type, ClientConstant? defaultValue, bool isRequired)
|
||||
{
|
||||
Name = name;
|
||||
Type = type;
|
||||
DefaultValue = defaultValue;
|
||||
IsRequired = isRequired;
|
||||
}
|
||||
|
||||
public ClientTypeReference Type { get; }
|
||||
public string Name { get; }
|
||||
public ClientConstant? DefaultValue { get; }
|
||||
public bool IsRequired { get; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ namespace AutoRest.CSharp.V3.CodeGen
|
|||
return true;
|
||||
}
|
||||
|
||||
private void WriteOperation(CodeWriter writer, ClientMethod operation, CSharpNamespace? @namespace)
|
||||
private void WriteOperation(CodeWriter writer, ClientMethod operation, CSharpNamespace @namespace)
|
||||
{
|
||||
//TODO: Handle multiple responses
|
||||
var schemaResponse = operation.ResponseType;
|
||||
|
@ -70,7 +70,9 @@ namespace AutoRest.CSharp.V3.CodeGen
|
|||
var methodName = operation.Name;
|
||||
using (writer.Method("public static async", writer.Type(returnType), $"{methodName}Async", parametersText))
|
||||
{
|
||||
writer.Line($"using var scope = clientDiagnostics.CreateScope(\"{@namespace?.FullName ?? "[NO NAMESPACE]"}.{methodName}\");");
|
||||
WriteParameterNullChecks(writer, operation);
|
||||
|
||||
writer.Line($"using var scope = clientDiagnostics.CreateScope(\"{@namespace.FullName}.{methodName}\");");
|
||||
//TODO: Implement attribute logic
|
||||
//writer.Line("scope.AddAttribute(\"key\", name);");
|
||||
writer.Line("scope.Start();");
|
||||
|
@ -105,21 +107,17 @@ namespace AutoRest.CSharp.V3.CodeGen
|
|||
|
||||
if (operation.Request.Body is ConstantOrParameter body)
|
||||
{
|
||||
var bufferWriter = new CSharpType(typeof(ArrayBufferWriter<>), new CSharpType(typeof(byte)));
|
||||
|
||||
writer.Line($"var buffer = new {writer.Type(bufferWriter)}();");
|
||||
writer.Line($"await using var writer = new {writer.Type(typeof(Utf8JsonWriter))}(buffer);");
|
||||
writer.Line($"using var content = new {writer.Type(typeof(Utf8JsonRequestContent))}();");
|
||||
writer.Line($"var writer = content.{nameof(Utf8JsonRequestContent.JsonWriter)};");
|
||||
|
||||
var type = body.IsConstant ? body.Constant.Type : body.Parameter.Type;
|
||||
var name = body.IsConstant ? body.Constant.ToValueString() : body.Parameter.Name;
|
||||
writer.ToSerializeCall(type, _typeFactory, name, string.Empty, false);
|
||||
|
||||
writer.Line("writer.Flush();");
|
||||
writer.Line("request.Content = RequestContent.Create(buffer.WrittenMemory);");
|
||||
writer.Line("request.Content = content;");
|
||||
}
|
||||
|
||||
writer.Line("var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);");
|
||||
writer.Line("cancellationToken.ThrowIfCancellationRequested();");
|
||||
|
||||
if (schemaResponse != null && responseType != null)
|
||||
{
|
||||
|
@ -140,6 +138,23 @@ namespace AutoRest.CSharp.V3.CodeGen
|
|||
}
|
||||
}
|
||||
|
||||
private void WriteParameterNullChecks(CodeWriter writer, ClientMethod operation)
|
||||
{
|
||||
foreach (ServiceClientMethodParameter parameter in operation.Parameters)
|
||||
{
|
||||
var cs = _typeFactory.CreateType(parameter.Type);
|
||||
if (parameter.IsRequired && (cs.IsNullable || !cs.IsValueType))
|
||||
{
|
||||
using (writer.If($"{parameter.Name} == null"))
|
||||
{
|
||||
writer.Append("throw new ").AppendType(typeof(ArgumentNullException)).Append("(nameof(").Append(parameter.Name).Append("));");
|
||||
writer.Line();
|
||||
}
|
||||
}
|
||||
}
|
||||
writer.Line();
|
||||
}
|
||||
|
||||
private void WriteConstant(CodeWriter writer, ClientConstant constant)
|
||||
{
|
||||
if (constant.Value == null)
|
||||
|
@ -155,7 +170,7 @@ namespace AutoRest.CSharp.V3.CodeGen
|
|||
dateTimeValue = dateTimeValue.ToUniversalTime();
|
||||
|
||||
writer.Append("new ");
|
||||
writer.Append(writer.Type(typeof(DateTimeOffset)));
|
||||
writer.AppendType(typeof(DateTimeOffset));
|
||||
writer.Append("(");
|
||||
writer.Literal(dateTimeValue.Year);
|
||||
writer.Comma();
|
||||
|
@ -171,7 +186,7 @@ namespace AutoRest.CSharp.V3.CodeGen
|
|||
writer.Comma();
|
||||
writer.Literal(dateTimeValue.Millisecond);
|
||||
writer.Comma();
|
||||
writer.Append(writer.Type(typeof(TimeSpan)));
|
||||
writer.AppendType(typeof(TimeSpan));
|
||||
writer.Append(".");
|
||||
writer.Append(nameof(TimeSpan.Zero));
|
||||
writer.Append(")");
|
||||
|
|
|
@ -135,6 +135,16 @@ namespace AutoRest.CSharp.V3.CodeGen
|
|||
return name;
|
||||
}
|
||||
|
||||
public CodeWriter AppendType(CSharpType type)
|
||||
{
|
||||
return Append(Type(type));
|
||||
}
|
||||
|
||||
public CodeWriter AppendType(Type type, bool isNullable = false)
|
||||
{
|
||||
return Append(Type(type, isNullable));
|
||||
}
|
||||
|
||||
public string Type(Type type, bool isNullable = false) => Type(new CSharpType(type, isNullable));
|
||||
public string AttributeType(Type type) => Type(type).Replace("Attribute", String.Empty);
|
||||
|
||||
|
|
|
@ -233,7 +233,7 @@ namespace AutoRest.CSharp.V3.Pipeline
|
|||
|
||||
private static void WriteDeserializeClientObject(CodeWriter writer, CSharpType cSharpType, string name)
|
||||
{
|
||||
writer.Append(writer.Type(cSharpType));
|
||||
writer.AppendType(cSharpType);
|
||||
writer.Append(".Deserialize(");
|
||||
writer.Append(name);
|
||||
writer.Append(")");
|
||||
|
@ -244,7 +244,7 @@ namespace AutoRest.CSharp.V3.Pipeline
|
|||
if (isStringBased)
|
||||
{
|
||||
writer.Append("new ");
|
||||
writer.Append(writer.Type(cSharpType));
|
||||
writer.AppendType(cSharpType);
|
||||
writer.Append("(");
|
||||
writer.Append(name);
|
||||
writer.Append(".GetString())");
|
||||
|
@ -253,7 +253,7 @@ namespace AutoRest.CSharp.V3.Pipeline
|
|||
|
||||
writer.Append(name);
|
||||
writer.Append(".GetString().To");
|
||||
writer.Append(writer.Type(cSharpType));
|
||||
writer.AppendType(cSharpType);
|
||||
writer.Append("()");
|
||||
}
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ namespace AutoRest.CSharp.V3.Plugins
|
|||
switch (requestParameter.Schema)
|
||||
{
|
||||
case ConstantSchema constant:
|
||||
constantOrParameter = ParseClientConstant(constant.Value.Value, CreateType(constant.ValueType, true));
|
||||
constantOrParameter = ParseClientConstant(constant.Value.Value, CreateType(constant.ValueType, constant.Value.Value == null));
|
||||
valueSchema = constant.ValueType;
|
||||
break;
|
||||
case BinarySchema _:
|
||||
|
@ -107,18 +107,18 @@ namespace AutoRest.CSharp.V3.Plugins
|
|||
case ArraySchema arraySchema when arraySchema.ElementType is ConstantSchema constantInnerType:
|
||||
constantOrParameter = new ServiceClientMethodParameter(requestParameter.CSharpName(),
|
||||
new CollectionTypeReference(CreateType(constantInnerType.ValueType, false), false),
|
||||
CreateDefaultValueConstant(requestParameter));
|
||||
CreateDefaultValueConstant(requestParameter), false);
|
||||
break;
|
||||
//TODO: Workaround for https://github.com/Azure/autorest.csharp/pull/275
|
||||
case DictionarySchema dictionarySchema when dictionarySchema.ElementType is ConstantSchema constantInnerType:
|
||||
constantOrParameter = new ServiceClientMethodParameter(requestParameter.CSharpName(),
|
||||
new CollectionTypeReference(CreateType(constantInnerType.ValueType, false), false),
|
||||
CreateDefaultValueConstant(requestParameter));
|
||||
CreateDefaultValueConstant(requestParameter), false);
|
||||
break;
|
||||
default:
|
||||
constantOrParameter = new ServiceClientMethodParameter(requestParameter.CSharpName(),
|
||||
CreateType(requestParameter.Schema, requestParameter.IsNullable()),
|
||||
CreateDefaultValueConstant(requestParameter));
|
||||
CreateDefaultValueConstant(requestParameter), requestParameter.Required == true);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,47 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
using System.IO;
|
||||
using System.Text.Json;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Azure.Core
|
||||
{
|
||||
internal class Utf8JsonRequestContent: RequestContent
|
||||
{
|
||||
private readonly ArrayBufferWriter<byte> _writer;
|
||||
|
||||
public Utf8JsonRequestContent()
|
||||
{
|
||||
_writer = new ArrayBufferWriter<byte>();
|
||||
JsonWriter = new Utf8JsonWriter(_writer);
|
||||
}
|
||||
|
||||
public Utf8JsonWriter JsonWriter { get; }
|
||||
|
||||
public override async Task WriteToAsync(Stream stream, CancellationToken cancellation)
|
||||
{
|
||||
await JsonWriter.FlushAsync(cancellation);
|
||||
using var content = Create(_writer.WrittenMemory);
|
||||
await content.WriteToAsync(stream, cancellation);
|
||||
}
|
||||
|
||||
public override void WriteTo(Stream stream, CancellationToken cancellation)
|
||||
{
|
||||
JsonWriter.Flush();
|
||||
using var content = Create(_writer.WrittenMemory);
|
||||
content.WriteTo(stream, cancellation);
|
||||
}
|
||||
|
||||
public override bool TryComputeLength(out long length)
|
||||
{
|
||||
length = JsonWriter.BytesCommitted + JsonWriter.BytesPending;
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void Dispose()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,103 @@
|
|||
using System.Threading.Tasks;
|
||||
using AutoRest.TestServer.Tests.Infrastructure;
|
||||
using extensible_enums_swagger;
|
||||
using extensible_enums_swagger.Models.V20160707;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace AutoRest.TestServer.Tests
|
||||
{
|
||||
public class ExtensibleEnumTests : TestServerTestBase
|
||||
{
|
||||
public ExtensibleEnumTests(TestServerVersion version) : base(version, "extensibleenums") { }
|
||||
|
||||
[Test]
|
||||
[IgnoreOnTestServer(TestServerVersion.V2, "Dynamic")]
|
||||
public Task RoundTripEnum() => TestStatus(async (host, pipeline) =>
|
||||
{
|
||||
var response = await PetOperations.AddPetAsync(ClientDiagnostics, pipeline, new Pet()
|
||||
{
|
||||
Name = "Retriever",
|
||||
IntEnum = IntEnum._2,
|
||||
DaysOfWeek = DaysOfWeekExtensibleEnum.Friday
|
||||
}, host: host);
|
||||
|
||||
Assert.AreEqual("Retriever", response.Value.Name);
|
||||
Assert.AreEqual(IntEnum._2, response.Value.IntEnum);
|
||||
Assert.AreEqual(DaysOfWeekExtensibleEnum.Friday, response.Value.DaysOfWeek);
|
||||
|
||||
return response.GetRawResponse();
|
||||
});
|
||||
|
||||
[Test]
|
||||
[IgnoreOnTestServer(TestServerVersion.V2, "Dynamic")]
|
||||
public Task RoundTripEnum_Custom() => TestStatus(async (host, pipeline) =>
|
||||
{
|
||||
var response = await PetOperations.AddPetAsync(ClientDiagnostics, pipeline, new Pet()
|
||||
{
|
||||
Name = "Retriever",
|
||||
IntEnum = "77",
|
||||
DaysOfWeek = "WED"
|
||||
}, host: host);
|
||||
|
||||
Assert.AreEqual("Retriever", response.Value.Name);
|
||||
Assert.AreEqual("77", response.Value.IntEnum.ToString());
|
||||
Assert.AreEqual("WED", response.Value.DaysOfWeek.Value.ToString());
|
||||
|
||||
return response.GetRawResponse();
|
||||
});
|
||||
|
||||
[Test]
|
||||
[IgnoreOnTestServer(TestServerVersion.V2, "Dynamic")]
|
||||
public Task RoundTripEnum_Null() => TestStatus(async (host, pipeline) =>
|
||||
{
|
||||
var response = await PetOperations.AddPetAsync(ClientDiagnostics, pipeline, new Pet()
|
||||
{
|
||||
Name = "Retriever",
|
||||
IntEnum = "77",
|
||||
DaysOfWeek = null
|
||||
}, host: host);
|
||||
|
||||
Assert.AreEqual("Retriever", response.Value.Name);
|
||||
Assert.AreEqual("77", response.Value.IntEnum.ToString());
|
||||
Assert.Null(response.Value.DaysOfWeek);
|
||||
|
||||
return response.GetRawResponse();
|
||||
});
|
||||
|
||||
[Test]
|
||||
public Task AllowedValueEnum() => TestStatus(async (host, pipeline) =>
|
||||
{
|
||||
var response = await PetOperations.GetByPetIdAsync(ClientDiagnostics, pipeline, "scooby", host: host);
|
||||
|
||||
Assert.AreEqual("Scooby Scarface", response.Value.Name);
|
||||
Assert.AreEqual("2.1", response.Value.IntEnum.ToString());
|
||||
Assert.AreEqual(DaysOfWeekExtensibleEnum.Thursday, response.Value.DaysOfWeek);
|
||||
|
||||
return response.GetRawResponse();
|
||||
});
|
||||
|
||||
[Test]
|
||||
public Task ExpectedEnum() => TestStatus(async (host, pipeline) =>
|
||||
{
|
||||
var response = await PetOperations.GetByPetIdAsync(ClientDiagnostics, pipeline, "tommy", host: host);
|
||||
|
||||
Assert.AreEqual("Tommy Tomson", response.Value.Name);
|
||||
Assert.AreEqual(IntEnum._1, response.Value.IntEnum);
|
||||
Assert.AreEqual(DaysOfWeekExtensibleEnum.Monday, response.Value.DaysOfWeek);
|
||||
|
||||
return response.GetRawResponse();
|
||||
});
|
||||
|
||||
[Test]
|
||||
public Task UnexpectedEnum() => TestStatus(async (host, pipeline) =>
|
||||
{
|
||||
var response = await PetOperations.GetByPetIdAsync(ClientDiagnostics, pipeline, "casper", host: host);
|
||||
|
||||
Assert.AreEqual("Casper Ghosty", response.Value.Name);
|
||||
Assert.AreEqual(IntEnum._2, response.Value.IntEnum);
|
||||
Assert.AreEqual("Weekend", response.Value.DaysOfWeek.Value.ToString());
|
||||
|
||||
return response.GetRawResponse();
|
||||
});
|
||||
}
|
||||
}
|
|
@ -54,7 +54,7 @@ namespace AutoRest.TestServer.Tests.Infrastructure
|
|||
|
||||
if (missingScenarios.Any())
|
||||
{
|
||||
Assert.Fail("Expected scenarios " + string.Join(Environment.NewLine, missingScenarios) + " not defined");
|
||||
Assert.Fail("Expected scenarios " + string.Join(Environment.NewLine, missingScenarios.OrderBy(s=>s)) + " not defined");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -62,7 +62,7 @@ namespace AutoRest.TestServer.Tests.Infrastructure
|
|||
|
||||
public Task TestStatus(Func<string, HttpPipeline, Task<Response>> test)
|
||||
{
|
||||
return TestStatus(TestContext.CurrentContext.Test.Name, test);
|
||||
return TestStatus(GetScenarioName(), test);
|
||||
}
|
||||
|
||||
private Task TestStatus(string scenario, Func<string, HttpPipeline, Task<Response>> test) => Test(scenario, async (host, pipeline) =>
|
||||
|
@ -71,9 +71,18 @@ namespace AutoRest.TestServer.Tests.Infrastructure
|
|||
Assert.AreEqual(200, response.Status, "Unexpected response " + response.ReasonPhrase);
|
||||
});
|
||||
|
||||
public Task Test(Action<string, HttpPipeline> test, bool ignoreScenario = false)
|
||||
{
|
||||
return Test(GetScenarioName(), (host, pipeline) =>
|
||||
{
|
||||
test(host, pipeline);
|
||||
return Task.CompletedTask;
|
||||
}, ignoreScenario);
|
||||
}
|
||||
|
||||
public Task Test(Func<string, HttpPipeline, Task> test, bool ignoreScenario = false)
|
||||
{
|
||||
return Test(TestContext.CurrentContext.Test.Name, test, ignoreScenario);
|
||||
return Test(GetScenarioName(), test, ignoreScenario);
|
||||
}
|
||||
|
||||
private async Task Test(string scenario, Func<string, HttpPipeline, Task> test, bool ignoreScenario = false)
|
||||
|
@ -102,5 +111,12 @@ namespace AutoRest.TestServer.Tests.Infrastructure
|
|||
|
||||
await server.DisposeAsync();
|
||||
}
|
||||
|
||||
private static string GetScenarioName()
|
||||
{
|
||||
var testName = TestContext.CurrentContext.Test.Name;
|
||||
var indexOfUnderscore = testName.IndexOf('_');
|
||||
return indexOfUnderscore == -1 ? testName : testName.Substring(0, indexOfUnderscore);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace AutoRest.TestServer.Tests.Infrastructure
|
|||
{
|
||||
public class TestServerV1 : IDisposable, ITestServer
|
||||
{
|
||||
private static Regex _scenariosRegex = new Regex("(coverage|optionalCoverage)\\[(\"|')(?<name>\\w+)(\"|')\\]", RegexOptions.Compiled);
|
||||
private static Regex _scenariosRegex = new Regex("(coverage|optionalCoverage|optCoverage)\\[(\"|')(?<name>\\w+)(\"|')\\]", RegexOptions.Compiled);
|
||||
|
||||
private Process _process;
|
||||
public HttpClient Client { get; }
|
||||
|
@ -109,6 +109,7 @@ namespace AutoRest.TestServer.Tests.Infrastructure
|
|||
foreach (var request in coverageDocument.RootElement.EnumerateObject())
|
||||
{
|
||||
var mapping = request.Name;
|
||||
if (request.Value.ValueKind != JsonValueKind.Number) continue;
|
||||
int value = request.Value.GetInt32();
|
||||
// HeaderParameterProtectedKey is always matched
|
||||
if (mapping == "HeaderParameterProtectedKey" && value == 1)
|
||||
|
|
|
@ -0,0 +1,98 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
using System;
|
||||
using System.Text.Json;
|
||||
using System.Threading.Tasks;
|
||||
using AutoRest.TestServer.Tests.Infrastructure;
|
||||
using body_integer;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace AutoRest.TestServer.Tests
|
||||
{
|
||||
public class IntegerTest : TestServerTestBase
|
||||
{
|
||||
public IntegerTest(TestServerVersion version) : base(version, "int") { }
|
||||
|
||||
[Test]
|
||||
public Task GetIntegerOverflow() => Test((host, pipeline) =>
|
||||
{
|
||||
Assert.ThrowsAsync<FormatException>(async () => await IntOperations.GetOverflowInt32Async(ClientDiagnostics, pipeline, host));
|
||||
});
|
||||
|
||||
[Test]
|
||||
public Task GetIntegerUnderflow() => Test((host, pipeline) =>
|
||||
{
|
||||
Assert.ThrowsAsync<FormatException>(async () => await IntOperations.GetUnderflowInt32Async(ClientDiagnostics, pipeline, host));
|
||||
});
|
||||
|
||||
[Test]
|
||||
public Task GetIntegerInvalid() => Test((host, pipeline) =>
|
||||
{
|
||||
Assert.ThrowsAsync(Is.InstanceOf<JsonException>(), async () => await IntOperations.GetInvalidAsync(ClientDiagnostics, pipeline, host));
|
||||
});
|
||||
|
||||
[Test]
|
||||
public Task GetLongOverflow() => Test((host, pipeline) =>
|
||||
{
|
||||
Assert.ThrowsAsync<FormatException>(async () => await IntOperations.GetOverflowInt64Async(ClientDiagnostics, pipeline, host));
|
||||
});
|
||||
|
||||
[Test]
|
||||
public Task GetLongUnderflow() => Test((host, pipeline) =>
|
||||
{
|
||||
Assert.ThrowsAsync<FormatException>(async () => await IntOperations.GetUnderflowInt64Async(ClientDiagnostics, pipeline, host));
|
||||
});
|
||||
|
||||
[Test]
|
||||
[Ignore("Unit time in json not implemented")]
|
||||
public Task GetUnixTime() => TestStatus(async (host, pipeline) =>
|
||||
{
|
||||
var response = await IntOperations.GetUnixTimeAsync(ClientDiagnostics, pipeline, host);
|
||||
Assert.AreEqual(DateTimeOffset.FromUnixTimeSeconds(1460505600), response.Value);
|
||||
return response.GetRawResponse();
|
||||
});
|
||||
|
||||
[Test]
|
||||
[Ignore("Nullable return types are not implemented")]
|
||||
public Task GetNullUnixTime() => TestStatus(async (host, pipeline) =>
|
||||
{
|
||||
var response = await IntOperations.GetNullUnixTimeAsync(ClientDiagnostics, pipeline, host);
|
||||
Assert.AreEqual(null, response.Value);
|
||||
return response.GetRawResponse();
|
||||
});
|
||||
|
||||
[Test]
|
||||
[Ignore("Nullable return types are not implemented")]
|
||||
public Task GetIntegerNull() => TestStatus(async (host, pipeline) =>
|
||||
{
|
||||
var response = await IntOperations.GetNullAsync(ClientDiagnostics, pipeline, host);
|
||||
Assert.AreEqual(null, response.Value);
|
||||
return response.GetRawResponse();
|
||||
});
|
||||
|
||||
[Test]
|
||||
public Task GetInvalidUnixTime() => Test((host, pipeline) =>
|
||||
{
|
||||
Assert.ThrowsAsync(Is.InstanceOf<JsonException>(),async () => await IntOperations.GetInvalidUnixTimeAsync(ClientDiagnostics, pipeline, host));
|
||||
});
|
||||
|
||||
[Test]
|
||||
public Task PutIntegerMax() => TestStatus(async (host, pipeline) => await IntOperations.PutMax32Async(ClientDiagnostics, pipeline, int.MaxValue, host));
|
||||
|
||||
[Test]
|
||||
[IgnoreOnTestServer(TestServerVersion.V2, "Match too strict")]
|
||||
public Task PutLongMax() => TestStatus(async (host, pipeline) => await IntOperations.PutMax64Async(ClientDiagnostics, pipeline, long.MaxValue, host));
|
||||
|
||||
[Test]
|
||||
public Task PutIntegerMin() => TestStatus(async (host, pipeline) => await IntOperations.PutMin32Async(ClientDiagnostics, pipeline, int.MinValue, host));
|
||||
|
||||
[Test]
|
||||
[IgnoreOnTestServer(TestServerVersion.V2, "Match too strict")]
|
||||
public Task PutLongMin() => TestStatus(async (host, pipeline) => await IntOperations.PutMin64Async(ClientDiagnostics, pipeline, long.MinValue, host));
|
||||
|
||||
[Test]
|
||||
[Ignore("Unit time in json not implemented")]
|
||||
public Task PutUnixTime() => TestStatus(async (host, pipeline) => await IntOperations.PutUnixTimeDateAsync(ClientDiagnostics, pipeline, DateTimeOffset.FromUnixTimeSeconds(1460505600), host));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,160 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
using System.Text.Json;
|
||||
using System.Threading.Tasks;
|
||||
using AutoRest.TestServer.Tests.Infrastructure;
|
||||
using body_number;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace AutoRest.TestServer.Tests
|
||||
{
|
||||
public class NumberTest : TestServerTestBase
|
||||
{
|
||||
public NumberTest(TestServerVersion version) : base(version, "number") { }
|
||||
|
||||
[Test]
|
||||
public Task PutFloatBigScientificNotation() => TestStatus(async (host, pipeline) => await NumberOperations.PutBigFloatAsync(ClientDiagnostics, pipeline, 3.402823e+20f, host));
|
||||
|
||||
[Test]
|
||||
public Task PutFloatSmallScientificNotation() => TestStatus(async (host, pipeline) => await NumberOperations.PutSmallFloatAsync(ClientDiagnostics, pipeline, 3.402823e-20f, host));
|
||||
|
||||
[Test]
|
||||
public Task PutDoubleSmallScientificNotation() => TestStatus(async (host, pipeline) => await NumberOperations.PutSmallDoubleAsync(ClientDiagnostics, pipeline, 2.5976931e-101d, host));
|
||||
|
||||
[Test]
|
||||
public Task PutDoubleBigScientificNotation() => TestStatus(async (host, pipeline) => await NumberOperations.PutBigDoubleAsync(ClientDiagnostics, pipeline, 2.5976931e+101d, host));
|
||||
|
||||
[Test]
|
||||
[IgnoreOnTestServer(TestServerVersion.V2, "Match too strict")]
|
||||
public Task PutDecimalBigPositiveDecimal() => TestStatus(async (host, pipeline) => await NumberOperations.PutBigDecimalPositiveDecimalAsync(ClientDiagnostics, pipeline, host));
|
||||
|
||||
[Test]
|
||||
[Ignore("Value 2.5976931e+101 is out of range of C# decimal")]
|
||||
public Task PutDecimalBig() => TestStatus(async (host, pipeline) => await NumberOperations.PutBigDecimalAsync(ClientDiagnostics, pipeline, 2.5976931e+10m, host));
|
||||
|
||||
[Test]
|
||||
[IgnoreOnTestServer(TestServerVersion.V2, "Match too strict")]
|
||||
public Task PutDecimalBigNegativeDecimal() => TestStatus(async (host, pipeline) => await NumberOperations.PutBigDecimalNegativeDecimalAsync(ClientDiagnostics, pipeline, host));
|
||||
|
||||
[Test]
|
||||
[Ignore("Value 2.5976931e-101m is out of range of C# decimal")]
|
||||
public Task PutDecimalSmall() => TestStatus(async (host, pipeline) => await NumberOperations.PutSmallDecimalAsync(ClientDiagnostics, pipeline, 2.5976931e-101m, host));
|
||||
|
||||
[Test]
|
||||
public Task PutDoubleBigNegativeDecimal() => TestStatus(async (host, pipeline) => await NumberOperations.PutBigDoubleNegativeDecimalAsync(ClientDiagnostics, pipeline, host));
|
||||
|
||||
[Test]
|
||||
public Task PutDoubleBigPositiveDecimal() => TestStatus(async (host, pipeline) => await NumberOperations.PutBigDoublePositiveDecimalAsync(ClientDiagnostics, pipeline, host));
|
||||
|
||||
[Test]
|
||||
public Task GetDecimalInvalid() => Test((host, pipeline) =>
|
||||
{
|
||||
Assert.ThrowsAsync(Is.InstanceOf<JsonException>(), async () => await NumberOperations.GetInvalidDecimalAsync(ClientDiagnostics, pipeline, host));
|
||||
});
|
||||
|
||||
[Test]
|
||||
public Task GetDoubleInvalid() => Test((host, pipeline) =>
|
||||
{
|
||||
Assert.ThrowsAsync(Is.InstanceOf<JsonException>(), async () => await NumberOperations.GetInvalidDoubleAsync(ClientDiagnostics, pipeline, host));
|
||||
});
|
||||
|
||||
[Test]
|
||||
public Task GetFloatInvalid() => Test((host, pipeline) =>
|
||||
{
|
||||
Assert.ThrowsAsync(Is.InstanceOf<JsonException>(), async () => await NumberOperations.GetInvalidFloatAsync(ClientDiagnostics, pipeline, host));
|
||||
});
|
||||
|
||||
[Test]
|
||||
[Ignore("Value 2.5976931e+101 is out of range of C# decimal")]
|
||||
public Task GetDecimalBig() => TestStatus(async (host, pipeline) =>
|
||||
{
|
||||
var response = await NumberOperations.GetBigDecimalAsync(ClientDiagnostics, pipeline, host);
|
||||
Assert.AreEqual(2.5976931e+101, response.Value);
|
||||
return response.GetRawResponse();
|
||||
});
|
||||
|
||||
[Test]
|
||||
public Task GetDecimalBigNegativeDecimal() => TestStatus(async (host, pipeline) =>
|
||||
{
|
||||
var response = await NumberOperations.GetBigDecimalNegativeDecimalAsync(ClientDiagnostics, pipeline, host);
|
||||
Assert.AreEqual(-99999999.99m, response.Value);
|
||||
return response.GetRawResponse();
|
||||
});
|
||||
|
||||
[Test]
|
||||
public Task GetDecimalBigPositiveDecimal() => TestStatus(async (host, pipeline) =>
|
||||
{
|
||||
var response = await NumberOperations.GetBigDecimalPositiveDecimalAsync(ClientDiagnostics, pipeline, host);
|
||||
Assert.AreEqual(99999999.99m, response.Value);
|
||||
return response.GetRawResponse();
|
||||
});
|
||||
|
||||
[Test]
|
||||
[Ignore("Value is out of range of C# decimal")]
|
||||
public Task GetDecimalSmall() => TestStatus(async (host, pipeline) =>
|
||||
{
|
||||
var response = await NumberOperations.GetSmallDecimalAsync(ClientDiagnostics, pipeline, host);
|
||||
Assert.AreEqual(2.5976931e-101m, response.Value);
|
||||
return response.GetRawResponse();
|
||||
});
|
||||
|
||||
|
||||
[Test]
|
||||
public Task GetDoubleBigScientificNotation() => TestStatus(async (host, pipeline) =>
|
||||
{
|
||||
var response = await NumberOperations.GetBigDoubleAsync(ClientDiagnostics, pipeline, host);
|
||||
Assert.AreEqual(2.5976931E+101d, response.Value);
|
||||
return response.GetRawResponse();
|
||||
});
|
||||
|
||||
[Test]
|
||||
public Task GetDoubleBigNegativeDecimal() => TestStatus(async (host, pipeline) =>
|
||||
{
|
||||
var response = await NumberOperations.GetBigDoubleNegativeDecimalAsync(ClientDiagnostics, pipeline, host);
|
||||
Assert.AreEqual(-99999999.989999995d, response.Value);
|
||||
return response.GetRawResponse();
|
||||
});
|
||||
|
||||
[Test]
|
||||
public Task GetDoubleBigPositiveDecimal() => TestStatus(async (host, pipeline) =>
|
||||
{
|
||||
var response = await NumberOperations.GetBigDoublePositiveDecimalAsync(ClientDiagnostics, pipeline, host);
|
||||
Assert.AreEqual(99999999.989999995d, response.Value);
|
||||
return response.GetRawResponse();
|
||||
});
|
||||
|
||||
[Test]
|
||||
public Task GetDoubleSmallScientificNotation() => TestStatus(async (host, pipeline) =>
|
||||
{
|
||||
var response = await NumberOperations.GetSmallDoubleAsync(ClientDiagnostics, pipeline, host);
|
||||
Assert.AreEqual(2.5976931000000001E-101d, response.Value);
|
||||
return response.GetRawResponse();
|
||||
});
|
||||
|
||||
[Test]
|
||||
public Task GetFloatBigScientificNotation() => TestStatus(async (host, pipeline) =>
|
||||
{
|
||||
var response = await NumberOperations.GetBigFloatAsync(ClientDiagnostics, pipeline, host);
|
||||
Assert.AreEqual(3.40282312E+20f, response.Value);
|
||||
return response.GetRawResponse();
|
||||
});
|
||||
|
||||
[Test]
|
||||
public Task GetFloatSmallScientificNotation() => TestStatus(async (host, pipeline) =>
|
||||
{
|
||||
var response = await NumberOperations.GetSmallFloatAsync(ClientDiagnostics, pipeline, host);
|
||||
Assert.AreEqual(3.4028229999999997E-20d, response.Value);
|
||||
return response.GetRawResponse();
|
||||
});
|
||||
|
||||
[Test]
|
||||
[Ignore("No support for null results")]
|
||||
public Task GetNumberNull() => TestStatus(async (host, pipeline) =>
|
||||
{
|
||||
var response = await NumberOperations.GetNullAsync(ClientDiagnostics, pipeline, host);
|
||||
Assert.Null(response.Value);
|
||||
return response.GetRawResponse();
|
||||
});
|
||||
}
|
||||
}
|
|
@ -6,6 +6,7 @@ using System.Collections.Generic;
|
|||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using AutoRest.TestServer.Tests.Infrastructure;
|
||||
using Azure.Core.Pipeline;
|
||||
using NUnit.Framework;
|
||||
using url;
|
||||
using url.Models.V100;
|
||||
|
@ -47,8 +48,10 @@ namespace AutoRest.TestServer.Tests
|
|||
public Task UrlPathsByteMultiByte() => TestStatus(async (host, pipeline) => await PathsOperations.ByteMultiByteAsync(ClientDiagnostics, pipeline, TestConstants.ByteArray, host));
|
||||
|
||||
[Test]
|
||||
[Ignore("Don't have null-checks yet")]
|
||||
public Task UrlByteNullAsync() => TestStatus(async (host, pipeline) => await PathsOperations.ByteNullAsync(ClientDiagnostics, pipeline, null, host));
|
||||
public void UrlByteNullAsync()
|
||||
{
|
||||
Assert.ThrowsAsync<ArgumentNullException>(async () => await PathsOperations.ByteNullAsync(ClientDiagnostics, null, null, host: string.Empty));
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Ignore("Might not apply")]
|
||||
|
|
|
@ -16,6 +16,11 @@ namespace body_complex
|
|||
{
|
||||
public static async ValueTask<Response<ArrayWrapper>> GetValidAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_complex.GetValid");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -25,7 +30,6 @@ namespace body_complex
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/complex/array/valid", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
|
@ -43,6 +47,15 @@ namespace body_complex
|
|||
}
|
||||
public static async ValueTask<Response> PutValidAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, ArrayWrapper complexBody, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (complexBody == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(complexBody));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_complex.PutValid");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -52,13 +65,11 @@ namespace body_complex
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/complex/array/valid", false);
|
||||
request.Headers.Add("Content-Type", "application/json");
|
||||
var buffer = new ArrayBufferWriter<byte>();
|
||||
await using var writer = new Utf8JsonWriter(buffer);
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
complexBody.Serialize(writer);
|
||||
writer.Flush();
|
||||
request.Content = RequestContent.Create(buffer.WrittenMemory);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -69,6 +80,11 @@ namespace body_complex
|
|||
}
|
||||
public static async ValueTask<Response<ArrayWrapper>> GetEmptyAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_complex.GetEmpty");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -78,7 +94,6 @@ namespace body_complex
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/complex/array/empty", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
|
@ -96,6 +111,15 @@ namespace body_complex
|
|||
}
|
||||
public static async ValueTask<Response> PutEmptyAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, ArrayWrapper complexBody, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (complexBody == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(complexBody));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_complex.PutEmpty");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -105,13 +129,11 @@ namespace body_complex
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/complex/array/empty", false);
|
||||
request.Headers.Add("Content-Type", "application/json");
|
||||
var buffer = new ArrayBufferWriter<byte>();
|
||||
await using var writer = new Utf8JsonWriter(buffer);
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
complexBody.Serialize(writer);
|
||||
writer.Flush();
|
||||
request.Content = RequestContent.Create(buffer.WrittenMemory);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -122,6 +144,11 @@ namespace body_complex
|
|||
}
|
||||
public static async ValueTask<Response<ArrayWrapper>> GetNotProvidedAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_complex.GetNotProvided");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -131,7 +158,6 @@ namespace body_complex
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/complex/array/notprovided", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
|
|
|
@ -16,6 +16,11 @@ namespace body_complex
|
|||
{
|
||||
public static async ValueTask<Response<Basic>> GetValidAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_complex.GetValid");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -25,7 +30,6 @@ namespace body_complex
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/complex/basic/valid", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
|
@ -43,6 +47,15 @@ namespace body_complex
|
|||
}
|
||||
public static async ValueTask<Response> PutValidAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Basic complexBody, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (complexBody == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(complexBody));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_complex.PutValid");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -53,13 +66,11 @@ namespace body_complex
|
|||
request.Uri.AppendPath("/complex/basic/valid", false);
|
||||
request.Headers.Add("Content-Type", "application/json");
|
||||
request.Uri.AppendQuery("api-version", "2016-02-29", true);
|
||||
var buffer = new ArrayBufferWriter<byte>();
|
||||
await using var writer = new Utf8JsonWriter(buffer);
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
complexBody.Serialize(writer);
|
||||
writer.Flush();
|
||||
request.Content = RequestContent.Create(buffer.WrittenMemory);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -70,6 +81,11 @@ namespace body_complex
|
|||
}
|
||||
public static async ValueTask<Response<Basic>> GetInvalidAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_complex.GetInvalid");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -79,7 +95,6 @@ namespace body_complex
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/complex/basic/invalid", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
|
@ -97,6 +112,11 @@ namespace body_complex
|
|||
}
|
||||
public static async ValueTask<Response<Basic>> GetEmptyAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_complex.GetEmpty");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -106,7 +126,6 @@ namespace body_complex
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/complex/basic/empty", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
|
@ -124,6 +143,11 @@ namespace body_complex
|
|||
}
|
||||
public static async ValueTask<Response<Basic>> GetNullAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_complex.GetNull");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -133,7 +157,6 @@ namespace body_complex
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/complex/basic/null", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
|
@ -151,6 +174,11 @@ namespace body_complex
|
|||
}
|
||||
public static async ValueTask<Response<Basic>> GetNotProvidedAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_complex.GetNotProvided");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -160,7 +188,6 @@ namespace body_complex
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/complex/basic/notprovided", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
|
|
|
@ -16,6 +16,11 @@ namespace body_complex
|
|||
{
|
||||
public static async ValueTask<Response<DictionaryWrapper>> GetValidAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_complex.GetValid");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -25,7 +30,6 @@ namespace body_complex
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/complex/dictionary/typed/valid", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
|
@ -43,6 +47,15 @@ namespace body_complex
|
|||
}
|
||||
public static async ValueTask<Response> PutValidAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, DictionaryWrapper complexBody, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (complexBody == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(complexBody));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_complex.PutValid");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -52,13 +65,11 @@ namespace body_complex
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/complex/dictionary/typed/valid", false);
|
||||
request.Headers.Add("Content-Type", "application/json");
|
||||
var buffer = new ArrayBufferWriter<byte>();
|
||||
await using var writer = new Utf8JsonWriter(buffer);
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
complexBody.Serialize(writer);
|
||||
writer.Flush();
|
||||
request.Content = RequestContent.Create(buffer.WrittenMemory);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -69,6 +80,11 @@ namespace body_complex
|
|||
}
|
||||
public static async ValueTask<Response<DictionaryWrapper>> GetEmptyAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_complex.GetEmpty");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -78,7 +94,6 @@ namespace body_complex
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/complex/dictionary/typed/empty", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
|
@ -96,6 +111,15 @@ namespace body_complex
|
|||
}
|
||||
public static async ValueTask<Response> PutEmptyAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, DictionaryWrapper complexBody, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (complexBody == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(complexBody));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_complex.PutEmpty");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -105,13 +129,11 @@ namespace body_complex
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/complex/dictionary/typed/empty", false);
|
||||
request.Headers.Add("Content-Type", "application/json");
|
||||
var buffer = new ArrayBufferWriter<byte>();
|
||||
await using var writer = new Utf8JsonWriter(buffer);
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
complexBody.Serialize(writer);
|
||||
writer.Flush();
|
||||
request.Content = RequestContent.Create(buffer.WrittenMemory);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -122,6 +144,11 @@ namespace body_complex
|
|||
}
|
||||
public static async ValueTask<Response<DictionaryWrapper>> GetNullAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_complex.GetNull");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -131,7 +158,6 @@ namespace body_complex
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/complex/dictionary/typed/null", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
|
@ -149,6 +175,11 @@ namespace body_complex
|
|||
}
|
||||
public static async ValueTask<Response<DictionaryWrapper>> GetNotProvidedAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_complex.GetNotProvided");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -158,7 +189,6 @@ namespace body_complex
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/complex/dictionary/typed/notprovided", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
|
|
|
@ -16,6 +16,11 @@ namespace body_complex
|
|||
{
|
||||
public static async ValueTask<Response<MyBaseType>> GetValidAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_complex.GetValid");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -25,7 +30,6 @@ namespace body_complex
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/complex/flatten/valid", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
|
|
|
@ -16,6 +16,11 @@ namespace body_complex
|
|||
{
|
||||
public static async ValueTask<Response<Siamese>> GetValidAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_complex.GetValid");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -25,7 +30,6 @@ namespace body_complex
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/complex/inheritance/valid", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
|
@ -43,6 +47,15 @@ namespace body_complex
|
|||
}
|
||||
public static async ValueTask<Response> PutValidAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Siamese complexBody, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (complexBody == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(complexBody));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_complex.PutValid");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -52,13 +65,11 @@ namespace body_complex
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/complex/inheritance/valid", false);
|
||||
request.Headers.Add("Content-Type", "application/json");
|
||||
var buffer = new ArrayBufferWriter<byte>();
|
||||
await using var writer = new Utf8JsonWriter(buffer);
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
complexBody.Serialize(writer);
|
||||
writer.Flush();
|
||||
request.Content = RequestContent.Create(buffer.WrittenMemory);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
|
|
@ -16,6 +16,11 @@ namespace body_complex
|
|||
{
|
||||
public static async ValueTask<Response<Fish>> GetValidAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_complex.GetValid");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -25,7 +30,6 @@ namespace body_complex
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/complex/polymorphicrecursive/valid", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
|
@ -43,6 +47,15 @@ namespace body_complex
|
|||
}
|
||||
public static async ValueTask<Response> PutValidAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Fish complexBody, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (complexBody == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(complexBody));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_complex.PutValid");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -52,13 +65,11 @@ namespace body_complex
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/complex/polymorphicrecursive/valid", false);
|
||||
request.Headers.Add("Content-Type", "application/json");
|
||||
var buffer = new ArrayBufferWriter<byte>();
|
||||
await using var writer = new Utf8JsonWriter(buffer);
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
complexBody.Serialize(writer);
|
||||
writer.Flush();
|
||||
request.Content = RequestContent.Create(buffer.WrittenMemory);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
|
|
@ -16,6 +16,11 @@ namespace body_complex
|
|||
{
|
||||
public static async ValueTask<Response<Fish>> GetValidAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_complex.GetValid");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -25,7 +30,6 @@ namespace body_complex
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/complex/polymorphism/valid", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
|
@ -43,6 +47,15 @@ namespace body_complex
|
|||
}
|
||||
public static async ValueTask<Response> PutValidAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Fish complexBody, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (complexBody == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(complexBody));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_complex.PutValid");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -52,13 +65,11 @@ namespace body_complex
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/complex/polymorphism/valid", false);
|
||||
request.Headers.Add("Content-Type", "application/json");
|
||||
var buffer = new ArrayBufferWriter<byte>();
|
||||
await using var writer = new Utf8JsonWriter(buffer);
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
complexBody.Serialize(writer);
|
||||
writer.Flush();
|
||||
request.Content = RequestContent.Create(buffer.WrittenMemory);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -69,6 +80,11 @@ namespace body_complex
|
|||
}
|
||||
public static async ValueTask<Response<DotFish>> GetDotSyntaxAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_complex.GetDotSyntax");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -78,7 +94,6 @@ namespace body_complex
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/complex/polymorphism/dotsyntax", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
|
@ -96,6 +111,11 @@ namespace body_complex
|
|||
}
|
||||
public static async ValueTask<Response<DotFishMarket>> GetComposedWithDiscriminatorAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_complex.GetComposedWithDiscriminator");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -105,7 +125,6 @@ namespace body_complex
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/complex/polymorphism/composedWithDiscriminator", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
|
@ -123,6 +142,11 @@ namespace body_complex
|
|||
}
|
||||
public static async ValueTask<Response<DotFishMarket>> GetComposedWithoutDiscriminatorAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_complex.GetComposedWithoutDiscriminator");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -132,7 +156,6 @@ namespace body_complex
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/complex/polymorphism/composedWithoutDiscriminator", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
|
@ -150,6 +173,11 @@ namespace body_complex
|
|||
}
|
||||
public static async ValueTask<Response<Salmon>> GetComplicatedAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_complex.GetComplicated");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -159,7 +187,6 @@ namespace body_complex
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/complex/polymorphism/complicated", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
|
@ -177,6 +204,15 @@ namespace body_complex
|
|||
}
|
||||
public static async ValueTask<Response> PutComplicatedAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Salmon complexBody, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (complexBody == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(complexBody));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_complex.PutComplicated");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -186,13 +222,11 @@ namespace body_complex
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/complex/polymorphism/complicated", false);
|
||||
request.Headers.Add("Content-Type", "application/json");
|
||||
var buffer = new ArrayBufferWriter<byte>();
|
||||
await using var writer = new Utf8JsonWriter(buffer);
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
complexBody.Serialize(writer);
|
||||
writer.Flush();
|
||||
request.Content = RequestContent.Create(buffer.WrittenMemory);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -203,6 +237,15 @@ namespace body_complex
|
|||
}
|
||||
public static async ValueTask<Response<Salmon>> PutMissingDiscriminatorAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Salmon complexBody, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (complexBody == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(complexBody));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_complex.PutMissingDiscriminator");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -212,13 +255,11 @@ namespace body_complex
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/complex/polymorphism/missingdiscriminator", false);
|
||||
request.Headers.Add("Content-Type", "application/json");
|
||||
var buffer = new ArrayBufferWriter<byte>();
|
||||
await using var writer = new Utf8JsonWriter(buffer);
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
complexBody.Serialize(writer);
|
||||
writer.Flush();
|
||||
request.Content = RequestContent.Create(buffer.WrittenMemory);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
|
@ -236,6 +277,15 @@ namespace body_complex
|
|||
}
|
||||
public static async ValueTask<Response> PutValidMissingRequiredAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Fish complexBody, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (complexBody == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(complexBody));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_complex.PutValidMissingRequired");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -245,13 +295,11 @@ namespace body_complex
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/complex/polymorphism/missingrequired/invalid", false);
|
||||
request.Headers.Add("Content-Type", "application/json");
|
||||
var buffer = new ArrayBufferWriter<byte>();
|
||||
await using var writer = new Utf8JsonWriter(buffer);
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
complexBody.Serialize(writer);
|
||||
writer.Flush();
|
||||
request.Content = RequestContent.Create(buffer.WrittenMemory);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
|
|
@ -16,6 +16,11 @@ namespace body_complex
|
|||
{
|
||||
public static async ValueTask<Response<IntWrapper>> GetIntAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_complex.GetInt");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -25,7 +30,6 @@ namespace body_complex
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/complex/primitive/integer", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
|
@ -43,6 +47,15 @@ namespace body_complex
|
|||
}
|
||||
public static async ValueTask<Response> PutIntAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, IntWrapper complexBody, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (complexBody == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(complexBody));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_complex.PutInt");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -52,13 +65,11 @@ namespace body_complex
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/complex/primitive/integer", false);
|
||||
request.Headers.Add("Content-Type", "application/json");
|
||||
var buffer = new ArrayBufferWriter<byte>();
|
||||
await using var writer = new Utf8JsonWriter(buffer);
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
complexBody.Serialize(writer);
|
||||
writer.Flush();
|
||||
request.Content = RequestContent.Create(buffer.WrittenMemory);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -69,6 +80,11 @@ namespace body_complex
|
|||
}
|
||||
public static async ValueTask<Response<LongWrapper>> GetLongAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_complex.GetLong");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -78,7 +94,6 @@ namespace body_complex
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/complex/primitive/long", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
|
@ -96,6 +111,15 @@ namespace body_complex
|
|||
}
|
||||
public static async ValueTask<Response> PutLongAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, LongWrapper complexBody, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (complexBody == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(complexBody));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_complex.PutLong");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -105,13 +129,11 @@ namespace body_complex
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/complex/primitive/long", false);
|
||||
request.Headers.Add("Content-Type", "application/json");
|
||||
var buffer = new ArrayBufferWriter<byte>();
|
||||
await using var writer = new Utf8JsonWriter(buffer);
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
complexBody.Serialize(writer);
|
||||
writer.Flush();
|
||||
request.Content = RequestContent.Create(buffer.WrittenMemory);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -122,6 +144,11 @@ namespace body_complex
|
|||
}
|
||||
public static async ValueTask<Response<FloatWrapper>> GetFloatAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_complex.GetFloat");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -131,7 +158,6 @@ namespace body_complex
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/complex/primitive/float", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
|
@ -149,6 +175,15 @@ namespace body_complex
|
|||
}
|
||||
public static async ValueTask<Response> PutFloatAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, FloatWrapper complexBody, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (complexBody == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(complexBody));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_complex.PutFloat");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -158,13 +193,11 @@ namespace body_complex
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/complex/primitive/float", false);
|
||||
request.Headers.Add("Content-Type", "application/json");
|
||||
var buffer = new ArrayBufferWriter<byte>();
|
||||
await using var writer = new Utf8JsonWriter(buffer);
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
complexBody.Serialize(writer);
|
||||
writer.Flush();
|
||||
request.Content = RequestContent.Create(buffer.WrittenMemory);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -175,6 +208,11 @@ namespace body_complex
|
|||
}
|
||||
public static async ValueTask<Response<DoubleWrapper>> GetDoubleAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_complex.GetDouble");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -184,7 +222,6 @@ namespace body_complex
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/complex/primitive/double", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
|
@ -202,6 +239,15 @@ namespace body_complex
|
|||
}
|
||||
public static async ValueTask<Response> PutDoubleAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, DoubleWrapper complexBody, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (complexBody == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(complexBody));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_complex.PutDouble");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -211,13 +257,11 @@ namespace body_complex
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/complex/primitive/double", false);
|
||||
request.Headers.Add("Content-Type", "application/json");
|
||||
var buffer = new ArrayBufferWriter<byte>();
|
||||
await using var writer = new Utf8JsonWriter(buffer);
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
complexBody.Serialize(writer);
|
||||
writer.Flush();
|
||||
request.Content = RequestContent.Create(buffer.WrittenMemory);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -228,6 +272,11 @@ namespace body_complex
|
|||
}
|
||||
public static async ValueTask<Response<BooleanWrapper>> GetBoolAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_complex.GetBool");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -237,7 +286,6 @@ namespace body_complex
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/complex/primitive/bool", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
|
@ -255,6 +303,15 @@ namespace body_complex
|
|||
}
|
||||
public static async ValueTask<Response> PutBoolAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, BooleanWrapper complexBody, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (complexBody == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(complexBody));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_complex.PutBool");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -264,13 +321,11 @@ namespace body_complex
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/complex/primitive/bool", false);
|
||||
request.Headers.Add("Content-Type", "application/json");
|
||||
var buffer = new ArrayBufferWriter<byte>();
|
||||
await using var writer = new Utf8JsonWriter(buffer);
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
complexBody.Serialize(writer);
|
||||
writer.Flush();
|
||||
request.Content = RequestContent.Create(buffer.WrittenMemory);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -281,6 +336,11 @@ namespace body_complex
|
|||
}
|
||||
public static async ValueTask<Response<StringWrapper>> GetStringAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_complex.GetString");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -290,7 +350,6 @@ namespace body_complex
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/complex/primitive/string", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
|
@ -308,6 +367,15 @@ namespace body_complex
|
|||
}
|
||||
public static async ValueTask<Response> PutStringAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, StringWrapper complexBody, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (complexBody == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(complexBody));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_complex.PutString");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -317,13 +385,11 @@ namespace body_complex
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/complex/primitive/string", false);
|
||||
request.Headers.Add("Content-Type", "application/json");
|
||||
var buffer = new ArrayBufferWriter<byte>();
|
||||
await using var writer = new Utf8JsonWriter(buffer);
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
complexBody.Serialize(writer);
|
||||
writer.Flush();
|
||||
request.Content = RequestContent.Create(buffer.WrittenMemory);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -334,6 +400,11 @@ namespace body_complex
|
|||
}
|
||||
public static async ValueTask<Response<DateWrapper>> GetDateAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_complex.GetDate");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -343,7 +414,6 @@ namespace body_complex
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/complex/primitive/date", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
|
@ -361,6 +431,15 @@ namespace body_complex
|
|||
}
|
||||
public static async ValueTask<Response> PutDateAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, DateWrapper complexBody, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (complexBody == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(complexBody));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_complex.PutDate");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -370,13 +449,11 @@ namespace body_complex
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/complex/primitive/date", false);
|
||||
request.Headers.Add("Content-Type", "application/json");
|
||||
var buffer = new ArrayBufferWriter<byte>();
|
||||
await using var writer = new Utf8JsonWriter(buffer);
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
complexBody.Serialize(writer);
|
||||
writer.Flush();
|
||||
request.Content = RequestContent.Create(buffer.WrittenMemory);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -387,6 +464,11 @@ namespace body_complex
|
|||
}
|
||||
public static async ValueTask<Response<DatetimeWrapper>> GetDateTimeAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_complex.GetDateTime");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -396,7 +478,6 @@ namespace body_complex
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/complex/primitive/datetime", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
|
@ -414,6 +495,15 @@ namespace body_complex
|
|||
}
|
||||
public static async ValueTask<Response> PutDateTimeAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, DatetimeWrapper complexBody, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (complexBody == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(complexBody));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_complex.PutDateTime");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -423,13 +513,11 @@ namespace body_complex
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/complex/primitive/datetime", false);
|
||||
request.Headers.Add("Content-Type", "application/json");
|
||||
var buffer = new ArrayBufferWriter<byte>();
|
||||
await using var writer = new Utf8JsonWriter(buffer);
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
complexBody.Serialize(writer);
|
||||
writer.Flush();
|
||||
request.Content = RequestContent.Create(buffer.WrittenMemory);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -440,6 +528,11 @@ namespace body_complex
|
|||
}
|
||||
public static async ValueTask<Response<Datetimerfc1123Wrapper>> GetDateTimeRfc1123Async(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_complex.GetDateTimeRfc1123");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -449,7 +542,6 @@ namespace body_complex
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/complex/primitive/datetimerfc1123", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
|
@ -467,6 +559,15 @@ namespace body_complex
|
|||
}
|
||||
public static async ValueTask<Response> PutDateTimeRfc1123Async(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Datetimerfc1123Wrapper complexBody, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (complexBody == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(complexBody));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_complex.PutDateTimeRfc1123");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -476,13 +577,11 @@ namespace body_complex
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/complex/primitive/datetimerfc1123", false);
|
||||
request.Headers.Add("Content-Type", "application/json");
|
||||
var buffer = new ArrayBufferWriter<byte>();
|
||||
await using var writer = new Utf8JsonWriter(buffer);
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
complexBody.Serialize(writer);
|
||||
writer.Flush();
|
||||
request.Content = RequestContent.Create(buffer.WrittenMemory);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -493,6 +592,11 @@ namespace body_complex
|
|||
}
|
||||
public static async ValueTask<Response<DurationWrapper>> GetDurationAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_complex.GetDuration");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -502,7 +606,6 @@ namespace body_complex
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/complex/primitive/duration", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
|
@ -520,6 +623,15 @@ namespace body_complex
|
|||
}
|
||||
public static async ValueTask<Response> PutDurationAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, DurationWrapper complexBody, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (complexBody == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(complexBody));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_complex.PutDuration");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -529,13 +641,11 @@ namespace body_complex
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/complex/primitive/duration", false);
|
||||
request.Headers.Add("Content-Type", "application/json");
|
||||
var buffer = new ArrayBufferWriter<byte>();
|
||||
await using var writer = new Utf8JsonWriter(buffer);
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
complexBody.Serialize(writer);
|
||||
writer.Flush();
|
||||
request.Content = RequestContent.Create(buffer.WrittenMemory);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -546,6 +656,11 @@ namespace body_complex
|
|||
}
|
||||
public static async ValueTask<Response<ByteWrapper>> GetByteAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_complex.GetByte");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -555,7 +670,6 @@ namespace body_complex
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/complex/primitive/byte", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
|
@ -573,6 +687,15 @@ namespace body_complex
|
|||
}
|
||||
public static async ValueTask<Response> PutByteAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, ByteWrapper complexBody, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (complexBody == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(complexBody));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_complex.PutByte");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -582,13 +705,11 @@ namespace body_complex
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/complex/primitive/byte", false);
|
||||
request.Headers.Add("Content-Type", "application/json");
|
||||
var buffer = new ArrayBufferWriter<byte>();
|
||||
await using var writer = new Utf8JsonWriter(buffer);
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
complexBody.Serialize(writer);
|
||||
writer.Flush();
|
||||
request.Content = RequestContent.Create(buffer.WrittenMemory);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
|
|
@ -16,6 +16,11 @@ namespace body_complex
|
|||
{
|
||||
public static async ValueTask<Response<ReadonlyObj>> GetValidAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_complex.GetValid");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -25,7 +30,6 @@ namespace body_complex
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/complex/readonlyproperty/valid", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
|
@ -43,6 +47,15 @@ namespace body_complex
|
|||
}
|
||||
public static async ValueTask<Response> PutValidAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, ReadonlyObj complexBody, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (complexBody == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(complexBody));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_complex.PutValid");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -52,13 +65,11 @@ namespace body_complex
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/complex/readonlyproperty/valid", false);
|
||||
request.Headers.Add("Content-Type", "application/json");
|
||||
var buffer = new ArrayBufferWriter<byte>();
|
||||
await using var writer = new Utf8JsonWriter(buffer);
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
complexBody.Serialize(writer);
|
||||
writer.Flush();
|
||||
request.Content = RequestContent.Create(buffer.WrittenMemory);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
using System.Text.Json;
|
||||
|
||||
namespace body_integer.Models.V100
|
||||
{
|
||||
public partial class Error
|
||||
{
|
||||
internal void Serialize(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
if (Status != null)
|
||||
{
|
||||
writer.WritePropertyName("status");
|
||||
writer.WriteNumberValue(Status.Value);
|
||||
}
|
||||
if (Message != null)
|
||||
{
|
||||
writer.WritePropertyName("message");
|
||||
writer.WriteStringValue(Message);
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static Error Deserialize(JsonElement element)
|
||||
{
|
||||
var result = new Error();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
{
|
||||
if (property.NameEquals("status"))
|
||||
{
|
||||
result.Status = property.Value.GetInt32();
|
||||
continue;
|
||||
}
|
||||
if (property.NameEquals("message"))
|
||||
{
|
||||
result.Message = property.Value.GetString();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
namespace body_integer.Models.V100
|
||||
{
|
||||
public partial class Error
|
||||
{
|
||||
public int? Status { get; set; }
|
||||
public string? Message { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,441 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
using System;
|
||||
using System.Text.Json;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Azure;
|
||||
using Azure.Core;
|
||||
using Azure.Core.Pipeline;
|
||||
|
||||
namespace body_integer
|
||||
{
|
||||
internal static class IntOperations
|
||||
{
|
||||
public static async ValueTask<Response<int>> GetNullAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_integer.GetNull");
|
||||
scope.Start();
|
||||
try
|
||||
{
|
||||
var request = pipeline.CreateRequest();
|
||||
request.Method = RequestMethod.Get;
|
||||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/int/null", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
case 200:
|
||||
return Response.FromValue(document.RootElement.GetInt32(), response);
|
||||
default:
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
scope.Failed(e);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static async ValueTask<Response<int>> GetInvalidAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_integer.GetInvalid");
|
||||
scope.Start();
|
||||
try
|
||||
{
|
||||
var request = pipeline.CreateRequest();
|
||||
request.Method = RequestMethod.Get;
|
||||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/int/invalid", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
case 200:
|
||||
return Response.FromValue(document.RootElement.GetInt32(), response);
|
||||
default:
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
scope.Failed(e);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static async ValueTask<Response<int>> GetOverflowInt32Async(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_integer.GetOverflowInt32");
|
||||
scope.Start();
|
||||
try
|
||||
{
|
||||
var request = pipeline.CreateRequest();
|
||||
request.Method = RequestMethod.Get;
|
||||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/int/overflowint32", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
case 200:
|
||||
return Response.FromValue(document.RootElement.GetInt32(), response);
|
||||
default:
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
scope.Failed(e);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static async ValueTask<Response<int>> GetUnderflowInt32Async(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_integer.GetUnderflowInt32");
|
||||
scope.Start();
|
||||
try
|
||||
{
|
||||
var request = pipeline.CreateRequest();
|
||||
request.Method = RequestMethod.Get;
|
||||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/int/underflowint32", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
case 200:
|
||||
return Response.FromValue(document.RootElement.GetInt32(), response);
|
||||
default:
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
scope.Failed(e);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static async ValueTask<Response<long>> GetOverflowInt64Async(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_integer.GetOverflowInt64");
|
||||
scope.Start();
|
||||
try
|
||||
{
|
||||
var request = pipeline.CreateRequest();
|
||||
request.Method = RequestMethod.Get;
|
||||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/int/overflowint64", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
case 200:
|
||||
return Response.FromValue(document.RootElement.GetInt64(), response);
|
||||
default:
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
scope.Failed(e);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static async ValueTask<Response<long>> GetUnderflowInt64Async(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_integer.GetUnderflowInt64");
|
||||
scope.Start();
|
||||
try
|
||||
{
|
||||
var request = pipeline.CreateRequest();
|
||||
request.Method = RequestMethod.Get;
|
||||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/int/underflowint64", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
case 200:
|
||||
return Response.FromValue(document.RootElement.GetInt64(), response);
|
||||
default:
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
scope.Failed(e);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static async ValueTask<Response> PutMax32Async(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, int intBody, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_integer.PutMax32");
|
||||
scope.Start();
|
||||
try
|
||||
{
|
||||
var request = pipeline.CreateRequest();
|
||||
request.Method = RequestMethod.Put;
|
||||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/int/max/32", false);
|
||||
request.Headers.Add("Content-Type", "application/json");
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
writer.WriteNumberValue(intBody);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
scope.Failed(e);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static async ValueTask<Response> PutMax64Async(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, long intBody, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_integer.PutMax64");
|
||||
scope.Start();
|
||||
try
|
||||
{
|
||||
var request = pipeline.CreateRequest();
|
||||
request.Method = RequestMethod.Put;
|
||||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/int/max/64", false);
|
||||
request.Headers.Add("Content-Type", "application/json");
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
writer.WriteNumberValue(intBody);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
scope.Failed(e);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static async ValueTask<Response> PutMin32Async(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, int intBody, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_integer.PutMin32");
|
||||
scope.Start();
|
||||
try
|
||||
{
|
||||
var request = pipeline.CreateRequest();
|
||||
request.Method = RequestMethod.Put;
|
||||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/int/min/32", false);
|
||||
request.Headers.Add("Content-Type", "application/json");
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
writer.WriteNumberValue(intBody);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
scope.Failed(e);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static async ValueTask<Response> PutMin64Async(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, long intBody, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_integer.PutMin64");
|
||||
scope.Start();
|
||||
try
|
||||
{
|
||||
var request = pipeline.CreateRequest();
|
||||
request.Method = RequestMethod.Put;
|
||||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/int/min/64", false);
|
||||
request.Headers.Add("Content-Type", "application/json");
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
writer.WriteNumberValue(intBody);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
scope.Failed(e);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static async ValueTask<Response<DateTimeOffset>> GetUnixTimeAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_integer.GetUnixTime");
|
||||
scope.Start();
|
||||
try
|
||||
{
|
||||
var request = pipeline.CreateRequest();
|
||||
request.Method = RequestMethod.Get;
|
||||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/int/unixtime", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
case 200:
|
||||
return Response.FromValue(document.RootElement.GetDateTimeOffset(), response);
|
||||
default:
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
scope.Failed(e);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static async ValueTask<Response> PutUnixTimeDateAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, DateTimeOffset intBody, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_integer.PutUnixTimeDate");
|
||||
scope.Start();
|
||||
try
|
||||
{
|
||||
var request = pipeline.CreateRequest();
|
||||
request.Method = RequestMethod.Put;
|
||||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/int/unixtime", false);
|
||||
request.Headers.Add("Content-Type", "application/json");
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
writer.WriteStringValue(intBody.ToString());
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
scope.Failed(e);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static async ValueTask<Response<DateTimeOffset>> GetInvalidUnixTimeAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_integer.GetInvalidUnixTime");
|
||||
scope.Start();
|
||||
try
|
||||
{
|
||||
var request = pipeline.CreateRequest();
|
||||
request.Method = RequestMethod.Get;
|
||||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/int/invalidunixtime", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
case 200:
|
||||
return Response.FromValue(document.RootElement.GetDateTimeOffset(), response);
|
||||
default:
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
scope.Failed(e);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static async ValueTask<Response<DateTimeOffset>> GetNullUnixTimeAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_integer.GetNullUnixTime");
|
||||
scope.Start();
|
||||
try
|
||||
{
|
||||
var request = pipeline.CreateRequest();
|
||||
request.Method = RequestMethod.Get;
|
||||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/int/nullunixtime", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
case 200:
|
||||
return Response.FromValue(document.RootElement.GetDateTimeOffset(), response);
|
||||
default:
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
scope.Failed(e);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
<Nullable>annotations</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Azure.Core" Version="1.0.0" />
|
||||
<PackageReference Include="System.Text.Json" Version="4.6.0" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
using System.Text.Json;
|
||||
|
||||
namespace body_number.Models.V100
|
||||
{
|
||||
public partial class Error
|
||||
{
|
||||
internal void Serialize(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
if (Status != null)
|
||||
{
|
||||
writer.WritePropertyName("status");
|
||||
writer.WriteNumberValue(Status.Value);
|
||||
}
|
||||
if (Message != null)
|
||||
{
|
||||
writer.WritePropertyName("message");
|
||||
writer.WriteStringValue(Message);
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static Error Deserialize(JsonElement element)
|
||||
{
|
||||
var result = new Error();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
{
|
||||
if (property.NameEquals("status"))
|
||||
{
|
||||
result.Status = property.Value.GetInt32();
|
||||
continue;
|
||||
}
|
||||
if (property.NameEquals("message"))
|
||||
{
|
||||
result.Message = property.Value.GetString();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
namespace body_number.Models.V100
|
||||
{
|
||||
public partial class Error
|
||||
{
|
||||
public int? Status { get; set; }
|
||||
public string? Message { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,741 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
using System;
|
||||
using System.Text.Json;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Azure;
|
||||
using Azure.Core;
|
||||
using Azure.Core.Pipeline;
|
||||
|
||||
namespace body_number
|
||||
{
|
||||
internal static class NumberOperations
|
||||
{
|
||||
public static async ValueTask<Response<float>> GetNullAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_number.GetNull");
|
||||
scope.Start();
|
||||
try
|
||||
{
|
||||
var request = pipeline.CreateRequest();
|
||||
request.Method = RequestMethod.Get;
|
||||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/number/null", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
case 200:
|
||||
return Response.FromValue(document.RootElement.GetSingle(), response);
|
||||
default:
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
scope.Failed(e);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static async ValueTask<Response<float>> GetInvalidFloatAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_number.GetInvalidFloat");
|
||||
scope.Start();
|
||||
try
|
||||
{
|
||||
var request = pipeline.CreateRequest();
|
||||
request.Method = RequestMethod.Get;
|
||||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/number/invalidfloat", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
case 200:
|
||||
return Response.FromValue(document.RootElement.GetSingle(), response);
|
||||
default:
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
scope.Failed(e);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static async ValueTask<Response<double>> GetInvalidDoubleAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_number.GetInvalidDouble");
|
||||
scope.Start();
|
||||
try
|
||||
{
|
||||
var request = pipeline.CreateRequest();
|
||||
request.Method = RequestMethod.Get;
|
||||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/number/invaliddouble", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
case 200:
|
||||
return Response.FromValue(document.RootElement.GetDouble(), response);
|
||||
default:
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
scope.Failed(e);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static async ValueTask<Response<decimal>> GetInvalidDecimalAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_number.GetInvalidDecimal");
|
||||
scope.Start();
|
||||
try
|
||||
{
|
||||
var request = pipeline.CreateRequest();
|
||||
request.Method = RequestMethod.Get;
|
||||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/number/invaliddecimal", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
case 200:
|
||||
return Response.FromValue(document.RootElement.GetDecimal(), response);
|
||||
default:
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
scope.Failed(e);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static async ValueTask<Response> PutBigFloatAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, float numberBody, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_number.PutBigFloat");
|
||||
scope.Start();
|
||||
try
|
||||
{
|
||||
var request = pipeline.CreateRequest();
|
||||
request.Method = RequestMethod.Put;
|
||||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/number/big/float/3.402823e+20", false);
|
||||
request.Headers.Add("Content-Type", "application/json");
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
writer.WriteNumberValue(numberBody);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
scope.Failed(e);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static async ValueTask<Response<float>> GetBigFloatAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_number.GetBigFloat");
|
||||
scope.Start();
|
||||
try
|
||||
{
|
||||
var request = pipeline.CreateRequest();
|
||||
request.Method = RequestMethod.Get;
|
||||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/number/big/float/3.402823e+20", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
case 200:
|
||||
return Response.FromValue(document.RootElement.GetSingle(), response);
|
||||
default:
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
scope.Failed(e);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static async ValueTask<Response> PutBigDoubleAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, double numberBody, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_number.PutBigDouble");
|
||||
scope.Start();
|
||||
try
|
||||
{
|
||||
var request = pipeline.CreateRequest();
|
||||
request.Method = RequestMethod.Put;
|
||||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/number/big/double/2.5976931e+101", false);
|
||||
request.Headers.Add("Content-Type", "application/json");
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
writer.WriteNumberValue(numberBody);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
scope.Failed(e);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static async ValueTask<Response<double>> GetBigDoubleAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_number.GetBigDouble");
|
||||
scope.Start();
|
||||
try
|
||||
{
|
||||
var request = pipeline.CreateRequest();
|
||||
request.Method = RequestMethod.Get;
|
||||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/number/big/double/2.5976931e+101", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
case 200:
|
||||
return Response.FromValue(document.RootElement.GetDouble(), response);
|
||||
default:
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
scope.Failed(e);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static async ValueTask<Response> PutBigDoublePositiveDecimalAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_number.PutBigDoublePositiveDecimal");
|
||||
scope.Start();
|
||||
try
|
||||
{
|
||||
var request = pipeline.CreateRequest();
|
||||
request.Method = RequestMethod.Put;
|
||||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/number/big/double/99999999.99", false);
|
||||
request.Headers.Add("Content-Type", "application/json");
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
writer.WriteNumberValue(99999999.99);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
scope.Failed(e);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static async ValueTask<Response<double>> GetBigDoublePositiveDecimalAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_number.GetBigDoublePositiveDecimal");
|
||||
scope.Start();
|
||||
try
|
||||
{
|
||||
var request = pipeline.CreateRequest();
|
||||
request.Method = RequestMethod.Get;
|
||||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/number/big/double/99999999.99", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
case 200:
|
||||
return Response.FromValue(document.RootElement.GetDouble(), response);
|
||||
default:
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
scope.Failed(e);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static async ValueTask<Response> PutBigDoubleNegativeDecimalAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_number.PutBigDoubleNegativeDecimal");
|
||||
scope.Start();
|
||||
try
|
||||
{
|
||||
var request = pipeline.CreateRequest();
|
||||
request.Method = RequestMethod.Put;
|
||||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/number/big/double/-99999999.99", false);
|
||||
request.Headers.Add("Content-Type", "application/json");
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
writer.WriteNumberValue(-99999999.99);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
scope.Failed(e);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static async ValueTask<Response<double>> GetBigDoubleNegativeDecimalAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_number.GetBigDoubleNegativeDecimal");
|
||||
scope.Start();
|
||||
try
|
||||
{
|
||||
var request = pipeline.CreateRequest();
|
||||
request.Method = RequestMethod.Get;
|
||||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/number/big/double/-99999999.99", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
case 200:
|
||||
return Response.FromValue(document.RootElement.GetDouble(), response);
|
||||
default:
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
scope.Failed(e);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static async ValueTask<Response> PutBigDecimalAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, decimal numberBody, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_number.PutBigDecimal");
|
||||
scope.Start();
|
||||
try
|
||||
{
|
||||
var request = pipeline.CreateRequest();
|
||||
request.Method = RequestMethod.Put;
|
||||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/number/big/decimal/2.5976931e+101", false);
|
||||
request.Headers.Add("Content-Type", "application/json");
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
writer.WriteNumberValue(numberBody);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
scope.Failed(e);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static async ValueTask<Response<decimal>> GetBigDecimalAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_number.GetBigDecimal");
|
||||
scope.Start();
|
||||
try
|
||||
{
|
||||
var request = pipeline.CreateRequest();
|
||||
request.Method = RequestMethod.Get;
|
||||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/number/big/decimal/2.5976931e+101", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
case 200:
|
||||
return Response.FromValue(document.RootElement.GetDecimal(), response);
|
||||
default:
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
scope.Failed(e);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static async ValueTask<Response> PutBigDecimalPositiveDecimalAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_number.PutBigDecimalPositiveDecimal");
|
||||
scope.Start();
|
||||
try
|
||||
{
|
||||
var request = pipeline.CreateRequest();
|
||||
request.Method = RequestMethod.Put;
|
||||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/number/big/decimal/99999999.99", false);
|
||||
request.Headers.Add("Content-Type", "application/json");
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
writer.WriteNumberValue(99999999.99);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
scope.Failed(e);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static async ValueTask<Response<decimal>> GetBigDecimalPositiveDecimalAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_number.GetBigDecimalPositiveDecimal");
|
||||
scope.Start();
|
||||
try
|
||||
{
|
||||
var request = pipeline.CreateRequest();
|
||||
request.Method = RequestMethod.Get;
|
||||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/number/big/decimal/99999999.99", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
case 200:
|
||||
return Response.FromValue(document.RootElement.GetDecimal(), response);
|
||||
default:
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
scope.Failed(e);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static async ValueTask<Response> PutBigDecimalNegativeDecimalAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_number.PutBigDecimalNegativeDecimal");
|
||||
scope.Start();
|
||||
try
|
||||
{
|
||||
var request = pipeline.CreateRequest();
|
||||
request.Method = RequestMethod.Put;
|
||||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/number/big/decimal/-99999999.99", false);
|
||||
request.Headers.Add("Content-Type", "application/json");
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
writer.WriteNumberValue(-99999999.99);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
scope.Failed(e);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static async ValueTask<Response<decimal>> GetBigDecimalNegativeDecimalAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_number.GetBigDecimalNegativeDecimal");
|
||||
scope.Start();
|
||||
try
|
||||
{
|
||||
var request = pipeline.CreateRequest();
|
||||
request.Method = RequestMethod.Get;
|
||||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/number/big/decimal/-99999999.99", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
case 200:
|
||||
return Response.FromValue(document.RootElement.GetDecimal(), response);
|
||||
default:
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
scope.Failed(e);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static async ValueTask<Response> PutSmallFloatAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, float numberBody, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_number.PutSmallFloat");
|
||||
scope.Start();
|
||||
try
|
||||
{
|
||||
var request = pipeline.CreateRequest();
|
||||
request.Method = RequestMethod.Put;
|
||||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/number/small/float/3.402823e-20", false);
|
||||
request.Headers.Add("Content-Type", "application/json");
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
writer.WriteNumberValue(numberBody);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
scope.Failed(e);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static async ValueTask<Response<double>> GetSmallFloatAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_number.GetSmallFloat");
|
||||
scope.Start();
|
||||
try
|
||||
{
|
||||
var request = pipeline.CreateRequest();
|
||||
request.Method = RequestMethod.Get;
|
||||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/number/small/float/3.402823e-20", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
case 200:
|
||||
return Response.FromValue(document.RootElement.GetDouble(), response);
|
||||
default:
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
scope.Failed(e);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static async ValueTask<Response> PutSmallDoubleAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, double numberBody, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_number.PutSmallDouble");
|
||||
scope.Start();
|
||||
try
|
||||
{
|
||||
var request = pipeline.CreateRequest();
|
||||
request.Method = RequestMethod.Put;
|
||||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/number/small/double/2.5976931e-101", false);
|
||||
request.Headers.Add("Content-Type", "application/json");
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
writer.WriteNumberValue(numberBody);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
scope.Failed(e);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static async ValueTask<Response<double>> GetSmallDoubleAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_number.GetSmallDouble");
|
||||
scope.Start();
|
||||
try
|
||||
{
|
||||
var request = pipeline.CreateRequest();
|
||||
request.Method = RequestMethod.Get;
|
||||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/number/small/double/2.5976931e-101", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
case 200:
|
||||
return Response.FromValue(document.RootElement.GetDouble(), response);
|
||||
default:
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
scope.Failed(e);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static async ValueTask<Response> PutSmallDecimalAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, decimal numberBody, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_number.PutSmallDecimal");
|
||||
scope.Start();
|
||||
try
|
||||
{
|
||||
var request = pipeline.CreateRequest();
|
||||
request.Method = RequestMethod.Put;
|
||||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/number/small/decimal/2.5976931e-101", false);
|
||||
request.Headers.Add("Content-Type", "application/json");
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
writer.WriteNumberValue(numberBody);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
scope.Failed(e);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static async ValueTask<Response<decimal>> GetSmallDecimalAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_number.GetSmallDecimal");
|
||||
scope.Start();
|
||||
try
|
||||
{
|
||||
var request = pipeline.CreateRequest();
|
||||
request.Method = RequestMethod.Get;
|
||||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/number/small/decimal/2.5976931e-101", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
case 200:
|
||||
return Response.FromValue(document.RootElement.GetDecimal(), response);
|
||||
default:
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
scope.Failed(e);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
<Nullable>annotations</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Azure.Core" Version="1.0.0" />
|
||||
<PackageReference Include="System.Text.Json" Version="4.6.0" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
@ -16,6 +16,11 @@ namespace body_string
|
|||
{
|
||||
public static async ValueTask<Response<Colors>> GetNotExpandableAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_string.GetNotExpandable");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -25,7 +30,6 @@ namespace body_string
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/string/enum/notExpandable", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
|
@ -43,6 +47,11 @@ namespace body_string
|
|||
}
|
||||
public static async ValueTask<Response> PutNotExpandableAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Colors stringBody, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_string.PutNotExpandable");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -52,13 +61,11 @@ namespace body_string
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/string/enum/notExpandable", false);
|
||||
request.Headers.Add("Content-Type", "application/json");
|
||||
var buffer = new ArrayBufferWriter<byte>();
|
||||
await using var writer = new Utf8JsonWriter(buffer);
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
writer.WriteStringValue(stringBody.ToSerialString());
|
||||
writer.Flush();
|
||||
request.Content = RequestContent.Create(buffer.WrittenMemory);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -69,6 +76,11 @@ namespace body_string
|
|||
}
|
||||
public static async ValueTask<Response<Colors>> GetReferencedAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_string.GetReferenced");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -78,7 +90,6 @@ namespace body_string
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/string/enum/Referenced", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
|
@ -96,6 +107,11 @@ namespace body_string
|
|||
}
|
||||
public static async ValueTask<Response> PutReferencedAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Colors enumStringBody, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_string.PutReferenced");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -105,13 +121,11 @@ namespace body_string
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/string/enum/Referenced", false);
|
||||
request.Headers.Add("Content-Type", "application/json");
|
||||
var buffer = new ArrayBufferWriter<byte>();
|
||||
await using var writer = new Utf8JsonWriter(buffer);
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
writer.WriteStringValue(enumStringBody.ToSerialString());
|
||||
writer.Flush();
|
||||
request.Content = RequestContent.Create(buffer.WrittenMemory);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -122,6 +136,11 @@ namespace body_string
|
|||
}
|
||||
public static async ValueTask<Response<RefColorConstant>> GetReferencedConstantAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_string.GetReferencedConstant");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -131,7 +150,6 @@ namespace body_string
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/string/enum/ReferencedConstant", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
|
@ -149,6 +167,15 @@ namespace body_string
|
|||
}
|
||||
public static async ValueTask<Response> PutReferencedConstantAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, RefColorConstant enumStringBody, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (enumStringBody == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(enumStringBody));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_string.PutReferencedConstant");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -158,13 +185,11 @@ namespace body_string
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/string/enum/ReferencedConstant", false);
|
||||
request.Headers.Add("Content-Type", "application/json");
|
||||
var buffer = new ArrayBufferWriter<byte>();
|
||||
await using var writer = new Utf8JsonWriter(buffer);
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
enumStringBody.Serialize(writer);
|
||||
writer.Flush();
|
||||
request.Content = RequestContent.Create(buffer.WrittenMemory);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
|
|
@ -15,6 +15,11 @@ namespace body_string
|
|||
{
|
||||
public static async ValueTask<Response<string>> GetNullAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_string.GetNull");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -24,7 +29,6 @@ namespace body_string
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/string/null", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
|
@ -42,6 +46,11 @@ namespace body_string
|
|||
}
|
||||
public static async ValueTask<Response> PutNullAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_string.PutNull");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -51,13 +60,11 @@ namespace body_string
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/string/null", false);
|
||||
request.Headers.Add("Content-Type", "application/json");
|
||||
var buffer = new ArrayBufferWriter<byte>();
|
||||
await using var writer = new Utf8JsonWriter(buffer);
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
writer.WriteStringValue("");
|
||||
writer.Flush();
|
||||
request.Content = RequestContent.Create(buffer.WrittenMemory);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -68,6 +75,11 @@ namespace body_string
|
|||
}
|
||||
public static async ValueTask<Response<string>> GetEmptyAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_string.GetEmpty");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -77,7 +89,6 @@ namespace body_string
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/string/empty", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
|
@ -95,6 +106,11 @@ namespace body_string
|
|||
}
|
||||
public static async ValueTask<Response> PutEmptyAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_string.PutEmpty");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -104,13 +120,11 @@ namespace body_string
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/string/empty", false);
|
||||
request.Headers.Add("Content-Type", "application/json");
|
||||
var buffer = new ArrayBufferWriter<byte>();
|
||||
await using var writer = new Utf8JsonWriter(buffer);
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
writer.WriteStringValue("");
|
||||
writer.Flush();
|
||||
request.Content = RequestContent.Create(buffer.WrittenMemory);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -121,6 +135,11 @@ namespace body_string
|
|||
}
|
||||
public static async ValueTask<Response<string>> GetMbcsAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_string.GetMbcs");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -130,7 +149,6 @@ namespace body_string
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/string/mbcs", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
|
@ -148,6 +166,11 @@ namespace body_string
|
|||
}
|
||||
public static async ValueTask<Response> PutMbcsAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_string.PutMbcs");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -157,13 +180,11 @@ namespace body_string
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/string/mbcs", false);
|
||||
request.Headers.Add("Content-Type", "application/json");
|
||||
var buffer = new ArrayBufferWriter<byte>();
|
||||
await using var writer = new Utf8JsonWriter(buffer);
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
writer.WriteStringValue("啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€");
|
||||
writer.Flush();
|
||||
request.Content = RequestContent.Create(buffer.WrittenMemory);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -174,6 +195,11 @@ namespace body_string
|
|||
}
|
||||
public static async ValueTask<Response<string>> GetWhitespaceAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_string.GetWhitespace");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -183,7 +209,6 @@ namespace body_string
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/string/whitespace", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
|
@ -201,6 +226,11 @@ namespace body_string
|
|||
}
|
||||
public static async ValueTask<Response> PutWhitespaceAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_string.PutWhitespace");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -210,13 +240,11 @@ namespace body_string
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/string/whitespace", false);
|
||||
request.Headers.Add("Content-Type", "application/json");
|
||||
var buffer = new ArrayBufferWriter<byte>();
|
||||
await using var writer = new Utf8JsonWriter(buffer);
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
writer.WriteStringValue(" Now is the time for all good men to come to the aid of their country ");
|
||||
writer.Flush();
|
||||
request.Content = RequestContent.Create(buffer.WrittenMemory);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -227,6 +255,11 @@ namespace body_string
|
|||
}
|
||||
public static async ValueTask<Response<string>> GetNotProvidedAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_string.GetNotProvided");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -236,7 +269,6 @@ namespace body_string
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/string/notProvided", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
|
@ -254,6 +286,11 @@ namespace body_string
|
|||
}
|
||||
public static async ValueTask<Response<Byte[]>> GetBase64EncodedAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_string.GetBase64Encoded");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -263,7 +300,6 @@ namespace body_string
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/string/base64Encoding", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
|
@ -281,6 +317,11 @@ namespace body_string
|
|||
}
|
||||
public static async ValueTask<Response<Byte[]>> GetBase64UrlEncodedAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_string.GetBase64UrlEncoded");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -290,7 +331,6 @@ namespace body_string
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/string/base64UrlEncoding", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
|
@ -308,6 +348,15 @@ namespace body_string
|
|||
}
|
||||
public static async ValueTask<Response> PutBase64UrlEncodedAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Byte[] stringBody, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (stringBody == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(stringBody));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_string.PutBase64UrlEncoded");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -317,13 +366,11 @@ namespace body_string
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/string/base64UrlEncoding", false);
|
||||
request.Headers.Add("Content-Type", "application/json");
|
||||
var buffer = new ArrayBufferWriter<byte>();
|
||||
await using var writer = new Utf8JsonWriter(buffer);
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
writer.WriteBase64StringValue(stringBody);
|
||||
writer.Flush();
|
||||
request.Content = RequestContent.Create(buffer.WrittenMemory);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -334,6 +381,11 @@ namespace body_string
|
|||
}
|
||||
public static async ValueTask<Response<Byte[]>> GetNullBase64UrlEncodedAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("body_string.GetNullBase64UrlEncoded");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -343,7 +395,6 @@ namespace body_string
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/string/nullBase64UrlEncoding", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
|
|
|
@ -14,6 +14,27 @@ namespace custom_baseUrl_more_options
|
|||
{
|
||||
public static async ValueTask<Response> GetEmptyAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string vault, string secret, string keyName, string subscriptionId, string? keyVersion, string dnsSuffix = "host", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (vault == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(vault));
|
||||
}
|
||||
if (secret == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(secret));
|
||||
}
|
||||
if (dnsSuffix == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(dnsSuffix));
|
||||
}
|
||||
if (keyName == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(keyName));
|
||||
}
|
||||
if (subscriptionId == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(subscriptionId));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("custom_baseUrl_more_options.GetEmpty");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -30,7 +51,6 @@ namespace custom_baseUrl_more_options
|
|||
request.Uri.AppendQuery("keyVersion", keyVersion, true);
|
||||
}
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
|
|
@ -14,6 +14,15 @@ namespace custom_baseUrl
|
|||
{
|
||||
public static async ValueTask<Response> GetEmptyAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string accountName, string host = "host", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (accountName == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(accountName));
|
||||
}
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("custom_baseUrl.GetEmpty");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -23,7 +32,6 @@ namespace custom_baseUrl
|
|||
request.Uri.Reset(new Uri($"http://{accountName}{host}"));
|
||||
request.Uri.AppendPath("/customuri", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
|
|
@ -0,0 +1,45 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace extensible_enums_swagger.Models.V20160707
|
||||
{
|
||||
public readonly partial struct DaysOfWeekExtensibleEnum : IEquatable<DaysOfWeekExtensibleEnum>
|
||||
{
|
||||
private readonly string? _value;
|
||||
|
||||
public DaysOfWeekExtensibleEnum(string value)
|
||||
{
|
||||
_value = value ?? throw new ArgumentNullException(nameof(value));
|
||||
}
|
||||
|
||||
private const string MondayValue = "Monday";
|
||||
private const string TuesdayValue = "Tuesday";
|
||||
private const string WednesdayValue = "Wednesday";
|
||||
private const string ThursdayValue = "Thursday";
|
||||
private const string FridayValue = "Friday";
|
||||
private const string SaturdayValue = "Saturday";
|
||||
private const string SundayValue = "Sunday";
|
||||
|
||||
public static DaysOfWeekExtensibleEnum Monday { get; } = new DaysOfWeekExtensibleEnum(MondayValue);
|
||||
public static DaysOfWeekExtensibleEnum Tuesday { get; } = new DaysOfWeekExtensibleEnum(TuesdayValue);
|
||||
public static DaysOfWeekExtensibleEnum Wednesday { get; } = new DaysOfWeekExtensibleEnum(WednesdayValue);
|
||||
public static DaysOfWeekExtensibleEnum Thursday { get; } = new DaysOfWeekExtensibleEnum(ThursdayValue);
|
||||
public static DaysOfWeekExtensibleEnum Friday { get; } = new DaysOfWeekExtensibleEnum(FridayValue);
|
||||
public static DaysOfWeekExtensibleEnum Saturday { get; } = new DaysOfWeekExtensibleEnum(SaturdayValue);
|
||||
public static DaysOfWeekExtensibleEnum Sunday { get; } = new DaysOfWeekExtensibleEnum(SundayValue);
|
||||
public static bool operator ==(DaysOfWeekExtensibleEnum left, DaysOfWeekExtensibleEnum right) => left.Equals(right);
|
||||
public static bool operator !=(DaysOfWeekExtensibleEnum left, DaysOfWeekExtensibleEnum right) => !left.Equals(right);
|
||||
public static implicit operator DaysOfWeekExtensibleEnum(string value) => new DaysOfWeekExtensibleEnum(value);
|
||||
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public override bool Equals(object? obj) => obj is DaysOfWeekExtensibleEnum other && Equals(other);
|
||||
public bool Equals(DaysOfWeekExtensibleEnum other) => string.Equals(_value, other._value, StringComparison.Ordinal);
|
||||
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public override int GetHashCode() => _value?.GetHashCode() ?? 0;
|
||||
public override string? ToString() => _value;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace extensible_enums_swagger.Models.V20160707
|
||||
{
|
||||
public readonly partial struct IntEnum : IEquatable<IntEnum>
|
||||
{
|
||||
private readonly string? _value;
|
||||
|
||||
public IntEnum(string value)
|
||||
{
|
||||
_value = value ?? throw new ArgumentNullException(nameof(value));
|
||||
}
|
||||
|
||||
private const string _1Value = "1";
|
||||
private const string _2Value = "2";
|
||||
private const string _3Value = "3";
|
||||
|
||||
public static IntEnum _1 { get; } = new IntEnum(_1Value);
|
||||
public static IntEnum _2 { get; } = new IntEnum(_2Value);
|
||||
public static IntEnum _3 { get; } = new IntEnum(_3Value);
|
||||
public static bool operator ==(IntEnum left, IntEnum right) => left.Equals(right);
|
||||
public static bool operator !=(IntEnum left, IntEnum right) => !left.Equals(right);
|
||||
public static implicit operator IntEnum(string value) => new IntEnum(value);
|
||||
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public override bool Equals(object? obj) => obj is IntEnum other && Equals(other);
|
||||
public bool Equals(IntEnum other) => string.Equals(_value, other._value, StringComparison.Ordinal);
|
||||
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public override int GetHashCode() => _value?.GetHashCode() ?? 0;
|
||||
public override string? ToString() => _value;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
using System.Text.Json;
|
||||
|
||||
namespace extensible_enums_swagger.Models.V20160707
|
||||
{
|
||||
public partial class Pet
|
||||
{
|
||||
internal void Serialize(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
if (Name != null)
|
||||
{
|
||||
writer.WritePropertyName("name");
|
||||
writer.WriteStringValue(Name);
|
||||
}
|
||||
if (DaysOfWeek != null)
|
||||
{
|
||||
writer.WritePropertyName("DaysOfWeek");
|
||||
writer.WriteStringValue(DaysOfWeek.ToString());
|
||||
}
|
||||
writer.WritePropertyName("IntEnum");
|
||||
writer.WriteStringValue(IntEnum.ToString());
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static Pet Deserialize(JsonElement element)
|
||||
{
|
||||
var result = new Pet();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
{
|
||||
if (property.NameEquals("name"))
|
||||
{
|
||||
result.Name = property.Value.GetString();
|
||||
continue;
|
||||
}
|
||||
if (property.NameEquals("DaysOfWeek"))
|
||||
{
|
||||
result.DaysOfWeek = new DaysOfWeekExtensibleEnum(property.Value.GetString());
|
||||
continue;
|
||||
}
|
||||
if (property.NameEquals("IntEnum"))
|
||||
{
|
||||
result.IntEnum = new IntEnum(property.Value.GetString());
|
||||
continue;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
namespace extensible_enums_swagger.Models.V20160707
|
||||
{
|
||||
public partial class Pet
|
||||
{
|
||||
public string? Name { get; set; }
|
||||
public DaysOfWeekExtensibleEnum? DaysOfWeek { get; set; }
|
||||
public IntEnum IntEnum { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,90 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
using System;
|
||||
using System.Text.Json;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Azure;
|
||||
using Azure.Core;
|
||||
using Azure.Core.Pipeline;
|
||||
using extensible_enums_swagger.Models.V20160707;
|
||||
|
||||
namespace extensible_enums_swagger
|
||||
{
|
||||
internal static class PetOperations
|
||||
{
|
||||
public static async ValueTask<Response<Pet>> GetByPetIdAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string petId, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (petId == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(petId));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("extensible_enums_swagger.GetByPetId");
|
||||
scope.Start();
|
||||
try
|
||||
{
|
||||
var request = pipeline.CreateRequest();
|
||||
request.Method = RequestMethod.Get;
|
||||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/extensibleenums/pet/", false);
|
||||
request.Uri.AppendPath(petId, true);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
case 200:
|
||||
return Response.FromValue(Pet.Deserialize(document.RootElement), response);
|
||||
default:
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
scope.Failed(e);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static async ValueTask<Response<Pet>> AddPetAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Pet? petParam, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("extensible_enums_swagger.AddPet");
|
||||
scope.Start();
|
||||
try
|
||||
{
|
||||
var request = pipeline.CreateRequest();
|
||||
request.Method = RequestMethod.Post;
|
||||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/extensibleenums/pet/addPet", false);
|
||||
request.Headers.Add("Content-Type", "application/json");
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
petParam?.Serialize(writer);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
{
|
||||
case 200:
|
||||
return Response.FromValue(Pet.Deserialize(document.RootElement), response);
|
||||
default:
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
scope.Failed(e);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
<Nullable>annotations</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Azure.Core" Version="1.0.0" />
|
||||
<PackageReference Include="System.Text.Json" Version="4.6.0" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
@ -15,6 +15,15 @@ namespace header
|
|||
{
|
||||
public static async ValueTask<Response> ParamExistingKeyAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string userAgent, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (userAgent == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(userAgent));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("header.ParamExistingKey");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -25,7 +34,6 @@ namespace header
|
|||
request.Uri.AppendPath("/header/param/existingkey", false);
|
||||
request.Headers.Add("User-Agent", userAgent);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -36,6 +44,11 @@ namespace header
|
|||
}
|
||||
public static async ValueTask<Response> ResponseExistingKeyAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("header.ResponseExistingKey");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -45,7 +58,6 @@ namespace header
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/header/response/existingkey", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -56,6 +68,15 @@ namespace header
|
|||
}
|
||||
public static async ValueTask<Response> ParamProtectedKeyAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string contentType, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (contentType == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(contentType));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("header.ParamProtectedKey");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -66,7 +87,6 @@ namespace header
|
|||
request.Uri.AppendPath("/header/param/protectedkey", false);
|
||||
request.Headers.Add("Content-Type", contentType);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -77,6 +97,11 @@ namespace header
|
|||
}
|
||||
public static async ValueTask<Response> ResponseProtectedKeyAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("header.ResponseProtectedKey");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -86,7 +111,6 @@ namespace header
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/header/response/protectedkey", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -97,6 +121,15 @@ namespace header
|
|||
}
|
||||
public static async ValueTask<Response> ParamIntegerAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string scenario, int value, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (scenario == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(scenario));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("header.ParamInteger");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -108,7 +141,6 @@ namespace header
|
|||
request.Headers.Add("scenario", scenario);
|
||||
request.Headers.Add("value", value);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -119,6 +151,15 @@ namespace header
|
|||
}
|
||||
public static async ValueTask<Response> ResponseIntegerAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string scenario, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (scenario == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(scenario));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("header.ResponseInteger");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -129,7 +170,6 @@ namespace header
|
|||
request.Uri.AppendPath("/header/response/prim/integer", false);
|
||||
request.Headers.Add("scenario", scenario);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -140,6 +180,15 @@ namespace header
|
|||
}
|
||||
public static async ValueTask<Response> ParamLongAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string scenario, long value, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (scenario == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(scenario));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("header.ParamLong");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -151,7 +200,6 @@ namespace header
|
|||
request.Headers.Add("scenario", scenario);
|
||||
request.Headers.Add("value", value);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -162,6 +210,15 @@ namespace header
|
|||
}
|
||||
public static async ValueTask<Response> ResponseLongAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string scenario, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (scenario == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(scenario));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("header.ResponseLong");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -172,7 +229,6 @@ namespace header
|
|||
request.Uri.AppendPath("/header/response/prim/long", false);
|
||||
request.Headers.Add("scenario", scenario);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -183,6 +239,15 @@ namespace header
|
|||
}
|
||||
public static async ValueTask<Response> ParamFloatAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string scenario, float value, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (scenario == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(scenario));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("header.ParamFloat");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -194,7 +259,6 @@ namespace header
|
|||
request.Headers.Add("scenario", scenario);
|
||||
request.Headers.Add("value", value);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -205,6 +269,15 @@ namespace header
|
|||
}
|
||||
public static async ValueTask<Response> ResponseFloatAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string scenario, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (scenario == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(scenario));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("header.ResponseFloat");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -215,7 +288,6 @@ namespace header
|
|||
request.Uri.AppendPath("/header/response/prim/float", false);
|
||||
request.Headers.Add("scenario", scenario);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -226,6 +298,15 @@ namespace header
|
|||
}
|
||||
public static async ValueTask<Response> ParamDoubleAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string scenario, double value, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (scenario == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(scenario));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("header.ParamDouble");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -237,7 +318,6 @@ namespace header
|
|||
request.Headers.Add("scenario", scenario);
|
||||
request.Headers.Add("value", value);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -248,6 +328,15 @@ namespace header
|
|||
}
|
||||
public static async ValueTask<Response> ResponseDoubleAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string scenario, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (scenario == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(scenario));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("header.ResponseDouble");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -258,7 +347,6 @@ namespace header
|
|||
request.Uri.AppendPath("/header/response/prim/double", false);
|
||||
request.Headers.Add("scenario", scenario);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -269,6 +357,15 @@ namespace header
|
|||
}
|
||||
public static async ValueTask<Response> ParamBoolAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string scenario, bool value, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (scenario == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(scenario));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("header.ParamBool");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -280,7 +377,6 @@ namespace header
|
|||
request.Headers.Add("scenario", scenario);
|
||||
request.Headers.Add("value", value);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -291,6 +387,15 @@ namespace header
|
|||
}
|
||||
public static async ValueTask<Response> ResponseBoolAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string scenario, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (scenario == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(scenario));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("header.ResponseBool");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -301,7 +406,6 @@ namespace header
|
|||
request.Uri.AppendPath("/header/response/prim/bool", false);
|
||||
request.Headers.Add("scenario", scenario);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -312,6 +416,15 @@ namespace header
|
|||
}
|
||||
public static async ValueTask<Response> ParamStringAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string scenario, string? value, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (scenario == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(scenario));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("header.ParamString");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -326,7 +439,6 @@ namespace header
|
|||
request.Headers.Add("value", value);
|
||||
}
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -337,6 +449,15 @@ namespace header
|
|||
}
|
||||
public static async ValueTask<Response> ResponseStringAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string scenario, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (scenario == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(scenario));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("header.ResponseString");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -347,7 +468,6 @@ namespace header
|
|||
request.Uri.AppendPath("/header/response/prim/string", false);
|
||||
request.Headers.Add("scenario", scenario);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -358,6 +478,15 @@ namespace header
|
|||
}
|
||||
public static async ValueTask<Response> ParamDateAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string scenario, DateTimeOffset value, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (scenario == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(scenario));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("header.ParamDate");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -369,7 +498,6 @@ namespace header
|
|||
request.Headers.Add("scenario", scenario);
|
||||
request.Headers.Add("value", value, "D");
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -380,6 +508,15 @@ namespace header
|
|||
}
|
||||
public static async ValueTask<Response> ResponseDateAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string scenario, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (scenario == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(scenario));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("header.ResponseDate");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -390,7 +527,6 @@ namespace header
|
|||
request.Uri.AppendPath("/header/response/prim/date", false);
|
||||
request.Headers.Add("scenario", scenario);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -401,6 +537,15 @@ namespace header
|
|||
}
|
||||
public static async ValueTask<Response> ParamDatetimeAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string scenario, DateTimeOffset value, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (scenario == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(scenario));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("header.ParamDatetime");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -412,7 +557,6 @@ namespace header
|
|||
request.Headers.Add("scenario", scenario);
|
||||
request.Headers.Add("value", value, "S");
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -423,6 +567,15 @@ namespace header
|
|||
}
|
||||
public static async ValueTask<Response> ResponseDatetimeAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string scenario, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (scenario == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(scenario));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("header.ResponseDatetime");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -433,7 +586,6 @@ namespace header
|
|||
request.Uri.AppendPath("/header/response/prim/datetime", false);
|
||||
request.Headers.Add("scenario", scenario);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -444,6 +596,15 @@ namespace header
|
|||
}
|
||||
public static async ValueTask<Response> ParamDatetimeRfc1123Async(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string scenario, DateTimeOffset? value, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (scenario == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(scenario));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("header.ParamDatetimeRfc1123");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -458,7 +619,6 @@ namespace header
|
|||
request.Headers.Add("value", value.Value, "R");
|
||||
}
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -469,6 +629,15 @@ namespace header
|
|||
}
|
||||
public static async ValueTask<Response> ResponseDatetimeRfc1123Async(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string scenario, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (scenario == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(scenario));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("header.ResponseDatetimeRfc1123");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -479,7 +648,6 @@ namespace header
|
|||
request.Uri.AppendPath("/header/response/prim/datetimerfc1123", false);
|
||||
request.Headers.Add("scenario", scenario);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -490,6 +658,15 @@ namespace header
|
|||
}
|
||||
public static async ValueTask<Response> ParamDurationAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string scenario, TimeSpan value, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (scenario == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(scenario));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("header.ParamDuration");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -501,7 +678,6 @@ namespace header
|
|||
request.Headers.Add("scenario", scenario);
|
||||
request.Headers.Add("value", value);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -512,6 +688,15 @@ namespace header
|
|||
}
|
||||
public static async ValueTask<Response> ResponseDurationAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string scenario, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (scenario == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(scenario));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("header.ResponseDuration");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -522,7 +707,6 @@ namespace header
|
|||
request.Uri.AppendPath("/header/response/prim/duration", false);
|
||||
request.Headers.Add("scenario", scenario);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -533,6 +717,19 @@ namespace header
|
|||
}
|
||||
public static async ValueTask<Response> ParamByteAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string scenario, Byte[] value, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (scenario == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(scenario));
|
||||
}
|
||||
if (value == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(value));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("header.ParamByte");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -544,7 +741,6 @@ namespace header
|
|||
request.Headers.Add("scenario", scenario);
|
||||
request.Headers.Add("value", value);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -555,6 +751,15 @@ namespace header
|
|||
}
|
||||
public static async ValueTask<Response> ResponseByteAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string scenario, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (scenario == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(scenario));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("header.ResponseByte");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -565,7 +770,6 @@ namespace header
|
|||
request.Uri.AppendPath("/header/response/prim/byte", false);
|
||||
request.Headers.Add("scenario", scenario);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -576,6 +780,15 @@ namespace header
|
|||
}
|
||||
public static async ValueTask<Response> ParamEnumAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string scenario, GreyscaleColors? value, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (scenario == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(scenario));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("header.ParamEnum");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -590,7 +803,6 @@ namespace header
|
|||
request.Headers.Add("value", value.Value);
|
||||
}
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -601,6 +813,15 @@ namespace header
|
|||
}
|
||||
public static async ValueTask<Response> ResponseEnumAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string scenario, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (scenario == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(scenario));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("header.ResponseEnum");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -611,7 +832,6 @@ namespace header
|
|||
request.Uri.AppendPath("/header/response/prim/enum", false);
|
||||
request.Headers.Add("scenario", scenario);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -622,6 +842,11 @@ namespace header
|
|||
}
|
||||
public static async ValueTask<Response> CustomRequestIdAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("header.CustomRequestId");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -631,7 +856,6 @@ namespace header
|
|||
request.Uri.Reset(new Uri($"{host}"));
|
||||
request.Uri.AppendPath("/header/custom/x-ms-client-request-id/9C4D50EE-2D56-4CD3-8152-34347DC9F2B0", false);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
|
|
@ -15,6 +15,11 @@ namespace url_multi_collectionFormat
|
|||
{
|
||||
public static async ValueTask<Response> ArrayStringMultiNullAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, IEnumerable<string> arrayQuery, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url_multi_collectionFormat.ArrayStringMultiNull");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -28,7 +33,6 @@ namespace url_multi_collectionFormat
|
|||
request.Uri.AppendQueryDelimited("arrayQuery", arrayQuery, ",", true);
|
||||
}
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -39,6 +43,11 @@ namespace url_multi_collectionFormat
|
|||
}
|
||||
public static async ValueTask<Response> ArrayStringMultiEmptyAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, IEnumerable<string> arrayQuery, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url_multi_collectionFormat.ArrayStringMultiEmpty");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -52,7 +61,6 @@ namespace url_multi_collectionFormat
|
|||
request.Uri.AppendQueryDelimited("arrayQuery", arrayQuery, ",", true);
|
||||
}
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -63,6 +71,11 @@ namespace url_multi_collectionFormat
|
|||
}
|
||||
public static async ValueTask<Response> ArrayStringMultiValidAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, IEnumerable<string> arrayQuery, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url_multi_collectionFormat.ArrayStringMultiValid");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -76,7 +89,6 @@ namespace url_multi_collectionFormat
|
|||
request.Uri.AppendQueryDelimited("arrayQuery", arrayQuery, ",", true);
|
||||
}
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
|
|
@ -14,6 +14,23 @@ namespace url
|
|||
{
|
||||
public static async ValueTask<Response> GetAllWithValuesAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string pathItemStringPath, string? pathItemStringQuery, string globalStringPath, string? globalStringQuery, string localStringPath, string? localStringQuery, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (pathItemStringPath == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(pathItemStringPath));
|
||||
}
|
||||
if (globalStringPath == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(globalStringPath));
|
||||
}
|
||||
if (localStringPath == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(localStringPath));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.GetAllWithValues");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -41,7 +58,6 @@ namespace url
|
|||
request.Uri.AppendQuery("localStringQuery", localStringQuery, true);
|
||||
}
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -52,6 +68,23 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> GetGlobalQueryNullAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string pathItemStringPath, string? pathItemStringQuery, string globalStringPath, string? globalStringQuery, string localStringPath, string? localStringQuery, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (pathItemStringPath == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(pathItemStringPath));
|
||||
}
|
||||
if (globalStringPath == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(globalStringPath));
|
||||
}
|
||||
if (localStringPath == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(localStringPath));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.GetGlobalQueryNull");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -79,7 +112,6 @@ namespace url
|
|||
request.Uri.AppendQuery("localStringQuery", localStringQuery, true);
|
||||
}
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -90,6 +122,23 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> GetGlobalAndLocalQueryNullAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string pathItemStringPath, string? pathItemStringQuery, string globalStringPath, string? globalStringQuery, string localStringPath, string? localStringQuery, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (pathItemStringPath == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(pathItemStringPath));
|
||||
}
|
||||
if (globalStringPath == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(globalStringPath));
|
||||
}
|
||||
if (localStringPath == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(localStringPath));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.GetGlobalAndLocalQueryNull");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -117,7 +166,6 @@ namespace url
|
|||
request.Uri.AppendQuery("localStringQuery", localStringQuery, true);
|
||||
}
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -128,6 +176,23 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> GetLocalPathItemQueryNullAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string pathItemStringPath, string? pathItemStringQuery, string globalStringPath, string? globalStringQuery, string localStringPath, string? localStringQuery, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (pathItemStringPath == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(pathItemStringPath));
|
||||
}
|
||||
if (globalStringPath == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(globalStringPath));
|
||||
}
|
||||
if (localStringPath == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(localStringPath));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.GetLocalPathItemQueryNull");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -155,7 +220,6 @@ namespace url
|
|||
request.Uri.AppendQuery("localStringQuery", localStringQuery, true);
|
||||
}
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
|
|
@ -16,6 +16,11 @@ namespace url
|
|||
{
|
||||
public static async ValueTask<Response> GetBooleanTrueAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.GetBooleanTrue");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -26,7 +31,6 @@ namespace url
|
|||
request.Uri.AppendPath("/paths/bool/true/", false);
|
||||
request.Uri.AppendPath(true, true);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -37,6 +41,11 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> GetBooleanFalseAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.GetBooleanFalse");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -47,7 +56,6 @@ namespace url
|
|||
request.Uri.AppendPath("/paths/bool/false/", false);
|
||||
request.Uri.AppendPath(false, true);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -58,6 +66,11 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> GetIntOneMillionAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.GetIntOneMillion");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -68,7 +81,6 @@ namespace url
|
|||
request.Uri.AppendPath("/paths/int/1000000/", false);
|
||||
request.Uri.AppendPath(1000000F, true);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -79,6 +91,11 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> GetIntNegativeOneMillionAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.GetIntNegativeOneMillion");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -89,7 +106,6 @@ namespace url
|
|||
request.Uri.AppendPath("/paths/int/-1000000/", false);
|
||||
request.Uri.AppendPath(-1000000F, true);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -100,6 +116,11 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> GetTenBillionAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.GetTenBillion");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -110,7 +131,6 @@ namespace url
|
|||
request.Uri.AppendPath("/paths/long/10000000000/", false);
|
||||
request.Uri.AppendPath(1E+10F, true);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -121,6 +141,11 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> GetNegativeTenBillionAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.GetNegativeTenBillion");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -131,7 +156,6 @@ namespace url
|
|||
request.Uri.AppendPath("/paths/long/-10000000000/", false);
|
||||
request.Uri.AppendPath(-1E+10F, true);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -142,6 +166,11 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> FloatScientificPositiveAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.FloatScientificPositive");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -152,7 +181,6 @@ namespace url
|
|||
request.Uri.AppendPath("/paths/float/1.034E+20/", false);
|
||||
request.Uri.AppendPath(1.034E+20F, true);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -163,6 +191,11 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> FloatScientificNegativeAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.FloatScientificNegative");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -173,7 +206,6 @@ namespace url
|
|||
request.Uri.AppendPath("/paths/float/-1.034E-20/", false);
|
||||
request.Uri.AppendPath(-1.034E-20F, true);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -184,6 +216,11 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> DoubleDecimalPositiveAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.DoubleDecimalPositive");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -194,7 +231,6 @@ namespace url
|
|||
request.Uri.AppendPath("/paths/double/9999999.999/", false);
|
||||
request.Uri.AppendPath(9999999.999, true);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -205,6 +241,11 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> DoubleDecimalNegativeAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.DoubleDecimalNegative");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -215,7 +256,6 @@ namespace url
|
|||
request.Uri.AppendPath("/paths/double/-9999999.999/", false);
|
||||
request.Uri.AppendPath(-9999999.999, true);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -226,6 +266,11 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> StringUnicodeAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.StringUnicode");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -236,7 +281,6 @@ namespace url
|
|||
request.Uri.AppendPath("/paths/string/unicode/", false);
|
||||
request.Uri.AppendPath("啊齄丂狛狜隣郎隣兀﨩", true);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -247,6 +291,11 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> StringUrlEncodedAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.StringUrlEncoded");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -257,7 +306,6 @@ namespace url
|
|||
request.Uri.AppendPath("/paths/string/begin%21%2A%27%28%29%3B%3A%40%20%26%3D%2B%24%2C%2F%3F%23%5B%5Dend/", false);
|
||||
request.Uri.AppendPath("begin!*'();:@ &=+$,/?#[]end", true);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -268,6 +316,11 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> StringEmptyAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.StringEmpty");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -278,7 +331,6 @@ namespace url
|
|||
request.Uri.AppendPath("/paths/string/empty/", false);
|
||||
request.Uri.AppendPath("", true);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -289,6 +341,15 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> StringNullAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string stringPath, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (stringPath == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(stringPath));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.StringNull");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -299,7 +360,6 @@ namespace url
|
|||
request.Uri.AppendPath("/paths/string/null/", false);
|
||||
request.Uri.AppendPath(stringPath, true);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -310,6 +370,11 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> EnumValidAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, UriColor enumPath, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.EnumValid");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -320,7 +385,6 @@ namespace url
|
|||
request.Uri.AppendPath("/paths/enum/green%20color/", false);
|
||||
request.Uri.AppendPath(enumPath, true);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -331,6 +395,11 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> EnumNullAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, UriColor enumPath, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.EnumNull");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -341,7 +410,6 @@ namespace url
|
|||
request.Uri.AppendPath("/paths/string/null/", false);
|
||||
request.Uri.AppendPath(enumPath, true);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -352,6 +420,15 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> ByteMultiByteAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Byte[] bytePath, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (bytePath == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(bytePath));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.ByteMultiByte");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -362,7 +439,6 @@ namespace url
|
|||
request.Uri.AppendPath("/paths/byte/multibyte/", false);
|
||||
request.Uri.AppendPath(bytePath, true);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -373,6 +449,11 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> ByteEmptyAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.ByteEmpty");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -383,7 +464,6 @@ namespace url
|
|||
request.Uri.AppendPath("/paths/byte/empty/", false);
|
||||
request.Uri.AppendPath(new byte[] { }, true);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -394,6 +474,15 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> ByteNullAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Byte[] bytePath, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (bytePath == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(bytePath));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.ByteNull");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -404,7 +493,6 @@ namespace url
|
|||
request.Uri.AppendPath("/paths/byte/null/", false);
|
||||
request.Uri.AppendPath(bytePath, true);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -415,6 +503,11 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> DateValidAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.DateValid");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -425,7 +518,6 @@ namespace url
|
|||
request.Uri.AppendPath("/paths/date/2012-01-01/", false);
|
||||
request.Uri.AppendPath(new DateTimeOffset(2012, 1, 1, 0, 0, 0, 0, TimeSpan.Zero), "D", true);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -436,6 +528,11 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> DateNullAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, DateTimeOffset datePath, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.DateNull");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -446,7 +543,6 @@ namespace url
|
|||
request.Uri.AppendPath("/paths/date/null/", false);
|
||||
request.Uri.AppendPath(datePath, "D", true);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -457,6 +553,11 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> DateTimeValidAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.DateTimeValid");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -467,7 +568,6 @@ namespace url
|
|||
request.Uri.AppendPath("/paths/datetime/2012-01-01T01%3A01%3A01Z/", false);
|
||||
request.Uri.AppendPath(new DateTimeOffset(2012, 1, 1, 1, 1, 1, 0, TimeSpan.Zero), "S", true);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -478,6 +578,11 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> DateTimeNullAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, DateTimeOffset dateTimePath, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.DateTimeNull");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -488,7 +593,6 @@ namespace url
|
|||
request.Uri.AppendPath("/paths/datetime/null/", false);
|
||||
request.Uri.AppendPath(dateTimePath, "S", true);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -499,6 +603,15 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> Base64UrlAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Byte[] base64UrlPath, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (base64UrlPath == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(base64UrlPath));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.Base64Url");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -509,7 +622,6 @@ namespace url
|
|||
request.Uri.AppendPath("/paths/string/bG9yZW0/", false);
|
||||
request.Uri.AppendPath(base64UrlPath, true);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -520,6 +632,15 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> ArrayCsvInPathAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, IEnumerable<string> arrayPath, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
if (arrayPath == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(arrayPath));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.ArrayCsvInPath");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -530,7 +651,6 @@ namespace url
|
|||
request.Uri.AppendPath("/paths/array/ArrayPath1%2cbegin%21%2A%27%28%29%3B%3A%40%20%26%3D%2B%24%2C%2F%3F%23%5B%5Dend%2c%2c/", false);
|
||||
request.Uri.AppendPath(arrayPath, true);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -541,6 +661,11 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> UnixTimeUrlAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, DateTimeOffset unixTimeUrlPath, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.UnixTimeUrl");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -551,7 +676,6 @@ namespace url
|
|||
request.Uri.AppendPath("/paths/int/1460505600/", false);
|
||||
request.Uri.AppendPath(unixTimeUrlPath, "U", true);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
|
|
@ -16,6 +16,11 @@ namespace url
|
|||
{
|
||||
public static async ValueTask<Response> GetBooleanTrueAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.GetBooleanTrue");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -26,7 +31,6 @@ namespace url
|
|||
request.Uri.AppendPath("/queries/bool/true", false);
|
||||
request.Uri.AppendQuery("boolQuery", true, true);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -37,6 +41,11 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> GetBooleanFalseAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.GetBooleanFalse");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -47,7 +56,6 @@ namespace url
|
|||
request.Uri.AppendPath("/queries/bool/false", false);
|
||||
request.Uri.AppendQuery("boolQuery", false, true);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -58,6 +66,11 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> GetBooleanNullAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, bool? boolQuery, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.GetBooleanNull");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -71,7 +84,6 @@ namespace url
|
|||
request.Uri.AppendQuery("boolQuery", boolQuery.Value, true);
|
||||
}
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -82,6 +94,11 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> GetIntOneMillionAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.GetIntOneMillion");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -92,7 +109,6 @@ namespace url
|
|||
request.Uri.AppendPath("/queries/int/1000000", false);
|
||||
request.Uri.AppendQuery("intQuery", 1000000F, true);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -103,6 +119,11 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> GetIntNegativeOneMillionAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.GetIntNegativeOneMillion");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -113,7 +134,6 @@ namespace url
|
|||
request.Uri.AppendPath("/queries/int/-1000000", false);
|
||||
request.Uri.AppendQuery("intQuery", -1000000F, true);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -124,6 +144,11 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> GetIntNullAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, int? intQuery, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.GetIntNull");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -137,7 +162,6 @@ namespace url
|
|||
request.Uri.AppendQuery("intQuery", intQuery.Value, true);
|
||||
}
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -148,6 +172,11 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> GetTenBillionAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.GetTenBillion");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -158,7 +187,6 @@ namespace url
|
|||
request.Uri.AppendPath("/queries/long/10000000000", false);
|
||||
request.Uri.AppendQuery("longQuery", 1E+10F, true);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -169,6 +197,11 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> GetNegativeTenBillionAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.GetNegativeTenBillion");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -179,7 +212,6 @@ namespace url
|
|||
request.Uri.AppendPath("/queries/long/-10000000000", false);
|
||||
request.Uri.AppendQuery("longQuery", -1E+10F, true);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -190,6 +222,11 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> GetLongNullAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, long? longQuery, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.GetLongNull");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -203,7 +240,6 @@ namespace url
|
|||
request.Uri.AppendQuery("longQuery", longQuery.Value, true);
|
||||
}
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -214,6 +250,11 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> FloatScientificPositiveAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.FloatScientificPositive");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -224,7 +265,6 @@ namespace url
|
|||
request.Uri.AppendPath("/queries/float/1.034E+20", false);
|
||||
request.Uri.AppendQuery("floatQuery", 1.034E+20F, true);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -235,6 +275,11 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> FloatScientificNegativeAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.FloatScientificNegative");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -245,7 +290,6 @@ namespace url
|
|||
request.Uri.AppendPath("/queries/float/-1.034E-20", false);
|
||||
request.Uri.AppendQuery("floatQuery", -1.034E-20F, true);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -256,6 +300,11 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> FloatNullAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, float? floatQuery, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.FloatNull");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -269,7 +318,6 @@ namespace url
|
|||
request.Uri.AppendQuery("floatQuery", floatQuery.Value, true);
|
||||
}
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -280,6 +328,11 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> DoubleDecimalPositiveAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.DoubleDecimalPositive");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -290,7 +343,6 @@ namespace url
|
|||
request.Uri.AppendPath("/queries/double/9999999.999", false);
|
||||
request.Uri.AppendQuery("doubleQuery", 9999999.999, true);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -301,6 +353,11 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> DoubleDecimalNegativeAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.DoubleDecimalNegative");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -311,7 +368,6 @@ namespace url
|
|||
request.Uri.AppendPath("/queries/double/-9999999.999", false);
|
||||
request.Uri.AppendQuery("doubleQuery", -9999999.999, true);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -322,6 +378,11 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> DoubleNullAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, double? doubleQuery, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.DoubleNull");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -335,7 +396,6 @@ namespace url
|
|||
request.Uri.AppendQuery("doubleQuery", doubleQuery.Value, true);
|
||||
}
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -346,6 +406,11 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> StringUnicodeAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.StringUnicode");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -356,7 +421,6 @@ namespace url
|
|||
request.Uri.AppendPath("/queries/string/unicode/", false);
|
||||
request.Uri.AppendQuery("stringQuery", "啊齄丂狛狜隣郎隣兀﨩", true);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -367,6 +431,11 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> StringUrlEncodedAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.StringUrlEncoded");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -377,7 +446,6 @@ namespace url
|
|||
request.Uri.AppendPath("/queries/string/begin%21%2A%27%28%29%3B%3A%40%20%26%3D%2B%24%2C%2F%3F%23%5B%5Dend", false);
|
||||
request.Uri.AppendQuery("stringQuery", "begin!*'();:@ &=+$,/?#[]end", true);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -388,6 +456,11 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> StringEmptyAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.StringEmpty");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -398,7 +471,6 @@ namespace url
|
|||
request.Uri.AppendPath("/queries/string/empty", false);
|
||||
request.Uri.AppendQuery("stringQuery", "", true);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -409,6 +481,11 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> StringNullAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string? stringQuery, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.StringNull");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -422,7 +499,6 @@ namespace url
|
|||
request.Uri.AppendQuery("stringQuery", stringQuery, true);
|
||||
}
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -433,6 +509,11 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> EnumValidAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, UriColor? enumQuery, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.EnumValid");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -446,7 +527,6 @@ namespace url
|
|||
request.Uri.AppendQuery("enumQuery", enumQuery.Value, true);
|
||||
}
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -457,6 +537,11 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> EnumNullAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, UriColor? enumQuery, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.EnumNull");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -470,7 +555,6 @@ namespace url
|
|||
request.Uri.AppendQuery("enumQuery", enumQuery.Value, true);
|
||||
}
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -481,6 +565,11 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> ByteMultiByteAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Byte[]? byteQuery, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.ByteMultiByte");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -494,7 +583,6 @@ namespace url
|
|||
request.Uri.AppendQuery("byteQuery", byteQuery, true);
|
||||
}
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -505,6 +593,11 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> ByteEmptyAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.ByteEmpty");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -515,7 +608,6 @@ namespace url
|
|||
request.Uri.AppendPath("/queries/byte/empty", false);
|
||||
request.Uri.AppendQuery("byteQuery", new byte[] { }, true);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -526,6 +618,11 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> ByteNullAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Byte[]? byteQuery, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.ByteNull");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -539,7 +636,6 @@ namespace url
|
|||
request.Uri.AppendQuery("byteQuery", byteQuery, true);
|
||||
}
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -550,6 +646,11 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> DateValidAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.DateValid");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -560,7 +661,6 @@ namespace url
|
|||
request.Uri.AppendPath("/queries/date/2012-01-01", false);
|
||||
request.Uri.AppendQuery("dateQuery", new DateTimeOffset(2012, 1, 1, 0, 0, 0, 0, TimeSpan.Zero), "D", true);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -571,6 +671,11 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> DateNullAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, DateTimeOffset? dateQuery, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.DateNull");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -584,7 +689,6 @@ namespace url
|
|||
request.Uri.AppendQuery("dateQuery", dateQuery.Value, "D", true);
|
||||
}
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -595,6 +699,11 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> DateTimeValidAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.DateTimeValid");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -605,7 +714,6 @@ namespace url
|
|||
request.Uri.AppendPath("/queries/datetime/2012-01-01T01%3A01%3A01Z", false);
|
||||
request.Uri.AppendQuery("dateTimeQuery", new DateTimeOffset(2012, 1, 1, 1, 1, 1, 0, TimeSpan.Zero), "S", true);
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -616,6 +724,11 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> DateTimeNullAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, DateTimeOffset? dateTimeQuery, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.DateTimeNull");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -629,7 +742,6 @@ namespace url
|
|||
request.Uri.AppendQuery("dateTimeQuery", dateTimeQuery.Value, "S", true);
|
||||
}
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -640,6 +752,11 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> ArrayStringCsvValidAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, IEnumerable<string> arrayQuery, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.ArrayStringCsvValid");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -653,7 +770,6 @@ namespace url
|
|||
request.Uri.AppendQueryDelimited("arrayQuery", arrayQuery, ",", true);
|
||||
}
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -664,6 +780,11 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> ArrayStringCsvNullAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, IEnumerable<string> arrayQuery, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.ArrayStringCsvNull");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -677,7 +798,6 @@ namespace url
|
|||
request.Uri.AppendQueryDelimited("arrayQuery", arrayQuery, ",", true);
|
||||
}
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -688,6 +808,11 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> ArrayStringCsvEmptyAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, IEnumerable<string> arrayQuery, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.ArrayStringCsvEmpty");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -701,7 +826,6 @@ namespace url
|
|||
request.Uri.AppendQueryDelimited("arrayQuery", arrayQuery, ",", true);
|
||||
}
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -712,6 +836,11 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> ArrayStringSsvValidAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, IEnumerable<string> arrayQuery, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.ArrayStringSsvValid");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -725,7 +854,6 @@ namespace url
|
|||
request.Uri.AppendQueryDelimited("arrayQuery", arrayQuery, " ", true);
|
||||
}
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -736,6 +864,11 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> ArrayStringTsvValidAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, IEnumerable<string> arrayQuery, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.ArrayStringTsvValid");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -749,7 +882,6 @@ namespace url
|
|||
request.Uri.AppendQueryDelimited("arrayQuery", arrayQuery, "\t", true);
|
||||
}
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -760,6 +892,11 @@ namespace url
|
|||
}
|
||||
public static async ValueTask<Response> ArrayStringPipesValidAsync(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, IEnumerable<string> arrayQuery, string host = "http://localhost:3000", CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (host == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
using var scope = clientDiagnostics.CreateScope("url.ArrayStringPipesValid");
|
||||
scope.Start();
|
||||
try
|
||||
|
@ -773,7 +910,6 @@ namespace url
|
|||
request.Uri.AppendQueryDelimited("arrayQuery", arrayQuery, "|", true);
|
||||
}
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return response;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
|
Загрузка…
Ссылка в новой задаче