diff --git a/.editorconfig b/.editorconfig index 45d8b2d5..11b7aff2 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,8 +1,8 @@ -# ATC coding rules - https://github.com/atc-net/atc-coding-rules -# Version: 1.0.9 -# Updated: 01-02-2022 +# ATC coding rules - https://github.com/atc-net/atc-coding-rules +# Version: 1.0.1 +# Updated: 03-06-2024 # Location: Root -# Distribution: DotNet6 +# Distribution: DotNet8 # Inspired by: https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/code-style-rule-options ########################################## @@ -87,6 +87,7 @@ dotnet_separate_import_directive_groups = false # .NET Code Style Settings # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#net-code-style-settings [*.{cs,csx,cake}] + # "this." and "Me." qualifiers # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#this-and-me dotnet_style_qualification_for_field = false @@ -146,12 +147,17 @@ dotnet_style_operator_placement_when_wrapping = end_of_line # C# Code Style Settings # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#c-code-style-settings [*.{cs,csx,cake}] + # Implicit and explicit types # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#implicit-and-explicit-types csharp_style_var_for_built_in_types = true # IDE0007 and IDE0008 csharp_style_var_when_type_is_apparent = true # IDE0007 and IDE0008 csharp_style_var_elsewhere = true # IDE0007 and IDE0008 +# Namespace declaration preferences +# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0160-ide0161?view=vs-2022 +csharp_style_namespace_declarations = file_scoped # IDE0160 and IDE0161 + # Expression-bodied members # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#expression-bodied-members csharp_style_expression_bodied_constructors = when_on_single_line # IDE0021 @@ -195,8 +201,8 @@ csharp_style_unused_value_assignment_preference = discard_variable # Index and range preferences # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#index-and-range-preferences -csharp_style_prefer_index_operator = true # IDE0056 -csharp_style_prefer_range_operator = true # IDE0057 +csharp_style_prefer_index_operator = true:suggestion # IDE0056 +csharp_style_prefer_range_operator = true:suggestion # IDE0057 # Miscellaneous preferences # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#miscellaneous-preferences @@ -259,6 +265,7 @@ csharp_space_between_square_brackets = false # https://docs.microsoft.com/visualstudio/ide/editorconfig-formatting-conventions#wrap-options csharp_preserve_single_line_statements = false csharp_preserve_single_line_blocks = true +csharp_style_namespace_declarations = file_scoped:suggestion ########################################## # .NET Naming Conventions @@ -443,10 +450,12 @@ dotnet_naming_rule.parameters_rule.severity = warning dotnet_diagnostic.MA0003.severity = suggestion # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0003.md dotnet_diagnostic.MA0004.severity = suggestion # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0004.md dotnet_diagnostic.MA0006.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0006.md +dotnet_diagnostic.MA0011.severity = none # Duplicate of CA1305 dotnet_diagnostic.MA0016.severity = error # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0016.md dotnet_diagnostic.MA0025.severity = suggestion # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0025.md dotnet_diagnostic.MA0026.severity = suggestion # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0026.md dotnet_diagnostic.MA0028.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0028.md +dotnet_diagnostic.MA0038.severity = none # Duplicate of CA1822 dotnet_diagnostic.MA0048.severity = error # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0048.md @@ -454,8 +463,47 @@ dotnet_diagnostic.MA0048.severity = error # https://github.com/atc-net # https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ dotnet_diagnostic.CA1014.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA1014.md dotnet_diagnostic.CA1068.severity = error # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA1068.md +dotnet_diagnostic.CA1305.severity = error +dotnet_diagnostic.CA1510.severity = suggestion # Use ArgumentNullException throw helper +dotnet_diagnostic.CA1511.severity = suggestion # Use ArgumentException throw helper +dotnet_diagnostic.CA1512.severity = suggestion # Use ArgumentOutOfRangeException throw helper +dotnet_diagnostic.CA1513.severity = suggestion # Use ObjectDisposedException throw helper +dotnet_diagnostic.CA1514.severity = error # Avoid redundant length argument dotnet_diagnostic.CA1707.severity = error # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA1707.md +dotnet_diagnostic.CA1812.severity = none +dotnet_diagnostic.CA1822.severity = suggestion +dotnet_diagnostic.CA1849.severity = error # Call async methods when in an async method +dotnet_diagnostic.CA1854.severity = suggestion # Prefer the 'IDictionary.TryGetValue(TKey, out TValue)' method +dotnet_diagnostic.CA1855.severity = suggestion # Prefer 'Clear' over 'Fill' +dotnet_diagnostic.CA1856.severity = error # Incorrect usage of ConstantExpected attribute +dotnet_diagnostic.CA1857.severity = suggestion # A constant is expected for the parameter +dotnet_diagnostic.CA1858.severity = suggestion # Use 'StartsWith' instead of 'IndexOf' +dotnet_diagnostic.CA1859.severity = suggestion # Use concrete types when possible for improved performance +dotnet_diagnostic.CA1860.severity = suggestion # Avoid using 'Enumerable.Any()' extension method +dotnet_diagnostic.CA1861.severity = suggestion # Avoid constant arrays as arguments +dotnet_diagnostic.CA1862.severity = error # Use the 'StringComparison' method overloads to perform case-insensitive string comparisons +dotnet_diagnostic.CA1863.severity = suggestion # Use 'CompositeFormat' +dotnet_diagnostic.CA1864.severity = suggestion # Prefer the 'IDictionary.TryAdd(TKey, TValue)' method +dotnet_diagnostic.CA1865.severity = suggestion # Use char overload +dotnet_diagnostic.CA1866.severity = suggestion # Use char overload +dotnet_diagnostic.CA1867.severity = suggestion # Use char overload +dotnet_diagnostic.CA1868.severity = suggestion # Unnecessary call to 'Contains(item)' +dotnet_diagnostic.CA1869.severity = suggestion # Cache and reuse 'JsonSerializerOptions' instances +dotnet_diagnostic.CA1870.severity = suggestion # Use a cached 'SearchValues' instance dotnet_diagnostic.CA2007.severity = suggestion # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA2007.md +dotnet_diagnostic.CA2017.severity = error # Parameter count mismatch +dotnet_diagnostic.CA2018.severity = error # The count argument to Buffer.BlockCopy should specify the number of bytes to copy +dotnet_diagnostic.CA2019.severity = error # ThreadStatic fields should not use inline initialization +dotnet_diagnostic.CA2021.severity = error # Don't call Enumerable.Cast or Enumerable.OfType with incompatible types +dotnet_diagnostic.CA2250.severity = suggestion # Use ThrowIfCancellationRequested +dotnet_diagnostic.CA2252.severity = suggestion # Opt-in to preview features should be used with caution +dotnet_diagnostic.CA2253.severity = error # Named placeholders should not be numeric values +dotnet_diagnostic.CA2254.severity = suggestion # Template should be a static expression +dotnet_diagnostic.CA2255.severity = suggestion # The ModuleInitializer attribute should not be used in libraries +dotnet_diagnostic.CA2259.severity = error # Ensure ThreadStatic is only used with static fields +dotnet_diagnostic.CA2260.severity = error # Implement generic math interfaces correctly +dotnet_diagnostic.CA2261.severity = error # Do not use ConfigureAwaitOptions.SuppressThrowing with Task +dotnet_diagnostic.IDE0005.severity = warning # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/IDE0005.md dotnet_diagnostic.IDE0058.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/IDE0058.md @@ -480,6 +528,7 @@ dotnet_diagnostic.SA1202.severity = none # https://github.com/atc-net dotnet_diagnostic.SA1204.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1204.md dotnet_diagnostic.SA1413.severity = error # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1413.md dotnet_diagnostic.SA1600.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1600.md +dotnet_diagnostic.SA1601.severity = none dotnet_diagnostic.SA1602.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1602.md dotnet_diagnostic.SA1604.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1604.md dotnet_diagnostic.SA1623.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1623.md @@ -491,6 +540,10 @@ dotnet_diagnostic.SA1649.severity = error # https://github.com/atc-net # SonarAnalyzer.CSharp # https://rules.sonarsource.com/csharp dotnet_diagnostic.S1135.severity = suggestion # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/SonarAnalyzerCSharp/S1135.md +dotnet_diagnostic.S2629.severity = none # Don't use string interpolation in logging message templates. +dotnet_diagnostic.S6602.severity = none # "Find" method should be used instead of the "FirstOrDefault" +dotnet_diagnostic.S6603.severity = none # The collection-specific "TrueForAll" method should be used instead of the "All" +dotnet_diagnostic.S6605.severity = none # Collection-specific "Exists" method should be used instead of the "Any" ########################################## @@ -514,7 +567,23 @@ dotnet_diagnostic.CA1848.severity = suggestion # Use the LoggerMessage delegate dotnet_diagnostic.CA2254.severity = suggestion # Template should be a static expression - https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2254 dotnet_diagnostic.S1172.severity = none # False positive +dotnet_diagnostic.S2629.Severity = none dotnet_diagnostic.S3267.severity = none # Loop should be simplified by calling Select(x => x.Value)) - We dont like this rule because of readability/maintainability +dotnet_diagnostic.S3878.Severity = none +dotnet_diagnostic.S6605.Severity = none +dotnet_diagnostic.S6608.Severity = none # Indexing at Count-1 should be used instead of the "Enumerable" extension method "Last" +dotnet_diagnostic.S6667.Severity = none +dotnet_diagnostic.SA1010.severity = none # Opening square brackets should not be preceded by a space dotnet_diagnostic.SA1118.Severity = none # Parameter spans multiple lines -dotnet_diagnostic.SA1414.Severity = none # Tuple types in signatures should have element names \ No newline at end of file +dotnet_diagnostic.SA1414.Severity = none # Tuple types in signatures should have element names + +dotnet_diagnostic.CS1591.Severity = none +dotnet_diagnostic.CA1822.Severity = none +dotnet_diagnostic.CA1859.Severity = none +dotnet_diagnostic.CA1860.Severity = none +dotnet_diagnostic.CA1861.Severity = none +dotnet_diagnostic.S125.Severity = none +dotnet_diagnostic.S1481.Severity = none +dotnet_diagnostic.SA1512.Severity = none +dotnet_diagnostic.SA1513.Severity = none \ No newline at end of file diff --git a/.github/workflows/post-integration.yml b/.github/workflows/post-integration.yml index 71eabee9..3da1ce8d 100644 --- a/.github/workflows/post-integration.yml +++ b/.github/workflows/post-integration.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - name: 🛒 Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 token: ${{ secrets.PAT_WORKFLOWS }} @@ -30,10 +30,10 @@ jobs: with: setAllVars: true - - name: ⚙️ Setup dotnet 6.0.x - uses: actions/setup-dotnet@v1 + - name: ⚙️ Setup dotnet 8.0.x + uses: actions/setup-dotnet@v4 with: - dotnet-version: '6.0.x' + dotnet-version: '8.0.x' - name: ⚙️ Set up JDK 17 uses: actions/setup-java@v3 @@ -51,7 +51,7 @@ jobs: run: dotnet build -c Release --no-restore /p:UseSourceLink=true - name: 🧪 Run unit tests - run: dotnet test -c Release --no-build + run: dotnet test -c Release --no-build --filter "Category!=Integration" - name: 🌩️ SonarCloud install scanner run: dotnet tool install --global dotnet-sonarscanner @@ -62,9 +62,9 @@ jobs: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} shell: pwsh run: | - dotnet sonarscanner begin /k:"atc-rest-api-generator" /o:"atc-net" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" + dotnet sonarscanner begin /k:"atc-rest-api-generator" /o:"atc-net" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" dotnet build -c Release /p:UseSourceLink=true --no-restore - dotnet sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}" + dotnet sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}" - name: ⏩ Merge to stable-branch run: | diff --git a/.github/workflows/pre-integration.yml b/.github/workflows/pre-integration.yml index 56f9a296..ec0d911b 100644 --- a/.github/workflows/pre-integration.yml +++ b/.github/workflows/pre-integration.yml @@ -16,14 +16,14 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: 🛒 Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 - - name: ⚙️ Setup dotnet 6.0.x - uses: actions/setup-dotnet@v1 + - name: ⚙️ Setup dotnet 8.0.x + uses: actions/setup-dotnet@v4 with: - dotnet-version: '6.0.x' + dotnet-version: '8.0.x' - name: 📐 Ensure nuget.org added as package source on Windows if: matrix.os == 'windows-latest' @@ -42,14 +42,14 @@ jobs: - dotnet-build steps: - name: 🛒 Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 - - name: ⚙️ Setup dotnet 6.0.x - uses: actions/setup-dotnet@v1 + - name: ⚙️ Setup dotnet 8.0.x + uses: actions/setup-dotnet@v4 with: - dotnet-version: '6.0.x' + dotnet-version: '8.0.x' - name: 🔁 Restore packages run: dotnet restore @@ -58,7 +58,7 @@ jobs: run: dotnet build -c Release --no-restore /p:UseSourceLink=true - name: 🧪 Run unit tests - run: dotnet test -c Release --no-build + run: dotnet test -c Release --no-build --filter "Category!=Integration" smoke-tests: strategy: @@ -70,14 +70,14 @@ jobs: - dotnet-test steps: - name: 🛒 Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 - - name: ⚙️ Setup dotnet 6.0.x - uses: actions/setup-dotnet@v1 + - name: ⚙️ Setup dotnet 8.0.x + uses: actions/setup-dotnet@v4 with: - dotnet-version: '6.0.x' + dotnet-version: '8.0.x' - name: 📐 Ensure nuget.org added as package source on Windows if: matrix.os == 'windows-latest' @@ -94,7 +94,7 @@ jobs: run: curl -O https://petstore3.swagger.io/api/v3/openapi.yaml - name: ⚙️ Generate Code - run: dotnet run -- generate server all -p "Swagger Petstore" -s ../../openapi.yaml --outputSlnPath ../../petstore3/ --outputSrcPath ../../petstore3/src --outputTestPath ../../petstore3/test --optionsPath ../../sample/Demo.ApiDesign/ApiGeneratorOptions.json --disableCodingRules -v + run: dotnet run -- generate server all -p "Swagger Petstore" -s ../../openapi.yaml --outputSlnPath ../../petstore3/ --outputSrcPath ../../petstore3/src --outputTestPath ../../petstore3/test --optionsPath ../../ApiGeneratorOptions.json --disableCodingRules --verbose working-directory: src/Atc.Rest.ApiGenerator.CLI - name: 🛠️ Build Generated Code diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 992c88be..5043ea7e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - name: 🛒 Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 token: ${{ secrets.PAT_WORKFLOWS }} @@ -27,10 +27,10 @@ jobs: with: setAllVars: true - - name: ⚙️ Setup dotnet 6.0.x - uses: actions/setup-dotnet@v1 + - name: ⚙️ Setup dotnet 8.0.x + uses: actions/setup-dotnet@v4 with: - dotnet-version: '6.0.x' + dotnet-version: '8.0.x' - name: 🧹 Clean run: dotnet clean -c Release && dotnet nuget locals all --clear diff --git a/ApiGeneratorOptions.json b/ApiGeneratorOptions.json new file mode 100644 index 00000000..6e5affbe --- /dev/null +++ b/ApiGeneratorOptions.json @@ -0,0 +1,20 @@ +{ + "generator": { + "aspNetOutputType": "Mvc", + "swaggerThemeMode": "None", + "useRestExtended": true, + "includeDeprecated": false, + "request": {}, + "response": { + "useProblemDetailsAsDefaultBody": false + } + }, + "validation": { + "strictMode": false, + "operationIdValidation": false, + "operationIdCasingStyle": "CamelCase", + "modelNameCasingStyle": "PascalCase", + "modelPropertyNameCasingStyle": "CamelCase" + }, + "includeDeprecated": false +} \ No newline at end of file diff --git a/Atc.Rest.Api.Generator.sln b/Atc.Rest.Api.Generator.sln index d1950fff..1ce1b35d 100644 --- a/Atc.Rest.Api.Generator.sln +++ b/Atc.Rest.Api.Generator.sln @@ -14,38 +14,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Docs", "Docs", "{1575FE97-3 README.md = README.md EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{02E0684C-13A4-4D2C-B6D3-379C52E724E7}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Demo.Api", "sample\src\Demo.Api\Demo.Api.csproj", "{B63975D1-8BD6-4436-8B73-460407AC807B}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Demo.Api.Full", "sample\src\Demo.Api.Full\Demo.Api.Full.csproj", "{DF929E2C-7526-423B-891B-AB752E7A1635}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Demo.ApiDesign", "Demo.ApiDesign", "{7676D3AA-2882-4517-8E93-93E632C9EA80}" - ProjectSection(SolutionItems) = preProject - sample\Demo.ApiDesign\ApiGeneratorOptions.json = sample\Demo.ApiDesign\ApiGeneratorOptions.json - sample\Demo.ApiDesign\DelegateApiGeneratorOptions.json = sample\Demo.ApiDesign\DelegateApiGeneratorOptions.json - sample\Demo.ApiDesign\DemoApiGeneratorOptions.json = sample\Demo.ApiDesign\DemoApiGeneratorOptions.json - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SingleFileVersion", "SingleFileVersion", "{C27353DA-1802-4443-80EE-B838A29AC419}" - ProjectSection(SolutionItems) = preProject - sample\Demo.ApiDesign\SingleFileVersion\Api.v1.yaml = sample\Demo.ApiDesign\SingleFileVersion\Api.v1.yaml - EndProjectSection -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Demo.Api.Generated", "sample\src\Demo.Api.Generated\Demo.Api.Generated.csproj", "{94AEFFF3-7233-4ABD-9321-4786F7FA5631}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Demo.Domain", "sample\src\Demo.Domain\Demo.Domain.csproj", "{12635ED2-1D8E-4E7D-9640-9ED08E22251A}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Atc.Rest.ApiGenerator.CLI", "src\Atc.Rest.ApiGenerator.CLI\Atc.Rest.ApiGenerator.CLI.csproj", "{0F69048E-9C05-4BE1-9C73-F703B8ACC8C4}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Demo.Api.Tests", "sample\test\Demo.Api.Tests\Demo.Api.Tests.csproj", "{0D7D2065-7A83-4DAD-9DD8-D76FB7682DD7}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Demo.Domain.Tests", "sample\test\Demo.Domain.Tests\Demo.Domain.Tests.csproj", "{40B0B0D0-B8AD-486B-A75A-0DF7CFFDC4E8}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{C1130B67-DEF9-480F-BEBB-E32E5E490583}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{B52C07ED-0C3B-423F-9E56-4CEB91957381}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Atc.Rest.ApiGenerator.Framework.Mvc", "src\Atc.Rest.ApiGenerator.Framework.Mvc\Atc.Rest.ApiGenerator.Framework.Mvc.csproj", "{5416CB30-1728-43C9-A7DE-D3463E35866D}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Atc.Rest.ApiGenerator.Framework.Minimal", "src\Atc.Rest.ApiGenerator.Framework.Minimal\Atc.Rest.ApiGenerator.Framework.Minimal.csproj", "{E0B64023-B487-4B0E-9A2B-B9E28D1E7964}" @@ -54,7 +24,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Atc.Rest.ApiGenerator.Frame EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Atc.Rest.ApiGenerator.Framework.Mvc.Tests", "test\Atc.Rest.ApiGenerator.Framework.Mvc.Tests\Atc.Rest.ApiGenerator.Framework.Mvc.Tests.csproj", "{108216D7-4552-4397-AC5A-5C3346D65BFB}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Atc.Rest.ApiGenerator.Framework.Contracts", "src\Atc.Rest.ApiGenerator.Framework.Contracts\Atc.Rest.ApiGenerator.Framework.Contracts.csproj", "{DEA4D5EC-DD8A-48D6-B859-55D95F46CC06}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Atc.Rest.ApiGenerator.Contracts", "src\Atc.Rest.ApiGenerator.Contracts\Atc.Rest.ApiGenerator.Contracts.csproj", "{DEA4D5EC-DD8A-48D6-B859-55D95F46CC06}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Atc.Rest.ApiGenerator.OpenApi", "src\Atc.Rest.ApiGenerator.OpenApi\Atc.Rest.ApiGenerator.OpenApi.csproj", "{EE12FAB6-FEA2-4819-ABAF-B38319325F35}" EndProject @@ -68,16 +38,16 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Atc.CodeGeneration.CSharp.T EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Atc.Rest.ApiGenerator.Nuget", "src\Atc.Rest.ApiGenerator.Nuget\Atc.Rest.ApiGenerator.Nuget.csproj", "{8670E175-EB04-4FDC-9D04-8FB0839CCF49}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Atc.Rest.ApiGenerator.Projects", "src\Atc.Rest.ApiGenerator.Projects\Atc.Rest.ApiGenerator.Projects.csproj", "{189D4B2C-6BF9-48CE-8D80-ECD20D554EBB}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Atc.Rest.ApiGenerator.CodingRules", "src\Atc.Rest.ApiGenerator.CodingRules\Atc.Rest.ApiGenerator.CodingRules.csproj", "{6DE044E7-2804-48AD-8EF1-EC804A2C0395}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Atc.Rest.ApiGenerator.Nuget.Tests", "test\Atc.Rest.ApiGenerator.Nuget.Tests\Atc.Rest.ApiGenerator.Nuget.Tests.csproj", "{3F33D1B3-7AD9-44A3-B5F4-048BED3913C8}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Atc.Rest.ApiGenerator.Framework.Contracts.Tests", "test\Atc.Rest.ApiGenerator.Framework.Contracts.Tests\Atc.Rest.ApiGenerator.Framework.Contracts.Tests.csproj", "{8FF7EF9D-DDBB-4D25-B3A5-5E0D11462545}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Atc.Rest.ApiGenerator.Contracts.Tests", "test\Atc.Rest.ApiGenerator.Contracts.Tests\Atc.Rest.ApiGenerator.Contracts.Tests.csproj", "{8FF7EF9D-DDBB-4D25-B3A5-5E0D11462545}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Atc.Rest.ApiGenerator.CLI.Tests", "test\Atc.Rest.ApiGenerator.CLI.Tests\Atc.Rest.ApiGenerator.CLI.Tests.csproj", "{D75819AA-3092-43F6-80D2-1BF2FCAA92EE}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Atc.Rest.ApiGenerator.Client.CSharp", "src\Atc.Rest.ApiGenerator.Client.CSharp\Atc.Rest.ApiGenerator.Client.CSharp.csproj", "{6BACA326-54B0-4832-B16E-1419083EECFD}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -88,34 +58,10 @@ Global {91EBC1B7-0F17-4E4E-96AF-A9D5445344AB}.Debug|Any CPU.Build.0 = Debug|Any CPU {91EBC1B7-0F17-4E4E-96AF-A9D5445344AB}.Release|Any CPU.ActiveCfg = Release|Any CPU {91EBC1B7-0F17-4E4E-96AF-A9D5445344AB}.Release|Any CPU.Build.0 = Release|Any CPU - {B63975D1-8BD6-4436-8B73-460407AC807B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B63975D1-8BD6-4436-8B73-460407AC807B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B63975D1-8BD6-4436-8B73-460407AC807B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B63975D1-8BD6-4436-8B73-460407AC807B}.Release|Any CPU.Build.0 = Release|Any CPU - {DF929E2C-7526-423B-891B-AB752E7A1635}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DF929E2C-7526-423B-891B-AB752E7A1635}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DF929E2C-7526-423B-891B-AB752E7A1635}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DF929E2C-7526-423B-891B-AB752E7A1635}.Release|Any CPU.Build.0 = Release|Any CPU - {94AEFFF3-7233-4ABD-9321-4786F7FA5631}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {94AEFFF3-7233-4ABD-9321-4786F7FA5631}.Debug|Any CPU.Build.0 = Debug|Any CPU - {94AEFFF3-7233-4ABD-9321-4786F7FA5631}.Release|Any CPU.ActiveCfg = Release|Any CPU - {94AEFFF3-7233-4ABD-9321-4786F7FA5631}.Release|Any CPU.Build.0 = Release|Any CPU - {12635ED2-1D8E-4E7D-9640-9ED08E22251A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {12635ED2-1D8E-4E7D-9640-9ED08E22251A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {12635ED2-1D8E-4E7D-9640-9ED08E22251A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {12635ED2-1D8E-4E7D-9640-9ED08E22251A}.Release|Any CPU.Build.0 = Release|Any CPU {0F69048E-9C05-4BE1-9C73-F703B8ACC8C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0F69048E-9C05-4BE1-9C73-F703B8ACC8C4}.Debug|Any CPU.Build.0 = Debug|Any CPU {0F69048E-9C05-4BE1-9C73-F703B8ACC8C4}.Release|Any CPU.ActiveCfg = Release|Any CPU {0F69048E-9C05-4BE1-9C73-F703B8ACC8C4}.Release|Any CPU.Build.0 = Release|Any CPU - {0D7D2065-7A83-4DAD-9DD8-D76FB7682DD7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0D7D2065-7A83-4DAD-9DD8-D76FB7682DD7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0D7D2065-7A83-4DAD-9DD8-D76FB7682DD7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0D7D2065-7A83-4DAD-9DD8-D76FB7682DD7}.Release|Any CPU.Build.0 = Release|Any CPU - {40B0B0D0-B8AD-486B-A75A-0DF7CFFDC4E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {40B0B0D0-B8AD-486B-A75A-0DF7CFFDC4E8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {40B0B0D0-B8AD-486B-A75A-0DF7CFFDC4E8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {40B0B0D0-B8AD-486B-A75A-0DF7CFFDC4E8}.Release|Any CPU.Build.0 = Release|Any CPU {5416CB30-1728-43C9-A7DE-D3463E35866D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {5416CB30-1728-43C9-A7DE-D3463E35866D}.Debug|Any CPU.Build.0 = Debug|Any CPU {5416CB30-1728-43C9-A7DE-D3463E35866D}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -160,10 +106,6 @@ Global {8670E175-EB04-4FDC-9D04-8FB0839CCF49}.Debug|Any CPU.Build.0 = Debug|Any CPU {8670E175-EB04-4FDC-9D04-8FB0839CCF49}.Release|Any CPU.ActiveCfg = Release|Any CPU {8670E175-EB04-4FDC-9D04-8FB0839CCF49}.Release|Any CPU.Build.0 = Release|Any CPU - {189D4B2C-6BF9-48CE-8D80-ECD20D554EBB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {189D4B2C-6BF9-48CE-8D80-ECD20D554EBB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {189D4B2C-6BF9-48CE-8D80-ECD20D554EBB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {189D4B2C-6BF9-48CE-8D80-ECD20D554EBB}.Release|Any CPU.Build.0 = Release|Any CPU {6DE044E7-2804-48AD-8EF1-EC804A2C0395}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {6DE044E7-2804-48AD-8EF1-EC804A2C0395}.Debug|Any CPU.Build.0 = Debug|Any CPU {6DE044E7-2804-48AD-8EF1-EC804A2C0395}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -180,23 +122,17 @@ Global {D75819AA-3092-43F6-80D2-1BF2FCAA92EE}.Debug|Any CPU.Build.0 = Debug|Any CPU {D75819AA-3092-43F6-80D2-1BF2FCAA92EE}.Release|Any CPU.ActiveCfg = Release|Any CPU {D75819AA-3092-43F6-80D2-1BF2FCAA92EE}.Release|Any CPU.Build.0 = Release|Any CPU + {6BACA326-54B0-4832-B16E-1419083EECFD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6BACA326-54B0-4832-B16E-1419083EECFD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6BACA326-54B0-4832-B16E-1419083EECFD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6BACA326-54B0-4832-B16E-1419083EECFD}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution {91EBC1B7-0F17-4E4E-96AF-A9D5445344AB} = {A4F3156B-9E74-4710-ADBC-4628DF389F68} - {B63975D1-8BD6-4436-8B73-460407AC807B} = {C1130B67-DEF9-480F-BEBB-E32E5E490583} - {DF929E2C-7526-423B-891B-AB752E7A1635} = {C1130B67-DEF9-480F-BEBB-E32E5E490583} - {7676D3AA-2882-4517-8E93-93E632C9EA80} = {02E0684C-13A4-4D2C-B6D3-379C52E724E7} - {C27353DA-1802-4443-80EE-B838A29AC419} = {7676D3AA-2882-4517-8E93-93E632C9EA80} - {94AEFFF3-7233-4ABD-9321-4786F7FA5631} = {C1130B67-DEF9-480F-BEBB-E32E5E490583} - {12635ED2-1D8E-4E7D-9640-9ED08E22251A} = {C1130B67-DEF9-480F-BEBB-E32E5E490583} {0F69048E-9C05-4BE1-9C73-F703B8ACC8C4} = {A4F3156B-9E74-4710-ADBC-4628DF389F68} - {0D7D2065-7A83-4DAD-9DD8-D76FB7682DD7} = {B52C07ED-0C3B-423F-9E56-4CEB91957381} - {40B0B0D0-B8AD-486B-A75A-0DF7CFFDC4E8} = {B52C07ED-0C3B-423F-9E56-4CEB91957381} - {C1130B67-DEF9-480F-BEBB-E32E5E490583} = {02E0684C-13A4-4D2C-B6D3-379C52E724E7} - {B52C07ED-0C3B-423F-9E56-4CEB91957381} = {02E0684C-13A4-4D2C-B6D3-379C52E724E7} {5416CB30-1728-43C9-A7DE-D3463E35866D} = {A4F3156B-9E74-4710-ADBC-4628DF389F68} {E0B64023-B487-4B0E-9A2B-B9E28D1E7964} = {A4F3156B-9E74-4710-ADBC-4628DF389F68} {2D69D9AA-19E2-469D-BCA4-ED972721E005} = {A4F3156B-9E74-4710-ADBC-4628DF389F68} @@ -208,11 +144,11 @@ Global {9A87BAA2-F521-45B1-AF93-9BC642FD8C76} = {A4F3156B-9E74-4710-ADBC-4628DF389F68} {F8F86538-AFA4-4CD9-9DF7-C870F85F4608} = {F39DCB66-0A9F-47BA-A916-301EC83F26EA} {8670E175-EB04-4FDC-9D04-8FB0839CCF49} = {A4F3156B-9E74-4710-ADBC-4628DF389F68} - {189D4B2C-6BF9-48CE-8D80-ECD20D554EBB} = {A4F3156B-9E74-4710-ADBC-4628DF389F68} {6DE044E7-2804-48AD-8EF1-EC804A2C0395} = {A4F3156B-9E74-4710-ADBC-4628DF389F68} {3F33D1B3-7AD9-44A3-B5F4-048BED3913C8} = {F39DCB66-0A9F-47BA-A916-301EC83F26EA} {8FF7EF9D-DDBB-4D25-B3A5-5E0D11462545} = {F39DCB66-0A9F-47BA-A916-301EC83F26EA} {D75819AA-3092-43F6-80D2-1BF2FCAA92EE} = {F39DCB66-0A9F-47BA-A916-301EC83F26EA} + {6BACA326-54B0-4832-B16E-1419083EECFD} = {A4F3156B-9E74-4710-ADBC-4628DF389F68} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {DFD408B5-CCB3-4B3A-9E3B-DC85C74256B1} diff --git a/Directory.Build.props b/Directory.Build.props index a094c40f..d0591b17 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -16,9 +16,9 @@ enable - 10.0 + 12.0 enable - net6.0 + net8.0 true 1573,1591,1712 @@ -43,10 +43,10 @@ - + - + \ No newline at end of file diff --git a/README.md b/README.md index f91a3ffe..8f6e6ca9 100644 --- a/README.md +++ b/README.md @@ -2,31 +2,79 @@ # ATC-NET REST API Generator -## Breaking changes - -![Breaking Changes](https://img.shields.io/static/v1?color=ff9900&style=for-the-badge&label=&message=Breaking%20changes%20From%20Version%201.x%20to%202.x) - -```powershell - * CLI package renamed from 'atc-api-gen' to 'atc-rest-api-generator' - * CLI tool renamed from 'atc-api' to 'atc-rest-api-generator' - * atc-rest-api-generator validate schema command - setting --strictMode renamed to --validate-strictMode - setting --operationIdCasingStyle renamed to --validate-operationIdCasingStyle - setting --modelNameCasingStyle renamed to --validate-modelNameCasingStyle - setting --modelPropertyNameCasingStyle renamed to --validate-modelPropertyNameCasingStyle -* atc-rest-api-generator options-file validate command -* atc-rest-api-generator options-file create command - * Api-Options file - Generator->UseNullableReferenceTypes has been removed (default in c# 10) -* CLI command argument '--useAuthorization' has been deprecated, in favor of custom extension flags in API specification. See section below. '[Autuhorize]' attribute is now set by default on controller level. - ``` ## Projects in the repository |Project|Target Framework|Description|Nuget Download Link| |---|---|---|---| -|[Atc.Rest.ApiGenerator](src/Atc.Rest.ApiGenerator)|net6.0|Atc.Rest.ApiGenerator is a WebApi C# code generator using a OpenApi 3.0.x specification YAML file.|[![Nuget](https://img.shields.io/nuget/dt/Atc.Rest.ApiGenerator?logo=nuget&style=flat-square)](https://www.nuget.org/packages/Atc.Rest.ApiGenerator)| -|[Atc.Rest.ApiGenerator.CLI](src/Atc.Rest.ApiGenerator.CLI)|net6.0|A CLI tool that use Atc.Rest.ApiGenerator to create/update a project specified by a OpenApi 3.0.x specification YAML file.|[![Nuget](https://img.shields.io/nuget/dt/atc-rest-api-generator?logo=nuget&style=flat-square)](https://www.nuget.org/packages/atc-rest-api-generator)| +|[Atc.Rest.ApiGenerator](src/Atc.Rest.ApiGenerator) | net8.0 | Atc.Rest.ApiGenerator is a WebApi C# code generator using a OpenApi 3.0.x specification YAML file. | [![Nuget](https://img.shields.io/nuget/dt/Atc.Rest.ApiGenerator?logo=nuget&style=flat-square)](https://www.nuget.org/packages/Atc.Rest.ApiGenerator) | +|[Atc.Rest.ApiGenerator.CLI](src/Atc.Rest.ApiGenerator.CLI) |net8.0 | A CLI tool that use Atc.Rest.ApiGenerator to create/update a project specified by a OpenApi 3.0.x specification YAML file. | [![Nuget](https://img.shields.io/nuget/dt/atc-rest-api-generator?logo=nuget&style=flat-square)](https://www.nuget.org/packages/atc-rest-api-generator) | +|[Atc.Rest.ApiGenerator.CodingRules](src/Atc.Rest.ApiGenerator.CodingRules) | net8.0| Create/update atc coding rules for the generated code | +|[Atc.Rest.ApiGenerator.Contracts](src/Atc.Rest.ApiGenerator.Contracts) | net8.0| Shared contracts and interfaces for the generated code. | +|[Atc.Rest.ApiGenerator.Framework.Mvc](src/Atc.Rest.ApiGenerator.Framework.Mvc) | net8.0| Provides support for generating ASP.NET MVC / Controller based REST API server implementations. | +|[Atc.Rest.ApiGenerator.Framework.Minimal](src/Atc.Rest.ApiGenerator.Framework.Minimal) | net8.0| Provides support for generating MinimalAPI based REST server implementations. | +|[Atc.Rest.ApiGenerator.Client.CSharp](src/Atc.Rest.ApiGenerator.Client.CSharp) | net8.0| Generates C# client code for interacting with the generated REST APIs. | +|[Atc.Rest.ApiGenerator.Framework](src/Atc.Rest.ApiGenerator.Framework) | net8.0| Shared framework components and utilities for the API generator projects. | +|[Atc.Rest.ApiGenerator.OpenApi](src/Atc.Rest.ApiGenerator.OpenApi) | net8.0| Handles OpenAPI specification parsing and manipulation for the API generator. | +|[Atc.Rest.ApiGenerator.Nuget](src/Atc.Rest.ApiGenerator.Nuget) | net8.0| Manages NuGet packages required by the generated code and frameworks. | +|[Atc.CodeGeneration.CSharp](src/Atc.CodeGeneration.CSharp) | net8.0| Provides utilities and functionalities for generating C# code. | + + +## Project dependency graph + +```mermaid +flowchart TB; + CLI[Atc.Rest.ApiGenerator.CLI] + Contracts[Atc.Rest.ApiGenerator.Contracts]; + ApiGenerator[Atc.Rest.ApiGenerator]; + CodingRules[Atc.Rest.ApiGenerator.CodingRules] + ClientCSharp[Atc.Rest.ApiGenerator.Client.CSharp]; + ServerMvc[Atc.Rest.ApiGenerator.Framework.Mvc]; + ServerMinimal[Atc.Rest.ApiGenerator.Framework.Minimal]; + Framework[Atc.Rest.ApiGenerator.Framework]; + Nuget[Atc.Rest.ApiGenerator.Nuget]; + CSharpGenerator[Atc.CodeGeneration.CSharp]; + OpenApi[Atc.Rest.ApiGenerator.OpenApi]; + + style CLI fill:#007FFF; + style Contracts fill:#57A64A; + style ApiGenerator fill:#; + style CodingRules fill:#; + style ClientCSharp fill:#B35A2D; + style ServerMvc fill:#B35A2D; + style ServerMinimal fill:#B35A2D; + style Framework fill:#; + style Nuget fill:#; + style CSharpGenerator fill:#; + style OpenApi fill:#; + + CLI --> ApiGenerator; + CLI --> CodingRules; + + ApiGenerator --> ClientCSharp; + ApiGenerator --> ServerMvc; + ApiGenerator --> ServerMinimal; + ApiGenerator .-> Contracts; + + ClientCSharp --> Framework; + ClientCSharp .-> Contracts; + ClientCSharp .-> CSharpGenerator; + + ServerMvc --> Framework; + ServerMvc .-> Contracts; + ServerMvc .-> CSharpGenerator; + + ServerMinimal --> Framework; + ServerMinimal .-> Contracts; + ServerMinimal .-> CSharpGenerator; + + Framework --> Nuget; + Framework --> OpenApi; + Framework .-> Contracts; + Framework --> CSharpGenerator; + + OpenApi ..-> Contracts; +``` ## CLI Tool @@ -49,7 +97,7 @@ Recommended tools for working with OpenAPI specifications: ### Requirements -- [.NET 6 SDK](https://dotnet.microsoft.com/en-us/download/dotnet/6.0) +- [.NET 8 SDK](https://dotnet.microsoft.com/en-us/download/dotnet/8.0) ### Installation @@ -90,7 +138,7 @@ USAGE: OPTIONS: -h, --help Prints help information - -v, --verbose Use verbose for more debug/trace information + --verbose Use verbose for more debug/trace information --version Display version COMMANDS: @@ -114,7 +162,7 @@ EXAMPLES: OPTIONS: -h, --help Prints help information - -v, --verbose Use verbose for more debug/trace information + --verbose Use verbose for more debug/trace information -s, --specificationPath Path to Open API specification (directory, file or url) --optionsPath [OPTIONSPATH] Path to options json-file --validate-strictMode Use strictmode @@ -182,7 +230,7 @@ atc-rest-api-generator generate server all ` --outputSrcPath \src ` --outputTestPath \test ` --disableCodingRules ` - -v + --verbose ``` Replace `` with an absolute path where the projects should be created. For example, @@ -197,7 +245,7 @@ atc-rest-api-generator generate server all ` --outputSrcPath C:\PetStore\src ` --outputTestPath C:\PetStore\test ` --disableCodingRules ` - -v + --verbose ``` The following is generated by running the above command: @@ -284,23 +332,23 @@ Running the above command produces the following output: 🟢 root: atc-coding-rules-updater.json created 🟢 root: atc-coding-rules-updater.ps1 created 🐭 Working on EditorConfig files - Download from: [GitHub] /atc-net/atc-coding-rules/main/distribution/dotnet6/.editorconfig + Download from: [GitHub] /atc-net/atc-coding-rules/main/distribution/dotnet8/.editorconfig Download time: 27.947 ms 🟢 root: .editorconfig created - Download from: [GitHub] /atc-net/atc-coding-rules/main/distribution/dotnet6/src/.editorconfig + Download from: [GitHub] /atc-net/atc-coding-rules/main/distribution/dotnet8/src/.editorconfig Download time: 22.987 ms 🟢 src: .editorconfig created - Download from: [GitHub] /atc-net/atc-coding-rules/main/distribution/dotnet6/test/.editorconfig + Download from: [GitHub] /atc-net/atc-coding-rules/main/distribution/dotnet8/test/.editorconfig Download time: 24.465 ms 🟢 test: .editorconfig created 🔨 Working on Directory.Build.props files - Download from: [GitHub] /atc-net/atc-coding-rules/main/distribution/dotnet6/Directory.Build.props + Download from: [GitHub] /atc-net/atc-coding-rules/main/distribution/dotnet8/Directory.Build.props Download time: 20.880 ms 🟢 root: Directory.Build.props created - Download from: [GitHub] /atc-net/atc-coding-rules/main/distribution/dotnet6/src/Directory.Build.props + Download from: [GitHub] /atc-net/atc-coding-rules/main/distribution/dotnet8/src/Directory.Build.props Download time: 48.340 ms 🟢 src: Directory.Build.props created - Download from: [GitHub] /atc-net/atc-coding-rules/main/distribution/dotnet6/test/Directory.Build.props + Download from: [GitHub] /atc-net/atc-coding-rules/main/distribution/dotnet8/test/Directory.Build.props Download time: 29.480 ms 🟢 test: Directory.Build.props created ✅ Done diff --git a/atc-coding-rules-updater.json b/atc-coding-rules-updater.json index e1b6b5b6..780fd5c1 100644 --- a/atc-coding-rules-updater.json +++ b/atc-coding-rules-updater.json @@ -1,7 +1,25 @@ { - "projectTarget": "DotNet5", - "mappings": { - "src": { "paths": [ "src" ] }, - "test": { "paths": [ "test" ] } - } + "projectTarget": "DotNet8", + "useLatestMinorNugetVersion": true, + "useTemporarySuppressions": false, + "temporarySuppressionAsExcel": false, + "analyzerProviderCollectingMode": "LocalCache", + "mappings": { + "sample": { + "paths": [ + "sample-minimal", + "sample-mvc" + ] + }, + "src": { + "paths": [ + "src" + ] + }, + "test": { + "paths": [ + "test" + ] + } + } } \ No newline at end of file diff --git a/atc-coding-rules-updater.ps1 b/atc-coding-rules-updater.ps1 index d78144cc..3798ec8e 100644 --- a/atc-coding-rules-updater.ps1 +++ b/atc-coding-rules-updater.ps1 @@ -8,4 +8,4 @@ Write-Host "Running atc-coding-rules-updater to fetch updated rulesets and confi atc-coding-rules-updater run ` -p $currentPath ` --optionsPath $currentPath'\atc-coding-rules-updater.json' ` - -v \ No newline at end of file + --verbose \ No newline at end of file diff --git a/sample/.editorconfig b/sample/.editorconfig deleted file mode 100644 index d1c4838e..00000000 --- a/sample/.editorconfig +++ /dev/null @@ -1,518 +0,0 @@ -# ATC coding rules - https://github.com/atc-net/atc-coding-rules -# Version: 1.0.9 -# Updated: 01-02-2022 -# Location: Root -# Distribution: DotNet6 -# Inspired by: https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/code-style-rule-options - -########################################## -# Common Settings -########################################## - -# This file is the top-most EditorConfig file -root = true - -# All Files -[*] -charset = utf-8 -indent_style = space -indent_size = 4 -insert_final_newline = false -trim_trailing_whitespace = true - -########################################## -# File Extension Settings -########################################## - -# Visual Studio Solution Files -[*.sln] -indent_style = tab - -# Visual Studio XML Project Files -[*.{csproj,vcxproj.filters,proj,projitems,shproj}] -indent_size = 2 - -# XML Configuration Files -[*.{xml,config,props,targets,nuspec,resx,ruleset,vsixmanifest,vsct}] -indent_size = 2 - -# JSON Files -[*.{json,json5,webmanifest}] -indent_size = 2 - -# YAML Files -[*.{yml,yaml}] -indent_size = 2 - -# Markdown Files -[*.md] -trim_trailing_whitespace = false - -# Web Files -[*.{htm,html,js,jsm,ts,tsx,css,sass,scss,less,svg,vue}] -indent_size = 2 - -# Batch Files -[*.{cmd,bat}] -end_of_line = crlf - -# Bash Files -[*.sh] -end_of_line = lf -indent_size = 2 - -# Powershell -[*.ps1] -end_of_line = lf -indent_size = 2 - -# Makefiles -[Makefile] -indent_style = tab - -########################################## -# .NET Language Conventions -# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions -########################################## - -# Default Severity for .NET Code Style -# https://docs.microsoft.com/dotnet/fundamentals/code-analysis/configuration-options#scope -dotnet_analyzer_diagnostic.severity = error - -# Misc preferences -file_header_template = unset # IDE0073 -dotnet_sort_system_directives_first = true -dotnet_separate_import_directive_groups = false - -# .NET Code Style Settings -# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#net-code-style-settings -[*.{cs,csx,cake}] -# "this." and "Me." qualifiers -# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#this-and-me -dotnet_style_qualification_for_field = false -dotnet_style_qualification_for_property = false -dotnet_style_qualification_for_method = false -dotnet_style_qualification_for_event = false - -# Language keywords instead of framework type names for type references -# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#language-keywords -dotnet_style_predefined_type_for_locals_parameters_members = true # IDE0049 -dotnet_style_predefined_type_for_member_access = true # IDE0049 - -# Modifier preferences -# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#normalize-modifiers -dotnet_style_require_accessibility_modifiers = always # IDE0040 -csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async # IDE0036 -dotnet_style_readonly_field = true # IDE0044 - -# Parentheses preferences -# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#parentheses-preferences -dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity # IDE0047 and IDE0048 -dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity # IDE0047 and IDE0048 -dotnet_style_parentheses_in_other_binary_operators = always_for_clarity # IDE0047 and IDE0048 -dotnet_style_parentheses_in_other_operators = always_for_clarity # IDE0047 and IDE0048 - -# Expression-level preferences -# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#expression-level-preferences -dotnet_style_object_initializer = true # IDE0017 -dotnet_style_collection_initializer = true # IDE0028 -dotnet_style_explicit_tuple_names = true # IDE0033 -dotnet_style_prefer_inferred_tuple_names = true # IDE0037 -dotnet_style_prefer_inferred_anonymous_type_member_names = true # IDE0037 -dotnet_style_prefer_auto_properties = true # IDE0050 -dotnet_style_prefer_is_null_check_over_reference_equality_method = true # IDE0041 -dotnet_style_prefer_conditional_expression_over_assignment = true # IDE0045 -dotnet_style_prefer_conditional_expression_over_return = true # IDE0046 -dotnet_style_prefer_compound_assignment = true # IDE0054 and IDE0074 -dotnet_style_prefer_simplified_interpolation = true # IDE0071 -dotnet_style_prefer_simplified_boolean_expressions = true # IDE0075 - -# Null-checking preferences -# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#null-checking-preferences -dotnet_style_coalesce_expression = true # IDE0029 and IDE0030 -dotnet_style_null_propagation = true # IDE0031 - -# Parameter preferences -# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#parameter-preferences -dotnet_code_quality_unused_parameters = all # IDE0060 - -# Suppression preferences -dotnet_remove_unnecessary_suppression_exclusions = none # IDE0079 - -# More style options (Undocumented) -# https://github.com/MicrosoftDocs/visualstudio-docs/issues/3641 -dotnet_style_operator_placement_when_wrapping = end_of_line - -# C# Code Style Settings -# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#c-code-style-settings -[*.{cs,csx,cake}] -# Implicit and explicit types -# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#implicit-and-explicit-types -csharp_style_var_for_built_in_types = true # IDE0007 and IDE0008 -csharp_style_var_when_type_is_apparent = true # IDE0007 and IDE0008 -csharp_style_var_elsewhere = true # IDE0007 and IDE0008 - -# Expression-bodied members -# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#expression-bodied-members -csharp_style_expression_bodied_constructors = when_on_single_line # IDE0021 -csharp_style_expression_bodied_methods = true # IDE0022 -csharp_style_expression_bodied_operators = true # IDE0023 and IDE0024 -csharp_style_expression_bodied_properties = true # IDE0025 -csharp_style_expression_bodied_indexers = true # IDE0026 -csharp_style_expression_bodied_accessors = true # IDE0027 -csharp_style_expression_bodied_lambdas = true # IDE0053 -csharp_style_expression_bodied_local_functions = true # IDE0061 - -# Pattern matching -# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#pattern-matching -csharp_style_pattern_matching_over_as_with_null_check = true # IDE0019 -csharp_style_pattern_matching_over_is_with_cast_check = true # IDE0020 -csharp_style_prefer_switch_expression = true:suggestion # IDE0066 -csharp_style_prefer_pattern_matching = true:silent # IDE0078 -csharp_style_prefer_not_pattern = true:suggestion # IDE0083 - -# Inlined variable declarations -# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#inlined-variable-declarations -csharp_style_inlined_variable_declaration = true # IDE0018 - -# Expression-level preferences -# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#expression-level-preferences -csharp_prefer_simple_default_expression = true # IDE0034 - -# "Null" checking preferences -# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#c-null-checking-preferences -csharp_style_throw_expression = true # IDE0016 -csharp_style_conditional_delegate_call = true # IDE1005 - -# Code block preferences -# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#code-block-preferences -csharp_prefer_braces = true # IDE0011 - -# Unused value preferences -# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#unused-value-preferences -csharp_style_unused_value_expression_statement_preference = discard_variable # IDE0058 -csharp_style_unused_value_assignment_preference = discard_variable # IDE0059 - -# Index and range preferences -# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#index-and-range-preferences -csharp_style_prefer_index_operator = true # IDE0056 -csharp_style_prefer_range_operator = true # IDE0057 - -# Miscellaneous preferences -# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#miscellaneous-preferences -csharp_style_pattern_local_over_anonymous_function = true # IDE0039 -csharp_style_deconstructed_variable_declaration = true # IDE0042 -csharp_prefer_static_local_function = true # IDE0062 -csharp_prefer_simple_using_statement = true # IDE0063 -csharp_using_directive_placement = outside_namespace # IDE0065 - -########################################## -# .NET Formatting Conventions -# https://docs.microsoft.com/visualstudio/ide/editorconfig-code-style-settings-reference#formatting-conventions -########################################## - -# Newline options -# https://docs.microsoft.com/visualstudio/ide/editorconfig-formatting-conventions#new-line-options -csharp_new_line_before_open_brace = all -csharp_new_line_before_else = true -csharp_new_line_before_catch = true -csharp_new_line_before_finally = true -csharp_new_line_before_members_in_object_initializers = true -csharp_new_line_before_members_in_anonymous_types = true -csharp_new_line_between_query_expression_clauses = true - -# Indentation options -# https://docs.microsoft.com/visualstudio/ide/editorconfig-formatting-conventions#indentation-options -csharp_indent_case_contents = true -csharp_indent_switch_labels = true -csharp_indent_labels = no_change -csharp_indent_block_contents = true -csharp_indent_braces = false -csharp_indent_case_contents_when_block = false - -# Spacing options -# https://docs.microsoft.com/visualstudio/ide/editorconfig-formatting-conventions#spacing-options -csharp_space_after_cast = false -csharp_space_after_keywords_in_control_flow_statements = true -csharp_space_between_parentheses = false -csharp_space_before_colon_in_inheritance_clause = true -csharp_space_after_colon_in_inheritance_clause = true -csharp_space_around_binary_operators = before_and_after -csharp_space_between_method_declaration_parameter_list_parentheses = false -csharp_space_between_method_declaration_empty_parameter_list_parentheses = false -csharp_space_between_method_declaration_name_and_open_parenthesis = false -csharp_space_between_method_call_parameter_list_parentheses = false -csharp_space_between_method_call_empty_parameter_list_parentheses = false -csharp_space_between_method_call_name_and_opening_parenthesis = false -csharp_space_after_comma = true -csharp_space_before_comma = false -csharp_space_after_dot = false -csharp_space_before_dot = false -csharp_space_after_semicolon_in_for_statement = true -csharp_space_before_semicolon_in_for_statement = false -csharp_space_around_declaration_statements = false -csharp_space_before_open_square_brackets = false -csharp_space_between_empty_square_brackets = false -csharp_space_between_square_brackets = false - -# Wrapping options -# https://docs.microsoft.com/visualstudio/ide/editorconfig-formatting-conventions#wrap-options -csharp_preserve_single_line_statements = false -csharp_preserve_single_line_blocks = true -csharp_style_namespace_declarations = file_scoped:suggestion - -########################################## -# .NET Naming Conventions -# https://docs.microsoft.com/visualstudio/ide/editorconfig-naming-conventions -########################################## - -[*.{cs,csx,cake}] - -########################################## -# Styles -########################################## - -# camel_case_style - Define the camelCase style -dotnet_naming_style.camel_case_style.capitalization = camel_case -# pascal_case_style - Define the PascalCase style -dotnet_naming_style.pascal_case_style.capitalization = pascal_case -# first_upper_style - The first character must start with an upper-case character -dotnet_naming_style.first_upper_style.capitalization = first_word_upper -# prefix_interface_with_i_style - Interfaces must be PascalCase and the first character of an interface must be an 'I' -dotnet_naming_style.prefix_interface_with_i_style.capitalization = pascal_case -dotnet_naming_style.prefix_interface_with_i_style.required_prefix = I -# prefix_type_parameters_with_t_style - Generic Type Parameters must be PascalCase and the first character must be a 'T' -dotnet_naming_style.prefix_type_parameters_with_t_style.capitalization = pascal_case -dotnet_naming_style.prefix_type_parameters_with_t_style.required_prefix = T -# disallowed_style - Anything that has this style applied is marked as disallowed -dotnet_naming_style.disallowed_style.capitalization = pascal_case -dotnet_naming_style.disallowed_style.required_prefix = ____RULE_VIOLATION____ -dotnet_naming_style.disallowed_style.required_suffix = ____RULE_VIOLATION____ -# internal_error_style - This style should never occur... if it does, it indicates a bug in file or in the parser using the file -dotnet_naming_style.internal_error_style.capitalization = pascal_case -dotnet_naming_style.internal_error_style.required_prefix = ____INTERNAL_ERROR____ -dotnet_naming_style.internal_error_style.required_suffix = ____INTERNAL_ERROR____ - -########################################## -# .NET Design Guideline Field Naming Rules -# Naming rules for fields follow the .NET Framework design guidelines -# https://docs.microsoft.com/dotnet/standard/design-guidelines/index -########################################## - -# All public/protected/protected_internal constant fields must be PascalCase -# https://docs.microsoft.com/dotnet/standard/design-guidelines/field -dotnet_naming_symbols.public_protected_constant_fields_group.applicable_accessibilities = public, protected, protected_internal -dotnet_naming_symbols.public_protected_constant_fields_group.required_modifiers = const -dotnet_naming_symbols.public_protected_constant_fields_group.applicable_kinds = field -dotnet_naming_rule.public_protected_constant_fields_must_be_pascal_case_rule.symbols = public_protected_constant_fields_group -dotnet_naming_rule.public_protected_constant_fields_must_be_pascal_case_rule.style = pascal_case_style -dotnet_naming_rule.public_protected_constant_fields_must_be_pascal_case_rule.severity = warning - -# All public/protected/protected_internal static readonly fields must be PascalCase -# https://docs.microsoft.com/dotnet/standard/design-guidelines/field -dotnet_naming_symbols.public_protected_static_readonly_fields_group.applicable_accessibilities = public, protected, protected_internal -dotnet_naming_symbols.public_protected_static_readonly_fields_group.required_modifiers = static, readonly -dotnet_naming_symbols.public_protected_static_readonly_fields_group.applicable_kinds = field -dotnet_naming_rule.public_protected_static_readonly_fields_must_be_pascal_case_rule.symbols = public_protected_static_readonly_fields_group -dotnet_naming_rule.public_protected_static_readonly_fields_must_be_pascal_case_rule.style = pascal_case_style -dotnet_naming_rule.public_protected_static_readonly_fields_must_be_pascal_case_rule.severity = warning - -# No other public/protected/protected_internal fields are allowed -# https://docs.microsoft.com/dotnet/standard/design-guidelines/field -dotnet_naming_symbols.other_public_protected_fields_group.applicable_accessibilities = public, protected, protected_internal -dotnet_naming_symbols.other_public_protected_fields_group.applicable_kinds = field -dotnet_naming_rule.other_public_protected_fields_disallowed_rule.symbols = other_public_protected_fields_group -dotnet_naming_rule.other_public_protected_fields_disallowed_rule.style = disallowed_style -dotnet_naming_rule.other_public_protected_fields_disallowed_rule.severity = error - -########################################## -# StyleCop Field Naming Rules -# Naming rules for fields follow the StyleCop analyzers -# This does not override any rules using disallowed_style above -# https://github.com/DotNetAnalyzers/StyleCopAnalyzers -########################################## - -# All constant fields must be PascalCase -# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1303.md -dotnet_naming_symbols.stylecop_constant_fields_group.applicable_accessibilities = public, internal, protected_internal, protected, private_protected, private -dotnet_naming_symbols.stylecop_constant_fields_group.required_modifiers = const -dotnet_naming_symbols.stylecop_constant_fields_group.applicable_kinds = field -dotnet_naming_rule.stylecop_constant_fields_must_be_pascal_case_rule.symbols = stylecop_constant_fields_group -dotnet_naming_rule.stylecop_constant_fields_must_be_pascal_case_rule.style = pascal_case_style -dotnet_naming_rule.stylecop_constant_fields_must_be_pascal_case_rule.severity = warning - -# All static readonly fields must be PascalCase -# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1311.md -dotnet_naming_symbols.stylecop_static_readonly_fields_group.applicable_accessibilities = public, internal, protected_internal, protected, private_protected, private -dotnet_naming_symbols.stylecop_static_readonly_fields_group.required_modifiers = static, readonly -dotnet_naming_symbols.stylecop_static_readonly_fields_group.applicable_kinds = field -dotnet_naming_rule.stylecop_static_readonly_fields_must_be_pascal_case_rule.symbols = stylecop_static_readonly_fields_group -dotnet_naming_rule.stylecop_static_readonly_fields_must_be_pascal_case_rule.style = pascal_case_style -dotnet_naming_rule.stylecop_static_readonly_fields_must_be_pascal_case_rule.severity = warning - -# No non-private instance fields are allowed -# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1401.md -dotnet_naming_symbols.stylecop_fields_must_be_private_group.applicable_accessibilities = public, internal, protected_internal, protected, private_protected -dotnet_naming_symbols.stylecop_fields_must_be_private_group.applicable_kinds = field -dotnet_naming_rule.stylecop_instance_fields_must_be_private_rule.symbols = stylecop_fields_must_be_private_group -dotnet_naming_rule.stylecop_instance_fields_must_be_private_rule.style = disallowed_style -dotnet_naming_rule.stylecop_instance_fields_must_be_private_rule.severity = error - -# Private fields must be camelCase -# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1306.md -dotnet_naming_symbols.stylecop_private_fields_group.applicable_accessibilities = private -dotnet_naming_symbols.stylecop_private_fields_group.applicable_kinds = field -dotnet_naming_rule.stylecop_private_fields_must_be_camel_case_rule.symbols = stylecop_private_fields_group -dotnet_naming_rule.stylecop_private_fields_must_be_camel_case_rule.style = camel_case_style -dotnet_naming_rule.stylecop_private_fields_must_be_camel_case_rule.severity = warning - -# Local variables must be camelCase -# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1312.md -dotnet_naming_symbols.stylecop_local_fields_group.applicable_accessibilities = local -dotnet_naming_symbols.stylecop_local_fields_group.applicable_kinds = local -dotnet_naming_rule.stylecop_local_fields_must_be_camel_case_rule.symbols = stylecop_local_fields_group -dotnet_naming_rule.stylecop_local_fields_must_be_camel_case_rule.style = camel_case_style -dotnet_naming_rule.stylecop_local_fields_must_be_camel_case_rule.severity = silent - -# This rule should never fire. However, it's included for at least two purposes: -# First, it helps to understand, reason about, and root-case certain types of issues, such as bugs in .editorconfig parsers. -# Second, it helps to raise immediate awareness if a new field type is added (as occurred recently in C#). -dotnet_naming_symbols.sanity_check_uncovered_field_case_group.applicable_accessibilities = * -dotnet_naming_symbols.sanity_check_uncovered_field_case_group.applicable_kinds = field -dotnet_naming_rule.sanity_check_uncovered_field_case_rule.symbols = sanity_check_uncovered_field_case_group -dotnet_naming_rule.sanity_check_uncovered_field_case_rule.style = internal_error_style -dotnet_naming_rule.sanity_check_uncovered_field_case_rule.severity = error - -########################################## -# Other Naming Rules -########################################## - -# All of the following must be PascalCase: -# - Namespaces -# https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-namespaces -# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1300.md -# - Classes and Enumerations -# https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces -# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1300.md -# - Delegates -# https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#names-of-common-types -# - Constructors, Properties, Events, Methods -# https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-type-members -dotnet_naming_symbols.element_group.applicable_kinds = namespace, class, enum, struct, delegate, event, method, property -dotnet_naming_rule.element_rule.symbols = element_group -dotnet_naming_rule.element_rule.style = pascal_case_style -dotnet_naming_rule.element_rule.severity = warning - -# Interfaces use PascalCase and are prefixed with uppercase 'I' -# https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces -dotnet_naming_symbols.interface_group.applicable_kinds = interface -dotnet_naming_rule.interface_rule.symbols = interface_group -dotnet_naming_rule.interface_rule.style = prefix_interface_with_i_style -dotnet_naming_rule.interface_rule.severity = warning - -# Generics Type Parameters use PascalCase and are prefixed with uppercase 'T' -# https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces -dotnet_naming_symbols.type_parameter_group.applicable_kinds = type_parameter -dotnet_naming_rule.type_parameter_rule.symbols = type_parameter_group -dotnet_naming_rule.type_parameter_rule.style = prefix_type_parameters_with_t_style -dotnet_naming_rule.type_parameter_rule.severity = warning - -# Function parameters use camelCase -# https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-parameters -dotnet_naming_symbols.parameters_group.applicable_kinds = parameter -dotnet_naming_rule.parameters_rule.symbols = parameters_group -dotnet_naming_rule.parameters_rule.style = camel_case_style -dotnet_naming_rule.parameters_rule.severity = warning - -########################################## - - -########################################## -# Code Analyzers Rules -########################################## - -# AsyncFixer -# http://www.asyncfixer.com - - -# Asyncify -# https://github.com/hvanbakel/Asyncify-CSharp - - -# Meziantou -# https://www.meziantou.net/enforcing-asynchronous-code-good-practices-using-a-roslyn-analyzer.htm -dotnet_diagnostic.MA0003.severity = suggestion # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0003.md -dotnet_diagnostic.MA0004.severity = suggestion # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0004.md -dotnet_diagnostic.MA0006.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0006.md -dotnet_diagnostic.MA0016.severity = error # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0016.md -dotnet_diagnostic.MA0025.severity = suggestion # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0025.md -dotnet_diagnostic.MA0026.severity = suggestion # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0026.md -dotnet_diagnostic.MA0028.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0028.md -dotnet_diagnostic.MA0048.severity = error # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0048.md - - -# Microsoft - Code Analysis -# https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ -dotnet_diagnostic.CA1014.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA1014.md -dotnet_diagnostic.CA1068.severity = error # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA1068.md -dotnet_diagnostic.CA1707.severity = error # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA1707.md -dotnet_diagnostic.CA2007.severity = suggestion # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA2007.md -dotnet_diagnostic.IDE0058.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/IDE0058.md - - -# Microsoft - Compiler Errors -# https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-messages/ -dotnet_diagnostic.CS4014.severity = error # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCompilerErrors/CS4014.md - - -# SecurityCodeScan -# https://security-code-scan.github.io/ - - -# StyleCop -# https://github.com/DotNetAnalyzers/StyleCopAnalyzers -dotnet_diagnostic.SA1009.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1009.md -dotnet_diagnostic.SA1101.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1101.md -dotnet_diagnostic.SA1122.severity = error # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1122.md -dotnet_diagnostic.SA1133.severity = error # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1133.md -dotnet_diagnostic.SA1200.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1200.md -dotnet_diagnostic.SA1201.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1201.md -dotnet_diagnostic.SA1202.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1202.md -dotnet_diagnostic.SA1204.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1204.md -dotnet_diagnostic.SA1413.severity = error # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1413.md -dotnet_diagnostic.SA1600.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1600.md -dotnet_diagnostic.SA1602.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1602.md -dotnet_diagnostic.SA1604.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1604.md -dotnet_diagnostic.SA1623.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1623.md -dotnet_diagnostic.SA1629.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1629.md -dotnet_diagnostic.SA1633.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1633.md -dotnet_diagnostic.SA1649.severity = error # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1649.md - - -# SonarAnalyzer.CSharp -# https://rules.sonarsource.com/csharp -dotnet_diagnostic.S1135.severity = suggestion # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/SonarAnalyzerCSharp/S1135.md - - -########################################## -# Custom - File Extension Settings -########################################## - - -########################################## -# Custom - Code Analyzers Rules -########################################## - -dotnet_diagnostic.MA0002.severity = none - -dotnet_diagnostic.CA1801.severity = none -dotnet_diagnostic.CA1822.severity = none -dotnet_diagnostic.CA2201.severity = none - -dotnet_diagnostic.CS8618.severity = none -dotnet_diagnostic.CS8625.severity = none - -dotnet_diagnostic.S1172.severity = none -dotnet_diagnostic.S4457.severity = none - -dotnet_diagnostic.AsyncFixer01.severity = none \ No newline at end of file diff --git a/sample/Demo.ApiDesign/ApiGeneratorOptions.json b/sample/Demo.ApiDesign/ApiGeneratorOptions.json deleted file mode 100644 index fa79af8b..00000000 --- a/sample/Demo.ApiDesign/ApiGeneratorOptions.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "Generator": { - "UseRestExtended": true, - "Request": { - }, - "Response": { - "UseProblemDetailsAsDefaultBody": true - } - }, - "Validation": { - "StrictMode": false, - "OperationIdCasingStyle": "CamelCase", - "ModelNameCasingStyle": "PascalCase", - "ModelPropertyNameCasingStyle": "CamelCase" - } -} \ No newline at end of file diff --git a/sample/Demo.ApiDesign/DelegateApiGeneratorOptions.json b/sample/Demo.ApiDesign/DelegateApiGeneratorOptions.json deleted file mode 100644 index 6e97a6d8..00000000 --- a/sample/Demo.ApiDesign/DelegateApiGeneratorOptions.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "Generator": { - "UseRestExtended": true, - "Request": { - }, - "Response": { - "UseProblemDetailsAsDefaultBody": true - } - }, - "Validation": { - "StrictMode": true, - "OperationIdCasingStyle": "CamelCase", - "ModelNameCasingStyle": "PascalCase", - "ModelPropertyNameCasingStyle": "CamelCase" - } -} \ No newline at end of file diff --git a/sample/Demo.ApiDesign/DemoApiGeneratorOptions.json b/sample/Demo.ApiDesign/DemoApiGeneratorOptions.json deleted file mode 100644 index 3292c001..00000000 --- a/sample/Demo.ApiDesign/DemoApiGeneratorOptions.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "Generator": { - "UseRestExtended": true, - "Request": { - }, - "Response": { - "UseProblemDetailsAsDefaultBody": true - } - }, - "Validation": { - "StrictMode": true, - "OperationIdCasingStyle": "CamelCase", - "ModelNameCasingStyle": "PascalCase", - "ModelPropertyNameCasingStyle": "CamelCase" - } -} \ No newline at end of file diff --git a/sample/Demo.ApiDesign/MultiFileVersion/common/components/endpoints.v1.yaml b/sample/Demo.ApiDesign/MultiFileVersion/common/components/endpoints.v1.yaml deleted file mode 100644 index 46ee286f..00000000 --- a/sample/Demo.ApiDesign/MultiFileVersion/common/components/endpoints.v1.yaml +++ /dev/null @@ -1,9 +0,0 @@ -info: - title: Demo Api - description: Demo Api - MultiFileVersion - version: '1.0' - contact: - name: Delegate A/S -servers: - - url: /api/v1 - description: Api version 1.0 diff --git a/sample/Demo.ApiDesign/MultiFileVersion/common/components/responses.v1.yaml b/sample/Demo.ApiDesign/MultiFileVersion/common/components/responses.v1.yaml deleted file mode 100644 index 041f5738..00000000 --- a/sample/Demo.ApiDesign/MultiFileVersion/common/components/responses.v1.yaml +++ /dev/null @@ -1,50 +0,0 @@ -'400': - description: Our shared 400 response - Bad Request. - content: - application/json: - schema: - '$ref': '../models/problemdetails.v1.yaml' - examples: - application/json: - code: '400' - message: Bad Request -'401': - description: Our shared 401 response - Not Authorized. - content: - application/json: - schema: - '$ref': '../models/problemdetails.v1.yaml' - examples: - application/json: - code: '401' - message: Not Authorized -'403': - description: Our shared 403 response - Forbidden. - content: - application/json: - schema: - '$ref': '../models/problemdetails.v1.yaml' - examples: - application/json: - code: '403' - message: Forbidden -'404': - description: Our shared 404 response - Not Found. - content: - application/json: - schema: - '$ref': '../models/problemdetails.v1.yaml' - examples: - application/json: - code: '404' - message: Not Found -'500': - description: Our shared 500 response - Internal Server Error. - content: - application/json: - schema: - '$ref': '../models/problemdetails.v1.yaml' - examples: - application/json: - code: '500' - message: Internal Server Error \ No newline at end of file diff --git a/sample/Demo.ApiDesign/MultiFileVersion/common/models/problemdetails.v1.yaml b/sample/Demo.ApiDesign/MultiFileVersion/common/models/problemdetails.v1.yaml deleted file mode 100644 index df94d0a8..00000000 --- a/sample/Demo.ApiDesign/MultiFileVersion/common/models/problemdetails.v1.yaml +++ /dev/null @@ -1,19 +0,0 @@ -title: ProblemDetails -type: object -properties: - type: - type: string - description: A URI reference [RFC3986] that identifies the problem type. This specification encourages that, when dereferenced, it provide human-readable documentation for the problem type (e.g., using HTML [W3C.REC-html5-20141028]). - title: - type: string - description: A short, human-readable summary of the problem type.It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization(e.g., using proactive content negotiation; see[RFC7231], Section 3.4). - status: - type: integer - format: int32 - description: The HTTP status code([RFC7231], Section 6) generated by the origin server for this occurrence of the problem. - detail: - type: string - description: A human-readable explanation specific to this occurrence of the problem. - instance: - type: string - description: A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced. \ No newline at end of file diff --git a/sample/Demo.ApiDesign/MultiFileVersion/orders/models/order.v1.yaml b/sample/Demo.ApiDesign/MultiFileVersion/orders/models/order.v1.yaml deleted file mode 100644 index 4e9d18b4..00000000 --- a/sample/Demo.ApiDesign/MultiFileVersion/orders/models/order.v1.yaml +++ /dev/null @@ -1,8 +0,0 @@ -title: Order -description: A single order. -type: object -properties: - id: - type: string - description: - type: string \ No newline at end of file diff --git a/sample/Demo.ApiDesign/MultiFileVersion/orders/ordersEndpoints.v1.yaml b/sample/Demo.ApiDesign/MultiFileVersion/orders/ordersEndpoints.v1.yaml deleted file mode 100644 index c9fb3fb8..00000000 --- a/sample/Demo.ApiDesign/MultiFileVersion/orders/ordersEndpoints.v1.yaml +++ /dev/null @@ -1,46 +0,0 @@ -openapi: 3.0.0 -info: - $ref: ../common/components/endpoints.v1.yaml#/info -servers: - $ref: ../common/components/endpoints.v1.yaml#/servers - -paths: - '/orders/{id}': - get: - tags: - - Orders - summary: Get order by id - description: Get order by id - operationId: getOrderById - parameters: - - name: id - in: path - required: true - description: The id of the order to retrieve - schema: - type: string - responses: - '200': - description: Expected response to a valid request - content: - application/json: - schema: - $ref: '#/components/schemas/Order' - '400': - $ref: ../common/components/responses.v1.yaml#/400 - '404': - $ref: ../common/components/responses.v1.yaml#/404 - default: - $ref: ../common/components/responses.v1.yaml#/400 -components: - schemas: - Order: - $ref: ./models/order.v1.yaml - Orders: - type: array - items: - $ref: '#/components/schemas/Order' - x-tags: - - Orders - title: Orders - description: A list of orders. diff --git a/sample/Demo.ApiDesign/MultiFileVersion/users/models/CreateUserRequest.v1.yaml b/sample/Demo.ApiDesign/MultiFileVersion/users/models/CreateUserRequest.v1.yaml deleted file mode 100644 index d6744b5b..00000000 --- a/sample/Demo.ApiDesign/MultiFileVersion/users/models/CreateUserRequest.v1.yaml +++ /dev/null @@ -1,19 +0,0 @@ -title: CreateUserRequest -description: 'Request to create a user' -type: object -required: - - firstname - - lastname - - email - - gender -properties: - firstname: - type: string - lastname: - type: string - email: - type: string - format: email - example: email@email.dk - gender: - $ref: ./genderType.v1.yaml \ No newline at end of file diff --git a/sample/Demo.ApiDesign/MultiFileVersion/users/models/UpdateUserRequest.v1.yaml b/sample/Demo.ApiDesign/MultiFileVersion/users/models/UpdateUserRequest.v1.yaml deleted file mode 100644 index 2cfb50ff..00000000 --- a/sample/Demo.ApiDesign/MultiFileVersion/users/models/UpdateUserRequest.v1.yaml +++ /dev/null @@ -1,14 +0,0 @@ -title: UpdateUserRequest -description: Request to update a user -type: object -properties: - firstname: - type: string - lastname: - type: string - email: - type: string - format: email - example: email@email.dk - gender: - $ref: ./genderType.v1.yaml diff --git a/sample/Demo.ApiDesign/MultiFileVersion/users/models/genderType.v1.yaml b/sample/Demo.ApiDesign/MultiFileVersion/users/models/genderType.v1.yaml deleted file mode 100644 index 9b7332db..00000000 --- a/sample/Demo.ApiDesign/MultiFileVersion/users/models/genderType.v1.yaml +++ /dev/null @@ -1,14 +0,0 @@ -title: GenderType -description: '' -type: object -properties: - gender: - type: string - description: The users gender type - enum: - - Unknown - - NonBinary - - Male - - Female -required: - - gender \ No newline at end of file diff --git a/sample/Demo.ApiDesign/MultiFileVersion/users/models/user.v1.yaml b/sample/Demo.ApiDesign/MultiFileVersion/users/models/user.v1.yaml deleted file mode 100644 index 9c7f8814..00000000 --- a/sample/Demo.ApiDesign/MultiFileVersion/users/models/user.v1.yaml +++ /dev/null @@ -1,18 +0,0 @@ -title: User -description: A single user. -type: object -properties: - id: - type: string - format: uuid - example: 00000000-0000-0000-0000-000000000000 - gender: - $ref: ./genderType.v1.yaml - firstname: - type: string - lastname: - type: string - email: - type: string - format: email - example: email@email.dk \ No newline at end of file diff --git a/sample/Demo.ApiDesign/MultiFileVersion/users/usersEndpoints.v1.yaml b/sample/Demo.ApiDesign/MultiFileVersion/users/usersEndpoints.v1.yaml deleted file mode 100644 index 3cbed82a..00000000 --- a/sample/Demo.ApiDesign/MultiFileVersion/users/usersEndpoints.v1.yaml +++ /dev/null @@ -1,153 +0,0 @@ -openapi: 3.0.0 -info: - $ref: '../common/components/endpoints.v1.yaml#/info' -servers: - $ref: '../common/components/endpoints.v1.yaml#/servers' -paths: - '/users/email': - get: - tags: - - Users - summary: Get user by email - description: Get user by email - operationId: getUserByEmail - parameters: - - name: email - in: query - description: The email of the user to retrieve - required: true - schema: - type: string - format: email - responses: - '200': - description: Expected response to a valid request - content: - application/json: - schema: - $ref: '#/components/schemas/User' - '400': - $ref: '../common/components/responses.v1.yaml#/400' - '404': - $ref: '../common/components/responses.v1.yaml#/404' - default: - $ref: '../common/components/responses.v1.yaml#/400' - '/users/{id}': - get: - tags: - - Users - summary: Get user by id - description: Get user by id - operationId: getUserById - parameters: - - name: id - in: path - required: true - description: The id of the user to retrieve - schema: - type: string - responses: - '200': - description: Expected response to a valid request - content: - application/json: - schema: - $ref: '#/components/schemas/User' - '400': - $ref: '../common/components/responses.v1.yaml#/400' - '404': - $ref: '../common/components/responses.v1.yaml#/404' - default: - $ref: '../common/components/responses.v1.yaml#/400' - put: - summary: '' - description: Update user by id - operationId: updateUserById - parameters: - - name: id - in: path - required: true - description: The id of the user to update - schema: - type: string - responses: - '200': - description: OK - '400': - $ref: '../common/components/responses.v1.yaml#/400' - '404': - $ref: '../common/components/responses.v1.yaml#/404' - default: - $ref: '../common/components/responses.v1.yaml#/400' - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateUserRequest' - delete: - summary: '' - description: Delete user by id - operationId: deleteUserById - parameters: - - name: id - in: path - required: true - description: The id of the user to delete - schema: - type: string - responses: - '200': - description: OK - '400': - $ref: '../common/components/responses.v1.yaml#/400' - '404': - $ref: '../common/components/responses.v1.yaml#/404' - default: - $ref: '../common/components/responses.v1.yaml#/400' - /users: - get: - summary: Get all users - operationId: get-users - tags: [] - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/Users' - '400': - $ref: '../common/components/responses.v1.yaml#/400' - default: - $ref: '../common/components/responses.v1.yaml#/400' - post: - summary: Create a new user - operationId: post-users - responses: - '200': - description: OK - '400': - $ref: '../common/components/responses.v1.yaml#/400' - default: - $ref: '../common/components/responses.v1.yaml#/400' - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateUserRequest' -components: - schemas: - User: - $ref: ./models/user.v1.yaml - Users: - type: array - items: - $ref: '#/components/schemas/User' - x-tags: - - Users - title: Users - description: A list of users. - CreateUserRequest: - $ref: ./models/CreateUserRequest.v1.yaml - UpdateUserRequest: - $ref: ./models/UpdateUserRequest.v1.yaml \ No newline at end of file diff --git a/sample/Demo.ApiDesign/SingleFileVersion/.spectral.yaml b/sample/Demo.ApiDesign/SingleFileVersion/.spectral.yaml deleted file mode 100644 index 56ec41d9..00000000 --- a/sample/Demo.ApiDesign/SingleFileVersion/.spectral.yaml +++ /dev/null @@ -1,10 +0,0 @@ -extends: [[spectral:oas, all]] -rules: - info-license: off - license-url: off - contact-properties: off - openapi-tags: off - operation-tags: off - operation-tag-defined: off - operation-default-response: off - diff --git a/sample/Demo.ApiDesign/SingleFileVersion/Api.v1.yaml b/sample/Demo.ApiDesign/SingleFileVersion/Api.v1.yaml deleted file mode 100644 index ba8208f8..00000000 --- a/sample/Demo.ApiDesign/SingleFileVersion/Api.v1.yaml +++ /dev/null @@ -1,969 +0,0 @@ -openapi: 3.0.0 -info: - title: Demo Api - description: Demo Api - SingleFileVersion - version: '1.0' - contact: - name: atc-net A/S -servers: - - url: /api/v1 - description: Api version 1.0 -x-authorize-roles: - - admin - - operator -paths: - /orders: - x-authentication-required: true - get: - tags: - - Orders - summary: Get orders - description: Get orders - operationId: getOrders - parameters: - - $ref: '#/components/parameters/pagingPageSize' - - $ref: '#/components/parameters/pagingPageIndex' - - $ref: '#/components/parameters/queryString' - - $ref: '#/components/parameters/queryStringArray' - - $ref: '#/components/parameters/continuationToken' - responses: - '200': - description: Expected response to a valid request - content: - application/json: - schema: - allOf: - - $ref: '#/components/schemas/Pagination' - - $ref: '#/components/schemas/Orders' - '404': - description: Not Found - '/orders/{id}': - x-authentication-required: true - x-authorize-roles: - - operator - get: - tags: - - Orders - summary: Get order by id - description: Get order by id - operationId: getOrderById - x-authentication-required: false - parameters: - - name: myEmail - in: query - description: The email for filter orders to retrieve - schema: - type: string - format: email - nullable: true - responses: - '200': - description: Expected response to a valid request - content: - application/json: - schema: - $ref: '#/components/schemas/Order' - '404': - description: Not Found - patch: - summary: Update part of order by id - description: Update part of order by id - operationId: patchOrdersId - x-authorize-roles: - - admin - - operator - parameters: - - name: myTestHeader - in: header - required: true - description: The myTestHeader special key - schema: - type: string - - name: myTestHeaderBool - in: header - required: true - description: The myTestHeaderBool special key - schema: - type: boolean - - name: myTestHeaderInt - in: header - required: true - description: The myTestHeaderInt special key - schema: - type: integer - - name: x-correlation-id - in: header - required: true - description: The correlationId - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateOrderRequest' - responses: - '200': - description: OK - '404': - description: Not Found - '409': - description: Conflict - '502': - description: Bad Gateway - content: - application/json: - schema: - $ref: '#/components/schemas/ProblemDetails' - parameters: - - name: id - in: path - description: The id of the order - required: true - schema: - type: string - format: uuid - /users/email: - get: - tags: - - Users - summary: Get user by email - description: Get user by email - operationId: getUserByEmail - parameters: - - name: email - in: query - description: The email of the user to retrieve - required: true - schema: - type: string - format: email - responses: - '200': - description: Expected response to a valid request - content: - application/json: - schema: - $ref: '#/components/schemas/User' - '400': - description: Bad Request - '404': - description: Not Found - '409': - description: Conflict - '/users/{id}': - get: - summary: Get user by id - description: Get user by id - operationId: getUserById - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/User' - '404': - description: Not Found - '409': - description: Conflict - put: - summary: Update user by id - description: Update user by id - operationId: updateUserById - responses: - '200': - description: OK - '400': - description: Bad Request - '404': - description: Not Found - '409': - description: Conflict - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateUserRequest' - delete: - summary: Delete user by id - description: Delete user by id - operationId: deleteUserById - responses: - '200': - description: OK - '404': - description: Not Found - '409': - description: Conflict - parameters: - - name: id - in: path - description: Id of the user - required: true - schema: - type: string - format: uuid - /users: - get: - summary: Get all users - description: Get all users - operationId: getUsers - tags: [] - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/Users' - '409': - description: Conflict - post: - summary: Create a new user - description: Create a new user - operationId: postUser - responses: - '201': - description: Created - '400': - description: Bad Request - '409': - description: Conflict - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateUserRequest' - '/users/{id}/gender': - put: - summary: Update gender on a user - description: Update gender on a user - operationId: updateMyTestGender - parameters: - - name: genderParam - in: query - description: The gender to set on the user - schema: - $ref: '#/components/schemas/GenderType' - responses: - '200': - description: OK - '400': - description: Bad Request - '404': - description: Not Found - '409': - description: Conflict - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateTestGenderRequest' - parameters: - - name: id - description: Id of the user - in: path - required: true - schema: - type: string - format: uuid - '/accounts/{accountId}/name': - put: - summary: Update name of account - description: Update name of account - operationId: updateAccountName - responses: - '200': - description: OK - parameters: - - name: name - in: header - description: The account name - schema: - type: string - post: - summary: Set name of account - description: Set name of account - operationId: setAccountName - responses: - '200': - description: OK - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateAccountRequest' - parameters: - - name: accountId - in: path - required: true - description: The accountId - schema: - type: string - format: uuid - '/addresses/{postalCode}': - get: - summary: Get addresses by postal code - description: Get addresses by postal code - operationId: getAddressesByPostalCodes - tags: [] - responses: - '200': - description: OK - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Address' - '404': - description: Not Found - parameters: - - name: postalCode - in: path - required: true - description: The postalCode to limit addresses on - schema: - type: string - /route-with-dash: - get: - summary: Your GET endpoint - description: Your GET endpoint - tags: [] - responses: - '200': - description: OK - operationId: getRouteWithDash - /items: - post: - summary: Create a new item - description: Create a new item - operationId: createItem - responses: - '200': - description: OK - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateItemRequest' - '/items/{id}': - put: - summary: Updates an item - description: Updates an item - operationId: updateItem - responses: - '200': - description: OK - content: - application/json: - schema: - type: string - format: uuid - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateItemRequest' - parameters: - - name: id - in: path - description: The id of the order - required: true - schema: - type: string - format: uuid - /tasks: - get: - operationId: getTasks - summary: Returns tasks - description: Returns tasks - tags: [] - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/Tasks' - '/eventArgs/{id}': - parameters: - - name: id - in: path - description: The id of the eventArgs - required: true - schema: - type: string - get: - summary: Get EventArgs By Id - description: Get EventArgs By Id - tags: [] - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/EventArgs' - '404': - description: Not Found - operationId: getEventArgById - /eventArgs: - get: - operationId: getEventArgs - summary: Get EventArgs List - description: Get EventArgs List - tags: [] - responses: - '200': - description: OK - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/EventArgs' - '/files/{id}': - parameters: - - name: id - in: path - description: The file id - required: true - schema: - type: string - get: - operationId: getFileById - summary: Get File By Id - description: Get File By Id - tags: [] - responses: - '200': - description: OK - content: - application/octet-stream: - schema: - type: string - format: binary - headers: {} - '404': - description: Not Found - /files/form-data/singleObject: - post: - operationId: uploadSingleObjectWithFileAsFormData - summary: Upload a file as FormData - description: Upload a file as FormData - responses: - '200': - description: OK - '400': - description: Bad Request - requestBody: - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/FileAsFormDataRequest' - parameters: [] - /files/form-data/singleObjectMultiFile: - post: - operationId: uploadSingleObjectWithFilesAsFormData - summary: Upload files as FormData - description: Upload files as FormData - responses: - '200': - description: OK - '400': - description: Bad Request - requestBody: - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/FilesAsFormDataRequest' - parameters: [] - /files/form-data/singleFile: - post: - operationId: uploadSingleFileAsFormData - summary: Upload a file as OctetStream - description: Upload a file as OctetStream - responses: - '200': - description: OK - requestBody: - content: - application/octet-stream: - schema: - type: string - format: binary - parameters: [] - /files/form-data/multiFile: - post: - summary: Upload multi files as form data - description: Upload multi files as form data - operationId: uploadMultiFilesAsFormData - responses: - '200': - description: OK - requestBody: - content: - multipart/form-data: - schema: - type: array - items: - type: string - format: binary -components: - parameters: - pagingPageSize: - name: pageSize - in: query - required: true - schema: - type: integer - minimum: 1 - maximum: 100 - default: 10 - description: The numbers of items to return. - pagingPageIndex: - name: pageIndex - in: query - required: false - schema: - type: integer - minimum: 0 - default: 0 - description: The number of items to skip before starting to collect the result set. - queryString: - name: queryString - in: query - required: false - schema: - type: string - nullable: true - description: The query string. - queryStringArray: - name: queryStringArray - in: query - required: false - schema: - type: array - items: - type: string - nullable: true - description: The query array of string. - continuationToken: - name: continuationToken - in: query - required: false - schema: - type: string - nullable: true - description: The continuation token. - schemas: - Pagination: - type: object - title: Pagination - description: A item result subset of a data query. - properties: - pageSize: - type: number - description: The number of items to request. - pageIndex: - type: number - nullable: true - description: The given page index starting with 0. - queryString: - type: string - nullable: true - description: The query to filter items by. - continuationToken: - type: string - nullable: true - description: Token to indicate next result set. - count: - type: number - description: Items count in result set. - totalCount: - type: number - nullable: true - description: Total items count. - totalPages: - type: number - nullable: true - description: Total pages. - required: - - pageSize - - count - ProblemDetails: - type: object - title: ProblemDetails - description: 'A machine-readable format for specifying errors in HTTP API responses based on https://tools.ietf.org/html/rfc7807.' - properties: - type: - type: string - description: 'A URI reference [RFC3986] that identifies the problem type. This specification encourages that, when dereferenced, it provide human-readable documentation for the problem type (e.g., using HTML [W3C.REC-html5-20141028]).' - title: - type: string - description: 'A short, human-readable summary of the problem type.It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization(e.g., using proactive content negotiation; see[RFC7231], Section 3.4).' - status: - type: integer - format: int32 - description: 'The HTTP status code([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.' - detail: - type: string - description: A human-readable explanation specific to this occurrence of the problem. - instance: - type: string - description: A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced. - Order: - title: Order - description: |- - A single order. - Hallo description with multiline and no ending dot - type: object - x-examples: - MyExample: - id: 123 - name: Hallo world - MyExample2: {} - properties: - id: - type: string - format: uuid - description: - type: string - myTime: - type: string - format: time - myEmail: - type: string - format: email - default: a@a.com - myNullableDateTime: - type: string - format: date-time - nullable: true - myDateTime: - type: string - format: date-time - myNumber: - type: number - minimum: 1.1 - maximum: 20.2 - myInteger: - type: integer - maximum: 50 - default: 15 - myBool: - type: boolean - description: MyBool is great - myUri: - type: string - format: uri - description: 'This is the good uri :-)' - myByte: - type: string - format: byte - myStringList: - type: array - description: 'Hallo myStringList desc :-)' - items: - type: string - myLong: - type: integer - format: int64 - minimum: 10 - exclusiveMinimum: false - deliveryAddress: - $ref: '#/components/schemas/Address' - Orders: - description: A list of orders. - type: array - x-tags: - - Orders - title: Orders - items: - $ref: '#/components/schemas/Order' - GenderType: - title: GenderType - description: '' - type: object - properties: - gender: - type: string - description: The users gender type - enum: - - None - - NonBinary - - Male - - Female - required: - - gender - ColorType: - title: ColorType - description: '' - type: object - properties: - color: - type: string - description: The users color type - enum: - - None = 0 - - Black = 1 - - White = 2 - - Yellow = 4 - - Red = 8 - required: - - color - User: - title: User - description: A single user. - type: object - properties: - id: - type: string - format: uuid - example: 00000000-0000-0000-0000-000000000000 - gender: - $ref: '#/components/schemas/GenderType' - firstName: - type: string - lastName: - type: string - email: - type: string - format: email - example: email@email.dk - homepage: - type: string - format: uri - color: - $ref: '#/components/schemas/ColorType' - homeAddress: - $ref: '#/components/schemas/Address' - companyAddress: - $ref: '#/components/schemas/Address' - Users: - description: A list of users. - type: array - items: - $ref: '#/components/schemas/User' - x-tags: - - Users - title: Users - CreateUserRequest: - title: CreateUserRequest - description: Request to create a user - type: object - properties: - firstName: - type: string - lastName: - type: string - myNullableDateTime: - type: string - format: date-time - nullable: true - myDateTime: - type: string - format: date-time - email: - type: string - format: email - example: email@email.dk - homepage: - type: string - format: uri - gender: - $ref: '#/components/schemas/GenderType' - myNullableAddress: - nullable: true - oneOf: - - $ref: '#/components/schemas/Address' - tags: - type: object - additionalProperties: - type: string - desiredProperties1: - type: object - additionalProperties: - type: string - desiredProperties2: - type: object - nullable: true - additionalProperties: - type: string - desiredProperties3: - type: object - nullable: true - additionalProperties: - type: integer - required: - - firstName - - lastName - - myDateTime - - email - - gender - - tags - CreateUsersRequest: - description: A list of users. - type: array - x-tags: - - CreateUsersRequest - title: CreateUsersRequest - items: - $ref: '#/components/schemas/CreateUserRequest' - UpdateUserRequest: - title: UpdateUserRequest - description: Request to update a user - type: object - properties: - firstName: - type: string - lastName: - type: string - email: - type: string - format: email - example: email@email.dk - gender: - $ref: '#/components/schemas/GenderType' - UpdateTestGenderRequest: - title: Update test-gender Request - description: '' - type: object - properties: - gender: - $ref: '#/components/schemas/GenderType' - Address: - title: Address - type: object - properties: - streetName: - type: string - maxLength: 255 - streetNumber: - type: string - postalCode: - type: string - cityName: - type: string - myCountry: - $ref: '#/components/schemas/Country' - Country: - title: Country - type: object - properties: - name: - type: string - alpha2Code: - type: string - minLength: 2 - maxLength: 2 - pattern: '^[A-Za-z]{2}$' - alpha3Code: - type: string - minLength: 3 - maxLength: 3 - pattern: '^[A-Za-z]{3}$' - required: - - name - - alpha2Code - - alpha3Code - UpdateOrderRequest: - title: UpdateOrderRequest - description: Request to update an order - type: object - properties: - myEmail: - type: string - format: email - required: - - myEmail - Item: - title: Item - type: object - properties: - name: - type: string - required: - - name - CreateItemRequest: - title: CreateItemRequest - type: object - properties: - item: - $ref: '#/components/schemas/Item' - myItems: - type: array - items: - $ref: '#/components/schemas/Item' - required: - - item - - myItems - UpdateItemRequest: - title: UpdateItemRequest - type: object - properties: - item: - $ref: '#/components/schemas/Item' - required: - - item - Task: - title: Task - type: object - properties: - id: - type: string - format: uuid - name: - type: string - description: Describes a single task. - Tasks: - title: Tasks - type: array - items: - $ref: '#/components/schemas/Task' - description: Contains a list of Tasks - EventArgs: - title: EventArgs - type: object - properties: - id: - type: string - format: uuid - eventName: - type: string - FileAsFormDataRequest: - title: FileAsFormDataRequest - type: object - properties: - itemName: - type: string - file: - type: string - format: binary - nullable: true - items: - type: array - items: - type: string - required: - - itemName - - items - FilesAsFormDataRequest: - title: FilesAsFormDataRequest - type: object - properties: - files: - type: array - items: - type: string - format: binary - required: - - files - UpdateAccountRequest: - title: UpdateAccountRequest - type: object - properties: - name: - type: string diff --git a/sample/Demo.ApiDesign/nswag.json b/sample/Demo.ApiDesign/nswag.json deleted file mode 100644 index 5218a695..00000000 --- a/sample/Demo.ApiDesign/nswag.json +++ /dev/null @@ -1,157 +0,0 @@ - { - "runtime": "Default", - "defaultVariables": null, - "documentGenerator": { - "fromDocument": { - "url": "SingleFileVersion/Api.v1.yaml", - "output": null, - "newLineBehavior": "Auto" - } - }, - "codeGenerators": { - "openApiToTypeScriptClient": { - "className": "{controller}Client", - "moduleName": "", - "namespace": "Demo.Client.Generated", - "typeScriptVersion": 2.7, - "template": "Axios", - "promiseType": "Promise", - "httpClass": "HttpClient", - "withCredentials": false, - "useSingletonProvider": false, - "injectionTokenType": "OpaqueToken", - "rxJsVersion": 6.0, - "dateTimeType": "Date", - "nullValue": "Undefined", - "generateClientClasses": true, - "generateClientInterfaces": false, - "generateOptionalParameters": false, - "exportTypes": true, - "wrapDtoExceptions": false, - "exceptionClass": "ApiException", - "clientBaseClass": null, - "wrapResponses": false, - "wrapResponseMethods": [], - "generateResponseClasses": true, - "responseClass": "SwaggerResponse", - "protectedMethods": [], - "configurationClass": null, - "useTransformOptionsMethod": false, - "useTransformResultMethod": false, - "generateDtoTypes": true, - "operationGenerationMode": "MultipleClientsFromOperationId", - "markOptionalProperties": true, - "generateCloneMethod": false, - "typeStyle": "Class", - "enumStyle": "Enum", - "useLeafType": false, - "classTypes": [], - "extendedClasses": [], - "extensionCode": null, - "generateDefaultValues": true, - "excludedTypeNames": [], - "excludedParameterNames": [], - "handleReferences": false, - "generateConstructorInterface": true, - "convertConstructorInterfaceData": false, - "importRequiredTypes": true, - "useGetBaseUrlMethod": false, - "baseUrlTokenName": "API_BASE_URL", - "queryNullValue": "", - "inlineNamedDictionaries": false, - "inlineNamedAny": false, - "templateDirectory": null, - "typeNameGeneratorType": null, - "propertyNameGeneratorType": null, - "enumNameGeneratorType": null, - "serviceHost": null, - "serviceSchemes": null, - "output": "../Demo.Client.Generated.Typescript/ServiceClient.ts", - "newLineBehavior": "Auto" - }, - "openApiToCSharpClient": { - "clientBaseClass": null, - "configurationClass": null, - "generateClientClasses": true, - "generateClientInterfaces": false, - "clientBaseInterface": null, - "injectHttpClient": true, - "disposeHttpClient": true, - "protectedMethods": [], - "generateExceptionClasses": true, - "exceptionClass": "ApiException", - "wrapDtoExceptions": true, - "useHttpClientCreationMethod": false, - "httpClientType": "System.Net.Http.HttpClient", - "useHttpRequestMessageCreationMethod": false, - "useBaseUrl": true, - "generateBaseUrlProperty": true, - "generateSyncMethods": false, - "exposeJsonSerializerSettings": false, - "clientClassAccessModifier": "public", - "typeAccessModifier": "public", - "generateContractsOutput": false, - "contractsNamespace": null, - "contractsOutputFilePath": null, - "parameterDateTimeFormat": "s", - "parameterDateFormat": "yyyy-MM-dd", - "generateUpdateJsonSerializerSettingsMethod": true, - "useRequestAndResponseSerializationSettings": false, - "serializeTypeInformation": false, - "queryNullValue": "", - "className": "{controller}Client", - "operationGenerationMode": "MultipleClientsFromOperationId", - "additionalNamespaceUsages": [], - "additionalContractNamespaceUsages": [], - "generateOptionalParameters": false, - "generateJsonMethods": false, - "enforceFlagEnums": false, - "parameterArrayType": "System.Collections.Generic.IEnumerable", - "parameterDictionaryType": "System.Collections.Generic.IDictionary", - "responseArrayType": "System.Collections.Generic.ICollection", - "responseDictionaryType": "System.Collections.Generic.IDictionary", - "wrapResponses": false, - "wrapResponseMethods": [], - "generateResponseClasses": true, - "responseClass": "SwaggerResponse", - "namespace": "Demo.Client.Generated", - "requiredPropertiesMustBeDefined": true, - "dateType": "System.DateTimeOffset", - "jsonConverters": null, - "anyType": "object", - "dateTimeType": "System.DateTimeOffset", - "timeType": "System.TimeSpan", - "timeSpanType": "System.TimeSpan", - "arrayType": "System.Collections.Generic.ICollection", - "arrayInstanceType": "System.Collections.ObjectModel.Collection", - "dictionaryType": "System.Collections.Generic.IDictionary", - "dictionaryInstanceType": "System.Collections.Generic.Dictionary", - "arrayBaseType": "System.Collections.ObjectModel.Collection", - "dictionaryBaseType": "System.Collections.Generic.Dictionary", - "classStyle": "Poco", - "generateDefaultValues": true, - "generateDataAnnotations": true, - "excludedTypeNames": [], - "excludedParameterNames": [], - "handleReferences": false, - "generateImmutableArrayProperties": false, - "generateImmutableDictionaryProperties": false, - "jsonSerializerSettingsTransformationMethod": null, - "inlineNamedArrays": false, - "inlineNamedDictionaries": false, - "inlineNamedTuples": true, - "inlineNamedAny": false, - "generateDtoTypes": true, - "generateOptionalPropertiesAsNullable": false, - "generateNullableReferenceTypes": false, - "templateDirectory": null, - "typeNameGeneratorType": null, - "propertyNameGeneratorType": null, - "enumNameGeneratorType": null, - "serviceHost": null, - "serviceSchemes": null, - "output": "../Demo.Client.Generated.CSharp/ServiceClient.cs", - "newLineBehavior": "Auto" - } - } -} \ No newline at end of file diff --git a/sample/Demo.sln b/sample/Demo.sln deleted file mode 100644 index eced2a49..00000000 --- a/sample/Demo.sln +++ /dev/null @@ -1,55 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.1.32228.430 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Demo.Api.Generated", "src\Demo.Api.Generated\Demo.Api.Generated.csproj", "{2D12D1D4-6BF4-4FE6-80C9-444F56E66109}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Demo.Domain", "src\Demo.Domain\Demo.Domain.csproj", "{079EA0A6-5815-4BAD-B8CF-A291DB0377C8}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Demo.Api", "src\Demo.Api\Demo.Api.csproj", "{91744CA1-EF50-4E85-B846-16E77F147DD2}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Demo.Domain.Tests", "test\Demo.Domain.Tests\Demo.Domain.Tests.csproj", "{1B935EE3-2C40-49D3-9B1E-E885F71AF877}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Demo.Api.Tests", "test\Demo.Api.Tests\Demo.Api.Tests.csproj", "{D5794914-A368-48FA-B694-535560053E2A}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Demo.Api.Full", "src\Demo.Api.Full\Demo.Api.Full.csproj", "{F7A48ED5-C81B-4248-AC0B-74F83CB58388}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {2D12D1D4-6BF4-4FE6-80C9-444F56E66109}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2D12D1D4-6BF4-4FE6-80C9-444F56E66109}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2D12D1D4-6BF4-4FE6-80C9-444F56E66109}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2D12D1D4-6BF4-4FE6-80C9-444F56E66109}.Release|Any CPU.Build.0 = Release|Any CPU - {079EA0A6-5815-4BAD-B8CF-A291DB0377C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {079EA0A6-5815-4BAD-B8CF-A291DB0377C8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {079EA0A6-5815-4BAD-B8CF-A291DB0377C8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {079EA0A6-5815-4BAD-B8CF-A291DB0377C8}.Release|Any CPU.Build.0 = Release|Any CPU - {91744CA1-EF50-4E85-B846-16E77F147DD2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {91744CA1-EF50-4E85-B846-16E77F147DD2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {91744CA1-EF50-4E85-B846-16E77F147DD2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {91744CA1-EF50-4E85-B846-16E77F147DD2}.Release|Any CPU.Build.0 = Release|Any CPU - {1B935EE3-2C40-49D3-9B1E-E885F71AF877}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1B935EE3-2C40-49D3-9B1E-E885F71AF877}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1B935EE3-2C40-49D3-9B1E-E885F71AF877}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1B935EE3-2C40-49D3-9B1E-E885F71AF877}.Release|Any CPU.Build.0 = Release|Any CPU - {D5794914-A368-48FA-B694-535560053E2A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D5794914-A368-48FA-B694-535560053E2A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D5794914-A368-48FA-B694-535560053E2A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D5794914-A368-48FA-B694-535560053E2A}.Release|Any CPU.Build.0 = Release|Any CPU - {F7A48ED5-C81B-4248-AC0B-74F83CB58388}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F7A48ED5-C81B-4248-AC0B-74F83CB58388}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F7A48ED5-C81B-4248-AC0B-74F83CB58388}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F7A48ED5-C81B-4248-AC0B-74F83CB58388}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {c4d74d80-71d0-496c-b86b-ee86277ef87c} - EndGlobalSection -EndGlobal diff --git a/sample/Demo.sln.DotSettings b/sample/Demo.sln.DotSettings deleted file mode 100644 index 1af690fb..00000000 --- a/sample/Demo.sln.DotSettings +++ /dev/null @@ -1,3 +0,0 @@ - - ExplicitlyExcluded - diff --git a/sample/Directory.Build.props b/sample/Directory.Build.props deleted file mode 100644 index 3b75d519..00000000 --- a/sample/Directory.Build.props +++ /dev/null @@ -1,52 +0,0 @@ - - - - - atc-net - Demo - - - - - $(OrganizationName) - $(OrganizationName) - en - en-US - - - - enable - 10.0 - enable - false - true - 1573,1591,1712 - - - full - true - - - - AllEnabledByDefault - true - latest - true - - - - - true - - - - - - - - - - - - - \ No newline at end of file diff --git a/sample/GenerateDemoApi.cmd b/sample/GenerateDemoApi.cmd deleted file mode 100644 index e342c2d5..00000000 --- a/sample/GenerateDemoApi.cmd +++ /dev/null @@ -1,15 +0,0 @@ -@ECHO off - -CLS -SET currentDirectory=%cd% -FOR %%a IN ("%currentDirectory%") DO SET rootDirectory=%%~dpa -SET srcDirectory=%rootDirectory%src -SET generatorFile=%srcDirectory%\Atc.Rest.ApiGenerator.CLI\bin\Debug\net6.0\atc-rest-api-generator.exe - -SET projectName=Demo -SET specFile=%currentDirectory%\Demo.ApiDesign\SingleFileVersion\Api.v1.yaml -SET generatedDirectory=%currentDirectory% -SET optionsFile=%currentDirectory%\Demo.ApiDesign\ApiGeneratorOptions.json - -%generatorFile% generate server all -p %projectName% -s %specFile% --outputSlnPath %generatedDirectory% --outputSrcPath %generatedDirectory%\src --outputTestPath %generatedDirectory%\test --optionsPath %optionsFile% -v true - diff --git a/sample/GeneratePetStoreApi.cmd b/sample/GeneratePetStoreApi.cmd deleted file mode 100644 index e68635e9..00000000 --- a/sample/GeneratePetStoreApi.cmd +++ /dev/null @@ -1,15 +0,0 @@ -@ECHO off - -CLS -SET currentDirectory=%cd% -FOR %%a IN ("%currentDirectory%") DO SET rootDirectory=%%~dpa -SET projectsRootDirectory=%rootDirectory%\sample\Code -SET slnDirectory=%projectsRootDirectory% -SET srcDirectory=%projectsRootDirectory%\src -SET testDirectory=%projectsRootDirectory%\test -SET generatorFile=%rootDirectory%src\Atc.Rest.ApiGenerator.CLI\bin\Debug\net6.0\atc-rest-api-generator.exe - -SET projectName=PetStore -SET specUrl=https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore.yaml - -%generatorFile% generate server all -p %projectName% -s %specUrl% --outputSlnPath %slnDirectory% --outputSrcPath %srcDirectory% --outputTestPath %testDirectory% -v \ No newline at end of file diff --git a/sample/atc-coding-rules-updater.ps1 b/sample/atc-coding-rules-updater.ps1 deleted file mode 100644 index 14459c30..00000000 --- a/sample/atc-coding-rules-updater.ps1 +++ /dev/null @@ -1,10 +0,0 @@ -Clear-Host -Write-Host "Update atc-coding-rules" -dotnet tool update -g atc-coding-rules-updater - -$currentPath = Get-Location - -atc-coding-rules-updater run ` --p $currentPath ` ---optionsPath $currentPath'\atc-coding-rules-updater.json' ` --v \ No newline at end of file diff --git a/sample/src/.editorconfig b/sample/src/.editorconfig deleted file mode 100644 index d28ccd1a..00000000 --- a/sample/src/.editorconfig +++ /dev/null @@ -1,48 +0,0 @@ -# ATC coding rules - https://github.com/atc-net/atc-coding-rules -# Version: 1.0.9 -# Updated: 01-02-2022 -# Location: src -# Distribution: DotNet6 -# Inspired by: https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/code-style-rule-options - -########################################## -# Code Analyzers Rules -########################################## -[*.{cs,csx,cake}] - -# AsyncFixer -# http://www.asyncfixer.com - - -# Asyncify -# https://github.com/hvanbakel/Asyncify-CSharp - - -# Meziantou -# https://www.meziantou.net/enforcing-asynchronous-code-good-practices-using-a-roslyn-analyzer.htm - - -# Microsoft - Code Analysis -# https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ - - -# Microsoft - Compiler Errors -# https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-messages/ - - -# SecurityCodeScan -# https://security-code-scan.github.io/ - - -# StyleCop -# https://github.com/DotNetAnalyzers/StyleCopAnalyzers - - -# SonarAnalyzer.CSharp -# https://rules.sonarsource.com/csharp - - -########################################## -# Custom - Code Analyzers Rules -########################################## -dotnet_diagnostic.IDE0058.severity = none # Have to override this for now - to get smoke-test to run \ No newline at end of file diff --git a/sample/src/Demo.Api.Full/Configuration/Configure.cs b/sample/src/Demo.Api.Full/Configuration/Configure.cs deleted file mode 100644 index fb8e0490..00000000 --- a/sample/src/Demo.Api.Full/Configuration/Configure.cs +++ /dev/null @@ -1,23 +0,0 @@ -namespace Demo.Api.Full.Configuration -{ - public static class Configure - { - public static void ConfigureServices(this IServiceCollection services) - { - // Handlers - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - - // Validators - services.AddTransient, PostUserParametersValidator>(); - } - } -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Full/ConfigureSwaggerOptions.cs b/sample/src/Demo.Api.Full/ConfigureSwaggerOptions.cs deleted file mode 100644 index 20dcab3e..00000000 --- a/sample/src/Demo.Api.Full/ConfigureSwaggerOptions.cs +++ /dev/null @@ -1,74 +0,0 @@ -using Swashbuckle.AspNetCore.SwaggerUI; - -namespace Demo.Api.Full; - -public class ConfigureSwaggerOptions : - IConfigureOptions, - IConfigureOptions -{ - private readonly RestApiExtendedOptions apiOptions; - private readonly IWebHostEnvironment env; - - public ConfigureSwaggerOptions( - RestApiExtendedOptions options, - IWebHostEnvironment env) - { - this.apiOptions = options ?? throw new ArgumentNullException(nameof(options)); - this.env = env ?? throw new ArgumentNullException(nameof(env)); - } - - public void Configure(SwaggerGenOptions options) - { - if (!env.IsDevelopment()) - { - return; - } - - var authority = $"{apiOptions.Authorization!.Instance}/{apiOptions.Authorization.TenantId}"; - var authorizationUrl = $"{authority}/oauth2/v2.0/authorize"; - var tokenUrl = $"{authority}/oauth2/v2.0/token"; - var authFlow = new OpenApiOAuthFlow - { - TokenUrl = new Uri(tokenUrl), - AuthorizationUrl = new Uri(authorizationUrl), - Scopes = new Dictionary - { - { $"{apiOptions.Authorization.Audience}/.default", "Default" }, - }, - }; - - options.AddSecurityDefinition( - SecuritySchemeType.OAuth2.ToString(), - new OpenApiSecurityScheme - { - Type = SecuritySchemeType.OAuth2, - Flows = new OpenApiOAuthFlows - { - Implicit = authFlow, - AuthorizationCode = authFlow, - }, - }); - - options.AddSecurityRequirement( - new OpenApiSecurityRequirement - { - { - new OpenApiSecurityScheme - { - Reference = new OpenApiReference - { - Type = ReferenceType.SecurityScheme, - Id = SecuritySchemeType.OAuth2.ToString(), - }, - }, - Array.Empty() - }, - }); - } - - public void Configure(SwaggerUIOptions options) - { - options.OAuthClientId(apiOptions.Authorization!.ClientId); - options.OAuthUsePkce(); - } -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Full/Demo.Api.Full.csproj b/sample/src/Demo.Api.Full/Demo.Api.Full.csproj deleted file mode 100644 index d5515151..00000000 --- a/sample/src/Demo.Api.Full/Demo.Api.Full.csproj +++ /dev/null @@ -1,27 +0,0 @@ - - - - net6.0 - - - - bin\Debug\net6.0\Demo.Api.Full.xml - - - - - - - - - - - - - - - - - - - diff --git a/sample/src/Demo.Api.Full/GlobalUsings.cs b/sample/src/Demo.Api.Full/GlobalUsings.cs deleted file mode 100644 index 9e719a39..00000000 --- a/sample/src/Demo.Api.Full/GlobalUsings.cs +++ /dev/null @@ -1,21 +0,0 @@ -global using System.Reflection; - -global using Atc; -global using Atc.Rest.Extended.Options; -global using Atc.Rest.Options; - -global using Demo.Api.Full.Configuration; -global using Demo.Api.Generated; -global using Demo.Api.Generated.Contracts.Orders; -global using Demo.Api.Generated.Contracts.Users; -global using Demo.Domain; -global using Demo.Domain.Handlers.Orders; -global using Demo.Domain.Handlers.Users; -global using Demo.Domain.Validators.Users; - -global using FluentValidation; - -global using Microsoft.Extensions.Options; -global using Microsoft.OpenApi.Models; - -global using Swashbuckle.AspNetCore.SwaggerGen; \ No newline at end of file diff --git a/sample/src/Demo.Api.Full/Program.cs b/sample/src/Demo.Api.Full/Program.cs deleted file mode 100644 index 137c0e2e..00000000 --- a/sample/src/Demo.Api.Full/Program.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Hosting; - -namespace Demo.Api.Full -{ - public static class Program - { - public static void Main(string[] args) - { - CreateHostBuilder(args).Build().Run(); - } - - public static IHostBuilder CreateHostBuilder(string[] args) => - Host.CreateDefaultBuilder(args) - .ConfigureWebHostDefaults(webBuilder => - { - webBuilder.UseStartup(); - }); - } -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Full/Properties/launchSettings.json b/sample/src/Demo.Api.Full/Properties/launchSettings.json deleted file mode 100644 index e104cf79..00000000 --- a/sample/src/Demo.Api.Full/Properties/launchSettings.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "iisSettings": { - "iisExpress": { - "applicationUrl": "http://localhost:2106", - "sslPort": 44302 - } - }, - "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "launchUrl": "swagger", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "src": { - "commandName": "Project", - "launchBrowser": true, - "launchUrl": "swagger", - "applicationUrl": "https://localhost:44302;http://localhost:2106", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - } - } -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Full/Startup.cs b/sample/src/Demo.Api.Full/Startup.cs deleted file mode 100644 index 575fd120..00000000 --- a/sample/src/Demo.Api.Full/Startup.cs +++ /dev/null @@ -1,58 +0,0 @@ -namespace Demo.Api.Full; - -public class Startup -{ - public Startup(IConfiguration configuration) - { - Configuration = configuration; - restApiOptions = new RestApiExtendedOptions - { - // Base - AllowAnonymousAccessForDevelopment = true, - UseApplicationInsights = true, - UseAutoRegistrateServices = true, - UseEnumAsStringInSerialization = true, - UseHttpContextAccessor = true, - ErrorHandlingExceptionFilter = new RestApiOptionsErrorHandlingExceptionFilter - { - Enable = true, - UseProblemDetailsAsResponseBody = true, - IncludeExceptionDetails = true, - }, - UseRequireHttpsPermanent = true, - UseJsonSerializerOptionsIgnoreNullValues = true, - JsonSerializerCasingStyle = CasingStyle.CamelCase, - UseValidateServiceRegistrations = true, - - // Extended - UseApiVersioning = true, - UseFluentValidation = true, - UseOpenApiSpec = true, - }; - - restApiOptions.AddAssemblyPairs( - Assembly.GetAssembly(typeof(ApiRegistration)), - Assembly.GetAssembly(typeof(DomainRegistration))); - } - - public IConfiguration Configuration { get; } - - private readonly RestApiExtendedOptions restApiOptions; - - public void ConfigureServices(IServiceCollection services) - { - if (!restApiOptions.UseAutoRegistrateServices) - { - // Manual ConfigureServices - services.ConfigureServices(); - } - - services.ConfigureOptions(); - services.AddRestApi(restApiOptions, Configuration); - } - - public void Configure(IApplicationBuilder app, IWebHostEnvironment env) - { - app.ConfigureRestApi(env, restApiOptions); - } -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Full/appsettings.Development.json b/sample/src/Demo.Api.Full/appsettings.Development.json deleted file mode 100644 index ee68dfab..00000000 --- a/sample/src/Demo.Api.Full/appsettings.Development.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - // Copy and fill out the AzureAd section into the project User Secrets - // - //"Authorization": { - // /* - // This will be used to set the Authority on the JWT bearer options - // - 'https://login.microsoftonline.com' (For Azure AD) - // - 'https://adfs1.some.organization.com' (For on-prem ADFS) - // */ - // "Instance": "https://login.microsoftonline.com", - // "ClientId": "[Application ID of the Azure AD App Registration]", - // /* - // You need specify the TenantId only if you want to accept access tokens from a single tenant - // (line-of-business app). - // Otherwise, you can leave them set to common. - // This can be: - // - A GUID (Tenant ID = Directory ID) - // - 'common' (any organization and personal accounts) - // - 'organizations' (any organization) - // - 'consumers' (Microsoft personal accounts) - // - 'adfs' (For on-prem ADFS) - // */ - // "TenantId": "common", - // "Audience": "[App Identifier URI of the Azure AD App Registration or api://[ClientId]]", - // "Issuer": "[The token iss claim also specified as the issuer or access_token_issuer from the OpenID configuration]", - // /* - // A string array of accepted audiences - // */ - // "ValidAudiences": [ - // "[App Identifier URI of the Azure AD App Registration or api://[ClientId]]", - // "[App Identifier URI of the Azure AD App Registration or api://[ClientId]]", - // "[App Identifier URI of the Azure AD App Registration or api://[ClientId]]" - // ], - // /* - // A string array of accepted issuers - // */ - // "ValidIssuers": [ - // "The token iss claim also specified as the issuer or access_token_issuer from the OpenID configuration", - // "The token iss claim also specified as the issuer or access_token_issuer from the OpenID configuration", - // "The token iss claim also specified as the issuer or access_token_issuer from the OpenID configuration" - // ] - //}, - - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft": "Warning", - "Microsoft.Hosting.Lifetime": "Information" - } - } -} diff --git a/sample/src/Demo.Api.Full/appsettings.json b/sample/src/Demo.Api.Full/appsettings.json deleted file mode 100644 index d9d9a9bf..00000000 --- a/sample/src/Demo.Api.Full/appsettings.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft": "Warning", - "Microsoft.Hosting.Lifetime": "Information" - } - }, - "AllowedHosts": "*" -} diff --git a/sample/src/Demo.Api.Full/web.config b/sample/src/Demo.Api.Full/web.config deleted file mode 100644 index 1b97ba03..00000000 --- a/sample/src/Demo.Api.Full/web.config +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/sample/src/Demo.Api.Full/wwwroot/swagger-ui/style.css b/sample/src/Demo.Api.Full/wwwroot/swagger-ui/style.css deleted file mode 100644 index 5bd59239..00000000 --- a/sample/src/Demo.Api.Full/wwwroot/swagger-ui/style.css +++ /dev/null @@ -1,16 +0,0 @@ -.topbar-wrapper .link { - background: url(swagger.png); - background-size: contain; - height: 22px; - width: 220px; - background-repeat: no-repeat; - flex: none !important; -} - - .topbar-wrapper .link img, .topbar-wrapper .link span { - display: none; - } - -#swagger-ui .select-label span { - color: white; -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/ApiRegistration.cs b/sample/src/Demo.Api.Generated/ApiRegistration.cs deleted file mode 100644 index 48ee64f0..00000000 --- a/sample/src/Demo.Api.Generated/ApiRegistration.cs +++ /dev/null @@ -1,12 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated; - -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class ApiRegistration -{ -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Accounts/Interfaces/ISetAccountNameHandler.cs b/sample/src/Demo.Api.Generated/Contracts/Accounts/Interfaces/ISetAccountNameHandler.cs deleted file mode 100644 index d7006c0e..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Accounts/Interfaces/ISetAccountNameHandler.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Accounts; - -/// -/// Domain Interface for RequestHandler. -/// Description: Set name of account. -/// Operation: SetAccountName. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public interface ISetAccountNameHandler -{ - /// - /// Execute method. - /// - /// The parameters. - /// The cancellation token. - Task ExecuteAsync( - SetAccountNameParameters parameters, - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Accounts/Interfaces/IUpdateAccountNameHandler.cs b/sample/src/Demo.Api.Generated/Contracts/Accounts/Interfaces/IUpdateAccountNameHandler.cs deleted file mode 100644 index 686017ca..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Accounts/Interfaces/IUpdateAccountNameHandler.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Accounts; - -/// -/// Domain Interface for RequestHandler. -/// Description: Update name of account. -/// Operation: UpdateAccountName. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public interface IUpdateAccountNameHandler -{ - /// - /// Execute method. - /// - /// The parameters. - /// The cancellation token. - Task ExecuteAsync( - UpdateAccountNameParameters parameters, - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Accounts/Models/UpdateAccountRequest.cs b/sample/src/Demo.Api.Generated/Contracts/Accounts/Models/UpdateAccountRequest.cs deleted file mode 100644 index 537ab123..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Accounts/Models/UpdateAccountRequest.cs +++ /dev/null @@ -1,20 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Accounts; - -/// -/// UpdateAccountRequest. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class UpdateAccountRequest -{ - public string Name { get; set; } - - /// - public override string ToString() - => $"{nameof(Name)}: {Name}"; -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Accounts/Parameters/SetAccountNameParameters.cs b/sample/src/Demo.Api.Generated/Contracts/Accounts/Parameters/SetAccountNameParameters.cs deleted file mode 100644 index 05b43e6d..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Accounts/Parameters/SetAccountNameParameters.cs +++ /dev/null @@ -1,34 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Accounts; - -/// -/// Parameters for operation request. -/// Description: Set name of account. -/// Operation: SetAccountName. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class SetAccountNameParameters -{ - /// - /// The accountId. - /// - [FromRoute(Name = "accountId")] - [Required] - public Guid AccountId { get; set; } - - /// - /// UpdateAccountRequest. - /// - [FromBody] - [Required] - public UpdateAccountRequest Request { get; set; } - - /// - public override string ToString() - => $"{nameof(AccountId)}: {AccountId}, {nameof(Request)}: ({Request})"; -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Accounts/Parameters/UpdateAccountNameParameters.cs b/sample/src/Demo.Api.Generated/Contracts/Accounts/Parameters/UpdateAccountNameParameters.cs deleted file mode 100644 index f11b5327..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Accounts/Parameters/UpdateAccountNameParameters.cs +++ /dev/null @@ -1,33 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.344.48829. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Accounts; - -/// -/// Parameters for operation request. -/// Description: Update name of account. -/// Operation: UpdateAccountName. -/// -[GeneratedCode("ApiGenerator", "2.0.344.48829")] -public class UpdateAccountNameParameters -{ - /// - /// The accountId. - /// - [FromRoute(Name = "accountId")] - [Required] - public Guid AccountId { get; set; } - - /// - /// The account name. - /// - [FromHeader(Name = "name")] - public string? Name { get; set; } - - /// - public override string ToString() - => $"{nameof(AccountId)}: {AccountId}, {nameof(Name)}: {Name}"; -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Accounts/Results/SetAccountNameResult.cs b/sample/src/Demo.Api.Generated/Contracts/Accounts/Results/SetAccountNameResult.cs deleted file mode 100644 index 9c48b6cd..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Accounts/Results/SetAccountNameResult.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Accounts; - -/// -/// Results for operation request. -/// Description: Set name of account. -/// Operation: SetAccountName. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class SetAccountNameResult : ResultBase -{ - private SetAccountNameResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static SetAccountNameResult Ok(string? message = null) - => new SetAccountNameResult(new OkObjectResult(message)); - - /// - /// Performs an implicit conversion from SetAccountNameResult to ActionResult. - /// - public static implicit operator SetAccountNameResult(string response) - => Ok(response); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Accounts/Results/UpdateAccountNameResult.cs b/sample/src/Demo.Api.Generated/Contracts/Accounts/Results/UpdateAccountNameResult.cs deleted file mode 100644 index 29ebb69e..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Accounts/Results/UpdateAccountNameResult.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Accounts; - -/// -/// Results for operation request. -/// Description: Update name of account. -/// Operation: UpdateAccountName. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class UpdateAccountNameResult : ResultBase -{ - private UpdateAccountNameResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static UpdateAccountNameResult Ok(string? message = null) - => new UpdateAccountNameResult(new OkObjectResult(message)); - - /// - /// Performs an implicit conversion from UpdateAccountNameResult to ActionResult. - /// - public static implicit operator UpdateAccountNameResult(string response) - => Ok(response); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Addresses/Interfaces/IGetAddressesByPostalCodesHandler.cs b/sample/src/Demo.Api.Generated/Contracts/Addresses/Interfaces/IGetAddressesByPostalCodesHandler.cs deleted file mode 100644 index cf19a16d..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Addresses/Interfaces/IGetAddressesByPostalCodesHandler.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Addresses; - -/// -/// Domain Interface for RequestHandler. -/// Description: Get addresses by postal code. -/// Operation: GetAddressesByPostalCodes. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public interface IGetAddressesByPostalCodesHandler -{ - /// - /// Execute method. - /// - /// The parameters. - /// The cancellation token. - Task ExecuteAsync( - GetAddressesByPostalCodesParameters parameters, - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Addresses/Parameters/GetAddressesByPostalCodesParameters.cs b/sample/src/Demo.Api.Generated/Contracts/Addresses/Parameters/GetAddressesByPostalCodesParameters.cs deleted file mode 100644 index b5f55514..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Addresses/Parameters/GetAddressesByPostalCodesParameters.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Addresses; - -/// -/// Parameters for operation request. -/// Description: Get addresses by postal code. -/// Operation: GetAddressesByPostalCodes. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class GetAddressesByPostalCodesParameters -{ - /// - /// The postalCode to limit addresses on. - /// - [FromRoute(Name = "postalCode")] - [Required] - public string PostalCode { get; set; } - - /// - public override string ToString() - => $"{nameof(PostalCode)}: {PostalCode}"; -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Addresses/Results/GetAddressesByPostalCodesResult.cs b/sample/src/Demo.Api.Generated/Contracts/Addresses/Results/GetAddressesByPostalCodesResult.cs deleted file mode 100644 index 2e3093c6..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Addresses/Results/GetAddressesByPostalCodesResult.cs +++ /dev/null @@ -1,36 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Addresses; - -/// -/// Results for operation request. -/// Description: Get addresses by postal code. -/// Operation: GetAddressesByPostalCodes. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class GetAddressesByPostalCodesResult : ResultBase -{ - private GetAddressesByPostalCodesResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static GetAddressesByPostalCodesResult Ok(IEnumerable
response) - => new GetAddressesByPostalCodesResult(new OkObjectResult(response ?? Enumerable.Empty
())); - - /// - /// 404 - NotFound response. - /// - public static GetAddressesByPostalCodesResult NotFound(string? message = null) - => new GetAddressesByPostalCodesResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.NotFound, message)); - - /// - /// Performs an implicit conversion from GetAddressesByPostalCodesResult to ActionResult. - /// - public static implicit operator GetAddressesByPostalCodesResult(List
response) - => Ok(response); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/EventArgs/Interfaces/IGetEventArgByIdHandler.cs b/sample/src/Demo.Api.Generated/Contracts/EventArgs/Interfaces/IGetEventArgByIdHandler.cs deleted file mode 100644 index 87f1a19c..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/EventArgs/Interfaces/IGetEventArgByIdHandler.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.EventArgs; - -/// -/// Domain Interface for RequestHandler. -/// Description: Get EventArgs By Id. -/// Operation: GetEventArgById. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public interface IGetEventArgByIdHandler -{ - /// - /// Execute method. - /// - /// The parameters. - /// The cancellation token. - Task ExecuteAsync( - GetEventArgByIdParameters parameters, - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/EventArgs/Interfaces/IGetEventArgsHandler.cs b/sample/src/Demo.Api.Generated/Contracts/EventArgs/Interfaces/IGetEventArgsHandler.cs deleted file mode 100644 index 9059cf2c..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/EventArgs/Interfaces/IGetEventArgsHandler.cs +++ /dev/null @@ -1,23 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.EventArgs; - -/// -/// Domain Interface for RequestHandler. -/// Description: Get EventArgs List. -/// Operation: GetEventArgs. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public interface IGetEventArgsHandler -{ - /// - /// Execute method. - /// - /// The cancellation token. - Task ExecuteAsync( - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/EventArgs/Models/EventArgs.cs b/sample/src/Demo.Api.Generated/Contracts/EventArgs/Models/EventArgs.cs deleted file mode 100644 index 53892bd9..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/EventArgs/Models/EventArgs.cs +++ /dev/null @@ -1,22 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.EventArgs; - -/// -/// EventArgs. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class EventArgs -{ - public Guid Id { get; set; } - - public string EventName { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}, {nameof(EventName)}: {EventName}"; -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/EventArgs/Parameters/GetEventArgByIdParameters.cs b/sample/src/Demo.Api.Generated/Contracts/EventArgs/Parameters/GetEventArgByIdParameters.cs deleted file mode 100644 index 84a85c34..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/EventArgs/Parameters/GetEventArgByIdParameters.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.EventArgs; - -/// -/// Parameters for operation request. -/// Description: Get EventArgs By Id. -/// Operation: GetEventArgById. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class GetEventArgByIdParameters -{ - /// - /// The id of the eventArgs. - /// - [FromRoute(Name = "id")] - [Required] - public string Id { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}"; -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/EventArgs/Results/GetEventArgByIdResult.cs b/sample/src/Demo.Api.Generated/Contracts/EventArgs/Results/GetEventArgByIdResult.cs deleted file mode 100644 index 0aee4b67..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/EventArgs/Results/GetEventArgByIdResult.cs +++ /dev/null @@ -1,36 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.EventArgs; - -/// -/// Results for operation request. -/// Description: Get EventArgs By Id. -/// Operation: GetEventArgById. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class GetEventArgByIdResult : ResultBase -{ - private GetEventArgByIdResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static GetEventArgByIdResult Ok(EventArgs response) - => new GetEventArgByIdResult(new OkObjectResult(response)); - - /// - /// 404 - NotFound response. - /// - public static GetEventArgByIdResult NotFound(string? message = null) - => new GetEventArgByIdResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.NotFound, message)); - - /// - /// Performs an implicit conversion from GetEventArgByIdResult to ActionResult. - /// - public static implicit operator GetEventArgByIdResult(EventArgs response) - => Ok(response); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/EventArgs/Results/GetEventArgsResult.cs b/sample/src/Demo.Api.Generated/Contracts/EventArgs/Results/GetEventArgsResult.cs deleted file mode 100644 index 80d748c4..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/EventArgs/Results/GetEventArgsResult.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.EventArgs; - -/// -/// Results for operation request. -/// Description: Get EventArgs List. -/// Operation: GetEventArgs. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class GetEventArgsResult : ResultBase -{ - private GetEventArgsResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static GetEventArgsResult Ok(IEnumerable response) - => new GetEventArgsResult(new OkObjectResult(response ?? Enumerable.Empty())); - - /// - /// Performs an implicit conversion from GetEventArgsResult to ActionResult. - /// - public static implicit operator GetEventArgsResult(List response) - => Ok(response); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Eventargs/Interfaces/IGetEventArgByIdHandler.cs b/sample/src/Demo.Api.Generated/Contracts/Eventargs/Interfaces/IGetEventArgByIdHandler.cs deleted file mode 100644 index 87f1a19c..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Eventargs/Interfaces/IGetEventArgByIdHandler.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.EventArgs; - -/// -/// Domain Interface for RequestHandler. -/// Description: Get EventArgs By Id. -/// Operation: GetEventArgById. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public interface IGetEventArgByIdHandler -{ - /// - /// Execute method. - /// - /// The parameters. - /// The cancellation token. - Task ExecuteAsync( - GetEventArgByIdParameters parameters, - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Eventargs/Interfaces/IGetEventArgsHandler.cs b/sample/src/Demo.Api.Generated/Contracts/Eventargs/Interfaces/IGetEventArgsHandler.cs deleted file mode 100644 index 9059cf2c..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Eventargs/Interfaces/IGetEventArgsHandler.cs +++ /dev/null @@ -1,23 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.EventArgs; - -/// -/// Domain Interface for RequestHandler. -/// Description: Get EventArgs List. -/// Operation: GetEventArgs. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public interface IGetEventArgsHandler -{ - /// - /// Execute method. - /// - /// The cancellation token. - Task ExecuteAsync( - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Eventargs/Models/EventArgs.cs b/sample/src/Demo.Api.Generated/Contracts/Eventargs/Models/EventArgs.cs deleted file mode 100644 index 53892bd9..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Eventargs/Models/EventArgs.cs +++ /dev/null @@ -1,22 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.EventArgs; - -/// -/// EventArgs. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class EventArgs -{ - public Guid Id { get; set; } - - public string EventName { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}, {nameof(EventName)}: {EventName}"; -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Eventargs/Parameters/GetEventArgByIdParameters.cs b/sample/src/Demo.Api.Generated/Contracts/Eventargs/Parameters/GetEventArgByIdParameters.cs deleted file mode 100644 index 84a85c34..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Eventargs/Parameters/GetEventArgByIdParameters.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.EventArgs; - -/// -/// Parameters for operation request. -/// Description: Get EventArgs By Id. -/// Operation: GetEventArgById. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class GetEventArgByIdParameters -{ - /// - /// The id of the eventArgs. - /// - [FromRoute(Name = "id")] - [Required] - public string Id { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}"; -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Eventargs/Results/GetEventArgByIdResult.cs b/sample/src/Demo.Api.Generated/Contracts/Eventargs/Results/GetEventArgByIdResult.cs deleted file mode 100644 index 0aee4b67..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Eventargs/Results/GetEventArgByIdResult.cs +++ /dev/null @@ -1,36 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.EventArgs; - -/// -/// Results for operation request. -/// Description: Get EventArgs By Id. -/// Operation: GetEventArgById. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class GetEventArgByIdResult : ResultBase -{ - private GetEventArgByIdResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static GetEventArgByIdResult Ok(EventArgs response) - => new GetEventArgByIdResult(new OkObjectResult(response)); - - /// - /// 404 - NotFound response. - /// - public static GetEventArgByIdResult NotFound(string? message = null) - => new GetEventArgByIdResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.NotFound, message)); - - /// - /// Performs an implicit conversion from GetEventArgByIdResult to ActionResult. - /// - public static implicit operator GetEventArgByIdResult(EventArgs response) - => Ok(response); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Eventargs/Results/GetEventArgsResult.cs b/sample/src/Demo.Api.Generated/Contracts/Eventargs/Results/GetEventArgsResult.cs deleted file mode 100644 index 80d748c4..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Eventargs/Results/GetEventArgsResult.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.EventArgs; - -/// -/// Results for operation request. -/// Description: Get EventArgs List. -/// Operation: GetEventArgs. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class GetEventArgsResult : ResultBase -{ - private GetEventArgsResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static GetEventArgsResult Ok(IEnumerable response) - => new GetEventArgsResult(new OkObjectResult(response ?? Enumerable.Empty())); - - /// - /// Performs an implicit conversion from GetEventArgsResult to ActionResult. - /// - public static implicit operator GetEventArgsResult(List response) - => Ok(response); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Files/Interfaces/IGetFileByIdHandler.cs b/sample/src/Demo.Api.Generated/Contracts/Files/Interfaces/IGetFileByIdHandler.cs deleted file mode 100644 index 61d762c1..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Files/Interfaces/IGetFileByIdHandler.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Files; - -/// -/// Domain Interface for RequestHandler. -/// Description: Get File By Id. -/// Operation: GetFileById. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public interface IGetFileByIdHandler -{ - /// - /// Execute method. - /// - /// The parameters. - /// The cancellation token. - Task ExecuteAsync( - GetFileByIdParameters parameters, - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Files/Interfaces/IUploadMultiFilesAsFormDataHandler.cs b/sample/src/Demo.Api.Generated/Contracts/Files/Interfaces/IUploadMultiFilesAsFormDataHandler.cs deleted file mode 100644 index 3c01b041..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Files/Interfaces/IUploadMultiFilesAsFormDataHandler.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Files; - -/// -/// Domain Interface for RequestHandler. -/// Description: Upload multi files as form data. -/// Operation: UploadMultiFilesAsFormData. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public interface IUploadMultiFilesAsFormDataHandler -{ - /// - /// Execute method. - /// - /// The parameters. - /// The cancellation token. - Task ExecuteAsync( - UploadMultiFilesAsFormDataParameters parameters, - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Files/Interfaces/IUploadSingleFileAsFormDataHandler.cs b/sample/src/Demo.Api.Generated/Contracts/Files/Interfaces/IUploadSingleFileAsFormDataHandler.cs deleted file mode 100644 index 4c2acd01..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Files/Interfaces/IUploadSingleFileAsFormDataHandler.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Files; - -/// -/// Domain Interface for RequestHandler. -/// Description: Upload a file as OctetStream. -/// Operation: UploadSingleFileAsFormData. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public interface IUploadSingleFileAsFormDataHandler -{ - /// - /// Execute method. - /// - /// The parameters. - /// The cancellation token. - Task ExecuteAsync( - UploadSingleFileAsFormDataParameters parameters, - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Files/Interfaces/IUploadSingleObjectWithFileAsFormDataHandler.cs b/sample/src/Demo.Api.Generated/Contracts/Files/Interfaces/IUploadSingleObjectWithFileAsFormDataHandler.cs deleted file mode 100644 index 26876ed9..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Files/Interfaces/IUploadSingleObjectWithFileAsFormDataHandler.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Files; - -/// -/// Domain Interface for RequestHandler. -/// Description: Upload a file as FormData. -/// Operation: UploadSingleObjectWithFileAsFormData. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public interface IUploadSingleObjectWithFileAsFormDataHandler -{ - /// - /// Execute method. - /// - /// The parameters. - /// The cancellation token. - Task ExecuteAsync( - UploadSingleObjectWithFileAsFormDataParameters parameters, - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Files/Interfaces/IUploadSingleObjectWithFilesAsFormDataHandler.cs b/sample/src/Demo.Api.Generated/Contracts/Files/Interfaces/IUploadSingleObjectWithFilesAsFormDataHandler.cs deleted file mode 100644 index 6641873d..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Files/Interfaces/IUploadSingleObjectWithFilesAsFormDataHandler.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Files; - -/// -/// Domain Interface for RequestHandler. -/// Description: Upload files as FormData. -/// Operation: UploadSingleObjectWithFilesAsFormData. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public interface IUploadSingleObjectWithFilesAsFormDataHandler -{ - /// - /// Execute method. - /// - /// The parameters. - /// The cancellation token. - Task ExecuteAsync( - UploadSingleObjectWithFilesAsFormDataParameters parameters, - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Files/Models/FileAsFormDataRequest.cs b/sample/src/Demo.Api.Generated/Contracts/Files/Models/FileAsFormDataRequest.cs deleted file mode 100644 index e0df246d..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Files/Models/FileAsFormDataRequest.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Files; - -/// -/// FileAsFormDataRequest. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class FileAsFormDataRequest -{ - [Required] - public string ItemName { get; set; } - - public IFormFile? File { get; set; } - - [Required] - public List Items { get; set; } - - /// - public override string ToString() - => $"{nameof(ItemName)}: {ItemName}, {nameof(File)}: {File}, {nameof(Items)}.Count: {Items?.Count ?? 0}"; -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Files/Models/FilesAsFormDataRequest.cs b/sample/src/Demo.Api.Generated/Contracts/Files/Models/FilesAsFormDataRequest.cs deleted file mode 100644 index 611cb524..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Files/Models/FilesAsFormDataRequest.cs +++ /dev/null @@ -1,23 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Files; - -/// -/// FilesAsFormDataRequest. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class FilesAsFormDataRequest -{ - /// - /// A list of File(s). - /// - public List Files { get; set; } = new List(); - - /// - public override string ToString() - => $"{nameof(Files)}.Count: {Files?.Count ?? 0}"; -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Files/Parameters/GetFileByIdParameters.cs b/sample/src/Demo.Api.Generated/Contracts/Files/Parameters/GetFileByIdParameters.cs deleted file mode 100644 index 86b96d18..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Files/Parameters/GetFileByIdParameters.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Files; - -/// -/// Parameters for operation request. -/// Description: Get File By Id. -/// Operation: GetFileById. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class GetFileByIdParameters -{ - /// - /// The file id. - /// - [FromRoute(Name = "id")] - [Required] - public string Id { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}"; -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Files/Parameters/UploadMultiFilesAsFormDataParameters.cs b/sample/src/Demo.Api.Generated/Contracts/Files/Parameters/UploadMultiFilesAsFormDataParameters.cs deleted file mode 100644 index 15cdd262..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Files/Parameters/UploadMultiFilesAsFormDataParameters.cs +++ /dev/null @@ -1,24 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Files; - -/// -/// Parameters for operation request. -/// Description: Upload multi files as form data. -/// Operation: UploadMultiFilesAsFormData. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class UploadMultiFilesAsFormDataParameters -{ - [FromForm] - [Required] - public List Request { get; set; } = new List(); - - /// - public override string ToString() - => $"{nameof(Request)}.Count: {Request?.Count ?? 0}"; -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Files/Parameters/UploadSingleFileAsFormDataParameters.cs b/sample/src/Demo.Api.Generated/Contracts/Files/Parameters/UploadSingleFileAsFormDataParameters.cs deleted file mode 100644 index c3cdda53..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Files/Parameters/UploadSingleFileAsFormDataParameters.cs +++ /dev/null @@ -1,24 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Files; - -/// -/// Parameters for operation request. -/// Description: Upload a file as OctetStream. -/// Operation: UploadSingleFileAsFormData. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class UploadSingleFileAsFormDataParameters -{ - [FromBody] - [Required] - public IFormFile Request { get; set; } - - /// - public override string ToString() - => $"{nameof(Request)}: ({Request})"; -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Files/Parameters/UploadSingleObjectWithFileAsFormDataParameters.cs b/sample/src/Demo.Api.Generated/Contracts/Files/Parameters/UploadSingleObjectWithFileAsFormDataParameters.cs deleted file mode 100644 index 5f775304..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Files/Parameters/UploadSingleObjectWithFileAsFormDataParameters.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Files; - -/// -/// Parameters for operation request. -/// Description: Upload a file as FormData. -/// Operation: UploadSingleObjectWithFileAsFormData. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class UploadSingleObjectWithFileAsFormDataParameters -{ - /// - /// FileAsFormDataRequest. - /// - [FromForm] - [Required] - public FileAsFormDataRequest Request { get; set; } - - /// - public override string ToString() - => $"{nameof(Request)}: ({Request})"; -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Files/Parameters/UploadSingleObjectWithFilesAsFormDataParameters.cs b/sample/src/Demo.Api.Generated/Contracts/Files/Parameters/UploadSingleObjectWithFilesAsFormDataParameters.cs deleted file mode 100644 index 60f6774f..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Files/Parameters/UploadSingleObjectWithFilesAsFormDataParameters.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Files; - -/// -/// Parameters for operation request. -/// Description: Upload files as FormData. -/// Operation: UploadSingleObjectWithFilesAsFormData. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class UploadSingleObjectWithFilesAsFormDataParameters -{ - /// - /// FilesAsFormDataRequest. - /// - [FromForm] - [Required] - public FilesAsFormDataRequest Request { get; set; } - - /// - public override string ToString() - => $"{nameof(Request)}: ({Request})"; -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Files/Results/GetFileByIdResult.cs b/sample/src/Demo.Api.Generated/Contracts/Files/Results/GetFileByIdResult.cs deleted file mode 100644 index 7a236635..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Files/Results/GetFileByIdResult.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Files; - -/// -/// Results for operation request. -/// Description: Get File By Id. -/// Operation: GetFileById. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class GetFileByIdResult : ResultBase -{ - private GetFileByIdResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static GetFileByIdResult Ok(byte[] bytes, string fileName) - => new GetFileByIdResult(ResultFactory.CreateFileContentResult(bytes, fileName)); - - /// - /// 404 - NotFound response. - /// - public static GetFileByIdResult NotFound(string? message = null) - => new GetFileByIdResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.NotFound, message)); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Files/Results/UploadMultiFilesAsFormDataResult.cs b/sample/src/Demo.Api.Generated/Contracts/Files/Results/UploadMultiFilesAsFormDataResult.cs deleted file mode 100644 index 8af90822..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Files/Results/UploadMultiFilesAsFormDataResult.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Files; - -/// -/// Results for operation request. -/// Description: Upload multi files as form data. -/// Operation: UploadMultiFilesAsFormData. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class UploadMultiFilesAsFormDataResult : ResultBase -{ - private UploadMultiFilesAsFormDataResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static UploadMultiFilesAsFormDataResult Ok(string? message = null) - => new UploadMultiFilesAsFormDataResult(new OkObjectResult(message)); - - /// - /// Performs an implicit conversion from UploadMultiFilesAsFormDataResult to ActionResult. - /// - public static implicit operator UploadMultiFilesAsFormDataResult(string response) - => Ok(response); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Files/Results/UploadSingleFileAsFormDataResult.cs b/sample/src/Demo.Api.Generated/Contracts/Files/Results/UploadSingleFileAsFormDataResult.cs deleted file mode 100644 index 862cfd6a..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Files/Results/UploadSingleFileAsFormDataResult.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Files; - -/// -/// Results for operation request. -/// Description: Upload a file as OctetStream. -/// Operation: UploadSingleFileAsFormData. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class UploadSingleFileAsFormDataResult : ResultBase -{ - private UploadSingleFileAsFormDataResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static UploadSingleFileAsFormDataResult Ok(string? message = null) - => new UploadSingleFileAsFormDataResult(new OkObjectResult(message)); - - /// - /// Performs an implicit conversion from UploadSingleFileAsFormDataResult to ActionResult. - /// - public static implicit operator UploadSingleFileAsFormDataResult(string response) - => Ok(response); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Files/Results/UploadSingleObjectWithFileAsFormDataResult.cs b/sample/src/Demo.Api.Generated/Contracts/Files/Results/UploadSingleObjectWithFileAsFormDataResult.cs deleted file mode 100644 index cce40863..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Files/Results/UploadSingleObjectWithFileAsFormDataResult.cs +++ /dev/null @@ -1,36 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Files; - -/// -/// Results for operation request. -/// Description: Upload a file as FormData. -/// Operation: UploadSingleObjectWithFileAsFormData. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class UploadSingleObjectWithFileAsFormDataResult : ResultBase -{ - private UploadSingleObjectWithFileAsFormDataResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static UploadSingleObjectWithFileAsFormDataResult Ok(string? message = null) - => new UploadSingleObjectWithFileAsFormDataResult(new OkObjectResult(message)); - - /// - /// 400 - BadRequest response. - /// - public static UploadSingleObjectWithFileAsFormDataResult BadRequest(string message) - => new UploadSingleObjectWithFileAsFormDataResult(ResultFactory.CreateContentResultWithValidationProblemDetails(HttpStatusCode.BadRequest, message)); - - /// - /// Performs an implicit conversion from UploadSingleObjectWithFileAsFormDataResult to ActionResult. - /// - public static implicit operator UploadSingleObjectWithFileAsFormDataResult(string response) - => Ok(response); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Files/Results/UploadSingleObjectWithFilesAsFormDataResult.cs b/sample/src/Demo.Api.Generated/Contracts/Files/Results/UploadSingleObjectWithFilesAsFormDataResult.cs deleted file mode 100644 index 7cca6c92..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Files/Results/UploadSingleObjectWithFilesAsFormDataResult.cs +++ /dev/null @@ -1,36 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Files; - -/// -/// Results for operation request. -/// Description: Upload files as FormData. -/// Operation: UploadSingleObjectWithFilesAsFormData. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class UploadSingleObjectWithFilesAsFormDataResult : ResultBase -{ - private UploadSingleObjectWithFilesAsFormDataResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static UploadSingleObjectWithFilesAsFormDataResult Ok(string? message = null) - => new UploadSingleObjectWithFilesAsFormDataResult(new OkObjectResult(message)); - - /// - /// 400 - BadRequest response. - /// - public static UploadSingleObjectWithFilesAsFormDataResult BadRequest(string message) - => new UploadSingleObjectWithFilesAsFormDataResult(ResultFactory.CreateContentResultWithValidationProblemDetails(HttpStatusCode.BadRequest, message)); - - /// - /// Performs an implicit conversion from UploadSingleObjectWithFilesAsFormDataResult to ActionResult. - /// - public static implicit operator UploadSingleObjectWithFilesAsFormDataResult(string response) - => Ok(response); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Items/Interfaces/ICreateItemHandler.cs b/sample/src/Demo.Api.Generated/Contracts/Items/Interfaces/ICreateItemHandler.cs deleted file mode 100644 index 8b89c126..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Items/Interfaces/ICreateItemHandler.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Items; - -/// -/// Domain Interface for RequestHandler. -/// Description: Create a new item. -/// Operation: CreateItem. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public interface ICreateItemHandler -{ - /// - /// Execute method. - /// - /// The parameters. - /// The cancellation token. - Task ExecuteAsync( - CreateItemParameters parameters, - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Items/Interfaces/IUpdateItemHandler.cs b/sample/src/Demo.Api.Generated/Contracts/Items/Interfaces/IUpdateItemHandler.cs deleted file mode 100644 index f3957db1..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Items/Interfaces/IUpdateItemHandler.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Items; - -/// -/// Domain Interface for RequestHandler. -/// Description: Updates an item. -/// Operation: UpdateItem. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public interface IUpdateItemHandler -{ - /// - /// Execute method. - /// - /// The parameters. - /// The cancellation token. - Task ExecuteAsync( - UpdateItemParameters parameters, - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Items/Models/CreateItemRequest.cs b/sample/src/Demo.Api.Generated/Contracts/Items/Models/CreateItemRequest.cs deleted file mode 100644 index e4c39f77..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Items/Models/CreateItemRequest.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Items; - -/// -/// CreateItemRequest. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class CreateItemRequest -{ - /// - /// Item. - /// - [Required] - public Item Item { get; set; } - - /// - /// A list of Item. - /// - [Required] - public List MyItems { get; set; } - - /// - public override string ToString() - => $"{nameof(Item)}: ({Item}), {nameof(MyItems)}.Count: {MyItems?.Count ?? 0}"; -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Items/Models/Item.cs b/sample/src/Demo.Api.Generated/Contracts/Items/Models/Item.cs deleted file mode 100644 index 5b877abf..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Items/Models/Item.cs +++ /dev/null @@ -1,21 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Items; - -/// -/// Item. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class Item -{ - [Required] - public string Name { get; set; } - - /// - public override string ToString() - => $"{nameof(Name)}: {Name}"; -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Items/Models/UpdateItemRequest.cs b/sample/src/Demo.Api.Generated/Contracts/Items/Models/UpdateItemRequest.cs deleted file mode 100644 index 32385091..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Items/Models/UpdateItemRequest.cs +++ /dev/null @@ -1,24 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Items; - -/// -/// UpdateItemRequest. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class UpdateItemRequest -{ - /// - /// Item. - /// - [Required] - public Item Item { get; set; } - - /// - public override string ToString() - => $"{nameof(Item)}: ({Item})"; -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Items/Parameters/CreateItemParameters.cs b/sample/src/Demo.Api.Generated/Contracts/Items/Parameters/CreateItemParameters.cs deleted file mode 100644 index d40e1092..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Items/Parameters/CreateItemParameters.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Items; - -/// -/// Parameters for operation request. -/// Description: Create a new item. -/// Operation: CreateItem. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class CreateItemParameters -{ - /// - /// CreateItemRequest. - /// - [FromBody] - [Required] - public CreateItemRequest Request { get; set; } - - /// - public override string ToString() - => $"{nameof(Request)}: ({Request})"; -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Items/Parameters/UpdateItemParameters.cs b/sample/src/Demo.Api.Generated/Contracts/Items/Parameters/UpdateItemParameters.cs deleted file mode 100644 index 5391590b..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Items/Parameters/UpdateItemParameters.cs +++ /dev/null @@ -1,34 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Items; - -/// -/// Parameters for operation request. -/// Description: Updates an item. -/// Operation: UpdateItem. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class UpdateItemParameters -{ - /// - /// The id of the order. - /// - [FromRoute(Name = "id")] - [Required] - public Guid Id { get; set; } - - /// - /// UpdateItemRequest. - /// - [FromBody] - [Required] - public UpdateItemRequest Request { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}, {nameof(Request)}: ({Request})"; -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Items/Results/CreateItemResult.cs b/sample/src/Demo.Api.Generated/Contracts/Items/Results/CreateItemResult.cs deleted file mode 100644 index 318f3bc6..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Items/Results/CreateItemResult.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Items; - -/// -/// Results for operation request. -/// Description: Create a new item. -/// Operation: CreateItem. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class CreateItemResult : ResultBase -{ - private CreateItemResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static CreateItemResult Ok(string? message = null) - => new CreateItemResult(new OkObjectResult(message)); - - /// - /// Performs an implicit conversion from CreateItemResult to ActionResult. - /// - public static implicit operator CreateItemResult(string response) - => Ok(response); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Items/Results/UpdateItemResult.cs b/sample/src/Demo.Api.Generated/Contracts/Items/Results/UpdateItemResult.cs deleted file mode 100644 index 3eeb8ce4..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Items/Results/UpdateItemResult.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Items; - -/// -/// Results for operation request. -/// Description: Updates an item. -/// Operation: UpdateItem. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class UpdateItemResult : ResultBase -{ - private UpdateItemResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static UpdateItemResult Ok(Guid response) - => new UpdateItemResult(new OkObjectResult(response)); - - /// - /// Performs an implicit conversion from UpdateItemResult to ActionResult. - /// - public static implicit operator UpdateItemResult(Guid response) - => Ok(response); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Orders/Interfaces/IGetOrderByIdHandler.cs b/sample/src/Demo.Api.Generated/Contracts/Orders/Interfaces/IGetOrderByIdHandler.cs deleted file mode 100644 index d3c3df8e..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Orders/Interfaces/IGetOrderByIdHandler.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Orders; - -/// -/// Domain Interface for RequestHandler. -/// Description: Get order by id. -/// Operation: GetOrderById. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public interface IGetOrderByIdHandler -{ - /// - /// Execute method. - /// - /// The parameters. - /// The cancellation token. - Task ExecuteAsync( - GetOrderByIdParameters parameters, - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Orders/Interfaces/IGetOrdersHandler.cs b/sample/src/Demo.Api.Generated/Contracts/Orders/Interfaces/IGetOrdersHandler.cs deleted file mode 100644 index 6bf590c7..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Orders/Interfaces/IGetOrdersHandler.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Orders; - -/// -/// Domain Interface for RequestHandler. -/// Description: Get orders. -/// Operation: GetOrders. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public interface IGetOrdersHandler -{ - /// - /// Execute method. - /// - /// The parameters. - /// The cancellation token. - Task ExecuteAsync( - GetOrdersParameters parameters, - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Orders/Interfaces/IPatchOrdersIdHandler.cs b/sample/src/Demo.Api.Generated/Contracts/Orders/Interfaces/IPatchOrdersIdHandler.cs deleted file mode 100644 index e66c5735..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Orders/Interfaces/IPatchOrdersIdHandler.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Orders; - -/// -/// Domain Interface for RequestHandler. -/// Description: Update part of order by id. -/// Operation: PatchOrdersId. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public interface IPatchOrdersIdHandler -{ - /// - /// Execute method. - /// - /// The parameters. - /// The cancellation token. - Task ExecuteAsync( - PatchOrdersIdParameters parameters, - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Orders/Models/Order.cs b/sample/src/Demo.Api.Generated/Contracts/Orders/Models/Order.cs deleted file mode 100644 index 8f7f2720..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Orders/Models/Order.cs +++ /dev/null @@ -1,79 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.323.55388. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Orders; - -/// -/// A single order. -/// Hallo description with multiline and no ending dot. -/// -[GeneratedCode("ApiGenerator", "2.0.323.55388")] -public class Order -{ - public Guid Id { get; set; } - - public string Description { get; set; } - - public DateTimeOffset MyTime { get; set; } - - /// - /// Undefined description. - /// - /// - /// Email validation being enforced. - /// - [EmailAddress] - public string MyEmail { get; set; } = "a@a.com"; - - public DateTimeOffset? MyNullableDateTime { get; set; } - - public DateTimeOffset MyDateTime { get; set; } - - [Range(1.1, 20.2)] - public double MyNumber { get; set; } - - [Range(-2147483648, 50)] - public int MyInteger { get; set; } = 15; - - /// - /// MyBool is great. - /// - public bool MyBool { get; set; } - - /// - /// This is the good uri :-). - /// - /// - /// Url validation being enforced. - /// - [Uri] - public Uri MyUri { get; set; } - - /// - /// Undefined description. - /// - /// - /// This string should be base64-encoded. - /// - public string MyByte { get; set; } - - /// - /// Hallo myStringList desc :-). - /// - public List MyStringList { get; set; } = new List(); - - [Range(10, 2147483647)] - public long MyLong { get; set; } - - /// - /// Address. - /// - public Address DeliveryAddress { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}, {nameof(Description)}: {Description}, {nameof(MyTime)}: ({MyTime}), {nameof(MyEmail)}: {MyEmail}, {nameof(MyNullableDateTime)}: ({MyNullableDateTime}), {nameof(MyDateTime)}: ({MyDateTime}), {nameof(MyNumber)}: {MyNumber}, {nameof(MyInteger)}: {MyInteger}, {nameof(MyBool)}: {MyBool}, {nameof(MyUri)}: ({MyUri}), {nameof(MyByte)}: {MyByte}, {nameof(MyStringList)}.Count: {MyStringList?.Count ?? 0}, {nameof(MyLong)}: {MyLong}, {nameof(DeliveryAddress)}: ({DeliveryAddress})"; -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Orders/Models/UpdateOrderRequest.cs b/sample/src/Demo.Api.Generated/Contracts/Orders/Models/UpdateOrderRequest.cs deleted file mode 100644 index 9cf8f9f9..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Orders/Models/UpdateOrderRequest.cs +++ /dev/null @@ -1,28 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.265.35674. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Orders; - -/// -/// Request to update an order. -/// -[GeneratedCode("ApiGenerator", "2.0.265.35674")] -public class UpdateOrderRequest -{ - /// - /// Undefined description. - /// - /// - /// Email validation being enforced. - /// - [Required] - [EmailAddress] - public string MyEmail { get; set; } - - /// - public override string ToString() - => $"{nameof(MyEmail)}: {MyEmail}"; -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Orders/Parameters/GetOrderByIdParameters.cs b/sample/src/Demo.Api.Generated/Contracts/Orders/Parameters/GetOrderByIdParameters.cs deleted file mode 100644 index 964cc24f..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Orders/Parameters/GetOrderByIdParameters.cs +++ /dev/null @@ -1,37 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.265.35674. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Orders; - -/// -/// Parameters for operation request. -/// Description: Get order by id. -/// Operation: GetOrderById. -/// -[GeneratedCode("ApiGenerator", "2.0.265.35674")] -public class GetOrderByIdParameters -{ - /// - /// The id of the order. - /// - [FromRoute(Name = "id")] - [Required] - public Guid Id { get; set; } - - /// - /// The email for filter orders to retrieve. - /// - /// - /// Email validation being enforced. - /// - [FromQuery(Name = "myEmail")] - [EmailAddress] - public string? MyEmail { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}, {nameof(MyEmail)}: {MyEmail}"; -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Orders/Parameters/GetOrdersParameters.cs b/sample/src/Demo.Api.Generated/Contracts/Orders/Parameters/GetOrdersParameters.cs deleted file mode 100644 index d09bfd8d..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Orders/Parameters/GetOrdersParameters.cs +++ /dev/null @@ -1,53 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Orders; - -/// -/// Parameters for operation request. -/// Description: Get orders. -/// Operation: GetOrders. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class GetOrdersParameters -{ - /// - /// The numbers of items to return. - /// - [FromQuery(Name = "pageSize")] - [Required] - [Range(1, 100)] - public int PageSize { get; set; } = 10; - - /// - /// The number of items to skip before starting to collect the result set. - /// - [FromQuery(Name = "pageIndex")] - [Range(0, 2147483647)] - public int PageIndex { get; set; } = 0; - - /// - /// The query string. - /// - [FromQuery(Name = "queryString")] - public string? QueryString { get; set; } - - /// - /// The query array of string. - /// - [FromQuery(Name = "queryStringArray")] - public List QueryStringArray { get; set; } = new List(); - - /// - /// The continuation token. - /// - [FromQuery(Name = "continuationToken")] - public string? ContinuationToken { get; set; } - - /// - public override string ToString() - => $"{nameof(PageSize)}: {PageSize}, {nameof(PageIndex)}: {PageIndex}, {nameof(QueryString)}: {QueryString}, {nameof(QueryStringArray)}.Count: {QueryStringArray?.Count ?? 0}, {nameof(ContinuationToken)}: {ContinuationToken}"; -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Orders/Parameters/PatchOrdersIdParameters.cs b/sample/src/Demo.Api.Generated/Contracts/Orders/Parameters/PatchOrdersIdParameters.cs deleted file mode 100644 index f03c1191..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Orders/Parameters/PatchOrdersIdParameters.cs +++ /dev/null @@ -1,62 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.305.9854. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Orders; - -/// -/// Parameters for operation request. -/// Description: Update part of order by id. -/// Operation: PatchOrdersId. -/// -[GeneratedCode("ApiGenerator", "2.0.305.9854")] -public class PatchOrdersIdParameters -{ - /// - /// The id of the order. - /// - [FromRoute(Name = "id")] - [Required] - public Guid Id { get; set; } - - /// - /// The myTestHeader special key. - /// - [FromHeader(Name = "myTestHeader")] - [Required] - public string MyTestHeader { get; set; } - - /// - /// The myTestHeaderBool special key. - /// - [FromHeader(Name = "myTestHeaderBool")] - [Required] - public bool MyTestHeaderBool { get; set; } - - /// - /// The myTestHeaderInt special key. - /// - [FromHeader(Name = "myTestHeaderInt")] - [Required] - public int MyTestHeaderInt { get; set; } - - /// - /// The correlationId. - /// - [FromHeader(Name = "x-correlation-id")] - [Required] - public string CorrelationId { get; set; } - - /// - /// Request to update an order. - /// - [FromBody] - [Required] - public UpdateOrderRequest Request { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}, {nameof(MyTestHeader)}: {MyTestHeader}, {nameof(MyTestHeaderBool)}: {MyTestHeaderBool}, {nameof(MyTestHeaderInt)}: {MyTestHeaderInt}, {nameof(CorrelationId)}: {CorrelationId}, {nameof(Request)}: ({Request})"; -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Orders/Results/GetOrderByIdResult.cs b/sample/src/Demo.Api.Generated/Contracts/Orders/Results/GetOrderByIdResult.cs deleted file mode 100644 index 059eda04..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Orders/Results/GetOrderByIdResult.cs +++ /dev/null @@ -1,36 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Orders; - -/// -/// Results for operation request. -/// Description: Get order by id. -/// Operation: GetOrderById. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class GetOrderByIdResult : ResultBase -{ - private GetOrderByIdResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static GetOrderByIdResult Ok(Order response) - => new GetOrderByIdResult(new OkObjectResult(response)); - - /// - /// 404 - NotFound response. - /// - public static GetOrderByIdResult NotFound(string? message = null) - => new GetOrderByIdResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.NotFound, message)); - - /// - /// Performs an implicit conversion from GetOrderByIdResult to ActionResult. - /// - public static implicit operator GetOrderByIdResult(Order response) - => Ok(response); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Orders/Results/GetOrdersResult.cs b/sample/src/Demo.Api.Generated/Contracts/Orders/Results/GetOrdersResult.cs deleted file mode 100644 index 3cde46d4..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Orders/Results/GetOrdersResult.cs +++ /dev/null @@ -1,36 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Orders; - -/// -/// Results for operation request. -/// Description: Get orders. -/// Operation: GetOrders. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class GetOrdersResult : ResultBase -{ - private GetOrdersResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static GetOrdersResult Ok(Pagination response) - => new GetOrdersResult(new OkObjectResult(response)); - - /// - /// 404 - NotFound response. - /// - public static GetOrdersResult NotFound(string? message = null) - => new GetOrdersResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.NotFound, message)); - - /// - /// Performs an implicit conversion from GetOrdersResult to ActionResult. - /// - public static implicit operator GetOrdersResult(Pagination response) - => Ok(response); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Orders/Results/PatchOrdersIdResult.cs b/sample/src/Demo.Api.Generated/Contracts/Orders/Results/PatchOrdersIdResult.cs deleted file mode 100644 index d7af823a..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Orders/Results/PatchOrdersIdResult.cs +++ /dev/null @@ -1,48 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Orders; - -/// -/// Results for operation request. -/// Description: Update part of order by id. -/// Operation: PatchOrdersId. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class PatchOrdersIdResult : ResultBase -{ - private PatchOrdersIdResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static PatchOrdersIdResult Ok(string? message = null) - => new PatchOrdersIdResult(new OkObjectResult(message)); - - /// - /// 404 - NotFound response. - /// - public static PatchOrdersIdResult NotFound(string? message = null) - => new PatchOrdersIdResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.NotFound, message)); - - /// - /// 409 - Conflict response. - /// - public static PatchOrdersIdResult Conflict(object? error = null) - => new PatchOrdersIdResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.Conflict, error)); - - /// - /// 502 - BadGateway response. - /// - public static PatchOrdersIdResult BadGateway(string? message = null) - => new PatchOrdersIdResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.BadGateway, message)); - - /// - /// Performs an implicit conversion from PatchOrdersIdResult to ActionResult. - /// - public static implicit operator PatchOrdersIdResult(string response) - => Ok(response); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/RouteWithDash/Interfaces/IGetRouteWithDashHandler.cs b/sample/src/Demo.Api.Generated/Contracts/RouteWithDash/Interfaces/IGetRouteWithDashHandler.cs deleted file mode 100644 index decf93a9..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/RouteWithDash/Interfaces/IGetRouteWithDashHandler.cs +++ /dev/null @@ -1,23 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.RouteWithDash; - -/// -/// Domain Interface for RequestHandler. -/// Description: Your GET endpoint. -/// Operation: GetRouteWithDash. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public interface IGetRouteWithDashHandler -{ - /// - /// Execute method. - /// - /// The cancellation token. - Task ExecuteAsync( - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/RouteWithDash/Results/GetRouteWithDashResult.cs b/sample/src/Demo.Api.Generated/Contracts/RouteWithDash/Results/GetRouteWithDashResult.cs deleted file mode 100644 index 43c61aa4..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/RouteWithDash/Results/GetRouteWithDashResult.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.RouteWithDash; - -/// -/// Results for operation request. -/// Description: Your GET endpoint. -/// Operation: GetRouteWithDash. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class GetRouteWithDashResult : ResultBase -{ - private GetRouteWithDashResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static GetRouteWithDashResult Ok(string? message = null) - => new GetRouteWithDashResult(new OkObjectResult(message)); - - /// - /// Performs an implicit conversion from GetRouteWithDashResult to ActionResult. - /// - public static implicit operator GetRouteWithDashResult(string response) - => Ok(response); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Tasks/Interfaces/IGetTasksHandler.cs b/sample/src/Demo.Api.Generated/Contracts/Tasks/Interfaces/IGetTasksHandler.cs deleted file mode 100644 index 723cf67b..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Tasks/Interfaces/IGetTasksHandler.cs +++ /dev/null @@ -1,23 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Tasks; - -/// -/// Domain Interface for RequestHandler. -/// Description: Returns tasks. -/// Operation: GetTasks. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public interface IGetTasksHandler -{ - /// - /// Execute method. - /// - /// The cancellation token. - Task ExecuteAsync( - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Tasks/Models/Task.cs b/sample/src/Demo.Api.Generated/Contracts/Tasks/Models/Task.cs deleted file mode 100644 index 0ec07cf8..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Tasks/Models/Task.cs +++ /dev/null @@ -1,22 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Tasks; - -/// -/// Describes a single task. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class Task -{ - public Guid Id { get; set; } - - public string Name { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}, {nameof(Name)}: {Name}"; -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Tasks/Models/Tasks.cs b/sample/src/Demo.Api.Generated/Contracts/Tasks/Models/Tasks.cs deleted file mode 100644 index 90c349ba..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Tasks/Models/Tasks.cs +++ /dev/null @@ -1,23 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Tasks; - -/// -/// Contains a list of Tasks. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class Tasks -{ - /// - /// A list of Task. - /// - public List TaskList { get; set; } = new List(); - - /// - public override string ToString() - => $"{nameof(TaskList)}.Count: {TaskList?.Count ?? 0}"; -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Tasks/Results/GetTasksResult.cs b/sample/src/Demo.Api.Generated/Contracts/Tasks/Results/GetTasksResult.cs deleted file mode 100644 index 4ad279d2..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Tasks/Results/GetTasksResult.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Tasks; - -/// -/// Results for operation request. -/// Description: Returns tasks. -/// Operation: GetTasks. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class GetTasksResult : ResultBase -{ - private GetTasksResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static GetTasksResult Ok(IEnumerable response) - => new GetTasksResult(new OkObjectResult(response ?? Enumerable.Empty())); - - /// - /// Performs an implicit conversion from GetTasksResult to ActionResult. - /// - public static implicit operator GetTasksResult(List response) - => Ok(response); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Users/Interfaces/IDeleteUserByIdHandler.cs b/sample/src/Demo.Api.Generated/Contracts/Users/Interfaces/IDeleteUserByIdHandler.cs deleted file mode 100644 index 2db1b7c7..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Users/Interfaces/IDeleteUserByIdHandler.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Users; - -/// -/// Domain Interface for RequestHandler. -/// Description: Delete user by id. -/// Operation: DeleteUserById. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public interface IDeleteUserByIdHandler -{ - /// - /// Execute method. - /// - /// The parameters. - /// The cancellation token. - Task ExecuteAsync( - DeleteUserByIdParameters parameters, - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Users/Interfaces/IGetUserByEmailHandler.cs b/sample/src/Demo.Api.Generated/Contracts/Users/Interfaces/IGetUserByEmailHandler.cs deleted file mode 100644 index c207ad5a..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Users/Interfaces/IGetUserByEmailHandler.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Users; - -/// -/// Domain Interface for RequestHandler. -/// Description: Get user by email. -/// Operation: GetUserByEmail. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public interface IGetUserByEmailHandler -{ - /// - /// Execute method. - /// - /// The parameters. - /// The cancellation token. - Task ExecuteAsync( - GetUserByEmailParameters parameters, - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Users/Interfaces/IGetUserByIdHandler.cs b/sample/src/Demo.Api.Generated/Contracts/Users/Interfaces/IGetUserByIdHandler.cs deleted file mode 100644 index 0c532727..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Users/Interfaces/IGetUserByIdHandler.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Users; - -/// -/// Domain Interface for RequestHandler. -/// Description: Get user by id. -/// Operation: GetUserById. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public interface IGetUserByIdHandler -{ - /// - /// Execute method. - /// - /// The parameters. - /// The cancellation token. - Task ExecuteAsync( - GetUserByIdParameters parameters, - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Users/Interfaces/IGetUsersHandler.cs b/sample/src/Demo.Api.Generated/Contracts/Users/Interfaces/IGetUsersHandler.cs deleted file mode 100644 index 4b1d188c..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Users/Interfaces/IGetUsersHandler.cs +++ /dev/null @@ -1,23 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Users; - -/// -/// Domain Interface for RequestHandler. -/// Description: Get all users. -/// Operation: GetUsers. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public interface IGetUsersHandler -{ - /// - /// Execute method. - /// - /// The cancellation token. - Task ExecuteAsync( - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Users/Interfaces/IPostUserHandler.cs b/sample/src/Demo.Api.Generated/Contracts/Users/Interfaces/IPostUserHandler.cs deleted file mode 100644 index c964b065..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Users/Interfaces/IPostUserHandler.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Users; - -/// -/// Domain Interface for RequestHandler. -/// Description: Create a new user. -/// Operation: PostUser. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public interface IPostUserHandler -{ - /// - /// Execute method. - /// - /// The parameters. - /// The cancellation token. - Task ExecuteAsync( - PostUserParameters parameters, - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Users/Interfaces/IUpdateMyTestGenderHandler.cs b/sample/src/Demo.Api.Generated/Contracts/Users/Interfaces/IUpdateMyTestGenderHandler.cs deleted file mode 100644 index 030973aa..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Users/Interfaces/IUpdateMyTestGenderHandler.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Users; - -/// -/// Domain Interface for RequestHandler. -/// Description: Update gender on a user. -/// Operation: UpdateMyTestGender. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public interface IUpdateMyTestGenderHandler -{ - /// - /// Execute method. - /// - /// The parameters. - /// The cancellation token. - Task ExecuteAsync( - UpdateMyTestGenderParameters parameters, - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Users/Interfaces/IUpdateUserByIdHandler.cs b/sample/src/Demo.Api.Generated/Contracts/Users/Interfaces/IUpdateUserByIdHandler.cs deleted file mode 100644 index 82d18165..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Users/Interfaces/IUpdateUserByIdHandler.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Users; - -/// -/// Domain Interface for RequestHandler. -/// Description: Update user by id. -/// Operation: UpdateUserById. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public interface IUpdateUserByIdHandler -{ - /// - /// Execute method. - /// - /// The parameters. - /// The cancellation token. - Task ExecuteAsync( - UpdateUserByIdParameters parameters, - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Users/Models/CreateUserRequest.cs b/sample/src/Demo.Api.Generated/Contracts/Users/Models/CreateUserRequest.cs deleted file mode 100644 index 9e7e4cf4..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Users/Models/CreateUserRequest.cs +++ /dev/null @@ -1,65 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.413.49179. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Users; - -/// -/// Request to create a user. -/// -[GeneratedCode("ApiGenerator", "2.0.413.49179")] -public class CreateUserRequest -{ - [Required] - public string FirstName { get; set; } - - [Required] - public string LastName { get; set; } - - public DateTimeOffset? MyNullableDateTime { get; set; } - - [Required] - public DateTimeOffset MyDateTime { get; set; } - - /// - /// Undefined description. - /// - /// - /// Email validation being enforced. - /// - [Required] - [EmailAddress] - public string Email { get; set; } - - /// - /// Undefined description. - /// - /// - /// Url validation being enforced. - /// - [Uri] - public Uri Homepage { get; set; } - - /// - /// GenderType. - /// - [Required] - public GenderType Gender { get; set; } - - public Address? MyNullableAddress { get; set; } - - [Required] - public Dictionary Tags { get; set; } - - public Dictionary DesiredProperties1 { get; set; } - - public Dictionary? DesiredProperties2 { get; set; } - - public Dictionary? DesiredProperties3 { get; set; } - - /// - public override string ToString() - => $"{nameof(FirstName)}: {FirstName}, {nameof(LastName)}: {LastName}, {nameof(MyNullableDateTime)}: ({MyNullableDateTime}), {nameof(MyDateTime)}: ({MyDateTime}), {nameof(Email)}: {Email}, {nameof(Homepage)}: ({Homepage}), {nameof(Gender)}: {Gender}, {nameof(MyNullableAddress)}: ({MyNullableAddress}), {nameof(Tags)}: ({Tags}), {nameof(DesiredProperties1)}: ({DesiredProperties1}), {nameof(DesiredProperties2)}: ({DesiredProperties2}), {nameof(DesiredProperties3)}: ({DesiredProperties3})"; -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Users/Models/UpdateTestGenderRequest.cs b/sample/src/Demo.Api.Generated/Contracts/Users/Models/UpdateTestGenderRequest.cs deleted file mode 100644 index 1f15159b..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Users/Models/UpdateTestGenderRequest.cs +++ /dev/null @@ -1,23 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Users; - -/// -/// Update test-gender Request. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class UpdateTestGenderRequest -{ - /// - /// GenderType. - /// - public GenderType Gender { get; set; } - - /// - public override string ToString() - => $"{nameof(Gender)}: {Gender}"; -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Users/Models/UpdateUserRequest.cs b/sample/src/Demo.Api.Generated/Contracts/Users/Models/UpdateUserRequest.cs deleted file mode 100644 index 5292b24a..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Users/Models/UpdateUserRequest.cs +++ /dev/null @@ -1,36 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.265.35674. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Users; - -/// -/// Request to update a user. -/// -[GeneratedCode("ApiGenerator", "2.0.265.35674")] -public class UpdateUserRequest -{ - public string FirstName { get; set; } - - public string LastName { get; set; } - - /// - /// Undefined description. - /// - /// - /// Email validation being enforced. - /// - [EmailAddress] - public string Email { get; set; } - - /// - /// GenderType. - /// - public GenderType Gender { get; set; } - - /// - public override string ToString() - => $"{nameof(FirstName)}: {FirstName}, {nameof(LastName)}: {LastName}, {nameof(Email)}: {Email}, {nameof(Gender)}: {Gender}"; -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Users/Models/User.cs b/sample/src/Demo.Api.Generated/Contracts/Users/Models/User.cs deleted file mode 100644 index 033f5682..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Users/Models/User.cs +++ /dev/null @@ -1,62 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.265.35674. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Users; - -/// -/// A single user. -/// -[GeneratedCode("ApiGenerator", "2.0.265.35674")] -public class User -{ - public Guid Id { get; set; } - - /// - /// GenderType. - /// - public GenderType Gender { get; set; } - - public string FirstName { get; set; } - - public string LastName { get; set; } - - /// - /// Undefined description. - /// - /// - /// Email validation being enforced. - /// - [EmailAddress] - public string Email { get; set; } - - /// - /// Undefined description. - /// - /// - /// Url validation being enforced. - /// - [Uri] - public Uri Homepage { get; set; } - - /// - /// ColorType. - /// - public ColorType Color { get; set; } - - /// - /// Address. - /// - public Address HomeAddress { get; set; } - - /// - /// Address. - /// - public Address CompanyAddress { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}, {nameof(Gender)}: {Gender}, {nameof(FirstName)}: {FirstName}, {nameof(LastName)}: {LastName}, {nameof(Email)}: {Email}, {nameof(Homepage)}: ({Homepage}), {nameof(Color)}: {Color}, {nameof(HomeAddress)}: ({HomeAddress}), {nameof(CompanyAddress)}: ({CompanyAddress})"; -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Users/Models/Users.cs b/sample/src/Demo.Api.Generated/Contracts/Users/Models/Users.cs deleted file mode 100644 index da0c5150..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Users/Models/Users.cs +++ /dev/null @@ -1,23 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Users; - -/// -/// A list of users. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class Users -{ - /// - /// A list of User. - /// - public List UserList { get; set; } = new List(); - - /// - public override string ToString() - => $"{nameof(UserList)}.Count: {UserList?.Count ?? 0}"; -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Users/Parameters/DeleteUserByIdParameters.cs b/sample/src/Demo.Api.Generated/Contracts/Users/Parameters/DeleteUserByIdParameters.cs deleted file mode 100644 index 6fcdf4fb..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Users/Parameters/DeleteUserByIdParameters.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Users; - -/// -/// Parameters for operation request. -/// Description: Delete user by id. -/// Operation: DeleteUserById. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class DeleteUserByIdParameters -{ - /// - /// Id of the user. - /// - [FromRoute(Name = "id")] - [Required] - public Guid Id { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}"; -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Users/Parameters/GetUserByEmailParameters.cs b/sample/src/Demo.Api.Generated/Contracts/Users/Parameters/GetUserByEmailParameters.cs deleted file mode 100644 index 5f11e45a..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Users/Parameters/GetUserByEmailParameters.cs +++ /dev/null @@ -1,31 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.265.35674. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Users; - -/// -/// Parameters for operation request. -/// Description: Get user by email. -/// Operation: GetUserByEmail. -/// -[GeneratedCode("ApiGenerator", "2.0.265.35674")] -public class GetUserByEmailParameters -{ - /// - /// The email of the user to retrieve. - /// - /// - /// Email validation being enforced. - /// - [FromQuery(Name = "email")] - [Required] - [EmailAddress] - public string Email { get; set; } - - /// - public override string ToString() - => $"{nameof(Email)}: {Email}"; -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Users/Parameters/GetUserByIdParameters.cs b/sample/src/Demo.Api.Generated/Contracts/Users/Parameters/GetUserByIdParameters.cs deleted file mode 100644 index 7e076ab7..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Users/Parameters/GetUserByIdParameters.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Users; - -/// -/// Parameters for operation request. -/// Description: Get user by id. -/// Operation: GetUserById. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class GetUserByIdParameters -{ - /// - /// Id of the user. - /// - [FromRoute(Name = "id")] - [Required] - public Guid Id { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}"; -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Users/Parameters/PostUserParameters.cs b/sample/src/Demo.Api.Generated/Contracts/Users/Parameters/PostUserParameters.cs deleted file mode 100644 index c6a28b7b..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Users/Parameters/PostUserParameters.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Users; - -/// -/// Parameters for operation request. -/// Description: Create a new user. -/// Operation: PostUser. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class PostUserParameters -{ - /// - /// Request to create a user. - /// - [FromBody] - [Required] - public CreateUserRequest Request { get; set; } - - /// - public override string ToString() - => $"{nameof(Request)}: ({Request})"; -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Users/Parameters/UpdateMyTestGenderParameters.cs b/sample/src/Demo.Api.Generated/Contracts/Users/Parameters/UpdateMyTestGenderParameters.cs deleted file mode 100644 index 33ca2cb6..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Users/Parameters/UpdateMyTestGenderParameters.cs +++ /dev/null @@ -1,40 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Users; - -/// -/// Parameters for operation request. -/// Description: Update gender on a user. -/// Operation: UpdateMyTestGender. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class UpdateMyTestGenderParameters -{ - /// - /// Id of the user. - /// - [FromRoute(Name = "id")] - [Required] - public Guid Id { get; set; } - - /// - /// The gender to set on the user. - /// - [FromQuery(Name = "genderParam")] - public GenderType? GenderParam { get; set; } - - /// - /// Update test-gender Request. - /// - [FromBody] - [Required] - public UpdateTestGenderRequest Request { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}, {nameof(GenderParam)}: {GenderParam}, {nameof(Request)}: ({Request})"; -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Users/Parameters/UpdateUserByIdParameters.cs b/sample/src/Demo.Api.Generated/Contracts/Users/Parameters/UpdateUserByIdParameters.cs deleted file mode 100644 index 0cf9e67e..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Users/Parameters/UpdateUserByIdParameters.cs +++ /dev/null @@ -1,34 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Users; - -/// -/// Parameters for operation request. -/// Description: Update user by id. -/// Operation: UpdateUserById. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class UpdateUserByIdParameters -{ - /// - /// Id of the user. - /// - [FromRoute(Name = "id")] - [Required] - public Guid Id { get; set; } - - /// - /// Request to update a user. - /// - [FromBody] - [Required] - public UpdateUserRequest Request { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}, {nameof(Request)}: ({Request})"; -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Users/Results/DeleteUserByIdResult.cs b/sample/src/Demo.Api.Generated/Contracts/Users/Results/DeleteUserByIdResult.cs deleted file mode 100644 index 46023e19..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Users/Results/DeleteUserByIdResult.cs +++ /dev/null @@ -1,42 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Users; - -/// -/// Results for operation request. -/// Description: Delete user by id. -/// Operation: DeleteUserById. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class DeleteUserByIdResult : ResultBase -{ - private DeleteUserByIdResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static DeleteUserByIdResult Ok(string? message = null) - => new DeleteUserByIdResult(new OkObjectResult(message)); - - /// - /// 404 - NotFound response. - /// - public static DeleteUserByIdResult NotFound(string? message = null) - => new DeleteUserByIdResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.NotFound, message)); - - /// - /// 409 - Conflict response. - /// - public static DeleteUserByIdResult Conflict(object? error = null) - => new DeleteUserByIdResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.Conflict, error)); - - /// - /// Performs an implicit conversion from DeleteUserByIdResult to ActionResult. - /// - public static implicit operator DeleteUserByIdResult(string response) - => Ok(response); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Users/Results/GetUserByEmailResult.cs b/sample/src/Demo.Api.Generated/Contracts/Users/Results/GetUserByEmailResult.cs deleted file mode 100644 index 1b949ddc..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Users/Results/GetUserByEmailResult.cs +++ /dev/null @@ -1,48 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Users; - -/// -/// Results for operation request. -/// Description: Get user by email. -/// Operation: GetUserByEmail. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class GetUserByEmailResult : ResultBase -{ - private GetUserByEmailResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static GetUserByEmailResult Ok(User response) - => new GetUserByEmailResult(new OkObjectResult(response)); - - /// - /// 400 - BadRequest response. - /// - public static GetUserByEmailResult BadRequest(string message) - => new GetUserByEmailResult(ResultFactory.CreateContentResultWithValidationProblemDetails(HttpStatusCode.BadRequest, message)); - - /// - /// 404 - NotFound response. - /// - public static GetUserByEmailResult NotFound(string? message = null) - => new GetUserByEmailResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.NotFound, message)); - - /// - /// 409 - Conflict response. - /// - public static GetUserByEmailResult Conflict(object? error = null) - => new GetUserByEmailResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.Conflict, error)); - - /// - /// Performs an implicit conversion from GetUserByEmailResult to ActionResult. - /// - public static implicit operator GetUserByEmailResult(User response) - => Ok(response); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Users/Results/GetUserByIdResult.cs b/sample/src/Demo.Api.Generated/Contracts/Users/Results/GetUserByIdResult.cs deleted file mode 100644 index 87dab526..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Users/Results/GetUserByIdResult.cs +++ /dev/null @@ -1,42 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Users; - -/// -/// Results for operation request. -/// Description: Get user by id. -/// Operation: GetUserById. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class GetUserByIdResult : ResultBase -{ - private GetUserByIdResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static GetUserByIdResult Ok(User response) - => new GetUserByIdResult(new OkObjectResult(response)); - - /// - /// 404 - NotFound response. - /// - public static GetUserByIdResult NotFound(string? message = null) - => new GetUserByIdResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.NotFound, message)); - - /// - /// 409 - Conflict response. - /// - public static GetUserByIdResult Conflict(object? error = null) - => new GetUserByIdResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.Conflict, error)); - - /// - /// Performs an implicit conversion from GetUserByIdResult to ActionResult. - /// - public static implicit operator GetUserByIdResult(User response) - => Ok(response); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Users/Results/GetUsersResult.cs b/sample/src/Demo.Api.Generated/Contracts/Users/Results/GetUsersResult.cs deleted file mode 100644 index dca11a82..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Users/Results/GetUsersResult.cs +++ /dev/null @@ -1,36 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Users; - -/// -/// Results for operation request. -/// Description: Get all users. -/// Operation: GetUsers. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class GetUsersResult : ResultBase -{ - private GetUsersResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static GetUsersResult Ok(IEnumerable response) - => new GetUsersResult(new OkObjectResult(response ?? Enumerable.Empty())); - - /// - /// 409 - Conflict response. - /// - public static GetUsersResult Conflict(object? error = null) - => new GetUsersResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.Conflict, error)); - - /// - /// Performs an implicit conversion from GetUsersResult to ActionResult. - /// - public static implicit operator GetUsersResult(List response) - => Ok(response); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Users/Results/PostUserResult.cs b/sample/src/Demo.Api.Generated/Contracts/Users/Results/PostUserResult.cs deleted file mode 100644 index c121e65c..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Users/Results/PostUserResult.cs +++ /dev/null @@ -1,36 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Users; - -/// -/// Results for operation request. -/// Description: Create a new user. -/// Operation: PostUser. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class PostUserResult : ResultBase -{ - private PostUserResult(ActionResult result) : base(result) { } - - /// - /// 201 - Created response. - /// - public static PostUserResult Created() - => new PostUserResult(ResultFactory.CreateContentResult(HttpStatusCode.Created, null)); - - /// - /// 400 - BadRequest response. - /// - public static PostUserResult BadRequest(string message) - => new PostUserResult(ResultFactory.CreateContentResultWithValidationProblemDetails(HttpStatusCode.BadRequest, message)); - - /// - /// 409 - Conflict response. - /// - public static PostUserResult Conflict(object? error = null) - => new PostUserResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.Conflict, error)); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Users/Results/UpdateMyTestGenderResult.cs b/sample/src/Demo.Api.Generated/Contracts/Users/Results/UpdateMyTestGenderResult.cs deleted file mode 100644 index b7748c5f..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Users/Results/UpdateMyTestGenderResult.cs +++ /dev/null @@ -1,48 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Users; - -/// -/// Results for operation request. -/// Description: Update gender on a user. -/// Operation: UpdateMyTestGender. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class UpdateMyTestGenderResult : ResultBase -{ - private UpdateMyTestGenderResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static UpdateMyTestGenderResult Ok(string? message = null) - => new UpdateMyTestGenderResult(new OkObjectResult(message)); - - /// - /// 400 - BadRequest response. - /// - public static UpdateMyTestGenderResult BadRequest(string message) - => new UpdateMyTestGenderResult(ResultFactory.CreateContentResultWithValidationProblemDetails(HttpStatusCode.BadRequest, message)); - - /// - /// 404 - NotFound response. - /// - public static UpdateMyTestGenderResult NotFound(string? message = null) - => new UpdateMyTestGenderResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.NotFound, message)); - - /// - /// 409 - Conflict response. - /// - public static UpdateMyTestGenderResult Conflict(object? error = null) - => new UpdateMyTestGenderResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.Conflict, error)); - - /// - /// Performs an implicit conversion from UpdateMyTestGenderResult to ActionResult. - /// - public static implicit operator UpdateMyTestGenderResult(string response) - => Ok(response); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/Users/Results/UpdateUserByIdResult.cs b/sample/src/Demo.Api.Generated/Contracts/Users/Results/UpdateUserByIdResult.cs deleted file mode 100644 index 60cb2f3e..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/Users/Results/UpdateUserByIdResult.cs +++ /dev/null @@ -1,48 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts.Users; - -/// -/// Results for operation request. -/// Description: Update user by id. -/// Operation: UpdateUserById. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class UpdateUserByIdResult : ResultBase -{ - private UpdateUserByIdResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static UpdateUserByIdResult Ok(string? message = null) - => new UpdateUserByIdResult(new OkObjectResult(message)); - - /// - /// 400 - BadRequest response. - /// - public static UpdateUserByIdResult BadRequest(string message) - => new UpdateUserByIdResult(ResultFactory.CreateContentResultWithValidationProblemDetails(HttpStatusCode.BadRequest, message)); - - /// - /// 404 - NotFound response. - /// - public static UpdateUserByIdResult NotFound(string? message = null) - => new UpdateUserByIdResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.NotFound, message)); - - /// - /// 409 - Conflict response. - /// - public static UpdateUserByIdResult Conflict(object? error = null) - => new UpdateUserByIdResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.Conflict, error)); - - /// - /// Performs an implicit conversion from UpdateUserByIdResult to ActionResult. - /// - public static implicit operator UpdateUserByIdResult(string response) - => Ok(response); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/_EnumerationTypes/ColorType.cs b/sample/src/Demo.Api.Generated/Contracts/_EnumerationTypes/ColorType.cs deleted file mode 100644 index 0c919963..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/_EnumerationTypes/ColorType.cs +++ /dev/null @@ -1,21 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.265.35674. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts; - -/// -/// Enumeration: ColorType. -/// -[GeneratedCode("ApiGenerator", "2.0.265.35674")] -[Flags] -public enum ColorType -{ - None = 0, - Black = 1, - White = 2, - Yellow = 4, - Red = 8, -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/_EnumerationTypes/GenderType.cs b/sample/src/Demo.Api.Generated/Contracts/_EnumerationTypes/GenderType.cs deleted file mode 100644 index d677b610..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/_EnumerationTypes/GenderType.cs +++ /dev/null @@ -1,19 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.265.35674. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts; - -/// -/// Enumeration: GenderType. -/// -[GeneratedCode("ApiGenerator", "2.0.265.35674")] -public enum GenderType -{ - None, - NonBinary, - Male, - Female, -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/_Shared/Address.cs b/sample/src/Demo.Api.Generated/Contracts/_Shared/Address.cs deleted file mode 100644 index 873b1621..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/_Shared/Address.cs +++ /dev/null @@ -1,32 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts; - -/// -/// Address. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class Address -{ - [StringLength(255)] - public string StreetName { get; set; } - - public string StreetNumber { get; set; } - - public string PostalCode { get; set; } - - public string CityName { get; set; } - - /// - /// Country. - /// - public Country MyCountry { get; set; } - - /// - public override string ToString() - => $"{nameof(StreetName)}: {StreetName}, {nameof(StreetNumber)}: {StreetNumber}, {nameof(PostalCode)}: {PostalCode}, {nameof(CityName)}: {CityName}, {nameof(MyCountry)}: ({MyCountry})"; -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Contracts/_Shared/Country.cs b/sample/src/Demo.Api.Generated/Contracts/_Shared/Country.cs deleted file mode 100644 index fee28d7d..00000000 --- a/sample/src/Demo.Api.Generated/Contracts/_Shared/Country.cs +++ /dev/null @@ -1,33 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Contracts; - -/// -/// Country. -/// -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class Country -{ - [Required] - public string Name { get; set; } - - [Required] - [MinLength(2)] - [MaxLength(2)] - [RegularExpression("^[A-Za-z]{2}$")] - public string Alpha2Code { get; set; } - - [Required] - [MinLength(3)] - [MaxLength(3)] - [RegularExpression("^[A-Za-z]{3}$")] - public string Alpha3Code { get; set; } - - /// - public override string ToString() - => $"{nameof(Name)}: {Name}, {nameof(Alpha2Code)}: {Alpha2Code}, {nameof(Alpha3Code)}: {Alpha3Code}"; -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Demo.Api.Generated.csproj b/sample/src/Demo.Api.Generated/Demo.Api.Generated.csproj deleted file mode 100644 index 66a6e644..00000000 --- a/sample/src/Demo.Api.Generated/Demo.Api.Generated.csproj +++ /dev/null @@ -1,32 +0,0 @@ - - - - net6.0 - false - - - - - true - - - - bin\Debug\net6.0\Demo.Api.Generated.xml - 1573;1591;1701;1702;1712;8618 - - - - - - - - - - - - - - - - - diff --git a/sample/src/Demo.Api.Generated/Endpoints/AccountsController.cs b/sample/src/Demo.Api.Generated/Endpoints/AccountsController.cs deleted file mode 100644 index afbc54f3..00000000 --- a/sample/src/Demo.Api.Generated/Endpoints/AccountsController.cs +++ /dev/null @@ -1,47 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Endpoints; - -/// -/// Endpoint definitions. -/// -[Authorize] -[ApiController] -[Route("/api/v1/accounts")] -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class AccountsController : ControllerBase -{ - /// - /// Description: Update name of account. - /// Operation: UpdateAccountName. - /// - [HttpPut("{accountId}/name")] - [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status403Forbidden)] - public async Task UpdateAccountName( - UpdateAccountNameParameters parameters, - [FromServices] IUpdateAccountNameHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(parameters, cancellationToken); - - /// - /// Description: Set name of account. - /// Operation: SetAccountName. - /// - [HttpPost("{accountId}/name")] - [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status403Forbidden)] - public async Task SetAccountName( - SetAccountNameParameters parameters, - [FromServices] ISetAccountNameHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(parameters, cancellationToken); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Endpoints/AddressesController.cs b/sample/src/Demo.Api.Generated/Endpoints/AddressesController.cs deleted file mode 100644 index 33893b6c..00000000 --- a/sample/src/Demo.Api.Generated/Endpoints/AddressesController.cs +++ /dev/null @@ -1,32 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Endpoints; - -/// -/// Endpoint definitions. -/// -[Authorize] -[ApiController] -[Route("/api/v1/addresses")] -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class AddressesController : ControllerBase -{ - /// - /// Description: Get addresses by postal code. - /// Operation: GetAddressesByPostalCodes. - /// - [HttpGet("{postalCode}")] - [ProducesResponseType(typeof(List
), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status403Forbidden)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] - public async Task GetAddressesByPostalCodes( - GetAddressesByPostalCodesParameters parameters, - [FromServices] IGetAddressesByPostalCodesHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(parameters, cancellationToken); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Endpoints/EventargsController.cs b/sample/src/Demo.Api.Generated/Endpoints/EventargsController.cs deleted file mode 100644 index fbe2b003..00000000 --- a/sample/src/Demo.Api.Generated/Endpoints/EventargsController.cs +++ /dev/null @@ -1,45 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Endpoints; - -/// -/// Endpoint definitions. -/// -[Authorize] -[ApiController] -[Route("/api/v1/eventArgs")] -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class EventArgsController : ControllerBase -{ - /// - /// Description: Get EventArgs List. - /// Operation: GetEventArgs. - /// - [HttpGet] - [ProducesResponseType(typeof(List), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status403Forbidden)] - public async Task GetEventArgs( - [FromServices] IGetEventArgsHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(cancellationToken); - - /// - /// Description: Get EventArgs By Id. - /// Operation: GetEventArgById. - /// - [HttpGet("{id}")] - [ProducesResponseType(typeof(Demo.Api.Generated.Contracts.EventArgs.EventArgs), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status403Forbidden)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] - public async Task GetEventArgById( - GetEventArgByIdParameters parameters, - [FromServices] IGetEventArgByIdHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(parameters, cancellationToken); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Endpoints/FilesController.cs b/sample/src/Demo.Api.Generated/Endpoints/FilesController.cs deleted file mode 100644 index b1fe2a80..00000000 --- a/sample/src/Demo.Api.Generated/Endpoints/FilesController.cs +++ /dev/null @@ -1,96 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.344.48829. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Endpoints; - -/// -/// Endpoint definitions. -/// -[Authorize] -[ApiController] -[Route("/api/v1/files")] -[GeneratedCode("ApiGenerator", "2.0.344.48829")] -public class FilesController : ControllerBase -{ - /// - /// Description: Upload multi files as form data. - /// Operation: UploadMultiFilesAsFormData. - /// - [HttpPost("form-data/multiFile")] - [RequestFormLimits(MultipartBodyLengthLimit = long.MaxValue)] - [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status403Forbidden)] - public async Task UploadMultiFilesAsFormData( - UploadMultiFilesAsFormDataParameters parameters, - [FromServices] IUploadMultiFilesAsFormDataHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(parameters, cancellationToken); - - /// - /// Description: Upload a file as OctetStream. - /// Operation: UploadSingleFileAsFormData. - /// - [HttpPost("form-data/singleFile")] - [RequestFormLimits(MultipartBodyLengthLimit = long.MaxValue)] - [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status403Forbidden)] - public async Task UploadSingleFileAsFormData( - UploadSingleFileAsFormDataParameters parameters, - [FromServices] IUploadSingleFileAsFormDataHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(parameters, cancellationToken); - - /// - /// Description: Upload a file as FormData. - /// Operation: UploadSingleObjectWithFileAsFormData. - /// - [HttpPost("form-data/singleObject")] - [RequestFormLimits(MultipartBodyLengthLimit = long.MaxValue)] - [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status403Forbidden)] - public async Task UploadSingleObjectWithFileAsFormData( - UploadSingleObjectWithFileAsFormDataParameters parameters, - [FromServices] IUploadSingleObjectWithFileAsFormDataHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(parameters, cancellationToken); - - /// - /// Description: Upload files as FormData. - /// Operation: UploadSingleObjectWithFilesAsFormData. - /// - [HttpPost("form-data/singleObjectMultiFile")] - [RequestFormLimits(MultipartBodyLengthLimit = long.MaxValue)] - [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status403Forbidden)] - public async Task UploadSingleObjectWithFilesAsFormData( - UploadSingleObjectWithFilesAsFormDataParameters parameters, - [FromServices] IUploadSingleObjectWithFilesAsFormDataHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(parameters, cancellationToken); - - /// - /// Description: Get File By Id. - /// Operation: GetFileById. - /// - [HttpGet("{id}")] - [ProducesResponseType(typeof(byte[]), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status403Forbidden)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] - public async Task GetFileById( - GetFileByIdParameters parameters, - [FromServices] IGetFileByIdHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(parameters, cancellationToken); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Endpoints/ItemsController.cs b/sample/src/Demo.Api.Generated/Endpoints/ItemsController.cs deleted file mode 100644 index 8fe84d21..00000000 --- a/sample/src/Demo.Api.Generated/Endpoints/ItemsController.cs +++ /dev/null @@ -1,47 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Endpoints; - -/// -/// Endpoint definitions. -/// -[Authorize] -[ApiController] -[Route("/api/v1/items")] -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class ItemsController : ControllerBase -{ - /// - /// Description: Create a new item. - /// Operation: CreateItem. - /// - [HttpPost] - [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status403Forbidden)] - public async Task CreateItem( - CreateItemParameters parameters, - [FromServices] ICreateItemHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(parameters, cancellationToken); - - /// - /// Description: Updates an item. - /// Operation: UpdateItem. - /// - [HttpPut("{id}")] - [ProducesResponseType(typeof(Guid), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status403Forbidden)] - public async Task UpdateItem( - UpdateItemParameters parameters, - [FromServices] IUpdateItemHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(parameters, cancellationToken); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Endpoints/OrdersController.cs b/sample/src/Demo.Api.Generated/Endpoints/OrdersController.cs deleted file mode 100644 index 58fd4b8a..00000000 --- a/sample/src/Demo.Api.Generated/Endpoints/OrdersController.cs +++ /dev/null @@ -1,68 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Endpoints; - -/// -/// Endpoint definitions. -/// -[Authorize] -[ApiController] -[Route("/api/v1/orders")] -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class OrdersController : ControllerBase -{ - /// - /// Description: Get orders. - /// Operation: GetOrders. - /// - [Authorize] - [HttpGet] - [ProducesResponseType(typeof(Pagination), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status403Forbidden)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] - public async Task GetOrders( - GetOrdersParameters parameters, - [FromServices] IGetOrdersHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(parameters, cancellationToken); - - /// - /// Description: Get order by id. - /// Operation: GetOrderById. - /// - [AllowAnonymous] - [HttpGet("{id}")] - [ProducesResponseType(typeof(Order), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] - public async Task GetOrderById( - GetOrderByIdParameters parameters, - [FromServices] IGetOrderByIdHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(parameters, cancellationToken); - - /// - /// Description: Update part of order by id. - /// Operation: PatchOrdersId. - /// - [Authorize(Roles = "admin,operator")] - [HttpPatch("{id}")] - [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status403Forbidden)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status409Conflict)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status502BadGateway)] - public async Task PatchOrdersId( - PatchOrdersIdParameters parameters, - [FromServices] IPatchOrdersIdHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(parameters, cancellationToken); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Endpoints/RouteWithDashController.cs b/sample/src/Demo.Api.Generated/Endpoints/RouteWithDashController.cs deleted file mode 100644 index 0a210b66..00000000 --- a/sample/src/Demo.Api.Generated/Endpoints/RouteWithDashController.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Endpoints; - -/// -/// Endpoint definitions. -/// -[Authorize] -[ApiController] -[Route("/api/v1/route-with-dash")] -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class RouteWithDashController : ControllerBase -{ - /// - /// Description: Your GET endpoint. - /// Operation: GetRouteWithDash. - /// - [HttpGet] - [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status403Forbidden)] - public async Task GetRouteWithDash( - [FromServices] IGetRouteWithDashHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(cancellationToken); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Endpoints/TasksController.cs b/sample/src/Demo.Api.Generated/Endpoints/TasksController.cs deleted file mode 100644 index 4bb55852..00000000 --- a/sample/src/Demo.Api.Generated/Endpoints/TasksController.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Endpoints; - -/// -/// Endpoint definitions. -/// -[Authorize] -[ApiController] -[Route("/api/v1/tasks")] -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class TasksController : ControllerBase -{ - /// - /// Description: Returns tasks. - /// Operation: GetTasks. - /// - [HttpGet] - [ProducesResponseType(typeof(List), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status403Forbidden)] - public async Task GetTasks( - [FromServices] IGetTasksHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(cancellationToken); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Endpoints/UsersController.cs b/sample/src/Demo.Api.Generated/Endpoints/UsersController.cs deleted file mode 100644 index f9e6cc33..00000000 --- a/sample/src/Demo.Api.Generated/Endpoints/UsersController.cs +++ /dev/null @@ -1,130 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.344.48829. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Generated.Endpoints; - -/// -/// Endpoint definitions. -/// -[Authorize] -[ApiController] -[Route("/api/v1/users")] -[GeneratedCode("ApiGenerator", "2.0.344.48829")] -public class UsersController : ControllerBase -{ - /// - /// Description: Get all users. - /// Operation: GetUsers. - /// - [HttpGet] - [ProducesResponseType(typeof(List), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status403Forbidden)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status409Conflict)] - public async Task GetUsers( - [FromServices] IGetUsersHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(cancellationToken); - - /// - /// Description: Create a new user. - /// Operation: PostUser. - /// - [HttpPost] - [ProducesResponseType(typeof(string), StatusCodes.Status201Created)] - [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status403Forbidden)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status409Conflict)] - public async Task PostUser( - PostUserParameters parameters, - [FromServices] IPostUserHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(parameters, cancellationToken); - - /// - /// Description: Get user by email. - /// Operation: GetUserByEmail. - /// - [HttpGet("email")] - [ProducesResponseType(typeof(User), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status403Forbidden)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status409Conflict)] - public async Task GetUserByEmail( - GetUserByEmailParameters parameters, - [FromServices] IGetUserByEmailHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(parameters, cancellationToken); - - /// - /// Description: Get user by id. - /// Operation: GetUserById. - /// - [HttpGet("{id}")] - [ProducesResponseType(typeof(User), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status403Forbidden)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status409Conflict)] - public async Task GetUserById( - GetUserByIdParameters parameters, - [FromServices] IGetUserByIdHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(parameters, cancellationToken); - - /// - /// Description: Update user by id. - /// Operation: UpdateUserById. - /// - [HttpPut("{id}")] - [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status403Forbidden)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status409Conflict)] - public async Task UpdateUserById( - UpdateUserByIdParameters parameters, - [FromServices] IUpdateUserByIdHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(parameters, cancellationToken); - - /// - /// Description: Delete user by id. - /// Operation: DeleteUserById. - /// - [HttpDelete("{id}")] - [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status403Forbidden)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status409Conflict)] - public async Task DeleteUserById( - DeleteUserByIdParameters parameters, - [FromServices] IDeleteUserByIdHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(parameters, cancellationToken); - - /// - /// Description: Update gender on a user. - /// Operation: UpdateMyTestGender. - /// - [HttpPut("{id}/gender")] - [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status403Forbidden)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status409Conflict)] - public async Task UpdateMyTestGender( - UpdateMyTestGenderParameters parameters, - [FromServices] IUpdateMyTestGenderHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(parameters, cancellationToken); -} \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/GlobalUsings.cs b/sample/src/Demo.Api.Generated/GlobalUsings.cs deleted file mode 100644 index d9cbc0a3..00000000 --- a/sample/src/Demo.Api.Generated/GlobalUsings.cs +++ /dev/null @@ -1,20 +0,0 @@ -global using System.CodeDom.Compiler; -global using System.ComponentModel.DataAnnotations; -global using System.Net; - -global using Atc.Rest.Results; - -global using Demo.Api.Generated.Contracts; -global using Demo.Api.Generated.Contracts.Accounts; -global using Demo.Api.Generated.Contracts.Addresses; -global using Demo.Api.Generated.Contracts.EventArgs; -global using Demo.Api.Generated.Contracts.Files; -global using Demo.Api.Generated.Contracts.Items; -global using Demo.Api.Generated.Contracts.Orders; -global using Demo.Api.Generated.Contracts.RouteWithDash; -global using Demo.Api.Generated.Contracts.Tasks; -global using Demo.Api.Generated.Contracts.Users; - -global using Microsoft.AspNetCore.Authorization; -global using Microsoft.AspNetCore.Http; -global using Microsoft.AspNetCore.Mvc; \ No newline at end of file diff --git a/sample/src/Demo.Api.Generated/Resources/ApiSpecification.yaml b/sample/src/Demo.Api.Generated/Resources/ApiSpecification.yaml deleted file mode 100644 index ba8208f8..00000000 --- a/sample/src/Demo.Api.Generated/Resources/ApiSpecification.yaml +++ /dev/null @@ -1,969 +0,0 @@ -openapi: 3.0.0 -info: - title: Demo Api - description: Demo Api - SingleFileVersion - version: '1.0' - contact: - name: atc-net A/S -servers: - - url: /api/v1 - description: Api version 1.0 -x-authorize-roles: - - admin - - operator -paths: - /orders: - x-authentication-required: true - get: - tags: - - Orders - summary: Get orders - description: Get orders - operationId: getOrders - parameters: - - $ref: '#/components/parameters/pagingPageSize' - - $ref: '#/components/parameters/pagingPageIndex' - - $ref: '#/components/parameters/queryString' - - $ref: '#/components/parameters/queryStringArray' - - $ref: '#/components/parameters/continuationToken' - responses: - '200': - description: Expected response to a valid request - content: - application/json: - schema: - allOf: - - $ref: '#/components/schemas/Pagination' - - $ref: '#/components/schemas/Orders' - '404': - description: Not Found - '/orders/{id}': - x-authentication-required: true - x-authorize-roles: - - operator - get: - tags: - - Orders - summary: Get order by id - description: Get order by id - operationId: getOrderById - x-authentication-required: false - parameters: - - name: myEmail - in: query - description: The email for filter orders to retrieve - schema: - type: string - format: email - nullable: true - responses: - '200': - description: Expected response to a valid request - content: - application/json: - schema: - $ref: '#/components/schemas/Order' - '404': - description: Not Found - patch: - summary: Update part of order by id - description: Update part of order by id - operationId: patchOrdersId - x-authorize-roles: - - admin - - operator - parameters: - - name: myTestHeader - in: header - required: true - description: The myTestHeader special key - schema: - type: string - - name: myTestHeaderBool - in: header - required: true - description: The myTestHeaderBool special key - schema: - type: boolean - - name: myTestHeaderInt - in: header - required: true - description: The myTestHeaderInt special key - schema: - type: integer - - name: x-correlation-id - in: header - required: true - description: The correlationId - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateOrderRequest' - responses: - '200': - description: OK - '404': - description: Not Found - '409': - description: Conflict - '502': - description: Bad Gateway - content: - application/json: - schema: - $ref: '#/components/schemas/ProblemDetails' - parameters: - - name: id - in: path - description: The id of the order - required: true - schema: - type: string - format: uuid - /users/email: - get: - tags: - - Users - summary: Get user by email - description: Get user by email - operationId: getUserByEmail - parameters: - - name: email - in: query - description: The email of the user to retrieve - required: true - schema: - type: string - format: email - responses: - '200': - description: Expected response to a valid request - content: - application/json: - schema: - $ref: '#/components/schemas/User' - '400': - description: Bad Request - '404': - description: Not Found - '409': - description: Conflict - '/users/{id}': - get: - summary: Get user by id - description: Get user by id - operationId: getUserById - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/User' - '404': - description: Not Found - '409': - description: Conflict - put: - summary: Update user by id - description: Update user by id - operationId: updateUserById - responses: - '200': - description: OK - '400': - description: Bad Request - '404': - description: Not Found - '409': - description: Conflict - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateUserRequest' - delete: - summary: Delete user by id - description: Delete user by id - operationId: deleteUserById - responses: - '200': - description: OK - '404': - description: Not Found - '409': - description: Conflict - parameters: - - name: id - in: path - description: Id of the user - required: true - schema: - type: string - format: uuid - /users: - get: - summary: Get all users - description: Get all users - operationId: getUsers - tags: [] - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/Users' - '409': - description: Conflict - post: - summary: Create a new user - description: Create a new user - operationId: postUser - responses: - '201': - description: Created - '400': - description: Bad Request - '409': - description: Conflict - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateUserRequest' - '/users/{id}/gender': - put: - summary: Update gender on a user - description: Update gender on a user - operationId: updateMyTestGender - parameters: - - name: genderParam - in: query - description: The gender to set on the user - schema: - $ref: '#/components/schemas/GenderType' - responses: - '200': - description: OK - '400': - description: Bad Request - '404': - description: Not Found - '409': - description: Conflict - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateTestGenderRequest' - parameters: - - name: id - description: Id of the user - in: path - required: true - schema: - type: string - format: uuid - '/accounts/{accountId}/name': - put: - summary: Update name of account - description: Update name of account - operationId: updateAccountName - responses: - '200': - description: OK - parameters: - - name: name - in: header - description: The account name - schema: - type: string - post: - summary: Set name of account - description: Set name of account - operationId: setAccountName - responses: - '200': - description: OK - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateAccountRequest' - parameters: - - name: accountId - in: path - required: true - description: The accountId - schema: - type: string - format: uuid - '/addresses/{postalCode}': - get: - summary: Get addresses by postal code - description: Get addresses by postal code - operationId: getAddressesByPostalCodes - tags: [] - responses: - '200': - description: OK - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Address' - '404': - description: Not Found - parameters: - - name: postalCode - in: path - required: true - description: The postalCode to limit addresses on - schema: - type: string - /route-with-dash: - get: - summary: Your GET endpoint - description: Your GET endpoint - tags: [] - responses: - '200': - description: OK - operationId: getRouteWithDash - /items: - post: - summary: Create a new item - description: Create a new item - operationId: createItem - responses: - '200': - description: OK - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateItemRequest' - '/items/{id}': - put: - summary: Updates an item - description: Updates an item - operationId: updateItem - responses: - '200': - description: OK - content: - application/json: - schema: - type: string - format: uuid - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateItemRequest' - parameters: - - name: id - in: path - description: The id of the order - required: true - schema: - type: string - format: uuid - /tasks: - get: - operationId: getTasks - summary: Returns tasks - description: Returns tasks - tags: [] - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/Tasks' - '/eventArgs/{id}': - parameters: - - name: id - in: path - description: The id of the eventArgs - required: true - schema: - type: string - get: - summary: Get EventArgs By Id - description: Get EventArgs By Id - tags: [] - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/EventArgs' - '404': - description: Not Found - operationId: getEventArgById - /eventArgs: - get: - operationId: getEventArgs - summary: Get EventArgs List - description: Get EventArgs List - tags: [] - responses: - '200': - description: OK - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/EventArgs' - '/files/{id}': - parameters: - - name: id - in: path - description: The file id - required: true - schema: - type: string - get: - operationId: getFileById - summary: Get File By Id - description: Get File By Id - tags: [] - responses: - '200': - description: OK - content: - application/octet-stream: - schema: - type: string - format: binary - headers: {} - '404': - description: Not Found - /files/form-data/singleObject: - post: - operationId: uploadSingleObjectWithFileAsFormData - summary: Upload a file as FormData - description: Upload a file as FormData - responses: - '200': - description: OK - '400': - description: Bad Request - requestBody: - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/FileAsFormDataRequest' - parameters: [] - /files/form-data/singleObjectMultiFile: - post: - operationId: uploadSingleObjectWithFilesAsFormData - summary: Upload files as FormData - description: Upload files as FormData - responses: - '200': - description: OK - '400': - description: Bad Request - requestBody: - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/FilesAsFormDataRequest' - parameters: [] - /files/form-data/singleFile: - post: - operationId: uploadSingleFileAsFormData - summary: Upload a file as OctetStream - description: Upload a file as OctetStream - responses: - '200': - description: OK - requestBody: - content: - application/octet-stream: - schema: - type: string - format: binary - parameters: [] - /files/form-data/multiFile: - post: - summary: Upload multi files as form data - description: Upload multi files as form data - operationId: uploadMultiFilesAsFormData - responses: - '200': - description: OK - requestBody: - content: - multipart/form-data: - schema: - type: array - items: - type: string - format: binary -components: - parameters: - pagingPageSize: - name: pageSize - in: query - required: true - schema: - type: integer - minimum: 1 - maximum: 100 - default: 10 - description: The numbers of items to return. - pagingPageIndex: - name: pageIndex - in: query - required: false - schema: - type: integer - minimum: 0 - default: 0 - description: The number of items to skip before starting to collect the result set. - queryString: - name: queryString - in: query - required: false - schema: - type: string - nullable: true - description: The query string. - queryStringArray: - name: queryStringArray - in: query - required: false - schema: - type: array - items: - type: string - nullable: true - description: The query array of string. - continuationToken: - name: continuationToken - in: query - required: false - schema: - type: string - nullable: true - description: The continuation token. - schemas: - Pagination: - type: object - title: Pagination - description: A item result subset of a data query. - properties: - pageSize: - type: number - description: The number of items to request. - pageIndex: - type: number - nullable: true - description: The given page index starting with 0. - queryString: - type: string - nullable: true - description: The query to filter items by. - continuationToken: - type: string - nullable: true - description: Token to indicate next result set. - count: - type: number - description: Items count in result set. - totalCount: - type: number - nullable: true - description: Total items count. - totalPages: - type: number - nullable: true - description: Total pages. - required: - - pageSize - - count - ProblemDetails: - type: object - title: ProblemDetails - description: 'A machine-readable format for specifying errors in HTTP API responses based on https://tools.ietf.org/html/rfc7807.' - properties: - type: - type: string - description: 'A URI reference [RFC3986] that identifies the problem type. This specification encourages that, when dereferenced, it provide human-readable documentation for the problem type (e.g., using HTML [W3C.REC-html5-20141028]).' - title: - type: string - description: 'A short, human-readable summary of the problem type.It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization(e.g., using proactive content negotiation; see[RFC7231], Section 3.4).' - status: - type: integer - format: int32 - description: 'The HTTP status code([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.' - detail: - type: string - description: A human-readable explanation specific to this occurrence of the problem. - instance: - type: string - description: A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced. - Order: - title: Order - description: |- - A single order. - Hallo description with multiline and no ending dot - type: object - x-examples: - MyExample: - id: 123 - name: Hallo world - MyExample2: {} - properties: - id: - type: string - format: uuid - description: - type: string - myTime: - type: string - format: time - myEmail: - type: string - format: email - default: a@a.com - myNullableDateTime: - type: string - format: date-time - nullable: true - myDateTime: - type: string - format: date-time - myNumber: - type: number - minimum: 1.1 - maximum: 20.2 - myInteger: - type: integer - maximum: 50 - default: 15 - myBool: - type: boolean - description: MyBool is great - myUri: - type: string - format: uri - description: 'This is the good uri :-)' - myByte: - type: string - format: byte - myStringList: - type: array - description: 'Hallo myStringList desc :-)' - items: - type: string - myLong: - type: integer - format: int64 - minimum: 10 - exclusiveMinimum: false - deliveryAddress: - $ref: '#/components/schemas/Address' - Orders: - description: A list of orders. - type: array - x-tags: - - Orders - title: Orders - items: - $ref: '#/components/schemas/Order' - GenderType: - title: GenderType - description: '' - type: object - properties: - gender: - type: string - description: The users gender type - enum: - - None - - NonBinary - - Male - - Female - required: - - gender - ColorType: - title: ColorType - description: '' - type: object - properties: - color: - type: string - description: The users color type - enum: - - None = 0 - - Black = 1 - - White = 2 - - Yellow = 4 - - Red = 8 - required: - - color - User: - title: User - description: A single user. - type: object - properties: - id: - type: string - format: uuid - example: 00000000-0000-0000-0000-000000000000 - gender: - $ref: '#/components/schemas/GenderType' - firstName: - type: string - lastName: - type: string - email: - type: string - format: email - example: email@email.dk - homepage: - type: string - format: uri - color: - $ref: '#/components/schemas/ColorType' - homeAddress: - $ref: '#/components/schemas/Address' - companyAddress: - $ref: '#/components/schemas/Address' - Users: - description: A list of users. - type: array - items: - $ref: '#/components/schemas/User' - x-tags: - - Users - title: Users - CreateUserRequest: - title: CreateUserRequest - description: Request to create a user - type: object - properties: - firstName: - type: string - lastName: - type: string - myNullableDateTime: - type: string - format: date-time - nullable: true - myDateTime: - type: string - format: date-time - email: - type: string - format: email - example: email@email.dk - homepage: - type: string - format: uri - gender: - $ref: '#/components/schemas/GenderType' - myNullableAddress: - nullable: true - oneOf: - - $ref: '#/components/schemas/Address' - tags: - type: object - additionalProperties: - type: string - desiredProperties1: - type: object - additionalProperties: - type: string - desiredProperties2: - type: object - nullable: true - additionalProperties: - type: string - desiredProperties3: - type: object - nullable: true - additionalProperties: - type: integer - required: - - firstName - - lastName - - myDateTime - - email - - gender - - tags - CreateUsersRequest: - description: A list of users. - type: array - x-tags: - - CreateUsersRequest - title: CreateUsersRequest - items: - $ref: '#/components/schemas/CreateUserRequest' - UpdateUserRequest: - title: UpdateUserRequest - description: Request to update a user - type: object - properties: - firstName: - type: string - lastName: - type: string - email: - type: string - format: email - example: email@email.dk - gender: - $ref: '#/components/schemas/GenderType' - UpdateTestGenderRequest: - title: Update test-gender Request - description: '' - type: object - properties: - gender: - $ref: '#/components/schemas/GenderType' - Address: - title: Address - type: object - properties: - streetName: - type: string - maxLength: 255 - streetNumber: - type: string - postalCode: - type: string - cityName: - type: string - myCountry: - $ref: '#/components/schemas/Country' - Country: - title: Country - type: object - properties: - name: - type: string - alpha2Code: - type: string - minLength: 2 - maxLength: 2 - pattern: '^[A-Za-z]{2}$' - alpha3Code: - type: string - minLength: 3 - maxLength: 3 - pattern: '^[A-Za-z]{3}$' - required: - - name - - alpha2Code - - alpha3Code - UpdateOrderRequest: - title: UpdateOrderRequest - description: Request to update an order - type: object - properties: - myEmail: - type: string - format: email - required: - - myEmail - Item: - title: Item - type: object - properties: - name: - type: string - required: - - name - CreateItemRequest: - title: CreateItemRequest - type: object - properties: - item: - $ref: '#/components/schemas/Item' - myItems: - type: array - items: - $ref: '#/components/schemas/Item' - required: - - item - - myItems - UpdateItemRequest: - title: UpdateItemRequest - type: object - properties: - item: - $ref: '#/components/schemas/Item' - required: - - item - Task: - title: Task - type: object - properties: - id: - type: string - format: uuid - name: - type: string - description: Describes a single task. - Tasks: - title: Tasks - type: array - items: - $ref: '#/components/schemas/Task' - description: Contains a list of Tasks - EventArgs: - title: EventArgs - type: object - properties: - id: - type: string - format: uuid - eventName: - type: string - FileAsFormDataRequest: - title: FileAsFormDataRequest - type: object - properties: - itemName: - type: string - file: - type: string - format: binary - nullable: true - items: - type: array - items: - type: string - required: - - itemName - - items - FilesAsFormDataRequest: - title: FilesAsFormDataRequest - type: object - properties: - files: - type: array - items: - type: string - format: binary - required: - - files - UpdateAccountRequest: - title: UpdateAccountRequest - type: object - properties: - name: - type: string diff --git a/sample/src/Demo.Api/ConfigureSwaggerDocOptions.cs b/sample/src/Demo.Api/ConfigureSwaggerDocOptions.cs deleted file mode 100644 index a42baa3a..00000000 --- a/sample/src/Demo.Api/ConfigureSwaggerDocOptions.cs +++ /dev/null @@ -1,39 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.259.29354. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api; - -[GeneratedCode("ApiGenerator", "2.0.259.29354")] -public class ConfigureSwaggerDocOptions : IConfigureOptions -{ - private readonly IApiVersionDescriptionProvider provider; - - public ConfigureSwaggerDocOptions( - IApiVersionDescriptionProvider provider) - => this.provider = provider; - - public void Configure( - SwaggerGenOptions options) - { - foreach (var version in provider.ApiVersionDescriptions) - { - options.SwaggerDoc( - version.GroupName, - new OpenApiInfo - { - Version = "1.0", - Title = "Demo Api", - Description = @"Demo Api - SingleFileVersion", - Contact = new OpenApiContact - { - Name = "atc-net A/S", - }, - }); - } - - options.IncludeXmlComments(Path.ChangeExtension(GetType().Assembly.Location, "xml")); - } -} \ No newline at end of file diff --git a/sample/src/Demo.Api/Demo.Api.csproj b/sample/src/Demo.Api/Demo.Api.csproj deleted file mode 100644 index 4da8c6cd..00000000 --- a/sample/src/Demo.Api/Demo.Api.csproj +++ /dev/null @@ -1,35 +0,0 @@ - - - - net6.0 - false - - - - - true - - - - bin\Debug\net6.0\Demo.Api.xml - 1573;1591;1701;1702;1712;8618 - - - - - - - - - - - - - - - - - - - - diff --git a/sample/src/Demo.Api/GlobalUsings.cs b/sample/src/Demo.Api/GlobalUsings.cs deleted file mode 100644 index 94d385ec..00000000 --- a/sample/src/Demo.Api/GlobalUsings.cs +++ /dev/null @@ -1,13 +0,0 @@ -global using System.CodeDom.Compiler; -global using System.Reflection; - -global using Atc.Rest.Extended.Options; - -global using Demo.Api.Generated; -global using Demo.Domain; - -global using Microsoft.AspNetCore.Mvc.ApiExplorer; -global using Microsoft.Extensions.Options; -global using Microsoft.OpenApi.Models; - -global using Swashbuckle.AspNetCore.SwaggerGen; \ No newline at end of file diff --git a/sample/src/Demo.Api/Program.cs b/sample/src/Demo.Api/Program.cs deleted file mode 100644 index 26618bba..00000000 --- a/sample/src/Demo.Api/Program.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace Demo.Api; -public static class Program -{ - public static void Main(string[] args) - { - CreateHostBuilder(args).Build().Run(); - } - - public static IHostBuilder CreateHostBuilder(string[] args) - { - var builder = Host.CreateDefaultBuilder(args).ConfigureWebHostDefaults(webBuilder => - { - webBuilder.UseStartup(); - }); - return builder; - } -} \ No newline at end of file diff --git a/sample/src/Demo.Api/Properties/launchSettings.json b/sample/src/Demo.Api/Properties/launchSettings.json deleted file mode 100644 index 1a08ba71..00000000 --- a/sample/src/Demo.Api/Properties/launchSettings.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:2597", - "sslPort": 44312 - } - }, - "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "launchUrl": "swagger", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "Demo.Api": { - "commandName": "Project", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "applicationUrl": "https://localhost:5001;http://localhost:5000" - } - } -} \ No newline at end of file diff --git a/sample/src/Demo.Api/Startup.cs b/sample/src/Demo.Api/Startup.cs deleted file mode 100644 index c92a426e..00000000 --- a/sample/src/Demo.Api/Startup.cs +++ /dev/null @@ -1,38 +0,0 @@ -namespace Demo.Api; - -public class Startup -{ - private readonly RestApiExtendedOptions restApiOptions; - - public Startup( - IConfiguration configuration) - { - Configuration = configuration; - restApiOptions = new RestApiExtendedOptions - { - // TODO: Remove/out-comment/set to false this for production scenarios! - AllowAnonymousAccessForDevelopment = true, - }; - - restApiOptions.AddAssemblyPairs( - Assembly.GetAssembly(typeof(ApiRegistration)), - Assembly.GetAssembly(typeof(DomainRegistration))); - } - - public IConfiguration Configuration { get; } - - public void ConfigureServices( - IServiceCollection services) - { - services.ConfigureOptions(); - - services.AddRestApi(restApiOptions, Configuration); - } - - public void Configure( - IApplicationBuilder app, - IWebHostEnvironment env) - { - app.ConfigureRestApi(env, restApiOptions); - } -} \ No newline at end of file diff --git a/sample/src/Demo.Api/web.config b/sample/src/Demo.Api/web.config deleted file mode 100644 index dc93c09c..00000000 --- a/sample/src/Demo.Api/web.config +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/sample/src/Demo.Domain/Demo.Domain.csproj b/sample/src/Demo.Domain/Demo.Domain.csproj deleted file mode 100644 index 5b07cef1..00000000 --- a/sample/src/Demo.Domain/Demo.Domain.csproj +++ /dev/null @@ -1,30 +0,0 @@ - - - - net6.0 - false - - - - - true - - - - bin\Debug\net6.0\Demo.Domain.xml - 1573;1591;1701;1702;1712;8618 - - - - - - - - - - - - - - - diff --git a/sample/src/Demo.Domain/DomainRegistration.cs b/sample/src/Demo.Domain/DomainRegistration.cs deleted file mode 100644 index 8c2d70cf..00000000 --- a/sample/src/Demo.Domain/DomainRegistration.cs +++ /dev/null @@ -1,12 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.325.56819. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Domain; - -[GeneratedCode("ApiGenerator", "2.0.325.56819")] -public class DomainRegistration -{ -} \ No newline at end of file diff --git a/sample/src/Demo.Domain/GlobalUsings.cs b/sample/src/Demo.Domain/GlobalUsings.cs deleted file mode 100644 index 6cf7c25b..00000000 --- a/sample/src/Demo.Domain/GlobalUsings.cs +++ /dev/null @@ -1,13 +0,0 @@ -global using System.CodeDom.Compiler; - -global using Demo.Api.Generated.Contracts.Accounts; -global using Demo.Api.Generated.Contracts.Addresses; -global using Demo.Api.Generated.Contracts.EventArgs; -global using Demo.Api.Generated.Contracts.Files; -global using Demo.Api.Generated.Contracts.Items; -global using Demo.Api.Generated.Contracts.Orders; -global using Demo.Api.Generated.Contracts.RouteWithDash; -global using Demo.Api.Generated.Contracts.Tasks; -global using Demo.Api.Generated.Contracts.Users; - -global using FluentValidation; \ No newline at end of file diff --git a/sample/src/Demo.Domain/Handlers/Accounts/SetAccountNameHandler.cs b/sample/src/Demo.Domain/Handlers/Accounts/SetAccountNameHandler.cs deleted file mode 100644 index 0689029e..00000000 --- a/sample/src/Demo.Domain/Handlers/Accounts/SetAccountNameHandler.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace Demo.Domain.Handlers.Accounts; - -/// -/// Handler for operation request. -/// Description: Set name of account. -/// Operation: SetAccountName. -/// -public class SetAccountNameHandler : ISetAccountNameHandler -{ - public Task ExecuteAsync( - SetAccountNameParameters parameters, - CancellationToken cancellationToken = default) - { - ArgumentNullException.ThrowIfNull(parameters); - - throw new NotImplementedException("Add logic here for SetAccountNameHandler"); - } -} \ No newline at end of file diff --git a/sample/src/Demo.Domain/Handlers/Accounts/UpdateAccountNameHandler.cs b/sample/src/Demo.Domain/Handlers/Accounts/UpdateAccountNameHandler.cs deleted file mode 100644 index 611446b0..00000000 --- a/sample/src/Demo.Domain/Handlers/Accounts/UpdateAccountNameHandler.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace Demo.Domain.Handlers.Accounts; - -/// -/// Handler for operation request. -/// Description: Update name of account. -/// Operation: UpdateAccountName. -/// -public class UpdateAccountNameHandler : IUpdateAccountNameHandler -{ - public Task ExecuteAsync( - UpdateAccountNameParameters parameters, - CancellationToken cancellationToken = default) - { - ArgumentNullException.ThrowIfNull(parameters); - - throw new NotImplementedException("Add logic here for UpdateAccountNameHandler"); - } -} \ No newline at end of file diff --git a/sample/src/Demo.Domain/Handlers/Addresses/GetAddressesByPostalCodesHandler.cs b/sample/src/Demo.Domain/Handlers/Addresses/GetAddressesByPostalCodesHandler.cs deleted file mode 100644 index ae978c9d..00000000 --- a/sample/src/Demo.Domain/Handlers/Addresses/GetAddressesByPostalCodesHandler.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace Demo.Domain.Handlers.Addresses; - -/// -/// Handler for operation request. -/// Description: Get addresses by postal code. -/// Operation: GetAddressesByPostalCodes. -/// -public class GetAddressesByPostalCodesHandler : IGetAddressesByPostalCodesHandler -{ - public Task ExecuteAsync( - GetAddressesByPostalCodesParameters parameters, - CancellationToken cancellationToken = default) - { - ArgumentNullException.ThrowIfNull(parameters); - - throw new NotImplementedException("Add logic here for GetAddressesByPostalCodesHandler"); - } -} \ No newline at end of file diff --git a/sample/src/Demo.Domain/Handlers/EventArgs/GetEventArgByIdHandler.cs b/sample/src/Demo.Domain/Handlers/EventArgs/GetEventArgByIdHandler.cs deleted file mode 100644 index 93b7f2e6..00000000 --- a/sample/src/Demo.Domain/Handlers/EventArgs/GetEventArgByIdHandler.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace Demo.Domain.Handlers.EventArgs; - -/// -/// Handler for operation request. -/// Description: Get EventArgs By Id. -/// Operation: GetEventArgById. -/// -public class GetEventArgByIdHandler : IGetEventArgByIdHandler -{ - public Task ExecuteAsync( - GetEventArgByIdParameters parameters, - CancellationToken cancellationToken = default) - { - ArgumentNullException.ThrowIfNull(parameters); - - throw new NotImplementedException("Add logic here for GetEventArgByIdHandler"); - } -} \ No newline at end of file diff --git a/sample/src/Demo.Domain/Handlers/EventArgs/GetEventArgsHandler.cs b/sample/src/Demo.Domain/Handlers/EventArgs/GetEventArgsHandler.cs deleted file mode 100644 index a0dbe501..00000000 --- a/sample/src/Demo.Domain/Handlers/EventArgs/GetEventArgsHandler.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace Demo.Domain.Handlers.EventArgs; - -/// -/// Handler for operation request. -/// Description: Get EventArgs List. -/// Operation: GetEventArgs. -/// -public class GetEventArgsHandler : IGetEventArgsHandler -{ - public Task ExecuteAsync( - CancellationToken cancellationToken = default) - { - throw new NotImplementedException("Add logic here for GetEventArgsHandler"); - } -} \ No newline at end of file diff --git a/sample/src/Demo.Domain/Handlers/Eventargs/GetEventArgByIdHandler.cs b/sample/src/Demo.Domain/Handlers/Eventargs/GetEventArgByIdHandler.cs deleted file mode 100644 index 93b7f2e6..00000000 --- a/sample/src/Demo.Domain/Handlers/Eventargs/GetEventArgByIdHandler.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace Demo.Domain.Handlers.EventArgs; - -/// -/// Handler for operation request. -/// Description: Get EventArgs By Id. -/// Operation: GetEventArgById. -/// -public class GetEventArgByIdHandler : IGetEventArgByIdHandler -{ - public Task ExecuteAsync( - GetEventArgByIdParameters parameters, - CancellationToken cancellationToken = default) - { - ArgumentNullException.ThrowIfNull(parameters); - - throw new NotImplementedException("Add logic here for GetEventArgByIdHandler"); - } -} \ No newline at end of file diff --git a/sample/src/Demo.Domain/Handlers/Eventargs/GetEventArgsHandler.cs b/sample/src/Demo.Domain/Handlers/Eventargs/GetEventArgsHandler.cs deleted file mode 100644 index a0dbe501..00000000 --- a/sample/src/Demo.Domain/Handlers/Eventargs/GetEventArgsHandler.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace Demo.Domain.Handlers.EventArgs; - -/// -/// Handler for operation request. -/// Description: Get EventArgs List. -/// Operation: GetEventArgs. -/// -public class GetEventArgsHandler : IGetEventArgsHandler -{ - public Task ExecuteAsync( - CancellationToken cancellationToken = default) - { - throw new NotImplementedException("Add logic here for GetEventArgsHandler"); - } -} \ No newline at end of file diff --git a/sample/src/Demo.Domain/Handlers/Files/GetFileByIdHandler.cs b/sample/src/Demo.Domain/Handlers/Files/GetFileByIdHandler.cs deleted file mode 100644 index 9b1c3864..00000000 --- a/sample/src/Demo.Domain/Handlers/Files/GetFileByIdHandler.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace Demo.Domain.Handlers.Files; - -/// -/// Handler for operation request. -/// Description: Get File By Id. -/// Operation: GetFileById. -/// -public class GetFileByIdHandler : IGetFileByIdHandler -{ - public Task ExecuteAsync( - GetFileByIdParameters parameters, - CancellationToken cancellationToken = default) - { - ArgumentNullException.ThrowIfNull(parameters); - - throw new NotImplementedException("Add logic here for GetFileByIdHandler"); - } -} \ No newline at end of file diff --git a/sample/src/Demo.Domain/Handlers/Files/UploadMultiFilesAsFormDataHandler.cs b/sample/src/Demo.Domain/Handlers/Files/UploadMultiFilesAsFormDataHandler.cs deleted file mode 100644 index e2867c22..00000000 --- a/sample/src/Demo.Domain/Handlers/Files/UploadMultiFilesAsFormDataHandler.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace Demo.Domain.Handlers.Files; - -/// -/// Handler for operation request. -/// Description: Upload multi files as form data. -/// Operation: UploadMultiFilesAsFormData. -/// -public class UploadMultiFilesAsFormDataHandler : IUploadMultiFilesAsFormDataHandler -{ - public Task ExecuteAsync( - UploadMultiFilesAsFormDataParameters parameters, - CancellationToken cancellationToken = default) - { - ArgumentNullException.ThrowIfNull(parameters); - - throw new NotImplementedException("Add logic here for UploadMultiFilesAsFormDataHandler"); - } -} \ No newline at end of file diff --git a/sample/src/Demo.Domain/Handlers/Files/UploadSingleFileAsFormDataHandler.cs b/sample/src/Demo.Domain/Handlers/Files/UploadSingleFileAsFormDataHandler.cs deleted file mode 100644 index 66938340..00000000 --- a/sample/src/Demo.Domain/Handlers/Files/UploadSingleFileAsFormDataHandler.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace Demo.Domain.Handlers.Files; - -/// -/// Handler for operation request. -/// Description: Upload a file as OctetStream. -/// Operation: UploadSingleFileAsFormData. -/// -public class UploadSingleFileAsFormDataHandler : IUploadSingleFileAsFormDataHandler -{ - public Task ExecuteAsync( - UploadSingleFileAsFormDataParameters parameters, - CancellationToken cancellationToken = default) - { - ArgumentNullException.ThrowIfNull(parameters); - - throw new NotImplementedException("Add logic here for UploadSingleFileAsFormDataHandler"); - } -} \ No newline at end of file diff --git a/sample/src/Demo.Domain/Handlers/Files/UploadSingleObjectWithFileAsFormDataHandler.cs b/sample/src/Demo.Domain/Handlers/Files/UploadSingleObjectWithFileAsFormDataHandler.cs deleted file mode 100644 index 45bb4ca6..00000000 --- a/sample/src/Demo.Domain/Handlers/Files/UploadSingleObjectWithFileAsFormDataHandler.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace Demo.Domain.Handlers.Files; - -/// -/// Handler for operation request. -/// Description: Upload a file as FormData. -/// Operation: UploadSingleObjectWithFileAsFormData. -/// -public class UploadSingleObjectWithFileAsFormDataHandler : IUploadSingleObjectWithFileAsFormDataHandler -{ - public Task ExecuteAsync( - UploadSingleObjectWithFileAsFormDataParameters parameters, - CancellationToken cancellationToken = default) - { - ArgumentNullException.ThrowIfNull(parameters); - - throw new NotImplementedException("Add logic here for UploadSingleObjectWithFileAsFormDataHandler"); - } -} \ No newline at end of file diff --git a/sample/src/Demo.Domain/Handlers/Files/UploadSingleObjectWithFilesAsFormDataHandler.cs b/sample/src/Demo.Domain/Handlers/Files/UploadSingleObjectWithFilesAsFormDataHandler.cs deleted file mode 100644 index 5806df67..00000000 --- a/sample/src/Demo.Domain/Handlers/Files/UploadSingleObjectWithFilesAsFormDataHandler.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace Demo.Domain.Handlers.Files; - -/// -/// Handler for operation request. -/// Description: Upload files as FormData. -/// Operation: UploadSingleObjectWithFilesAsFormData. -/// -public class UploadSingleObjectWithFilesAsFormDataHandler : IUploadSingleObjectWithFilesAsFormDataHandler -{ - public Task ExecuteAsync( - UploadSingleObjectWithFilesAsFormDataParameters parameters, - CancellationToken cancellationToken = default) - { - ArgumentNullException.ThrowIfNull(parameters); - - throw new NotImplementedException("Add logic here for UploadSingleObjectWithFilesAsFormDataHandler"); - } -} \ No newline at end of file diff --git a/sample/src/Demo.Domain/Handlers/Items/CreateItemHandler.cs b/sample/src/Demo.Domain/Handlers/Items/CreateItemHandler.cs deleted file mode 100644 index 569720d3..00000000 --- a/sample/src/Demo.Domain/Handlers/Items/CreateItemHandler.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace Demo.Domain.Handlers.Items; - -/// -/// Handler for operation request. -/// Description: Create a new item. -/// Operation: CreateItem. -/// -public class CreateItemHandler : ICreateItemHandler -{ - public Task ExecuteAsync( - CreateItemParameters parameters, - CancellationToken cancellationToken = default) - { - ArgumentNullException.ThrowIfNull(parameters); - - throw new NotImplementedException("Add logic here for CreateItemHandler"); - } -} \ No newline at end of file diff --git a/sample/src/Demo.Domain/Handlers/Items/UpdateItemHandler.cs b/sample/src/Demo.Domain/Handlers/Items/UpdateItemHandler.cs deleted file mode 100644 index 39cc78e8..00000000 --- a/sample/src/Demo.Domain/Handlers/Items/UpdateItemHandler.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace Demo.Domain.Handlers.Items; - -/// -/// Handler for operation request. -/// Description: Updates an item. -/// Operation: UpdateItem. -/// -public class UpdateItemHandler : IUpdateItemHandler -{ - public Task ExecuteAsync( - UpdateItemParameters parameters, - CancellationToken cancellationToken = default) - { - ArgumentNullException.ThrowIfNull(parameters); - - throw new NotImplementedException("Add logic here for UpdateItemHandler"); - } -} \ No newline at end of file diff --git a/sample/src/Demo.Domain/Handlers/Orders/GetOrderByIdHandler.cs b/sample/src/Demo.Domain/Handlers/Orders/GetOrderByIdHandler.cs deleted file mode 100644 index ca87677c..00000000 --- a/sample/src/Demo.Domain/Handlers/Orders/GetOrderByIdHandler.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace Demo.Domain.Handlers.Orders; - -/// -/// Handler for operation request. -/// Description: Get order by id. -/// Operation: GetOrderById. -/// -public class GetOrderByIdHandler : IGetOrderByIdHandler -{ - public Task ExecuteAsync( - GetOrderByIdParameters parameters, - CancellationToken cancellationToken = default) - { - ArgumentNullException.ThrowIfNull(parameters); - - throw new NotImplementedException("Add logic here for GetOrderByIdHandler"); - } -} \ No newline at end of file diff --git a/sample/src/Demo.Domain/Handlers/Orders/GetOrdersHandler.cs b/sample/src/Demo.Domain/Handlers/Orders/GetOrdersHandler.cs deleted file mode 100644 index b327e08a..00000000 --- a/sample/src/Demo.Domain/Handlers/Orders/GetOrdersHandler.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace Demo.Domain.Handlers.Orders; - -/// -/// Handler for operation request. -/// Description: Get orders. -/// Operation: GetOrders. -/// -public class GetOrdersHandler : IGetOrdersHandler -{ - public Task ExecuteAsync( - GetOrdersParameters parameters, - CancellationToken cancellationToken = default) - { - ArgumentNullException.ThrowIfNull(parameters); - - throw new NotImplementedException("Add logic here for GetOrdersHandler"); - } -} \ No newline at end of file diff --git a/sample/src/Demo.Domain/Handlers/Orders/PatchOrdersIdHandler.cs b/sample/src/Demo.Domain/Handlers/Orders/PatchOrdersIdHandler.cs deleted file mode 100644 index d70f276c..00000000 --- a/sample/src/Demo.Domain/Handlers/Orders/PatchOrdersIdHandler.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace Demo.Domain.Handlers.Orders; - -/// -/// Handler for operation request. -/// Description: Update part of order by id. -/// Operation: PatchOrdersId. -/// -public class PatchOrdersIdHandler : IPatchOrdersIdHandler -{ - public Task ExecuteAsync( - PatchOrdersIdParameters parameters, - CancellationToken cancellationToken = default) - { - ArgumentNullException.ThrowIfNull(parameters); - - throw new NotImplementedException("Add logic here for PatchOrdersIdHandler"); - } -} \ No newline at end of file diff --git a/sample/src/Demo.Domain/Handlers/RouteWithDash/GetRouteWithDashHandler.cs b/sample/src/Demo.Domain/Handlers/RouteWithDash/GetRouteWithDashHandler.cs deleted file mode 100644 index d5cde9a5..00000000 --- a/sample/src/Demo.Domain/Handlers/RouteWithDash/GetRouteWithDashHandler.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace Demo.Domain.Handlers.RouteWithDash; - -/// -/// Handler for operation request. -/// Description: Your GET endpoint. -/// Operation: GetRouteWithDash. -/// -public class GetRouteWithDashHandler : IGetRouteWithDashHandler -{ - public Task ExecuteAsync( - CancellationToken cancellationToken = default) - { - throw new NotImplementedException("Add logic here for GetRouteWithDashHandler"); - } -} \ No newline at end of file diff --git a/sample/src/Demo.Domain/Handlers/Tasks/GetTasksHandler.cs b/sample/src/Demo.Domain/Handlers/Tasks/GetTasksHandler.cs deleted file mode 100644 index 380f6983..00000000 --- a/sample/src/Demo.Domain/Handlers/Tasks/GetTasksHandler.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace Demo.Domain.Handlers.Tasks; - -/// -/// Handler for operation request. -/// Description: Returns tasks. -/// Operation: GetTasks. -/// -public class GetTasksHandler : IGetTasksHandler -{ - public Task ExecuteAsync( - CancellationToken cancellationToken = default) - { - throw new NotImplementedException("Add logic here for GetTasksHandler"); - } -} \ No newline at end of file diff --git a/sample/src/Demo.Domain/Handlers/Users/DeleteUserByIdHandler.cs b/sample/src/Demo.Domain/Handlers/Users/DeleteUserByIdHandler.cs deleted file mode 100644 index f225b220..00000000 --- a/sample/src/Demo.Domain/Handlers/Users/DeleteUserByIdHandler.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace Demo.Domain.Handlers.Users; - -/// -/// Handler for operation request. -/// Description: Delete user by id. -/// Operation: DeleteUserById. -/// -public class DeleteUserByIdHandler : IDeleteUserByIdHandler -{ - public Task ExecuteAsync( - DeleteUserByIdParameters parameters, - CancellationToken cancellationToken = default) - { - ArgumentNullException.ThrowIfNull(parameters); - - throw new NotImplementedException("Add logic here for DeleteUserByIdHandler"); - } -} \ No newline at end of file diff --git a/sample/src/Demo.Domain/Handlers/Users/GetUserByEmailHandler.cs b/sample/src/Demo.Domain/Handlers/Users/GetUserByEmailHandler.cs deleted file mode 100644 index 563f5f16..00000000 --- a/sample/src/Demo.Domain/Handlers/Users/GetUserByEmailHandler.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace Demo.Domain.Handlers.Users; - -/// -/// Handler for operation request. -/// Description: Get user by email. -/// Operation: GetUserByEmail. -/// -public class GetUserByEmailHandler : IGetUserByEmailHandler -{ - public Task ExecuteAsync( - GetUserByEmailParameters parameters, - CancellationToken cancellationToken = default) - { - ArgumentNullException.ThrowIfNull(parameters); - - throw new NotImplementedException("Add logic here for GetUserByEmailHandler"); - } -} \ No newline at end of file diff --git a/sample/src/Demo.Domain/Handlers/Users/GetUserByIdHandler.cs b/sample/src/Demo.Domain/Handlers/Users/GetUserByIdHandler.cs deleted file mode 100644 index 42a3f4f1..00000000 --- a/sample/src/Demo.Domain/Handlers/Users/GetUserByIdHandler.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace Demo.Domain.Handlers.Users; - -/// -/// Handler for operation request. -/// Description: Get user by id. -/// Operation: GetUserById. -/// -public class GetUserByIdHandler : IGetUserByIdHandler -{ - public Task ExecuteAsync( - GetUserByIdParameters parameters, - CancellationToken cancellationToken = default) - { - ArgumentNullException.ThrowIfNull(parameters); - - throw new NotImplementedException("Add logic here for GetUserByIdHandler"); - } -} \ No newline at end of file diff --git a/sample/src/Demo.Domain/Handlers/Users/GetUsersHandler.cs b/sample/src/Demo.Domain/Handlers/Users/GetUsersHandler.cs deleted file mode 100644 index f9633227..00000000 --- a/sample/src/Demo.Domain/Handlers/Users/GetUsersHandler.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace Demo.Domain.Handlers.Users; - -/// -/// Handler for operation request. -/// Description: Get all users. -/// Operation: GetUsers. -/// -public class GetUsersHandler : IGetUsersHandler -{ - public Task ExecuteAsync( - CancellationToken cancellationToken = default) - { - throw new NotImplementedException("Add logic here for GetUsersHandler"); - } -} \ No newline at end of file diff --git a/sample/src/Demo.Domain/Handlers/Users/PostUserHandler.cs b/sample/src/Demo.Domain/Handlers/Users/PostUserHandler.cs deleted file mode 100644 index bcb7cbc0..00000000 --- a/sample/src/Demo.Domain/Handlers/Users/PostUserHandler.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace Demo.Domain.Handlers.Users; - -/// -/// Handler for operation request. -/// Description: Create a new user. -/// Operation: PostUser. -/// -public class PostUserHandler : IPostUserHandler -{ - public Task ExecuteAsync( - PostUserParameters parameters, - CancellationToken cancellationToken = default) - { - ArgumentNullException.ThrowIfNull(parameters); - - throw new NotImplementedException("Add logic here for PostUserHandler"); - } -} \ No newline at end of file diff --git a/sample/src/Demo.Domain/Handlers/Users/UpdateMyTestGenderHandler.cs b/sample/src/Demo.Domain/Handlers/Users/UpdateMyTestGenderHandler.cs deleted file mode 100644 index 0014342c..00000000 --- a/sample/src/Demo.Domain/Handlers/Users/UpdateMyTestGenderHandler.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace Demo.Domain.Handlers.Users; - -/// -/// Handler for operation request. -/// Description: Update gender on a user. -/// Operation: UpdateMyTestGender. -/// -public class UpdateMyTestGenderHandler : IUpdateMyTestGenderHandler -{ - public Task ExecuteAsync( - UpdateMyTestGenderParameters parameters, - CancellationToken cancellationToken = default) - { - ArgumentNullException.ThrowIfNull(parameters); - - throw new NotImplementedException("Add logic here for UpdateMyTestGenderHandler"); - } -} \ No newline at end of file diff --git a/sample/src/Demo.Domain/Handlers/Users/UpdateUserByIdHandler.cs b/sample/src/Demo.Domain/Handlers/Users/UpdateUserByIdHandler.cs deleted file mode 100644 index eca49ded..00000000 --- a/sample/src/Demo.Domain/Handlers/Users/UpdateUserByIdHandler.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace Demo.Domain.Handlers.Users; - -/// -/// Handler for operation request. -/// Description: Update user by id. -/// Operation: UpdateUserById. -/// -public class UpdateUserByIdHandler : IUpdateUserByIdHandler -{ - public Task ExecuteAsync( - UpdateUserByIdParameters parameters, - CancellationToken cancellationToken = default) - { - ArgumentNullException.ThrowIfNull(parameters); - - throw new NotImplementedException("Add logic here for UpdateUserByIdHandler"); - } -} \ No newline at end of file diff --git a/sample/src/Demo.Domain/Validators/Users/PostUserParametersValidator.cs b/sample/src/Demo.Domain/Validators/Users/PostUserParametersValidator.cs deleted file mode 100644 index 183a1d90..00000000 --- a/sample/src/Demo.Domain/Validators/Users/PostUserParametersValidator.cs +++ /dev/null @@ -1,22 +0,0 @@ -// ReSharper disable ConditionIsAlwaysTrueOrFalse -namespace Demo.Domain.Validators.Users; - -public class PostUserParametersValidator : AbstractValidator -{ - public PostUserParametersValidator() - { - When(x => x.Request is not null, () => - { - RuleFor(x => x.Request.FirstName) - .NotNull() - .Length(2, 10) - .Matches(@"^[A-Z]").WithMessage(x => $"{nameof(x.Request.FirstName)} has to start with an uppercase letter"); - - RuleFor(x => x.Request.LastName) - .NotNull() - .Length(2, 30) - .Matches(@"^[A-Z]").WithMessage(x => $"{nameof(x.Request.LastName)} has to start with an uppercase letter") - .NotEqual(x => x.Request.FirstName); - }); - } -} \ No newline at end of file diff --git a/sample/src/Directory.Build.props b/sample/src/Directory.Build.props deleted file mode 100644 index 55514333..00000000 --- a/sample/src/Directory.Build.props +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - Library - - true - - snupkg - - true - - embedded - - \ No newline at end of file diff --git a/sample/test/.editorconfig b/sample/test/.editorconfig deleted file mode 100644 index d8fb4917..00000000 --- a/sample/test/.editorconfig +++ /dev/null @@ -1,54 +0,0 @@ -# ATC coding rules - https://github.com/atc-net/atc-coding-rules -# Version: 1.0.9 -# Updated: 24-11-2022 -# Location: test -# Distribution: DotNet6 -# Inspired by: https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/code-style-rule-options - -########################################## -# Code Analyzers Rules -########################################## -[*.{cs,csx,cake}] - -# AsyncFixer -# http://www.asyncfixer.com - - -# Asyncify -# https://github.com/hvanbakel/Asyncify-CSharp - - -# Meziantou -# https://www.meziantou.net/enforcing-asynchronous-code-good-practices-using-a-roslyn-analyzer.htm -dotnet_diagnostic.MA0004.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0004.md -dotnet_diagnostic.MA0016.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0016.md - - -# Microsoft - Code Analysis -# https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ -dotnet_diagnostic.CA1068.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA1068.md -dotnet_diagnostic.CA1707.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA1707.md -dotnet_diagnostic.CA2007.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA2007.md - - -# Microsoft - Compiler Errors -# https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-messages/ - - -# SecurityCodeScan -# https://security-code-scan.github.io/ - - -# StyleCop -# https://github.com/DotNetAnalyzers/StyleCopAnalyzers -dotnet_diagnostic.SA1122.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1122.md -dotnet_diagnostic.SA1133.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1133.md - - -# SonarAnalyzer.CSharp -# https://rules.sonarsource.com/csharp - - -########################################## -# Custom - Code Analyzers Rules -########################################## diff --git a/sample/test/Demo.Api.Tests/Demo.Api.Tests.csproj b/sample/test/Demo.Api.Tests/Demo.Api.Tests.csproj deleted file mode 100644 index 28aea221..00000000 --- a/sample/test/Demo.Api.Tests/Demo.Api.Tests.csproj +++ /dev/null @@ -1,34 +0,0 @@ - - - - net6.0 - - - - - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - Always - - - diff --git a/sample/test/Demo.Api.Tests/Endpoints/Accounts/SetAccountNameHandlerStub.cs b/sample/test/Demo.Api.Tests/Endpoints/Accounts/SetAccountNameHandlerStub.cs deleted file mode 100644 index ac40e2bb..00000000 --- a/sample/test/Demo.Api.Tests/Endpoints/Accounts/SetAccountNameHandlerStub.cs +++ /dev/null @@ -1,18 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.324.48157. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Tests.Endpoints.Accounts; - -[GeneratedCode("ApiGenerator", "2.0.324.48157")] -public class SetAccountNameHandlerStub : ISetAccountNameHandler -{ - public Task ExecuteAsync( - SetAccountNameParameters parameters, - CancellationToken cancellationToken = default) - { - return Task.FromResult(SetAccountNameResult.Ok("Hallo world")); - } -} \ No newline at end of file diff --git a/sample/test/Demo.Api.Tests/Endpoints/Accounts/SetAccountNameTests.cs b/sample/test/Demo.Api.Tests/Endpoints/Accounts/SetAccountNameTests.cs deleted file mode 100644 index a2aec830..00000000 --- a/sample/test/Demo.Api.Tests/Endpoints/Accounts/SetAccountNameTests.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace Demo.Api.Tests.Endpoints.Accounts; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class SetAccountNameTests : WebApiControllerBaseTest -{ - public SetAccountNameTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/sample/test/Demo.Api.Tests/Endpoints/Accounts/UpdateAccountNameHandlerStub.cs b/sample/test/Demo.Api.Tests/Endpoints/Accounts/UpdateAccountNameHandlerStub.cs deleted file mode 100644 index 7f52b423..00000000 --- a/sample/test/Demo.Api.Tests/Endpoints/Accounts/UpdateAccountNameHandlerStub.cs +++ /dev/null @@ -1,18 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.324.48157. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Tests.Endpoints.Accounts; - -[GeneratedCode("ApiGenerator", "2.0.324.48157")] -public class UpdateAccountNameHandlerStub : IUpdateAccountNameHandler -{ - public Task ExecuteAsync( - UpdateAccountNameParameters parameters, - CancellationToken cancellationToken = default) - { - return Task.FromResult(UpdateAccountNameResult.Ok("Hallo world")); - } -} \ No newline at end of file diff --git a/sample/test/Demo.Api.Tests/Endpoints/Accounts/UpdateAccountNameTests.cs b/sample/test/Demo.Api.Tests/Endpoints/Accounts/UpdateAccountNameTests.cs deleted file mode 100644 index 64344ebb..00000000 --- a/sample/test/Demo.Api.Tests/Endpoints/Accounts/UpdateAccountNameTests.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace Demo.Api.Tests.Endpoints.Accounts; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class UpdateAccountNameTests : WebApiControllerBaseTest -{ - public UpdateAccountNameTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/sample/test/Demo.Api.Tests/Endpoints/Addresses/GetAddressesByPostalCodesHandlerStub.cs b/sample/test/Demo.Api.Tests/Endpoints/Addresses/GetAddressesByPostalCodesHandlerStub.cs deleted file mode 100644 index 4b6354ef..00000000 --- a/sample/test/Demo.Api.Tests/Endpoints/Addresses/GetAddressesByPostalCodesHandlerStub.cs +++ /dev/null @@ -1,20 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.324.48157. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Tests.Endpoints.Addresses; - -[GeneratedCode("ApiGenerator", "2.0.324.48157")] -public class GetAddressesByPostalCodesHandlerStub : IGetAddressesByPostalCodesHandler -{ - public Task ExecuteAsync( - GetAddressesByPostalCodesParameters parameters, - CancellationToken cancellationToken = default) - { - var data = new Fixture().Create>(); - - return Task.FromResult(GetAddressesByPostalCodesResult.Ok(data)); - } -} \ No newline at end of file diff --git a/sample/test/Demo.Api.Tests/Endpoints/Addresses/GetAddressesByPostalCodesTests.cs b/sample/test/Demo.Api.Tests/Endpoints/Addresses/GetAddressesByPostalCodesTests.cs deleted file mode 100644 index e1ba1898..00000000 --- a/sample/test/Demo.Api.Tests/Endpoints/Addresses/GetAddressesByPostalCodesTests.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace Demo.Api.Tests.Endpoints.Addresses; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class GetAddressesByPostalCodesTests : WebApiControllerBaseTest -{ - public GetAddressesByPostalCodesTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/sample/test/Demo.Api.Tests/Endpoints/EventArgs/GetEventArgByIdHandlerStub.cs b/sample/test/Demo.Api.Tests/Endpoints/EventArgs/GetEventArgByIdHandlerStub.cs deleted file mode 100644 index 03aeb4cd..00000000 --- a/sample/test/Demo.Api.Tests/Endpoints/EventArgs/GetEventArgByIdHandlerStub.cs +++ /dev/null @@ -1,20 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.324.48157. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Tests.Endpoints.EventArgs; - -[GeneratedCode("ApiGenerator", "2.0.324.48157")] -public class GetEventArgByIdHandlerStub : IGetEventArgByIdHandler -{ - public Task ExecuteAsync( - GetEventArgByIdParameters parameters, - CancellationToken cancellationToken = default) - { - var data = new Fixture().Create(); - - return Task.FromResult(GetEventArgByIdResult.Ok(data)); - } -} \ No newline at end of file diff --git a/sample/test/Demo.Api.Tests/Endpoints/EventArgs/GetEventArgByIdTests.cs b/sample/test/Demo.Api.Tests/Endpoints/EventArgs/GetEventArgByIdTests.cs deleted file mode 100644 index 9eeda14c..00000000 --- a/sample/test/Demo.Api.Tests/Endpoints/EventArgs/GetEventArgByIdTests.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace Demo.Api.Tests.Endpoints.EventArgs; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class GetEventArgByIdTests : WebApiControllerBaseTest -{ - public GetEventArgByIdTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/sample/test/Demo.Api.Tests/Endpoints/EventArgs/GetEventArgsHandlerStub.cs b/sample/test/Demo.Api.Tests/Endpoints/EventArgs/GetEventArgsHandlerStub.cs deleted file mode 100644 index eb5e43b9..00000000 --- a/sample/test/Demo.Api.Tests/Endpoints/EventArgs/GetEventArgsHandlerStub.cs +++ /dev/null @@ -1,19 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.324.48157. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Tests.Endpoints.EventArgs; - -[GeneratedCode("ApiGenerator", "2.0.324.48157")] -public class GetEventArgsHandlerStub : IGetEventArgsHandler -{ - public Task ExecuteAsync( - CancellationToken cancellationToken = default) - { - var data = new Fixture().Create>(); - - return Task.FromResult(GetEventArgsResult.Ok(data)); - } -} \ No newline at end of file diff --git a/sample/test/Demo.Api.Tests/Endpoints/EventArgs/GetEventArgsTests.cs b/sample/test/Demo.Api.Tests/Endpoints/EventArgs/GetEventArgsTests.cs deleted file mode 100644 index c0f1c135..00000000 --- a/sample/test/Demo.Api.Tests/Endpoints/EventArgs/GetEventArgsTests.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace Demo.Api.Tests.Endpoints.EventArgs; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class GetEventArgsTests : WebApiControllerBaseTest -{ - public GetEventArgsTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/sample/test/Demo.Api.Tests/Endpoints/Files/GetFileByIdHandlerStub.cs b/sample/test/Demo.Api.Tests/Endpoints/Files/GetFileByIdHandlerStub.cs deleted file mode 100644 index 0fea2cc7..00000000 --- a/sample/test/Demo.Api.Tests/Endpoints/Files/GetFileByIdHandlerStub.cs +++ /dev/null @@ -1,19 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.324.48157. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Tests.Endpoints.Files; - -[GeneratedCode("ApiGenerator", "2.0.324.48157")] -public class GetFileByIdHandlerStub : IGetFileByIdHandler -{ - public Task ExecuteAsync( - GetFileByIdParameters parameters, - CancellationToken cancellationToken = default) - { - var bytes = Encoding.UTF8.GetBytes("Hello World"); - return Task.FromResult(GetFileByIdResult.Ok(bytes, "dummy.txt")); - } -} \ No newline at end of file diff --git a/sample/test/Demo.Api.Tests/Endpoints/Files/GetFileByIdTests.cs b/sample/test/Demo.Api.Tests/Endpoints/Files/GetFileByIdTests.cs deleted file mode 100644 index a2ff1f3d..00000000 --- a/sample/test/Demo.Api.Tests/Endpoints/Files/GetFileByIdTests.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace Demo.Api.Tests.Endpoints.Files; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class GetFileByIdTests : WebApiControllerBaseTest -{ - public GetFileByIdTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/sample/test/Demo.Api.Tests/Endpoints/Files/UploadMultiFilesAsFormDataHandlerStub.cs b/sample/test/Demo.Api.Tests/Endpoints/Files/UploadMultiFilesAsFormDataHandlerStub.cs deleted file mode 100644 index 66e44771..00000000 --- a/sample/test/Demo.Api.Tests/Endpoints/Files/UploadMultiFilesAsFormDataHandlerStub.cs +++ /dev/null @@ -1,18 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.324.48157. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Tests.Endpoints.Files; - -[GeneratedCode("ApiGenerator", "2.0.324.48157")] -public class UploadMultiFilesAsFormDataHandlerStub : IUploadMultiFilesAsFormDataHandler -{ - public Task ExecuteAsync( - UploadMultiFilesAsFormDataParameters parameters, - CancellationToken cancellationToken = default) - { - return Task.FromResult(UploadMultiFilesAsFormDataResult.Ok("Hallo world")); - } -} \ No newline at end of file diff --git a/sample/test/Demo.Api.Tests/Endpoints/Files/UploadMultiFilesAsFormDataTests.cs b/sample/test/Demo.Api.Tests/Endpoints/Files/UploadMultiFilesAsFormDataTests.cs deleted file mode 100644 index 440fd909..00000000 --- a/sample/test/Demo.Api.Tests/Endpoints/Files/UploadMultiFilesAsFormDataTests.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace Demo.Api.Tests.Endpoints.Files; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class UploadMultiFilesAsFormDataTests : WebApiControllerBaseTest -{ - public UploadMultiFilesAsFormDataTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/sample/test/Demo.Api.Tests/Endpoints/Files/UploadSingleFileAsFormDataHandlerStub.cs b/sample/test/Demo.Api.Tests/Endpoints/Files/UploadSingleFileAsFormDataHandlerStub.cs deleted file mode 100644 index 61dad395..00000000 --- a/sample/test/Demo.Api.Tests/Endpoints/Files/UploadSingleFileAsFormDataHandlerStub.cs +++ /dev/null @@ -1,18 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.324.48157. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Tests.Endpoints.Files; - -[GeneratedCode("ApiGenerator", "2.0.324.48157")] -public class UploadSingleFileAsFormDataHandlerStub : IUploadSingleFileAsFormDataHandler -{ - public Task ExecuteAsync( - UploadSingleFileAsFormDataParameters parameters, - CancellationToken cancellationToken = default) - { - return Task.FromResult(UploadSingleFileAsFormDataResult.Ok("Hallo world")); - } -} \ No newline at end of file diff --git a/sample/test/Demo.Api.Tests/Endpoints/Files/UploadSingleFileAsFormDataTests.cs b/sample/test/Demo.Api.Tests/Endpoints/Files/UploadSingleFileAsFormDataTests.cs deleted file mode 100644 index d6f5334a..00000000 --- a/sample/test/Demo.Api.Tests/Endpoints/Files/UploadSingleFileAsFormDataTests.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace Demo.Api.Tests.Endpoints.Files; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class UploadSingleFileAsFormDataTests : WebApiControllerBaseTest -{ - public UploadSingleFileAsFormDataTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/sample/test/Demo.Api.Tests/Endpoints/Files/UploadSingleObjectWithFileAsFormDataHandlerStub.cs b/sample/test/Demo.Api.Tests/Endpoints/Files/UploadSingleObjectWithFileAsFormDataHandlerStub.cs deleted file mode 100644 index 4fec0073..00000000 --- a/sample/test/Demo.Api.Tests/Endpoints/Files/UploadSingleObjectWithFileAsFormDataHandlerStub.cs +++ /dev/null @@ -1,18 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.324.48157. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Tests.Endpoints.Files; - -[GeneratedCode("ApiGenerator", "2.0.324.48157")] -public class UploadSingleObjectWithFileAsFormDataHandlerStub : IUploadSingleObjectWithFileAsFormDataHandler -{ - public Task ExecuteAsync( - UploadSingleObjectWithFileAsFormDataParameters parameters, - CancellationToken cancellationToken = default) - { - return Task.FromResult(UploadSingleObjectWithFileAsFormDataResult.Ok("Hallo world")); - } -} \ No newline at end of file diff --git a/sample/test/Demo.Api.Tests/Endpoints/Files/UploadSingleObjectWithFileAsFormDataTests.cs b/sample/test/Demo.Api.Tests/Endpoints/Files/UploadSingleObjectWithFileAsFormDataTests.cs deleted file mode 100644 index b947e637..00000000 --- a/sample/test/Demo.Api.Tests/Endpoints/Files/UploadSingleObjectWithFileAsFormDataTests.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace Demo.Api.Tests.Endpoints.Files; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class UploadSingleObjectWithFileAsFormDataTests : WebApiControllerBaseTest -{ - public UploadSingleObjectWithFileAsFormDataTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/sample/test/Demo.Api.Tests/Endpoints/Files/UploadSingleObjectWithFilesAsFormDataHandlerStub.cs b/sample/test/Demo.Api.Tests/Endpoints/Files/UploadSingleObjectWithFilesAsFormDataHandlerStub.cs deleted file mode 100644 index 0b9ecbf8..00000000 --- a/sample/test/Demo.Api.Tests/Endpoints/Files/UploadSingleObjectWithFilesAsFormDataHandlerStub.cs +++ /dev/null @@ -1,18 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.324.48157. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Tests.Endpoints.Files; - -[GeneratedCode("ApiGenerator", "2.0.324.48157")] -public class UploadSingleObjectWithFilesAsFormDataHandlerStub : IUploadSingleObjectWithFilesAsFormDataHandler -{ - public Task ExecuteAsync( - UploadSingleObjectWithFilesAsFormDataParameters parameters, - CancellationToken cancellationToken = default) - { - return Task.FromResult(UploadSingleObjectWithFilesAsFormDataResult.Ok("Hallo world")); - } -} \ No newline at end of file diff --git a/sample/test/Demo.Api.Tests/Endpoints/Files/UploadSingleObjectWithFilesAsFormDataTests.cs b/sample/test/Demo.Api.Tests/Endpoints/Files/UploadSingleObjectWithFilesAsFormDataTests.cs deleted file mode 100644 index 9e5ed115..00000000 --- a/sample/test/Demo.Api.Tests/Endpoints/Files/UploadSingleObjectWithFilesAsFormDataTests.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace Demo.Api.Tests.Endpoints.Files; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class UploadSingleObjectWithFilesAsFormDataTests : WebApiControllerBaseTest -{ - public UploadSingleObjectWithFilesAsFormDataTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/sample/test/Demo.Api.Tests/Endpoints/Items/CreateItemHandlerStub.cs b/sample/test/Demo.Api.Tests/Endpoints/Items/CreateItemHandlerStub.cs deleted file mode 100644 index 246f31f4..00000000 --- a/sample/test/Demo.Api.Tests/Endpoints/Items/CreateItemHandlerStub.cs +++ /dev/null @@ -1,18 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.324.48157. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Tests.Endpoints.Items; - -[GeneratedCode("ApiGenerator", "2.0.324.48157")] -public class CreateItemHandlerStub : ICreateItemHandler -{ - public Task ExecuteAsync( - CreateItemParameters parameters, - CancellationToken cancellationToken = default) - { - return Task.FromResult(CreateItemResult.Ok("Hallo world")); - } -} \ No newline at end of file diff --git a/sample/test/Demo.Api.Tests/Endpoints/Items/CreateItemTests.cs b/sample/test/Demo.Api.Tests/Endpoints/Items/CreateItemTests.cs deleted file mode 100644 index c6b93ce6..00000000 --- a/sample/test/Demo.Api.Tests/Endpoints/Items/CreateItemTests.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace Demo.Api.Tests.Endpoints.Items; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class CreateItemTests : WebApiControllerBaseTest -{ - public CreateItemTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/sample/test/Demo.Api.Tests/Endpoints/Items/UpdateItemHandlerStub.cs b/sample/test/Demo.Api.Tests/Endpoints/Items/UpdateItemHandlerStub.cs deleted file mode 100644 index 6fbd50ce..00000000 --- a/sample/test/Demo.Api.Tests/Endpoints/Items/UpdateItemHandlerStub.cs +++ /dev/null @@ -1,18 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.324.48157. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Tests.Endpoints.Items; - -[GeneratedCode("ApiGenerator", "2.0.324.48157")] -public class UpdateItemHandlerStub : IUpdateItemHandler -{ - public Task ExecuteAsync( - UpdateItemParameters parameters, - CancellationToken cancellationToken = default) - { - return Task.FromResult(UpdateItemResult.Ok(Guid.NewGuid())); - } -} \ No newline at end of file diff --git a/sample/test/Demo.Api.Tests/Endpoints/Items/UpdateItemTests.cs b/sample/test/Demo.Api.Tests/Endpoints/Items/UpdateItemTests.cs deleted file mode 100644 index f3705726..00000000 --- a/sample/test/Demo.Api.Tests/Endpoints/Items/UpdateItemTests.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace Demo.Api.Tests.Endpoints.Items; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class UpdateItemTests : WebApiControllerBaseTest -{ - public UpdateItemTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/sample/test/Demo.Api.Tests/Endpoints/Orders/GetOrderByIdHandlerStub.cs b/sample/test/Demo.Api.Tests/Endpoints/Orders/GetOrderByIdHandlerStub.cs deleted file mode 100644 index ae56135a..00000000 --- a/sample/test/Demo.Api.Tests/Endpoints/Orders/GetOrderByIdHandlerStub.cs +++ /dev/null @@ -1,20 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.324.48157. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Tests.Endpoints.Orders; - -[GeneratedCode("ApiGenerator", "2.0.324.48157")] -public class GetOrderByIdHandlerStub : IGetOrderByIdHandler -{ - public Task ExecuteAsync( - GetOrderByIdParameters parameters, - CancellationToken cancellationToken = default) - { - var data = new Fixture().Create(); - - return Task.FromResult(GetOrderByIdResult.Ok(data)); - } -} \ No newline at end of file diff --git a/sample/test/Demo.Api.Tests/Endpoints/Orders/GetOrderByIdTests.cs b/sample/test/Demo.Api.Tests/Endpoints/Orders/GetOrderByIdTests.cs deleted file mode 100644 index 2e3cc5b6..00000000 --- a/sample/test/Demo.Api.Tests/Endpoints/Orders/GetOrderByIdTests.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace Demo.Api.Tests.Endpoints.Orders; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class GetOrderByIdTests : WebApiControllerBaseTest -{ - public GetOrderByIdTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/sample/test/Demo.Api.Tests/Endpoints/Orders/GetOrdersHandlerStub.cs b/sample/test/Demo.Api.Tests/Endpoints/Orders/GetOrdersHandlerStub.cs deleted file mode 100644 index 10532f42..00000000 --- a/sample/test/Demo.Api.Tests/Endpoints/Orders/GetOrdersHandlerStub.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.324.48157. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Tests.Endpoints.Orders; - -[GeneratedCode("ApiGenerator", "2.0.324.48157")] -public class GetOrdersHandlerStub : IGetOrdersHandler -{ - public Task ExecuteAsync( - GetOrdersParameters parameters, - CancellationToken cancellationToken = default) - { - var data = new Fixture().Create>(); - - var paginationData = new Pagination( - data, - parameters.PageSize, - parameters.QueryString, - parameters.ContinuationToken); - - return Task.FromResult(GetOrdersResult.Ok(paginationData)); - } -} \ No newline at end of file diff --git a/sample/test/Demo.Api.Tests/Endpoints/Orders/GetOrdersTests.cs b/sample/test/Demo.Api.Tests/Endpoints/Orders/GetOrdersTests.cs deleted file mode 100644 index 3c6375ae..00000000 --- a/sample/test/Demo.Api.Tests/Endpoints/Orders/GetOrdersTests.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace Demo.Api.Tests.Endpoints.Orders; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class GetOrdersTests : WebApiControllerBaseTest -{ - public GetOrdersTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/sample/test/Demo.Api.Tests/Endpoints/Orders/PatchOrdersIdHandlerStub.cs b/sample/test/Demo.Api.Tests/Endpoints/Orders/PatchOrdersIdHandlerStub.cs deleted file mode 100644 index a731f5c9..00000000 --- a/sample/test/Demo.Api.Tests/Endpoints/Orders/PatchOrdersIdHandlerStub.cs +++ /dev/null @@ -1,18 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.324.48157. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Tests.Endpoints.Orders; - -[GeneratedCode("ApiGenerator", "2.0.324.48157")] -public class PatchOrdersIdHandlerStub : IPatchOrdersIdHandler -{ - public Task ExecuteAsync( - PatchOrdersIdParameters parameters, - CancellationToken cancellationToken = default) - { - return Task.FromResult(PatchOrdersIdResult.Ok("Hallo world")); - } -} \ No newline at end of file diff --git a/sample/test/Demo.Api.Tests/Endpoints/Orders/PatchOrdersIdTests.cs b/sample/test/Demo.Api.Tests/Endpoints/Orders/PatchOrdersIdTests.cs deleted file mode 100644 index a3f1a04d..00000000 --- a/sample/test/Demo.Api.Tests/Endpoints/Orders/PatchOrdersIdTests.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace Demo.Api.Tests.Endpoints.Orders; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class PatchOrdersIdTests : WebApiControllerBaseTest -{ - public PatchOrdersIdTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/sample/test/Demo.Api.Tests/Endpoints/RouteWithDash/GetRouteWithDashHandlerStub.cs b/sample/test/Demo.Api.Tests/Endpoints/RouteWithDash/GetRouteWithDashHandlerStub.cs deleted file mode 100644 index 99b81341..00000000 --- a/sample/test/Demo.Api.Tests/Endpoints/RouteWithDash/GetRouteWithDashHandlerStub.cs +++ /dev/null @@ -1,17 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.324.48157. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Tests.Endpoints.RouteWithDash; - -[GeneratedCode("ApiGenerator", "2.0.324.48157")] -public class GetRouteWithDashHandlerStub : IGetRouteWithDashHandler -{ - public Task ExecuteAsync( - CancellationToken cancellationToken = default) - { - return Task.FromResult(GetRouteWithDashResult.Ok("Hallo world")); - } -} \ No newline at end of file diff --git a/sample/test/Demo.Api.Tests/Endpoints/RouteWithDash/GetRouteWithDashTests.cs b/sample/test/Demo.Api.Tests/Endpoints/RouteWithDash/GetRouteWithDashTests.cs deleted file mode 100644 index 498a12df..00000000 --- a/sample/test/Demo.Api.Tests/Endpoints/RouteWithDash/GetRouteWithDashTests.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace Demo.Api.Tests.Endpoints.RouteWithDash; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class GetRouteWithDashTests : WebApiControllerBaseTest -{ - public GetRouteWithDashTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/sample/test/Demo.Api.Tests/Endpoints/Tasks/GetTasksHandlerStub.cs b/sample/test/Demo.Api.Tests/Endpoints/Tasks/GetTasksHandlerStub.cs deleted file mode 100644 index 02732c28..00000000 --- a/sample/test/Demo.Api.Tests/Endpoints/Tasks/GetTasksHandlerStub.cs +++ /dev/null @@ -1,19 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.324.48157. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Tests.Endpoints.Tasks; - -[GeneratedCode("ApiGenerator", "2.0.324.48157")] -public class GetTasksHandlerStub : Demo.Api.Generated.Contracts.Tasks.IGetTasksHandler -{ - public Task ExecuteAsync( - CancellationToken cancellationToken = default) - { - var data = new Fixture().Create>(); - - return Task.FromResult(Demo.Api.Generated.Contracts.Tasks.GetTasksResult.Ok(data)); - } -} \ No newline at end of file diff --git a/sample/test/Demo.Api.Tests/Endpoints/Tasks/GetTasksTests.cs b/sample/test/Demo.Api.Tests/Endpoints/Tasks/GetTasksTests.cs deleted file mode 100644 index 7d468840..00000000 --- a/sample/test/Demo.Api.Tests/Endpoints/Tasks/GetTasksTests.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace Demo.Api.Tests.Endpoints.Tasks; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class GetTasksTests : WebApiControllerBaseTest -{ - public GetTasksTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/sample/test/Demo.Api.Tests/Endpoints/Users/DeleteUserByIdHandlerStub.cs b/sample/test/Demo.Api.Tests/Endpoints/Users/DeleteUserByIdHandlerStub.cs deleted file mode 100644 index 6b3d6163..00000000 --- a/sample/test/Demo.Api.Tests/Endpoints/Users/DeleteUserByIdHandlerStub.cs +++ /dev/null @@ -1,18 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.324.48157. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Tests.Endpoints.Users; - -[GeneratedCode("ApiGenerator", "2.0.324.48157")] -public class DeleteUserByIdHandlerStub : IDeleteUserByIdHandler -{ - public Task ExecuteAsync( - DeleteUserByIdParameters parameters, - CancellationToken cancellationToken = default) - { - return Task.FromResult(DeleteUserByIdResult.Ok("Hallo world")); - } -} \ No newline at end of file diff --git a/sample/test/Demo.Api.Tests/Endpoints/Users/DeleteUserByIdTests.cs b/sample/test/Demo.Api.Tests/Endpoints/Users/DeleteUserByIdTests.cs deleted file mode 100644 index 96128536..00000000 --- a/sample/test/Demo.Api.Tests/Endpoints/Users/DeleteUserByIdTests.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace Demo.Api.Tests.Endpoints.Users; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class DeleteUserByIdTests : WebApiControllerBaseTest -{ - public DeleteUserByIdTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/sample/test/Demo.Api.Tests/Endpoints/Users/GetUserByEmailHandlerStub.cs b/sample/test/Demo.Api.Tests/Endpoints/Users/GetUserByEmailHandlerStub.cs deleted file mode 100644 index 3e4666eb..00000000 --- a/sample/test/Demo.Api.Tests/Endpoints/Users/GetUserByEmailHandlerStub.cs +++ /dev/null @@ -1,20 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.324.48157. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Tests.Endpoints.Users; - -[GeneratedCode("ApiGenerator", "2.0.324.48157")] -public class GetUserByEmailHandlerStub : IGetUserByEmailHandler -{ - public Task ExecuteAsync( - GetUserByEmailParameters parameters, - CancellationToken cancellationToken = default) - { - var data = new Fixture().Create(); - - return Task.FromResult(GetUserByEmailResult.Ok(data)); - } -} \ No newline at end of file diff --git a/sample/test/Demo.Api.Tests/Endpoints/Users/GetUserByEmailTests.cs b/sample/test/Demo.Api.Tests/Endpoints/Users/GetUserByEmailTests.cs deleted file mode 100644 index 6c649627..00000000 --- a/sample/test/Demo.Api.Tests/Endpoints/Users/GetUserByEmailTests.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace Demo.Api.Tests.Endpoints.Users; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class GetUserByEmailTests : WebApiControllerBaseTest -{ - public GetUserByEmailTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/sample/test/Demo.Api.Tests/Endpoints/Users/GetUserByIdHandlerStub.cs b/sample/test/Demo.Api.Tests/Endpoints/Users/GetUserByIdHandlerStub.cs deleted file mode 100644 index 2f326a60..00000000 --- a/sample/test/Demo.Api.Tests/Endpoints/Users/GetUserByIdHandlerStub.cs +++ /dev/null @@ -1,20 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.324.48157. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Tests.Endpoints.Users; - -[GeneratedCode("ApiGenerator", "2.0.324.48157")] -public class GetUserByIdHandlerStub : IGetUserByIdHandler -{ - public Task ExecuteAsync( - GetUserByIdParameters parameters, - CancellationToken cancellationToken = default) - { - var data = new Fixture().Create(); - - return Task.FromResult(GetUserByIdResult.Ok(data)); - } -} \ No newline at end of file diff --git a/sample/test/Demo.Api.Tests/Endpoints/Users/GetUserByIdTests.cs b/sample/test/Demo.Api.Tests/Endpoints/Users/GetUserByIdTests.cs deleted file mode 100644 index 16bea0a1..00000000 --- a/sample/test/Demo.Api.Tests/Endpoints/Users/GetUserByIdTests.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace Demo.Api.Tests.Endpoints.Users; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class GetUserByIdTests : WebApiControllerBaseTest -{ - public GetUserByIdTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/sample/test/Demo.Api.Tests/Endpoints/Users/GetUsersHandlerStub.cs b/sample/test/Demo.Api.Tests/Endpoints/Users/GetUsersHandlerStub.cs deleted file mode 100644 index 9f959a3e..00000000 --- a/sample/test/Demo.Api.Tests/Endpoints/Users/GetUsersHandlerStub.cs +++ /dev/null @@ -1,19 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.324.48157. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Tests.Endpoints.Users; - -[GeneratedCode("ApiGenerator", "2.0.324.48157")] -public class GetUsersHandlerStub : IGetUsersHandler -{ - public Task ExecuteAsync( - CancellationToken cancellationToken = default) - { - var data = new Fixture().Create>(); - - return Task.FromResult(GetUsersResult.Ok(data)); - } -} \ No newline at end of file diff --git a/sample/test/Demo.Api.Tests/Endpoints/Users/GetUsersTests.cs b/sample/test/Demo.Api.Tests/Endpoints/Users/GetUsersTests.cs deleted file mode 100644 index 96d9e9e8..00000000 --- a/sample/test/Demo.Api.Tests/Endpoints/Users/GetUsersTests.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace Demo.Api.Tests.Endpoints.Users; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class GetUsersTests : WebApiControllerBaseTest -{ - public GetUsersTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/sample/test/Demo.Api.Tests/Endpoints/Users/PostUserHandlerStub.cs b/sample/test/Demo.Api.Tests/Endpoints/Users/PostUserHandlerStub.cs deleted file mode 100644 index 10e7c13a..00000000 --- a/sample/test/Demo.Api.Tests/Endpoints/Users/PostUserHandlerStub.cs +++ /dev/null @@ -1,18 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.324.48157. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Tests.Endpoints.Users; - -[GeneratedCode("ApiGenerator", "2.0.324.48157")] -public class PostUserHandlerStub : IPostUserHandler -{ - public Task ExecuteAsync( - PostUserParameters parameters, - CancellationToken cancellationToken = default) - { - return Task.FromResult(PostUserResult.Created()); - } -} \ No newline at end of file diff --git a/sample/test/Demo.Api.Tests/Endpoints/Users/PostUserTests.cs b/sample/test/Demo.Api.Tests/Endpoints/Users/PostUserTests.cs deleted file mode 100644 index d5aacfc2..00000000 --- a/sample/test/Demo.Api.Tests/Endpoints/Users/PostUserTests.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace Demo.Api.Tests.Endpoints.Users; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class PostUserTests : WebApiControllerBaseTest -{ - public PostUserTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/sample/test/Demo.Api.Tests/Endpoints/Users/UpdateMyTestGenderHandlerStub.cs b/sample/test/Demo.Api.Tests/Endpoints/Users/UpdateMyTestGenderHandlerStub.cs deleted file mode 100644 index 242c3619..00000000 --- a/sample/test/Demo.Api.Tests/Endpoints/Users/UpdateMyTestGenderHandlerStub.cs +++ /dev/null @@ -1,18 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.324.48157. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Tests.Endpoints.Users; - -[GeneratedCode("ApiGenerator", "2.0.324.48157")] -public class UpdateMyTestGenderHandlerStub : IUpdateMyTestGenderHandler -{ - public Task ExecuteAsync( - UpdateMyTestGenderParameters parameters, - CancellationToken cancellationToken = default) - { - return Task.FromResult(UpdateMyTestGenderResult.Ok("Hallo world")); - } -} \ No newline at end of file diff --git a/sample/test/Demo.Api.Tests/Endpoints/Users/UpdateMyTestGenderTests.cs b/sample/test/Demo.Api.Tests/Endpoints/Users/UpdateMyTestGenderTests.cs deleted file mode 100644 index f14d1b09..00000000 --- a/sample/test/Demo.Api.Tests/Endpoints/Users/UpdateMyTestGenderTests.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace Demo.Api.Tests.Endpoints.Users; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class UpdateMyTestGenderTests : WebApiControllerBaseTest -{ - public UpdateMyTestGenderTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/sample/test/Demo.Api.Tests/Endpoints/Users/UpdateUserByIdHandlerStub.cs b/sample/test/Demo.Api.Tests/Endpoints/Users/UpdateUserByIdHandlerStub.cs deleted file mode 100644 index e8d599ae..00000000 --- a/sample/test/Demo.Api.Tests/Endpoints/Users/UpdateUserByIdHandlerStub.cs +++ /dev/null @@ -1,18 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.324.48157. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Tests.Endpoints.Users; - -[GeneratedCode("ApiGenerator", "2.0.324.48157")] -public class UpdateUserByIdHandlerStub : IUpdateUserByIdHandler -{ - public Task ExecuteAsync( - UpdateUserByIdParameters parameters, - CancellationToken cancellationToken = default) - { - return Task.FromResult(UpdateUserByIdResult.Ok("Hallo world")); - } -} \ No newline at end of file diff --git a/sample/test/Demo.Api.Tests/Endpoints/Users/UpdateUserByIdTests.cs b/sample/test/Demo.Api.Tests/Endpoints/Users/UpdateUserByIdTests.cs deleted file mode 100644 index 35caf946..00000000 --- a/sample/test/Demo.Api.Tests/Endpoints/Users/UpdateUserByIdTests.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace Demo.Api.Tests.Endpoints.Users; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class UpdateUserByIdTests : WebApiControllerBaseTest -{ - public UpdateUserByIdTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/sample/test/Demo.Api.Tests/GlobalUsings.cs b/sample/test/Demo.Api.Tests/GlobalUsings.cs deleted file mode 100644 index c7e7c787..00000000 --- a/sample/test/Demo.Api.Tests/GlobalUsings.cs +++ /dev/null @@ -1,27 +0,0 @@ -global using System.CodeDom.Compiler; -global using System.Reflection; -global using System.Text; -global using System.Text.Json; -global using System.Text.Json.Serialization; - -global using Atc.Rest.Options; -global using Atc.Rest.Results; -global using Atc.XUnit; - -global using Demo.Api.Generated; -global using Demo.Api.Generated.Contracts; -global using Demo.Api.Generated.Contracts.Accounts; -global using Demo.Api.Generated.Contracts.Addresses; -global using Demo.Api.Generated.Contracts.EventArgs; -global using Demo.Api.Generated.Contracts.Files; -global using Demo.Api.Generated.Contracts.Items; -global using Demo.Api.Generated.Contracts.Orders; -global using Demo.Api.Generated.Contracts.RouteWithDash; -global using Demo.Api.Generated.Contracts.Users; - -global using Microsoft.AspNetCore.Hosting; -global using Microsoft.AspNetCore.Http; -global using Microsoft.AspNetCore.Mvc.Testing; -global using Microsoft.AspNetCore.TestHost; -global using Microsoft.Extensions.Configuration; -global using Microsoft.Extensions.DependencyInjection; \ No newline at end of file diff --git a/sample/test/Demo.Api.Tests/WebApiControllerBaseTest.cs b/sample/test/Demo.Api.Tests/WebApiControllerBaseTest.cs deleted file mode 100644 index 2b8ccc6e..00000000 --- a/sample/test/Demo.Api.Tests/WebApiControllerBaseTest.cs +++ /dev/null @@ -1,56 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.324.48157. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Tests; - -[GeneratedCode("ApiGenerator", "2.0.324.48157")] -public abstract class WebApiControllerBaseTest : IClassFixture -{ - protected readonly WebApiStartupFactory Factory; - - protected readonly HttpClient HttpClient; - - protected readonly IConfiguration Configuration; - - protected static JsonSerializerOptions? JsonSerializerOptions; - - protected WebApiControllerBaseTest(WebApiStartupFactory fixture) - { - this.Factory = fixture; - this.HttpClient = this.Factory.CreateClient(); - this.Configuration = new ConfigurationBuilder().Build(); - JsonSerializerOptions = new JsonSerializerOptions - { - PropertyNameCaseInsensitive = true, - Converters = - { - new JsonStringEnumConverter() - }, - }; - } - - protected static StringContent ToJson(object data) - => new(JsonSerializer.Serialize(data, JsonSerializerOptions), Encoding.UTF8, "application/json"); - - protected static StringContent Json(string data) - => new(data, Encoding.UTF8, "application/json"); - - protected static IFormFile GetTestFile() - { - var bytes = Encoding.UTF8.GetBytes("Hello World"); - var stream = new MemoryStream(bytes); - var formFile = new FormFile(stream, 0, stream.Length, "dummy", "dummy.txt") - { - Headers = new HeaderDictionary(), - ContentType = "application/octet-stream", - }; - - return formFile; - } - - protected static List GetTestFiles() - => new() { GetTestFile(), GetTestFile() }; -} \ No newline at end of file diff --git a/sample/test/Demo.Api.Tests/WebApiStartupFactory.cs b/sample/test/Demo.Api.Tests/WebApiStartupFactory.cs deleted file mode 100644 index 68de70de..00000000 --- a/sample/test/Demo.Api.Tests/WebApiStartupFactory.cs +++ /dev/null @@ -1,40 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator 2.0.324.48157. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace Demo.Api.Tests; - -/// -/// Factory for bootstrapping in memory tests. -/// Includes options to override configuration and service collection using a partial class. -/// -[GeneratedCode("ApiGenerator", "2.0.324.48157")] -public partial class WebApiStartupFactory : WebApplicationFactory -{ - protected override void ConfigureWebHost(IWebHostBuilder builder) - { - builder.ConfigureAppConfiguration(config => - { - ModifyConfiguration(config); - var integrationConfig = new ConfigurationBuilder() - .AddJsonFile("appsettings.integrationtest.json") - .Build(); - config.AddConfiguration(integrationConfig); - }); - - builder.ConfigureTestServices(services => - { - ModifyServices(services); - services.AddSingleton(); - services.AutoRegistrateServices( - Assembly.GetAssembly(typeof(ApiRegistration))!, - Assembly.GetAssembly(typeof(WebApiStartupFactory))!); - }); - } - - partial void ModifyConfiguration(IConfigurationBuilder config); - - partial void ModifyServices(IServiceCollection services); -} \ No newline at end of file diff --git a/sample/test/Demo.Api.Tests/appsettings.integrationtest.json b/sample/test/Demo.Api.Tests/appsettings.integrationtest.json deleted file mode 100644 index 8593c62d..00000000 --- a/sample/test/Demo.Api.Tests/appsettings.integrationtest.json +++ /dev/null @@ -1,2 +0,0 @@ -{ -} \ No newline at end of file diff --git a/sample/test/Demo.Domain.Tests/Demo.Domain.Tests.csproj b/sample/test/Demo.Domain.Tests/Demo.Domain.Tests.csproj deleted file mode 100644 index a946d49a..00000000 --- a/sample/test/Demo.Domain.Tests/Demo.Domain.Tests.csproj +++ /dev/null @@ -1,27 +0,0 @@ - - - - net6.0 - - - - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - diff --git a/sample/test/Demo.Domain.Tests/Handlers/Accounts/SetAccountNameHandlerTests.cs b/sample/test/Demo.Domain.Tests/Handlers/Accounts/SetAccountNameHandlerTests.cs deleted file mode 100644 index ec29dfd3..00000000 --- a/sample/test/Demo.Domain.Tests/Handlers/Accounts/SetAccountNameHandlerTests.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Demo.Domain.Tests.Handlers.Accounts; - -public class SetAccountNameHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/sample/test/Demo.Domain.Tests/Handlers/Accounts/UpdateAccountNameHandlerTests.cs b/sample/test/Demo.Domain.Tests/Handlers/Accounts/UpdateAccountNameHandlerTests.cs deleted file mode 100644 index ee1869f5..00000000 --- a/sample/test/Demo.Domain.Tests/Handlers/Accounts/UpdateAccountNameHandlerTests.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Demo.Domain.Tests.Handlers.Accounts; - -public class UpdateAccountNameHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/sample/test/Demo.Domain.Tests/Handlers/Addresses/GetAddressesByPostalCodesHandlerTests.cs b/sample/test/Demo.Domain.Tests/Handlers/Addresses/GetAddressesByPostalCodesHandlerTests.cs deleted file mode 100644 index fdab8237..00000000 --- a/sample/test/Demo.Domain.Tests/Handlers/Addresses/GetAddressesByPostalCodesHandlerTests.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Demo.Domain.Tests.Handlers.Addresses; - -public class GetAddressesByPostalCodesHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/sample/test/Demo.Domain.Tests/Handlers/EventArgs/GetEventArgByIdHandlerTests.cs b/sample/test/Demo.Domain.Tests/Handlers/EventArgs/GetEventArgByIdHandlerTests.cs deleted file mode 100644 index 425f066e..00000000 --- a/sample/test/Demo.Domain.Tests/Handlers/EventArgs/GetEventArgByIdHandlerTests.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Demo.Domain.Tests.Handlers.EventArgs; - -public class GetEventArgByIdHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/sample/test/Demo.Domain.Tests/Handlers/EventArgs/GetEventArgsHandlerTests.cs b/sample/test/Demo.Domain.Tests/Handlers/EventArgs/GetEventArgsHandlerTests.cs deleted file mode 100644 index 0ad122e5..00000000 --- a/sample/test/Demo.Domain.Tests/Handlers/EventArgs/GetEventArgsHandlerTests.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Demo.Domain.Tests.Handlers.EventArgs; - -public class GetEventArgsHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/sample/test/Demo.Domain.Tests/Handlers/Eventargs/GetEventArgByIdHandlerTests.cs b/sample/test/Demo.Domain.Tests/Handlers/Eventargs/GetEventArgByIdHandlerTests.cs deleted file mode 100644 index 425f066e..00000000 --- a/sample/test/Demo.Domain.Tests/Handlers/Eventargs/GetEventArgByIdHandlerTests.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Demo.Domain.Tests.Handlers.EventArgs; - -public class GetEventArgByIdHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/sample/test/Demo.Domain.Tests/Handlers/Eventargs/GetEventArgsHandlerTests.cs b/sample/test/Demo.Domain.Tests/Handlers/Eventargs/GetEventArgsHandlerTests.cs deleted file mode 100644 index 0ad122e5..00000000 --- a/sample/test/Demo.Domain.Tests/Handlers/Eventargs/GetEventArgsHandlerTests.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Demo.Domain.Tests.Handlers.EventArgs; - -public class GetEventArgsHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/sample/test/Demo.Domain.Tests/Handlers/Files/GetFileByIdHandlerTests.cs b/sample/test/Demo.Domain.Tests/Handlers/Files/GetFileByIdHandlerTests.cs deleted file mode 100644 index 902af84b..00000000 --- a/sample/test/Demo.Domain.Tests/Handlers/Files/GetFileByIdHandlerTests.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Demo.Domain.Tests.Handlers.Files; - -public class GetFileByIdHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/sample/test/Demo.Domain.Tests/Handlers/Files/UploadMultiFilesAsFormDataHandlerTests.cs b/sample/test/Demo.Domain.Tests/Handlers/Files/UploadMultiFilesAsFormDataHandlerTests.cs deleted file mode 100644 index 9fc30882..00000000 --- a/sample/test/Demo.Domain.Tests/Handlers/Files/UploadMultiFilesAsFormDataHandlerTests.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Demo.Domain.Tests.Handlers.Files; - -public class UploadMultiFilesAsFormDataHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/sample/test/Demo.Domain.Tests/Handlers/Files/UploadSingleFileAsFormDataHandlerTests.cs b/sample/test/Demo.Domain.Tests/Handlers/Files/UploadSingleFileAsFormDataHandlerTests.cs deleted file mode 100644 index 3b4ef20b..00000000 --- a/sample/test/Demo.Domain.Tests/Handlers/Files/UploadSingleFileAsFormDataHandlerTests.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Demo.Domain.Tests.Handlers.Files; - -public class UploadSingleFileAsFormDataHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/sample/test/Demo.Domain.Tests/Handlers/Files/UploadSingleObjectWithFileAsFormDataHandlerTests.cs b/sample/test/Demo.Domain.Tests/Handlers/Files/UploadSingleObjectWithFileAsFormDataHandlerTests.cs deleted file mode 100644 index e0de98bb..00000000 --- a/sample/test/Demo.Domain.Tests/Handlers/Files/UploadSingleObjectWithFileAsFormDataHandlerTests.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Demo.Domain.Tests.Handlers.Files; - -public class UploadSingleObjectWithFileAsFormDataHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/sample/test/Demo.Domain.Tests/Handlers/Files/UploadSingleObjectWithFilesAsFormDataHandlerTests.cs b/sample/test/Demo.Domain.Tests/Handlers/Files/UploadSingleObjectWithFilesAsFormDataHandlerTests.cs deleted file mode 100644 index 3a93b213..00000000 --- a/sample/test/Demo.Domain.Tests/Handlers/Files/UploadSingleObjectWithFilesAsFormDataHandlerTests.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Demo.Domain.Tests.Handlers.Files; - -public class UploadSingleObjectWithFilesAsFormDataHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/sample/test/Demo.Domain.Tests/Handlers/Items/CreateItemHandlerTests.cs b/sample/test/Demo.Domain.Tests/Handlers/Items/CreateItemHandlerTests.cs deleted file mode 100644 index 484d7695..00000000 --- a/sample/test/Demo.Domain.Tests/Handlers/Items/CreateItemHandlerTests.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Demo.Domain.Tests.Handlers.Items; - -public class CreateItemHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/sample/test/Demo.Domain.Tests/Handlers/Items/UpdateItemHandlerTests.cs b/sample/test/Demo.Domain.Tests/Handlers/Items/UpdateItemHandlerTests.cs deleted file mode 100644 index 355d7ccb..00000000 --- a/sample/test/Demo.Domain.Tests/Handlers/Items/UpdateItemHandlerTests.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Demo.Domain.Tests.Handlers.Items; - -public class UpdateItemHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/sample/test/Demo.Domain.Tests/Handlers/Orders/GetOrderByIdHandlerTests.cs b/sample/test/Demo.Domain.Tests/Handlers/Orders/GetOrderByIdHandlerTests.cs deleted file mode 100644 index 3e539c55..00000000 --- a/sample/test/Demo.Domain.Tests/Handlers/Orders/GetOrderByIdHandlerTests.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Demo.Domain.Tests.Handlers.Orders; - -public class GetOrderByIdHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/sample/test/Demo.Domain.Tests/Handlers/Orders/GetOrdersHandlerTests.cs b/sample/test/Demo.Domain.Tests/Handlers/Orders/GetOrdersHandlerTests.cs deleted file mode 100644 index 2d81d6d3..00000000 --- a/sample/test/Demo.Domain.Tests/Handlers/Orders/GetOrdersHandlerTests.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Demo.Domain.Tests.Handlers.Orders; - -public class GetOrdersHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/sample/test/Demo.Domain.Tests/Handlers/Orders/PatchOrdersIdHandlerTests.cs b/sample/test/Demo.Domain.Tests/Handlers/Orders/PatchOrdersIdHandlerTests.cs deleted file mode 100644 index 8ca6cde8..00000000 --- a/sample/test/Demo.Domain.Tests/Handlers/Orders/PatchOrdersIdHandlerTests.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Demo.Domain.Tests.Handlers.Orders; - -public class PatchOrdersIdHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/sample/test/Demo.Domain.Tests/Handlers/RouteWithDash/GetRouteWithDashHandlerTests.cs b/sample/test/Demo.Domain.Tests/Handlers/RouteWithDash/GetRouteWithDashHandlerTests.cs deleted file mode 100644 index d60072c9..00000000 --- a/sample/test/Demo.Domain.Tests/Handlers/RouteWithDash/GetRouteWithDashHandlerTests.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Demo.Domain.Tests.Handlers.RouteWithDash; - -public class GetRouteWithDashHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/sample/test/Demo.Domain.Tests/Handlers/Tasks/GetTasksHandlerTests.cs b/sample/test/Demo.Domain.Tests/Handlers/Tasks/GetTasksHandlerTests.cs deleted file mode 100644 index 78f2decf..00000000 --- a/sample/test/Demo.Domain.Tests/Handlers/Tasks/GetTasksHandlerTests.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Demo.Domain.Tests.Handlers.Tasks; - -public class GetTasksHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/sample/test/Demo.Domain.Tests/Handlers/Users/DeleteUserByIdHandlerTests.cs b/sample/test/Demo.Domain.Tests/Handlers/Users/DeleteUserByIdHandlerTests.cs deleted file mode 100644 index f9c822de..00000000 --- a/sample/test/Demo.Domain.Tests/Handlers/Users/DeleteUserByIdHandlerTests.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Demo.Domain.Tests.Handlers.Users; - -public class DeleteUserByIdHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/sample/test/Demo.Domain.Tests/Handlers/Users/GetUserByEmailHandlerTests.cs b/sample/test/Demo.Domain.Tests/Handlers/Users/GetUserByEmailHandlerTests.cs deleted file mode 100644 index 4410612b..00000000 --- a/sample/test/Demo.Domain.Tests/Handlers/Users/GetUserByEmailHandlerTests.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Demo.Domain.Tests.Handlers.Users; - -public class GetUserByEmailHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/sample/test/Demo.Domain.Tests/Handlers/Users/GetUserByIdHandlerTests.cs b/sample/test/Demo.Domain.Tests/Handlers/Users/GetUserByIdHandlerTests.cs deleted file mode 100644 index c9163e21..00000000 --- a/sample/test/Demo.Domain.Tests/Handlers/Users/GetUserByIdHandlerTests.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Demo.Domain.Tests.Handlers.Users; - -public class GetUserByIdHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/sample/test/Demo.Domain.Tests/Handlers/Users/GetUsersHandlerTests.cs b/sample/test/Demo.Domain.Tests/Handlers/Users/GetUsersHandlerTests.cs deleted file mode 100644 index 64ce906d..00000000 --- a/sample/test/Demo.Domain.Tests/Handlers/Users/GetUsersHandlerTests.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Demo.Domain.Tests.Handlers.Users; - -public class GetUsersHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/sample/test/Demo.Domain.Tests/Handlers/Users/PostUserHandlerTests.cs b/sample/test/Demo.Domain.Tests/Handlers/Users/PostUserHandlerTests.cs deleted file mode 100644 index df6aa091..00000000 --- a/sample/test/Demo.Domain.Tests/Handlers/Users/PostUserHandlerTests.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Demo.Domain.Tests.Handlers.Users; - -public class PostUserHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/sample/test/Demo.Domain.Tests/Handlers/Users/UpdateMyTestGenderHandlerTests.cs b/sample/test/Demo.Domain.Tests/Handlers/Users/UpdateMyTestGenderHandlerTests.cs deleted file mode 100644 index e0a379bc..00000000 --- a/sample/test/Demo.Domain.Tests/Handlers/Users/UpdateMyTestGenderHandlerTests.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Demo.Domain.Tests.Handlers.Users; - -public class UpdateMyTestGenderHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/sample/test/Demo.Domain.Tests/Handlers/Users/UpdateUserByIdHandlerTests.cs b/sample/test/Demo.Domain.Tests/Handlers/Users/UpdateUserByIdHandlerTests.cs deleted file mode 100644 index 534d47a4..00000000 --- a/sample/test/Demo.Domain.Tests/Handlers/Users/UpdateUserByIdHandlerTests.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Demo.Domain.Tests.Handlers.Users; - -public class UpdateUserByIdHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/sample/test/Directory.Build.props b/sample/test/Directory.Build.props deleted file mode 100644 index afd059a0..00000000 --- a/sample/test/Directory.Build.props +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - annotations - - - - - - - - - - - - - - - - - diff --git a/smoke-test.ps1 b/smoke-test.ps1 index 1556c764..9c2e751b 100644 --- a/smoke-test.ps1 +++ b/smoke-test.ps1 @@ -3,7 +3,7 @@ Invoke-WebRequest -Uri https://petstore3.swagger.io/api/v3/openapi.yaml -OutFile Write-Host "`nGenerate code`n" -ForegroundColor Green Set-Location src/Atc.Rest.ApiGenerator.CLI -dotnet run -- generate server all -p "Swagger Petstore" -s ../../openapi.yaml --outputSlnPath ../../petstore3/ --outputSrcPath ../../petstore3/src --outputTestPath ../../petstore3/test -v true +dotnet run -- generate server all -p "Swagger Petstore" -s ../../openapi.yaml --outputSlnPath ../../petstore3/ --outputSrcPath ../../petstore3/src --outputTestPath ../../petstore3/test --verbose true Set-Location ../../ dotnet build ./petstore3 diff --git a/src/.editorconfig b/src/.editorconfig index 41cd97ef..e0c0f9a9 100644 --- a/src/.editorconfig +++ b/src/.editorconfig @@ -1,8 +1,8 @@ # ATC coding rules - https://github.com/atc-net/atc-coding-rules -# Version: 1.0.9 -# Updated: 01-02-2022 +# Version: 1.0.0 +# Updated: 25-09-2023 # Location: src -# Distribution: DotNet6 +# Distribution: DotNet8 # Inspired by: https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/code-style-rule-options ########################################## @@ -48,6 +48,7 @@ dotnet_diagnostic.CA1305.severity = none # Specify IFormatProvider dotnet_diagnostic.MA0011.severity = none # IFormatProvider is missing +dotnet_diagnostic.MA0048.severity = none # File name must match type name dotnet_diagnostic.MA0051.severity = none # Method is too long dotnet_diagnostic.S3358.severity = none # for now.. \ No newline at end of file diff --git a/src/Atc.CodeGeneration.CSharp/Atc.CodeGeneration.CSharp.csproj b/src/Atc.CodeGeneration.CSharp/Atc.CodeGeneration.CSharp.csproj index 1c6c4931..bb3b58c1 100644 --- a/src/Atc.CodeGeneration.CSharp/Atc.CodeGeneration.CSharp.csproj +++ b/src/Atc.CodeGeneration.CSharp/Atc.CodeGeneration.CSharp.csproj @@ -1,14 +1,14 @@ - net6.0 + net8.0 false - - - + + + \ No newline at end of file diff --git a/src/Atc.CodeGeneration.CSharp/Content/AccessModifiers.cs b/src/Atc.CodeGeneration.CSharp/Content/AccessModifiers.cs index af4f171c..ced56d0e 100644 --- a/src/Atc.CodeGeneration.CSharp/Content/AccessModifiers.cs +++ b/src/Atc.CodeGeneration.CSharp/Content/AccessModifiers.cs @@ -16,6 +16,12 @@ public enum AccessModifiers [Description("public static implicit operator")] PublicStaticImplicitOperator, + [Description("public class")] + PublicClass, + + [Description("public static class")] + PublicStaticClass, + [Description("public record")] PublicRecord, diff --git a/src/Atc.CodeGeneration.CSharp/Content/Factories/AttributeParametersFactory.cs b/src/Atc.CodeGeneration.CSharp/Content/Factories/AttributeParametersFactory.cs deleted file mode 100644 index ed59393c..00000000 --- a/src/Atc.CodeGeneration.CSharp/Content/Factories/AttributeParametersFactory.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace Atc.CodeGeneration.CSharp.Content.Factories; - -public static class AttributeParametersFactory -{ - public static AttributeParameters Create( - string name) - => new(name, Content: null); - - public static AttributeParameters Create( - string name, - string content) - => new(name, content); -} \ No newline at end of file diff --git a/src/Atc.CodeGeneration.CSharp/Content/Factories/AttributesParametersFactory.cs b/src/Atc.CodeGeneration.CSharp/Content/Factories/AttributesParametersFactory.cs index 5f8ac071..785a8147 100644 --- a/src/Atc.CodeGeneration.CSharp/Content/Factories/AttributesParametersFactory.cs +++ b/src/Atc.CodeGeneration.CSharp/Content/Factories/AttributesParametersFactory.cs @@ -41,8 +41,7 @@ public static IList Create( result.Add(new AttributeParameters("Range", $"{rangeAttribute.Minimum}, {rangeAttribute.Maximum}")); break; case RegularExpressionAttribute regularExpressionAttribute: - var escapedPattern = SymbolDisplay.FormatLiteral(regularExpressionAttribute.Pattern, quote: true); - result.Add(new AttributeParameters("RegularExpression", escapedPattern)); + result.Add(new AttributeParameters("RegularExpression", regularExpressionAttribute.GetEscapedPattern())); break; case UriAttribute: result.Add(new AttributeParameters("Uri", Content: null)); diff --git a/src/Atc.CodeGeneration.CSharp/Content/Factories/ClassParametersFactory.cs b/src/Atc.CodeGeneration.CSharp/Content/Factories/ClassParametersFactory.cs index ca507092..ed4ec74b 100644 --- a/src/Atc.CodeGeneration.CSharp/Content/Factories/ClassParametersFactory.cs +++ b/src/Atc.CodeGeneration.CSharp/Content/Factories/ClassParametersFactory.cs @@ -12,7 +12,7 @@ public static ClassParameters Create( Namespace: @namespace, DocumentationTags: null, Attributes: new List { attribute }, - AccessModifiers.Public, + AccessModifiers.PublicClass, ClassTypeName: classTypeName, GenericTypeName: null, InheritedClassTypeName: null, diff --git a/src/Atc.CodeGeneration.CSharp/Content/Factories/InterfaceParametersFactory.cs b/src/Atc.CodeGeneration.CSharp/Content/Factories/InterfaceParametersFactory.cs new file mode 100644 index 00000000..a088294b --- /dev/null +++ b/src/Atc.CodeGeneration.CSharp/Content/Factories/InterfaceParametersFactory.cs @@ -0,0 +1,36 @@ +namespace Atc.CodeGeneration.CSharp.Content.Factories; + +public static class InterfaceParametersFactory +{ + public static InterfaceParameters Create( + string headerContent, + string @namespace, + AttributeParameters attribute, + string interfaceTypeName) + => new( + HeaderContent: headerContent, + Namespace: @namespace, + DocumentationTags: null, + Attributes: new List { attribute }, + AccessModifiers.Public, + InterfaceTypeName: interfaceTypeName, + InheritedInterfaceTypeName: null, + Properties: null, + Methods: null); + + public static InterfaceParameters Create( + string headerContent, + string @namespace, + List attributes, + string interfaceTypeName) + => new( + HeaderContent: headerContent, + Namespace: @namespace, + DocumentationTags: null, + Attributes: attributes, + AccessModifiers.Public, + InterfaceTypeName: interfaceTypeName, + InheritedInterfaceTypeName: null, + Properties: null, + Methods: null); +} \ No newline at end of file diff --git a/src/Atc.CodeGeneration.CSharp/Content/Generators/GenerateContentForClass.cs b/src/Atc.CodeGeneration.CSharp/Content/Generators/GenerateContentForClass.cs index dce256b0..4474a12f 100644 --- a/src/Atc.CodeGeneration.CSharp/Content/Generators/GenerateContentForClass.cs +++ b/src/Atc.CodeGeneration.CSharp/Content/Generators/GenerateContentForClass.cs @@ -27,8 +27,7 @@ public string Generate() parameters.DocumentationTags, parameters.Attributes)); - sb.Append($"{parameters.AccessModifier.GetDescription()} class "); - sb.Append(parameters.ClassTypeName); + sb.Append($"{parameters.AccessModifier.GetDescription()} {parameters.ClassTypeName}"); if (!string.IsNullOrEmpty(parameters.GenericTypeName)) { sb.Append($"<{parameters.GenericTypeName}>"); diff --git a/src/Atc.CodeGeneration.CSharp/Content/Generators/GenerateContentForEnum.cs b/src/Atc.CodeGeneration.CSharp/Content/Generators/GenerateContentForEnum.cs index 7d8708f8..44709351 100644 --- a/src/Atc.CodeGeneration.CSharp/Content/Generators/GenerateContentForEnum.cs +++ b/src/Atc.CodeGeneration.CSharp/Content/Generators/GenerateContentForEnum.cs @@ -19,6 +19,8 @@ public string Generate() { var contentWriter = new GenerateContentWriter(codeDocumentationTagsGenerator); + var useJsonStringEnumConverter = UseJsonStringEnumConverter(parameters.Values); + var sb = new StringBuilder(); sb.Append( contentWriter.GenerateTopOfType( @@ -27,6 +29,11 @@ public string Generate() parameters.DocumentationTags, GetAttributeParametersList())); + if (useJsonStringEnumConverter) + { + sb.AppendLine("[JsonConverter(typeof(JsonStringEnumConverter))]"); + } + sb.Append($"{parameters.AccessModifier.GetDescription()} enum "); sb.AppendLine($"{parameters.EnumTypeName}"); @@ -35,13 +42,30 @@ public string Generate() { if (parametersValue.DescriptionAttribute is not null) { - sb.AppendAttribute(4, parametersValue.DescriptionAttribute); + sb.AppendAttribute(4, usePropertyPrefix: false, parametersValue.DescriptionAttribute); sb.AppendLine(); } var sbLine = new StringBuilder(); - sbLine.Append(parametersValue.Name); + if (useJsonStringEnumConverter) + { + if ("*".Equals(parametersValue.Name, StringComparison.Ordinal)) + { + sbLine.AppendLine("[EnumMember(Value = \"*\")]"); + sbLine.Append(4, "None"); + } + else + { + sbLine.AppendLine($"[EnumMember(Value = \"{parametersValue.Name}\")]"); + sbLine.Append(4, parametersValue.Name.PascalCase(removeSeparators: true)); + } + } + else + { + sbLine.Append(parametersValue.Name); + } + if (parametersValue.Value is not null) { sbLine.Append($" = {parametersValue.Value}"); @@ -49,6 +73,12 @@ public string Generate() sbLine.Append(','); sb.AppendLine(4, sbLine.ToString()); + + if (useJsonStringEnumConverter && + parameters.Values.Last() != parametersValue) + { + sb.AppendLine(); + } } sb.Append('}'); @@ -71,4 +101,9 @@ attributeParameters is not null && return attributeParameters; } + + private static bool UseJsonStringEnumConverter( + IList parametersValues) + => parametersValues.Any(x => x.Name.IsFirstCharacterLowerCase() || + x.Name.Contains('-', StringComparison.Ordinal)); } \ No newline at end of file diff --git a/src/Atc.CodeGeneration.CSharp/Content/Generators/GenerateContentForProjectFile.cs b/src/Atc.CodeGeneration.CSharp/Content/Generators/GenerateContentForProjectFile.cs new file mode 100644 index 00000000..ec1ab094 --- /dev/null +++ b/src/Atc.CodeGeneration.CSharp/Content/Generators/GenerateContentForProjectFile.cs @@ -0,0 +1,104 @@ +namespace Atc.CodeGeneration.CSharp.Content.Generators; + +public class GenerateContentForProjectFile : IContentGenerator +{ + private readonly ProjectFileParameters parameters; + + public GenerateContentForProjectFile( + ProjectFileParameters parameters) + { + this.parameters = parameters; + } + + public string Generate() + { + var sb = new StringBuilder(); + + sb.AppendLine($""); + sb.AppendLine(); + + for (var i = 0; i < parameters.PropertyGroups.Count; i++) + { + if (i > 0) + { + sb.AppendLine(); + } + + var propertyGroups = parameters.PropertyGroups[i]; + + sb.AppendLine(2, ""); + foreach (var propertyGroup in propertyGroups) + { + sb.AppendLine(4, $"<{propertyGroup.Key}>{propertyGroup.Value}"); + } + + sb.AppendLine(2, ""); + } + + if (parameters.PropertyGroups.Count > 0) + { + sb.AppendLine(); + } + + for (var i = 0; i < parameters.ItemGroups.Count; i++) + { + if (i > 0) + { + sb.AppendLine(); + } + + var itemGroups = parameters.ItemGroups[i]; + + sb.AppendLine(2, ""); + foreach (var itemGroup in itemGroups) + { + string? attributes = null; + if (itemGroup.Attributes is not null) + { + attributes = itemGroup + .Attributes + .Select(attr => $"{attr.Key}=\"{attr.Value}\"") + .Aggregate((current, next) => $"{current} {next}"); + } + + if (string.IsNullOrEmpty(itemGroup.Value)) + { + sb.AppendLine( + 4, + attributes is null + ? $"<{itemGroup.Key} />" + : $"<{itemGroup.Key} {attributes} />"); + } + else + { + if (itemGroup.Value.StartsWith('<') && + itemGroup.Value.EndsWith('>')) + { + var xElement = XElement + .Parse($"<{itemGroup.Key} {attributes}>{itemGroup.Value}"); + + var lines = xElement + .ToString(SaveOptions.None) + .ToLines(); + + foreach (var line in lines) + { + sb.AppendLine(4, line); + } + } + else + { + sb.AppendLine(4, $"<{itemGroup.Key} {attributes}>{itemGroup.Value}"); + } + } + } + + sb.AppendLine(2, ""); + } + + sb.AppendLine(); + sb.AppendLine(""); + + return sb.ToString(); + } +} \ No newline at end of file diff --git a/src/Atc.CodeGeneration.CSharp/Content/Generators/GenerateContentForRecords.cs b/src/Atc.CodeGeneration.CSharp/Content/Generators/GenerateContentForRecords.cs index 5a790bdb..4e576f44 100644 --- a/src/Atc.CodeGeneration.CSharp/Content/Generators/GenerateContentForRecords.cs +++ b/src/Atc.CodeGeneration.CSharp/Content/Generators/GenerateContentForRecords.cs @@ -30,7 +30,17 @@ public string Generate() { var recordParameters = parameters.Parameters[i]; - sb.Append($"{recordParameters.AccessModifier.GetDescription()} {recordParameters.Name}"); + if (recordParameters.Parameters is not null && + recordParameters.Parameters.Any(x => x.IsGenericListType && + x.TypeName.Equals("T", StringComparison.Ordinal))) + { + sb.Append($"{recordParameters.AccessModifier.GetDescription()} {recordParameters.Name}"); + } + else + { + sb.Append($"{recordParameters.AccessModifier.GetDescription()} {recordParameters.Name}"); + } + if (recordParameters.Parameters is null || !recordParameters.Parameters.Any()) { @@ -38,16 +48,8 @@ public string Generate() } else { - var indentSpaces = 0; - if (parameters.Parameters.Count == 1) - { - sb.Append('('); - } - else - { - sb.AppendLine("("); - indentSpaces = 4; - } + sb.AppendLine("("); + const int indentSpaces = 4; for (var j = 0; j < recordParameters.Parameters.Count; j++) { @@ -55,22 +57,30 @@ public string Generate() var useCommaForEndChar = j != recordParameters.Parameters.Count - 1; sb.AppendInputParameter( indentSpaces, + usePropertyPrefix: true, item.Attributes, item.GenericTypeName, item.TypeName, + item.IsNullableType, item.Name, item.DefaultValue, useCommaForEndChar); } } - sb.Append(';'); + if (recordParameters.Parameters is not null && + recordParameters.Parameters.Any()) + { + sb.Append(';'); + } - if (i != parameters.Parameters.Count - 1) + if (i == parameters.Parameters.Count - 1) { - sb.AppendLine(); - sb.AppendLine(); + continue; } + + sb.AppendLine(); + sb.AppendLine(); } return sb.ToString(); diff --git a/src/Atc.CodeGeneration.CSharp/Content/Generators/GenerateContentForSolutionDotSettingsFile.cs b/src/Atc.CodeGeneration.CSharp/Content/Generators/GenerateContentForSolutionDotSettingsFile.cs new file mode 100644 index 00000000..342637a8 --- /dev/null +++ b/src/Atc.CodeGeneration.CSharp/Content/Generators/GenerateContentForSolutionDotSettingsFile.cs @@ -0,0 +1,23 @@ +namespace Atc.CodeGeneration.CSharp.Content.Generators; + +public class GenerateContentForSolutionDotSettingsFile : IContentGenerator +{ + [SuppressMessage("X", "S4487: Remove this unread private field 'xxx' or refactor the code to use its value", Justification = "OK - WIP")] + private readonly SolutionDotSettingsFileParameters parameters; + + public GenerateContentForSolutionDotSettingsFile( + SolutionDotSettingsFileParameters parameters) + { + this.parameters = parameters; + } + + public string Generate() + { + var sb = new StringBuilder(); + + sb.AppendLine(""); + + sb.AppendLine(""); + return sb.ToString(); + } +} \ No newline at end of file diff --git a/src/Atc.CodeGeneration.CSharp/Content/Generators/GenerateContentForSolutionFile.cs b/src/Atc.CodeGeneration.CSharp/Content/Generators/GenerateContentForSolutionFile.cs new file mode 100644 index 00000000..10382719 --- /dev/null +++ b/src/Atc.CodeGeneration.CSharp/Content/Generators/GenerateContentForSolutionFile.cs @@ -0,0 +1,55 @@ +namespace Atc.CodeGeneration.CSharp.Content.Generators; + +public class GenerateContentForSolutionFile : IContentGenerator +{ + private readonly SolutionFileParameters parameters; + + public GenerateContentForSolutionFile( + SolutionFileParameters parameters) + { + this.parameters = parameters; + } + + public string Generate() + { + var sb = new StringBuilder(); + + sb.AppendLine(); + sb.AppendLine("Microsoft Visual Studio Solution File, Format Version 12.00"); + sb.AppendLine("# Visual Studio Version 17"); + sb.AppendLine("VisualStudioVersion = 17.0.31903.59"); + sb.AppendLine("MinimumVisualStudioVersion = 15.0.26124.0"); + + foreach (var project in parameters.Projects) + { + sb.AppendLine($"Project(\"{project.ProjectTypeId}\") = \"{project.Name}\", \"{project.RelativePath}\", \"{project.ConfigurationId}\""); + sb.AppendLine("EndProject"); + } + + sb.AppendLine("Global"); + sb.AppendLine(4, "GlobalSection(SolutionConfigurationPlatforms) = preSolution"); + sb.AppendLine(8, "Debug|Any CPU = Debug|Any CPU"); + sb.AppendLine(8, "Release|Any CPU = Release|Any CPU"); + sb.AppendLine(4, "EndGlobalSection"); + sb.AppendLine(4, "GlobalSection(ProjectConfigurationPlatforms) = postSolution"); + + foreach (var configuration in parameters.Configurations) + { + sb.AppendLine(8, $"{{{configuration.ConfigurationId}}}.Debug|Any CPU.ActiveCfg = Debug|Any CPU"); + sb.AppendLine(8, $"{{{configuration.ConfigurationId}}}.Debug|Any CPU.Build.0 = Debug|Any CPU"); + sb.AppendLine(8, $"{{{configuration.ConfigurationId}}}.Release|Any CPU.ActiveCfg = Release|Any CPU"); + sb.AppendLine(8, $"{{{configuration.ConfigurationId}}}.Release|Any CPU.Build.0 = Release|Any CPU"); + } + + sb.AppendLine(4, "EndGlobalSection"); + sb.AppendLine(4, "GlobalSection(SolutionProperties) = preSolution"); + sb.AppendLine(8, "HideSolutionNode = FALSE"); + sb.AppendLine(4, "EndGlobalSection"); + sb.AppendLine(4, "GlobalSection(ExtensibilityGlobals) = postSolution"); + sb.AppendLine(8, $"SolutionGuid = {{{parameters.SolutionId}}}"); + sb.AppendLine(4, "EndGlobalSection"); + sb.AppendLine(4, "EndGlobal"); + + return sb.ToString(); + } +} \ No newline at end of file diff --git a/src/Atc.CodeGeneration.CSharp/Content/Generators/Internal/GenerateContentWriter.cs b/src/Atc.CodeGeneration.CSharp/Content/Generators/Internal/GenerateContentWriter.cs index bcf83cfb..6f1d2108 100644 --- a/src/Atc.CodeGeneration.CSharp/Content/Generators/Internal/GenerateContentWriter.cs +++ b/src/Atc.CodeGeneration.CSharp/Content/Generators/Internal/GenerateContentWriter.cs @@ -38,7 +38,7 @@ public string GenerateTopOfType( { foreach (var attribute in attributes) { - sb.AppendAttribute(attribute); + sb.AppendAttribute(usePropertyPrefix: false, attribute); sb.AppendLine(); } } @@ -68,7 +68,7 @@ public string GenerateConstructor( { if (parameters.Parameters.Count(x => x.PassToInheritedClass) == 1) { - var firstParameterParameters = parameters.Parameters.First(); + var firstParameterParameters = parameters.Parameters[0]; if (firstParameterParameters.CreateAaOneLiner) { sb.Append($"{firstParameterParameters.TypeName} {firstParameterParameters.Name})"); @@ -87,9 +87,11 @@ public string GenerateConstructor( var useCommaForEndChar = i != parameters.Parameters.Count - 1; sb.AppendInputParameter( 8, + usePropertyPrefix: false, attributes: null, item.GenericTypeName, item.TypeName, + item.IsNullableType, item.Name, item.DefaultValue, useCommaForEndChar); @@ -111,7 +113,7 @@ public string GenerateConstructor( if (parameters.Parameters is not null && parameters.Parameters.Count(x => x.PassToInheritedClass) == 1) { - var firstParameterParameters = parameters.Parameters.First(); + var firstParameterParameters = parameters.Parameters[0]; if (firstParameterParameters.CreateAaOneLiner) { sb.Append($" : {parameters.InheritedClassTypeName}({firstParameterParameters.Name}) {{ }}"); @@ -170,7 +172,12 @@ public string GenerateProperty( if (parameters.Attributes is not null) { - sb.AppendAttributesAsLines(4, parameters.Attributes); + sb.AppendAttributesAsLines(4, usePropertyPrefix: false, parameters.Attributes); + } + + if (parameters.JsonName is not null) + { + sb.AppendLine(4, $"[JsonPropertyName(\"{parameters.JsonName}\")]"); } sb.Append(" "); @@ -179,7 +186,7 @@ public string GenerateProperty( sb.AppendAccessModifier(parameters.AccessModifier); } - sb.AppendTypeAndName(parameters.GenericTypeName, parameters.TypeName, parameters.Name); + sb.AppendTypeAndName(parameters.GenericTypeName, parameters.TypeName, parameters.IsNullableType, parameters.Name); if (parameters.UseAutoProperty) { @@ -203,7 +210,16 @@ public string GenerateProperty( } else if (!string.IsNullOrEmpty(parameters.DefaultValue)) { - sb.Append($" = {parameters.DefaultValue};"); + if (!parameters.IsGenericListType && + parameters.TypeName.Equals("string", StringComparison.Ordinal) && + !parameters.DefaultValue.Equals("null", StringComparison.Ordinal)) + { + sb.Append($" = \"{parameters.DefaultValue}\";"); + } + else + { + sb.Append($" = {parameters.DefaultValue};"); + } } } else if (!string.IsNullOrEmpty(parameters.Content)) @@ -240,7 +256,7 @@ public string GenerateMethod( if (parameters.Attributes is not null) { - sb.AppendAttributesAsLines(4, parameters.Attributes); + sb.AppendAttributesAsLines(4, usePropertyPrefix: false, parameters.Attributes); } sb.Append(" "); @@ -255,7 +271,7 @@ public string GenerateMethod( } else { - sb.AppendTypeAndName(parameters.ReturnGenericTypeName, parameters.ReturnTypeName, parameters.Name); + sb.AppendTypeAndName(parameters.ReturnGenericTypeName, parameters.ReturnTypeName, isNullableType: false, parameters.Name); } if (parameters.Parameters is not null && @@ -279,9 +295,11 @@ public string GenerateMethod( var useCommaForEndChar = i != parameters.Parameters.Count - 1; sb.AppendInputParameter( indentSpaces, + usePropertyPrefix: false, item.Attributes, item.GenericTypeName, item.TypeName, + item.IsNullableType, item.Name, item.DefaultValue, useCommaForEndChar); diff --git a/src/Atc.CodeGeneration.CSharp/Content/ParameterRecords.cs b/src/Atc.CodeGeneration.CSharp/Content/ParameterRecords.cs index 39c54ac6..f384eb90 100644 --- a/src/Atc.CodeGeneration.CSharp/Content/ParameterRecords.cs +++ b/src/Atc.CodeGeneration.CSharp/Content/ParameterRecords.cs @@ -1,5 +1,37 @@ namespace Atc.CodeGeneration.CSharp.Content; +public record SolutionConfigurationParameters( + Guid ConfigurationId); + +public record SolutionProjectParameters( + Guid ProjectTypeId, + string Name, + string RelativePath, + Guid ConfigurationId); + +public record SolutionFileParameters( + Guid SolutionId, + IList Configurations, + IList Projects); + +[SuppressMessage("X", "S2094: Remove this empty record, write its code or make it an interface", Justification = "OK - WIP")] +public record SolutionDotSettingsFileParameters(); + +public record PropertyGroupParameter( + string Key, + IList>? Attributes, + string? Value); + +public record ItemGroupParameter( + string Key, + IList>? Attributes, + string? Value); + +public record ProjectFileParameters( + string ProjectSdK, + IList> PropertyGroups, + IList> ItemGroups); + public record BaseParameters( string? HeaderContent, string Namespace, @@ -71,6 +103,7 @@ public record ParameterBaseParameters( string? GenericTypeName, bool IsGenericListType, string TypeName, + bool IsNullableType, bool IsReferenceType, string Name, string? DefaultValue); @@ -78,6 +111,7 @@ public record ParameterBaseParameters( public record ConstructorParameterBaseParameters( string? GenericTypeName, string TypeName, + bool IsNullableType, string Name, string? DefaultValue, bool PassToInheritedClass, @@ -98,7 +132,9 @@ public record PropertyParameters( AccessModifiers AccessModifier, string? GenericTypeName, string TypeName, + bool IsNullableType, string Name, + string? JsonName, string? DefaultValue, bool IsReferenceType, bool IsGenericListType, @@ -112,6 +148,7 @@ public record PropertyParameters( GenericTypeName, IsGenericListType, TypeName, + IsNullableType, IsReferenceType, Name, DefaultValue); diff --git a/src/Atc.CodeGeneration.CSharp/Extensions/RegularExpressionAttributeExtensions.cs b/src/Atc.CodeGeneration.CSharp/Extensions/RegularExpressionAttributeExtensions.cs new file mode 100644 index 00000000..dc4f796d --- /dev/null +++ b/src/Atc.CodeGeneration.CSharp/Extensions/RegularExpressionAttributeExtensions.cs @@ -0,0 +1,25 @@ +namespace Atc.CodeGeneration.CSharp.Extensions; + +public static class RegularExpressionAttributeExtensions +{ + public static string GetEscapedPattern( + this RegularExpressionAttribute regularExpressionAttribute, + bool ensureQuotes = true) + { + ArgumentNullException.ThrowIfNull(regularExpressionAttribute); + + if (!regularExpressionAttribute.Pattern.Contains(@"\\", StringComparison.Ordinal)) + { + return SymbolDisplay.FormatLiteral(regularExpressionAttribute.Pattern, quote: ensureQuotes); + } + + if (ensureQuotes && + !regularExpressionAttribute.Pattern.StartsWith('"') && + !regularExpressionAttribute.Pattern.EndsWith('"')) + { + return $"\"{regularExpressionAttribute.Pattern}\""; + } + + return regularExpressionAttribute.Pattern; + } +} \ No newline at end of file diff --git a/src/Atc.CodeGeneration.CSharp/Extensions/StringBuilderExtensions.cs b/src/Atc.CodeGeneration.CSharp/Extensions/StringBuilderExtensions.cs index 8c6f7af0..8c46f3ba 100644 --- a/src/Atc.CodeGeneration.CSharp/Extensions/StringBuilderExtensions.cs +++ b/src/Atc.CodeGeneration.CSharp/Extensions/StringBuilderExtensions.cs @@ -23,11 +23,13 @@ public static void AppendTypeAndName( this StringBuilder sb, string? genericTypeName, string typeName, + bool isNullableType, string name) => sb.AppendTypeAndName( 0, genericTypeName, typeName, + isNullableType, name, defaultValue: null); @@ -36,11 +38,13 @@ public static void AppendTypeAndName( int indentSpaces, string? genericTypeName, string typeName, + bool isNullableType, string name) => sb.AppendTypeAndName( indentSpaces, genericTypeName, typeName, + isNullableType, name, defaultValue: null); @@ -49,88 +53,182 @@ public static void AppendTypeAndName( int indentSpaces, string? genericTypeName, string typeName, + bool isNullableType, string name, string? defaultValue) { - sb.Append( - indentSpaces, - string.IsNullOrEmpty(genericTypeName) - ? $"{typeName} {name}" - : $"{genericTypeName}<{typeName}> {name}"); + if (isNullableType) + { + sb.Append( + indentSpaces, + string.IsNullOrEmpty(genericTypeName) + ? $"{typeName}? {name}" + : $"{genericTypeName}<{typeName}>? {name}"); + } + else + { + sb.Append( + indentSpaces, + string.IsNullOrEmpty(genericTypeName) + ? $"{typeName} {name}" + : $"{genericTypeName}<{typeName}> {name}"); + } - if (!string.IsNullOrEmpty(defaultValue)) + if (string.IsNullOrEmpty(defaultValue)) { - if (typeName.Equals("string", StringComparison.Ordinal)) - { - sb.Append($" = \"{defaultValue}\""); - } - else - { - sb.Append($" = {defaultValue}"); - } + return; + } + + if (string.IsNullOrEmpty(genericTypeName) && + typeName.Equals("string", StringComparison.Ordinal) && + !defaultValue.Equals("null", StringComparison.Ordinal)) + { + sb.Append($" = \"{defaultValue}\""); + } + else + { + sb.Append($" = {defaultValue}"); } } public static void AppendAttributesAsLines( this StringBuilder sb, int indentSpaces, + bool usePropertyPrefix, IList attributes) { foreach (var item in attributes) { - sb.AppendAttribute(indentSpaces, item); + sb.AppendAttribute(indentSpaces, usePropertyPrefix, item); sb.AppendLine(); } } public static void AppendAttribute( this StringBuilder sb, + bool usePropertyPrefix, AttributeParameters attribute) => sb.AppendAttribute( indentSpaces: 0, + usePropertyPrefix, attribute.Name, attribute.Content); public static void AppendAttribute( this StringBuilder sb, int indentSpaces, + bool usePropertyPrefix, AttributeParameters attribute) => sb.AppendAttribute( indentSpaces, + usePropertyPrefix, attribute.Name, attribute.Content); public static void AppendAttribute( this StringBuilder sb, int indentSpaces, + bool usePropertyPrefix, string name, string? content) { - sb.Append( - indentSpaces, - string.IsNullOrEmpty(content) - ? $"[{name}]" - : $"[{name}({content})]"); + if (usePropertyPrefix) + { + sb.Append( + indentSpaces, + string.IsNullOrEmpty(content) + ? $"[property: {name}]" + : $"[property: {name}({content})]"); + } + else + { + sb.Append( + indentSpaces, + string.IsNullOrEmpty(content) + ? $"[{name}]" + : $"[{name}({content})]"); + } + } + + public static void AppendAttributes( + this StringBuilder sb, + int indentSpaces, + bool usePropertyPrefix, + bool mergeIntoOne, + IList attributes) + { + if (mergeIntoOne) + { + for (var i = 0; i < attributes.Count; i++) + { + if (i == 0) + { + sb.Append( + indentSpaces, + usePropertyPrefix + ? "[property: " + : "["); + } + + var attribute = attributes[i]; + + if (string.IsNullOrEmpty(attribute.Content)) + { + sb.Append(attribute.Name); + } + else + { + sb.Append($"{attribute.Name}({attribute.Content})"); + } + + if (i == attributes.Count - 1) + { + sb.Append(']'); + } + else + { + sb.Append(", "); + } + } + } + else + { + foreach (var attribute in attributes) + { + AppendAttribute(sb, indentSpaces, usePropertyPrefix, attribute); + } + } } public static void AppendInputParameter( this StringBuilder sb, int indentSpaces, + bool usePropertyPrefix, IList? attributes, string? genericTypeName, string typeName, + bool isNullableType, string name, string? defaultValue, bool useCommaForEndChar) { if (attributes is not null && - attributes.Count == 1) + attributes.Count > 0) { - sb.AppendAttribute(indentSpaces, attributes[0]); - indentSpaces = 1; + switch (attributes.Count) + { + case 1: + sb.AppendAttribute(indentSpaces, usePropertyPrefix, attributes[0]); + indentSpaces = 1; + break; + case > 1: + sb.AppendAttributes(indentSpaces, usePropertyPrefix, mergeIntoOne: true, attributes); + indentSpaces = 1; + break; + } } - sb.AppendTypeAndName(indentSpaces, genericTypeName, typeName, name, defaultValue); + sb.AppendTypeAndName(indentSpaces, genericTypeName, typeName, isNullableType, name, defaultValue); if (useCommaForEndChar) { @@ -156,7 +254,13 @@ public static void AppendContent( .EnsureEnvironmentNewLines() .Split(Environment.NewLine); - for (var i = 0; i < lines.Length; i++) + var linesLength = lines.Length; + if (string.IsNullOrEmpty(lines[^1])) + { + linesLength--; + } + + for (var i = 0; i < linesLength; i++) { var line = lines[i]; if (string.IsNullOrEmpty(line)) @@ -165,7 +269,7 @@ public static void AppendContent( } else { - if (i == lines.Length - 1) + if (i == linesLength - 1) { sb.Append(indentSpaces, line); } @@ -192,14 +296,20 @@ public static void AppendContentAsExpressionBody( } else { - for (var i = 0; i < lines.Length; i++) + var linesLength = lines.Length; + if (string.IsNullOrEmpty(lines[^1])) + { + linesLength--; + } + + for (var i = 0; i < linesLength; i++) { var line = lines[i]; if (i == 0) { sb.AppendLine(indentSpaces, $"=> {line}"); } - else if (i == lines.Length - 1) + else if (i == linesLength - 1) { sb.Append(indentSpaces, $"{line};"); } diff --git a/src/Atc.CodeGeneration.CSharp/GlobalUsings.cs b/src/Atc.CodeGeneration.CSharp/GlobalUsings.cs index bb52c5ff..e00e9315 100644 --- a/src/Atc.CodeGeneration.CSharp/GlobalUsings.cs +++ b/src/Atc.CodeGeneration.CSharp/GlobalUsings.cs @@ -3,6 +3,7 @@ global using System.Diagnostics.CodeAnalysis; global using System.Runtime.Serialization; global using System.Text; +global using System.Xml.Linq; global using Atc.CodeDocumentation.CodeComment; global using Atc.CodeGeneration.CSharp.Content; diff --git a/src/Atc.Rest.ApiGenerator.CLI/.editorconfig b/src/Atc.Rest.ApiGenerator.CLI/.editorconfig new file mode 100644 index 00000000..a9ab1446 --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.CLI/.editorconfig @@ -0,0 +1,25 @@ +# ATC coding rules - https://github.com/atc-net/atc-coding-rules +# Version: 1.0.0 +# Updated: 11-04-2024 +# Location: cli +# Distribution: Frameworks + +########################################## +# Code Analyzers Rules +########################################## +[*.{cs}] + +dotnet_diagnostic.CA1031.severity = none # Do not catch general exception types +dotnet_diagnostic.CA1303.severity = none # Do not pass literals as localized parameters +dotnet_diagnostic.CA1819.severity = none # Properties should not return arrays +dotnet_diagnostic.CA1848.severity = none # Use the LoggerMessage delegates +dotnet_diagnostic.CA2000.severity = none # Dispose objects before losing scope +dotnet_diagnostic.CA2254.severity = none # Template should be a static expression + +dotnet_diagnostic.MA0076.severity = none # Do not use implicit culture-sensitive ToString in interpolated strings + +dotnet_diagnostic.S2629.severity = none # Don't use string interpolation in logging message templates. + +########################################## +# Custom - Code Analyzers Rules +########################################## \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.CLI/ApiOptionsHelper.cs b/src/Atc.Rest.ApiGenerator.CLI/ApiOptionsHelper.cs index 33ba06f4..00acfe28 100644 --- a/src/Atc.Rest.ApiGenerator.CLI/ApiOptionsHelper.cs +++ b/src/Atc.Rest.ApiGenerator.CLI/ApiOptionsHelper.cs @@ -1,3 +1,4 @@ +// ReSharper disable InvertIf namespace Atc.Rest.ApiGenerator.CLI; [SuppressMessage("Info Code Smell", "S4457:Split this method into two", Justification = "OK for now.")] @@ -115,5 +116,69 @@ private static void ApplyValidationOverrides( { apiOptions.Validation.ModelPropertyNameCasingStyle = settings.ModelPropertyNameCasingStyle.Value; } + + switch (settings) + { + case ServerAllCommandSettings serverAllCommandSettings: + { + if (serverAllCommandSettings.AspNetOutputType.IsSet) + { + apiOptions.Generator.AspNetOutputType = serverAllCommandSettings.AspNetOutputType.Value; + } + + if (serverAllCommandSettings.SwaggerThemeMode.IsSet) + { + apiOptions.Generator.SwaggerThemeMode = serverAllCommandSettings.SwaggerThemeMode.Value; + } + + if (serverAllCommandSettings.UseProblemDetailsAsDefaultResponseBody) + { + apiOptions.Generator.Response.UseProblemDetailsAsDefaultBody = serverAllCommandSettings.UseProblemDetailsAsDefaultResponseBody; + } + + break; + } + case ServerHostCommandSettings serverHostCommandSettings: + { + if (serverHostCommandSettings.AspNetOutputType.IsSet) + { + apiOptions.Generator.AspNetOutputType = serverHostCommandSettings.AspNetOutputType.Value; + } + + if (serverHostCommandSettings.SwaggerThemeMode.IsSet) + { + apiOptions.Generator.SwaggerThemeMode = serverHostCommandSettings.SwaggerThemeMode.Value; + } + + if (serverHostCommandSettings.UseProblemDetailsAsDefaultResponseBody) + { + apiOptions.Generator.Response.UseProblemDetailsAsDefaultBody = serverHostCommandSettings.UseProblemDetailsAsDefaultResponseBody; + } + + break; + } + case ServerApiCommandSettings serverApiCommandSettings: + { + if (serverApiCommandSettings.UseProblemDetailsAsDefaultResponseBody) + { + apiOptions.Generator.Response.UseProblemDetailsAsDefaultBody = serverApiCommandSettings.UseProblemDetailsAsDefaultResponseBody; + } + + break; + } + case ServerDomainCommandSettings: + { + break; + } + case ClientApiCommandSettings clientApiCommandSettings: + { + if (clientApiCommandSettings.UseProblemDetailsAsDefaultResponseBody) + { + apiOptions.Generator.Response.UseProblemDetailsAsDefaultBody = clientApiCommandSettings.UseProblemDetailsAsDefaultResponseBody; + } + + break; + } + } } } \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.CLI/Atc.Rest.ApiGenerator.CLI.csproj b/src/Atc.Rest.ApiGenerator.CLI/Atc.Rest.ApiGenerator.CLI.csproj index 86c13bc3..161beec4 100644 --- a/src/Atc.Rest.ApiGenerator.CLI/Atc.Rest.ApiGenerator.CLI.csproj +++ b/src/Atc.Rest.ApiGenerator.CLI/Atc.Rest.ApiGenerator.CLI.csproj @@ -1,7 +1,7 @@ - net6.0 + net8.0 atc-rest-api-generator rest;api;netstandard;generator A .NET Core Web API C# code generator using a OpenApi 3.0.x specification YAML file. @@ -13,9 +13,9 @@ - - - + + + diff --git a/src/Atc.Rest.ApiGenerator.CLI/Commands/ArgumentCommandConstants.cs b/src/Atc.Rest.ApiGenerator.CLI/Commands/ArgumentCommandConstants.cs index fc656c56..e4fd46bd 100644 --- a/src/Atc.Rest.ApiGenerator.CLI/Commands/ArgumentCommandConstants.cs +++ b/src/Atc.Rest.ApiGenerator.CLI/Commands/ArgumentCommandConstants.cs @@ -11,6 +11,9 @@ public static class ArgumentCommandConstants public const string LongConfigurationSpecificationPath = "--specificationPath"; public const string LongConfigurationOptionsPath = "--optionsPath"; + public const string LongConfigurationAspNetOutputType = "--aspnet-output-type"; + public const string LongConfigurationSwaggerTheme = "--swagger-theme"; + public const string LongConfigurationValidateStrictMode = "--validate-strictMode"; public const string LongConfigurationValidateOperationIdValidation = "--validate-operationIdValidation"; public const string LongConfigurationValidateOperationIdCasingStyle = "--validate-operationIdCasingStyle"; @@ -27,5 +30,7 @@ public static class ArgumentCommandConstants public const string LongServerOutputApiPath = "--apiPath"; public const string LongServerOutputDomainPath = "--domainPath"; public const string LongServerDisableCodingRules = "--disableCodingRules"; + + public const string LongUseProblemDetailsAsDefaultResponseBody = "--useProblemDetailsAsDefaultResponseBody"; public const string LongRemoveNamespaceGroupSeparatorInGlobalUsings = "--removeNamespaceGroupSeparatorInGlobalUsings"; } \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.CLI/Commands/Attributes/AspNetOutputTypeAttribute.cs b/src/Atc.Rest.ApiGenerator.CLI/Commands/Attributes/AspNetOutputTypeAttribute.cs new file mode 100644 index 00000000..75424b1d --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.CLI/Commands/Attributes/AspNetOutputTypeAttribute.cs @@ -0,0 +1,36 @@ +namespace Atc.Rest.ApiGenerator.CLI.Commands.Attributes; + +/// +/// AspNetOutputType Description Attribute. +/// +[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Enum | AttributeTargets.Interface | AttributeTargets.Delegate)] +public sealed class AspNetOutputTypeAttribute : DescriptionAttribute +{ + /// Gets or sets the default. + /// The default. + public new AspNetOutputType Default { get; set; } = AspNetOutputType.Mvc; + + /// Gets or sets the prefix. + /// The prefix. + public string? Prefix { get; set; } + + /// + /// Gets the description stored in this attribute. + /// + /// The description stored in this attribute. + public override string Description + { + get + { + var values = Enum.GetNames(typeof(AspNetOutputType)) + .Select(enumValue => enumValue.Equals(Default.ToString(), StringComparison.Ordinal) + ? $"{enumValue} (default)" + : enumValue) + .ToList(); + + return string.IsNullOrEmpty(Prefix) + ? $"Valid values are: {string.Join(", ", values)}" + : $"{Prefix}. Valid values are: {string.Join(", ", values)}".Replace("..", ".", StringComparison.Ordinal); + } + } +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.CLI/Commands/Attributes/SwaggerThemeModeAttribute.cs b/src/Atc.Rest.ApiGenerator.CLI/Commands/Attributes/SwaggerThemeModeAttribute.cs new file mode 100644 index 00000000..79820c94 --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.CLI/Commands/Attributes/SwaggerThemeModeAttribute.cs @@ -0,0 +1,36 @@ +namespace Atc.Rest.ApiGenerator.CLI.Commands.Attributes; + +/// +/// SwaggerThemeMode Description Attribute. +/// +[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Enum | AttributeTargets.Interface | AttributeTargets.Delegate)] +public sealed class SwaggerThemeModeAttribute : DescriptionAttribute +{ + /// Gets or sets the default. + /// The default. + public new SwaggerThemeMode Default { get; set; } = SwaggerThemeMode.None; + + /// Gets or sets the prefix. + /// The prefix. + public string? Prefix { get; set; } + + /// + /// Gets the description stored in this attribute. + /// + /// The description stored in this attribute. + public override string Description + { + get + { + var values = Enum.GetNames(typeof(SwaggerThemeMode)) + .Select(enumValue => enumValue.Equals(Default.ToString(), StringComparison.Ordinal) + ? $"{enumValue} (default)" + : enumValue) + .ToList(); + + return string.IsNullOrEmpty(Prefix) + ? $"Valid values are: {string.Join(", ", values)}" + : $"{Prefix}. Valid values are: {string.Join(", ", values)}".Replace("..", ".", StringComparison.Ordinal); + } + } +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.CLI/Commands/GenerateClientCSharpCommand.cs b/src/Atc.Rest.ApiGenerator.CLI/Commands/GenerateClientCSharpCommand.cs index 30225f1e..46f9615b 100644 --- a/src/Atc.Rest.ApiGenerator.CLI/Commands/GenerateClientCSharpCommand.cs +++ b/src/Atc.Rest.ApiGenerator.CLI/Commands/GenerateClientCSharpCommand.cs @@ -2,18 +2,20 @@ namespace Atc.Rest.ApiGenerator.CLI.Commands; public class GenerateClientCSharpCommand : AsyncCommand { + private readonly ILoggerFactory loggerFactory; private readonly ILogger logger; private readonly IApiOperationExtractor apiOperationExtractor; private readonly INugetPackageReferenceProvider nugetPackageReferenceProvider; private readonly IOpenApiDocumentValidator openApiDocumentValidator; public GenerateClientCSharpCommand( - ILogger logger, + ILoggerFactory loggerFactory, IApiOperationExtractor apiOperationExtractor, INugetPackageReferenceProvider nugetPackageReferenceProvider, IOpenApiDocumentValidator openApiDocumentValidator) { - this.logger = logger; + this.loggerFactory = loggerFactory; + logger = loggerFactory.CreateLogger(); this.apiOperationExtractor = apiOperationExtractor; this.nugetPackageReferenceProvider = nugetPackageReferenceProvider; this.openApiDocumentValidator = openApiDocumentValidator; @@ -62,13 +64,14 @@ private async Task ExecuteInternalAsync( { if (!openApiDocumentValidator.IsValid( apiOptions.Validation, + apiOptions.IncludeDeprecated, apiDocumentContainer)) { return ConsoleExitStatusCodes.Failure; } if (!GenerateHelper.GenerateServerCSharpClient( - logger, + loggerFactory, apiOperationExtractor, nugetPackageReferenceProvider, settings.ProjectPrefixName, diff --git a/src/Atc.Rest.ApiGenerator.CLI/Commands/GenerateServerAllCommand.cs b/src/Atc.Rest.ApiGenerator.CLI/Commands/GenerateServerAllCommand.cs index a2111fb1..493bcc9f 100644 --- a/src/Atc.Rest.ApiGenerator.CLI/Commands/GenerateServerAllCommand.cs +++ b/src/Atc.Rest.ApiGenerator.CLI/Commands/GenerateServerAllCommand.cs @@ -2,6 +2,7 @@ namespace Atc.Rest.ApiGenerator.CLI.Commands; public class GenerateServerAllCommand : AsyncCommand { + private readonly ILoggerFactory loggerFactory; private readonly ILogger logger; private readonly IApiOperationExtractor apiOperationExtractor; private readonly INugetPackageReferenceProvider nugetPackageReferenceProvider; @@ -9,13 +10,14 @@ public class GenerateServerAllCommand : AsyncCommand private readonly IOpenApiDocumentValidator openApiDocumentValidator; public GenerateServerAllCommand( - ILogger logger, + ILoggerFactory loggerFactory, IApiOperationExtractor apiOperationExtractor, INugetPackageReferenceProvider nugetPackageReferenceProvider, IAtcCodingRulesUpdater atcCodingRulesUpdater, IOpenApiDocumentValidator openApiDocumentValidator) { - this.logger = logger; + this.loggerFactory = loggerFactory; + logger = loggerFactory.CreateLogger(); this.apiOperationExtractor = apiOperationExtractor; this.nugetPackageReferenceProvider = nugetPackageReferenceProvider; this.atcCodingRulesUpdater = atcCodingRulesUpdater; @@ -62,6 +64,16 @@ private async Task ExecuteInternalAsync( var shouldScaffoldCodingRules = CodingRulesHelper.ShouldScaffoldCodingRules(outputSlnPath, settings.DisableCodingRules); var isUsingCodingRules = CodingRulesHelper.IsUsingCodingRules(outputSlnPath, settings.DisableCodingRules); + if (settings.AspNetOutputType.IsSet) + { + apiOptions.Generator.AspNetOutputType = settings.AspNetOutputType.Value; + } + + if (settings.SwaggerThemeMode.IsSet) + { + apiOptions.Generator.SwaggerThemeMode = settings.SwaggerThemeMode.Value; + } + if (shouldScaffoldCodingRules && !NetworkInformationHelper.HasHttpConnection()) { @@ -73,28 +85,30 @@ private async Task ExecuteInternalAsync( { if (!openApiDocumentValidator.IsValid( apiOptions.Validation, + apiOptions.IncludeDeprecated, apiDocumentContainer)) { return ConsoleExitStatusCodes.Failure; } if (!GenerateHelper.GenerateServerApi( - logger, - apiOperationExtractor, - nugetPackageReferenceProvider, - projectPrefixName, - outputSrcPath, - outputTestPath, - apiDocumentContainer, - apiOptions, - isUsingCodingRules, - settings.RemoveNamespaceGroupSeparatorInGlobalUsings)) + loggerFactory, + apiOperationExtractor, + nugetPackageReferenceProvider, + projectPrefixName, + outputSrcPath, + outputTestPath, + apiDocumentContainer, + apiOptions, + isUsingCodingRules, + settings.RemoveNamespaceGroupSeparatorInGlobalUsings)) { return ConsoleExitStatusCodes.Failure; } if (!GenerateHelper.GenerateServerDomain( - logger, + loggerFactory, + apiOperationExtractor, nugetPackageReferenceProvider, projectPrefixName, outputSrcPath, @@ -109,7 +123,8 @@ private async Task ExecuteInternalAsync( } if (!GenerateHelper.GenerateServerHost( - logger, + loggerFactory, + apiOperationExtractor, nugetPackageReferenceProvider, projectPrefixName, outputSrcPath, @@ -125,11 +140,12 @@ private async Task ExecuteInternalAsync( } if (!GenerateHelper.GenerateServerSln( - logger, + loggerFactory, projectPrefixName, outputSlnPath, outputSrcPath, - outputTestPath)) + outputTestPath, + apiOptions.Generator.AspNetOutputType)) { return ConsoleExitStatusCodes.Failure; } @@ -138,7 +154,7 @@ private async Task ExecuteInternalAsync( !atcCodingRulesUpdater.Scaffold( outputSlnPath, outputSrcPath, - outputTestPath)) + apiOptions.Generator.AspNetOutputType == AspNetOutputType.Mvc ? outputTestPath : null)) { return ConsoleExitStatusCodes.Failure; } diff --git a/src/Atc.Rest.ApiGenerator.CLI/Commands/GenerateServerApiCommand.cs b/src/Atc.Rest.ApiGenerator.CLI/Commands/GenerateServerApiCommand.cs index c5833fdc..68222f4c 100644 --- a/src/Atc.Rest.ApiGenerator.CLI/Commands/GenerateServerApiCommand.cs +++ b/src/Atc.Rest.ApiGenerator.CLI/Commands/GenerateServerApiCommand.cs @@ -2,18 +2,20 @@ namespace Atc.Rest.ApiGenerator.CLI.Commands; public class GenerateServerApiCommand : AsyncCommand { + private readonly ILoggerFactory loggerFactory; private readonly ILogger logger; private readonly IApiOperationExtractor apiOperationExtractor; private readonly INugetPackageReferenceProvider nugetPackageReferenceProvider; private readonly IOpenApiDocumentValidator openApiDocumentValidator; public GenerateServerApiCommand( - ILogger logger, + ILoggerFactory loggerFactory, IApiOperationExtractor apiOperationExtractor, INugetPackageReferenceProvider nugetPackageReferenceProvider, IOpenApiDocumentValidator openApiDocumentValidator) { - this.logger = logger; + this.loggerFactory = loggerFactory; + logger = loggerFactory.CreateLogger(); this.apiOperationExtractor = apiOperationExtractor; this.nugetPackageReferenceProvider = nugetPackageReferenceProvider; this.openApiDocumentValidator = openApiDocumentValidator; @@ -55,6 +57,11 @@ private async Task ExecuteInternalAsync( var shouldScaffoldCodingRules = CodingRulesHelper.ShouldScaffoldCodingRules(settings.OutputPath, settings.DisableCodingRules); var isUsingCodingRules = CodingRulesHelper.IsUsingCodingRules(settings.OutputPath, settings.DisableCodingRules); + if (settings.AspNetOutputType.IsSet) + { + apiOptions.Generator.AspNetOutputType = settings.AspNetOutputType.Value; + } + if (shouldScaffoldCodingRules && !NetworkInformationHelper.HasHttpConnection()) { @@ -66,13 +73,14 @@ private async Task ExecuteInternalAsync( { if (!openApiDocumentValidator.IsValid( apiOptions.Validation, + apiOptions.IncludeDeprecated, apiDocumentContainer)) { return ConsoleExitStatusCodes.Failure; } if (!GenerateHelper.GenerateServerApi( - logger, + loggerFactory, apiOperationExtractor, nugetPackageReferenceProvider, settings.ProjectPrefixName, diff --git a/src/Atc.Rest.ApiGenerator.CLI/Commands/GenerateServerDomainCommand.cs b/src/Atc.Rest.ApiGenerator.CLI/Commands/GenerateServerDomainCommand.cs index 7dbb4b65..a4fdffea 100644 --- a/src/Atc.Rest.ApiGenerator.CLI/Commands/GenerateServerDomainCommand.cs +++ b/src/Atc.Rest.ApiGenerator.CLI/Commands/GenerateServerDomainCommand.cs @@ -2,16 +2,21 @@ namespace Atc.Rest.ApiGenerator.CLI.Commands; public class GenerateServerDomainCommand : AsyncCommand { + private readonly ILoggerFactory loggerFactory; private readonly ILogger logger; + private readonly IApiOperationExtractor apiOperationExtractor; private readonly INugetPackageReferenceProvider nugetPackageReferenceProvider; private readonly IOpenApiDocumentValidator openApiDocumentValidator; public GenerateServerDomainCommand( - ILogger logger, + ILoggerFactory loggerFactory, + IApiOperationExtractor apiOperationExtractor, INugetPackageReferenceProvider nugetPackageReferenceProvider, IOpenApiDocumentValidator openApiDocumentValidator) { - this.logger = logger; + this.loggerFactory = loggerFactory; + logger = loggerFactory.CreateLogger(); + this.apiOperationExtractor = apiOperationExtractor; this.nugetPackageReferenceProvider = nugetPackageReferenceProvider; this.openApiDocumentValidator = openApiDocumentValidator; } @@ -52,6 +57,11 @@ private async Task ExecuteInternalAsync( var shouldScaffoldCodingRules = CodingRulesHelper.ShouldScaffoldCodingRules(settings.OutputPath, settings.DisableCodingRules); var isUsingCodingRules = CodingRulesHelper.IsUsingCodingRules(settings.OutputPath, settings.DisableCodingRules); + if (settings.AspNetOutputType.IsSet) + { + apiOptions.Generator.AspNetOutputType = settings.AspNetOutputType.Value; + } + if (shouldScaffoldCodingRules && !NetworkInformationHelper.HasHttpConnection()) { @@ -63,13 +73,15 @@ private async Task ExecuteInternalAsync( { if (!openApiDocumentValidator.IsValid( apiOptions.Validation, + apiOptions.IncludeDeprecated, apiDocumentContainer)) { return ConsoleExitStatusCodes.Failure; } if (!GenerateHelper.GenerateServerDomain( - logger, + loggerFactory, + apiOperationExtractor, nugetPackageReferenceProvider, settings.ProjectPrefixName, new DirectoryInfo(settings.OutputPath), diff --git a/src/Atc.Rest.ApiGenerator.CLI/Commands/GenerateServerHostCommand.cs b/src/Atc.Rest.ApiGenerator.CLI/Commands/GenerateServerHostCommand.cs index f53315a6..1a49db97 100644 --- a/src/Atc.Rest.ApiGenerator.CLI/Commands/GenerateServerHostCommand.cs +++ b/src/Atc.Rest.ApiGenerator.CLI/Commands/GenerateServerHostCommand.cs @@ -2,16 +2,21 @@ namespace Atc.Rest.ApiGenerator.CLI.Commands; public class GenerateServerHostCommand : AsyncCommand { + private readonly ILoggerFactory loggerFactory; private readonly ILogger logger; + private readonly IApiOperationExtractor apiOperationExtractor; private readonly INugetPackageReferenceProvider nugetPackageReferenceProvider; private readonly IOpenApiDocumentValidator openApiDocumentValidator; public GenerateServerHostCommand( - ILogger logger, + ILoggerFactory loggerFactory, + IApiOperationExtractor apiOperationExtractor, INugetPackageReferenceProvider nugetPackageReferenceProvider, IOpenApiDocumentValidator openApiDocumentValidator) { - this.logger = logger; + this.loggerFactory = loggerFactory; + logger = loggerFactory.CreateLogger(); + this.apiOperationExtractor = apiOperationExtractor; this.nugetPackageReferenceProvider = nugetPackageReferenceProvider; this.openApiDocumentValidator = openApiDocumentValidator; } @@ -52,6 +57,16 @@ private async Task ExecuteInternalAsync( var shouldScaffoldCodingRules = CodingRulesHelper.ShouldScaffoldCodingRules(settings.OutputPath, settings.DisableCodingRules); var isUsingCodingRules = CodingRulesHelper.IsUsingCodingRules(settings.OutputPath, settings.DisableCodingRules); + if (settings.AspNetOutputType.IsSet) + { + apiOptions.Generator.AspNetOutputType = settings.AspNetOutputType.Value; + } + + if (settings.SwaggerThemeMode.IsSet) + { + apiOptions.Generator.SwaggerThemeMode = settings.SwaggerThemeMode.Value; + } + if (shouldScaffoldCodingRules && !NetworkInformationHelper.HasHttpConnection()) { @@ -63,13 +78,15 @@ private async Task ExecuteInternalAsync( { if (!openApiDocumentValidator.IsValid( apiOptions.Validation, + apiOptions.IncludeDeprecated, apiDocumentContainer)) { return ConsoleExitStatusCodes.Failure; } if (!GenerateHelper.GenerateServerHost( - logger, + loggerFactory, + apiOperationExtractor, nugetPackageReferenceProvider, settings.ProjectPrefixName, new DirectoryInfo(settings.OutputPath), diff --git a/src/Atc.Rest.ApiGenerator.CLI/Commands/Settings/BaseGenerateCommandSettings.cs b/src/Atc.Rest.ApiGenerator.CLI/Commands/Settings/BaseGenerateCommandSettings.cs index 106f0c13..c8ec7782 100644 --- a/src/Atc.Rest.ApiGenerator.CLI/Commands/Settings/BaseGenerateCommandSettings.cs +++ b/src/Atc.Rest.ApiGenerator.CLI/Commands/Settings/BaseGenerateCommandSettings.cs @@ -10,6 +10,10 @@ public class BaseGenerateCommandSettings : BaseConfigurationCommandSettings [Description("Disable ATC-Coding-Rules")] public bool DisableCodingRules { get; init; } + [CommandOption($"{ArgumentCommandConstants.LongUseProblemDetailsAsDefaultResponseBody}")] + [Description("Use ProblemDetails as default responsen body")] + public bool UseProblemDetailsAsDefaultResponseBody { get; init; } + [CommandOption($"{ArgumentCommandConstants.LongRemoveNamespaceGroupSeparatorInGlobalUsings}")] [Description("Remove space between namespace groups in GlobalUsing.cs")] public bool RemoveNamespaceGroupSeparatorInGlobalUsings { get; init; } diff --git a/src/Atc.Rest.ApiGenerator.CLI/Commands/Settings/BaseServerCommandSettings.cs b/src/Atc.Rest.ApiGenerator.CLI/Commands/Settings/BaseServerCommandSettings.cs new file mode 100644 index 00000000..19df260e --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.CLI/Commands/Settings/BaseServerCommandSettings.cs @@ -0,0 +1,21 @@ +namespace Atc.Rest.ApiGenerator.CLI.Commands.Settings; + +public class BaseServerCommandSettings : BaseGenerateCommandSettings +{ + [CommandOption($"{ArgumentCommandConstants.LongConfigurationAspNetOutputType} [ASPNETOUTPUTTYPE]")] + [AspNetOutputType(Default = Contracts.AspNetOutputType.Mvc, Prefix = "Set AspNet output type for the generated api")] + public FlagValue AspNetOutputType { get; init; } = new(); + + [CommandOption($"{ArgumentCommandConstants.LongConfigurationSwaggerTheme} [SWAGGERTHEME]")] + [SwaggerThemeMode(Default = Contracts.SwaggerThemeMode.Default, Prefix = "Set Swagger theme for the hosting api")] + public FlagValue SwaggerThemeMode { get; init; } = new(); + + public override ValidationResult Validate() + { + var validationResult = base.Validate(); + + return validationResult.Successful + ? ValidationResult.Success() + : validationResult; + } +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.CLI/Commands/Settings/ServerAllCommandSettings.cs b/src/Atc.Rest.ApiGenerator.CLI/Commands/Settings/ServerAllCommandSettings.cs index c59af8e2..f6802ea4 100644 --- a/src/Atc.Rest.ApiGenerator.CLI/Commands/Settings/ServerAllCommandSettings.cs +++ b/src/Atc.Rest.ApiGenerator.CLI/Commands/Settings/ServerAllCommandSettings.cs @@ -1,6 +1,6 @@ namespace Atc.Rest.ApiGenerator.CLI.Commands.Settings; -public class ServerAllCommandSettings : BaseGenerateCommandSettings +public class ServerAllCommandSettings : BaseServerCommandSettings { [CommandOption($"{ArgumentCommandConstants.LongServerOutputSolutionPath} ")] [Description("Path to solution file (directory or file)")] diff --git a/src/Atc.Rest.ApiGenerator.CLI/Commands/Settings/ServerApiCommandSettings.cs b/src/Atc.Rest.ApiGenerator.CLI/Commands/Settings/ServerApiCommandSettings.cs index 1d99774e..53c53cd7 100644 --- a/src/Atc.Rest.ApiGenerator.CLI/Commands/Settings/ServerApiCommandSettings.cs +++ b/src/Atc.Rest.ApiGenerator.CLI/Commands/Settings/ServerApiCommandSettings.cs @@ -1,6 +1,6 @@ namespace Atc.Rest.ApiGenerator.CLI.Commands.Settings; -public class ServerApiCommandSettings : BaseGenerateCommandSettings +public class ServerApiCommandSettings : BaseServerCommandSettings { [CommandOption($"{ArgumentCommandConstants.ShortOutputPath}|{ArgumentCommandConstants.LongOutputPath} ")] [Description("Path to generated project (directory)")] diff --git a/src/Atc.Rest.ApiGenerator.CLI/Commands/Settings/ServerDomainCommandSettings.cs b/src/Atc.Rest.ApiGenerator.CLI/Commands/Settings/ServerDomainCommandSettings.cs index ca2e2614..9c0efdbf 100644 --- a/src/Atc.Rest.ApiGenerator.CLI/Commands/Settings/ServerDomainCommandSettings.cs +++ b/src/Atc.Rest.ApiGenerator.CLI/Commands/Settings/ServerDomainCommandSettings.cs @@ -1,6 +1,6 @@ namespace Atc.Rest.ApiGenerator.CLI.Commands.Settings; -public class ServerDomainCommandSettings : BaseGenerateCommandSettings +public class ServerDomainCommandSettings : BaseServerCommandSettings { [CommandOption($"{ArgumentCommandConstants.ShortOutputPath}|{ArgumentCommandConstants.LongOutputPath} ")] [Description("Path to generated project (directory)")] diff --git a/src/Atc.Rest.ApiGenerator.CLI/Commands/Settings/ServerHostCommandSettings.cs b/src/Atc.Rest.ApiGenerator.CLI/Commands/Settings/ServerHostCommandSettings.cs index d32aefcf..370c4f5e 100644 --- a/src/Atc.Rest.ApiGenerator.CLI/Commands/Settings/ServerHostCommandSettings.cs +++ b/src/Atc.Rest.ApiGenerator.CLI/Commands/Settings/ServerHostCommandSettings.cs @@ -1,6 +1,6 @@ namespace Atc.Rest.ApiGenerator.CLI.Commands.Settings; -public class ServerHostCommandSettings : BaseGenerateCommandSettings +public class ServerHostCommandSettings : BaseServerCommandSettings { [CommandOption($"{ArgumentCommandConstants.ShortOutputPath}|{ArgumentCommandConstants.LongOutputPath} ")] [Description("Path to generated project (directory)")] diff --git a/src/Atc.Rest.ApiGenerator.CLI/Commands/ValidateSchemaCommand.cs b/src/Atc.Rest.ApiGenerator.CLI/Commands/ValidateSchemaCommand.cs index 6ce58d7f..f487d041 100644 --- a/src/Atc.Rest.ApiGenerator.CLI/Commands/ValidateSchemaCommand.cs +++ b/src/Atc.Rest.ApiGenerator.CLI/Commands/ValidateSchemaCommand.cs @@ -41,6 +41,7 @@ private async Task ExecuteInternalAsync( { if (!openApiDocumentValidator.IsValid( apiOptions.Validation, + apiOptions.IncludeDeprecated, apiDocumentContainer)) { return ConsoleExitStatusCodes.Failure; diff --git a/src/Atc.Rest.ApiGenerator.CLI/Extensions/CommandAppExtensions.cs b/src/Atc.Rest.ApiGenerator.CLI/Extensions/CommandAppExtensions.cs index ea4ad11f..fc29063c 100644 --- a/src/Atc.Rest.ApiGenerator.CLI/Extensions/CommandAppExtensions.cs +++ b/src/Atc.Rest.ApiGenerator.CLI/Extensions/CommandAppExtensions.cs @@ -23,20 +23,20 @@ private static Action> ConfigureOptionsFileComman node .AddCommand(CommandConstants.NameOptionsFileCreate) .WithDescription("Create default options file 'ApiGeneratorOptions.json' if it doesn't exist") - .WithExample(new[] - { + .WithExample( + [ CreateArgumentCommandsOptionsFileWithCreate(), CreateArgumentConfigurationOptionsPath(), - }); + ]); node .AddCommand(CommandConstants.NameOptionsFileValidate) .WithDescription("Validate the options file 'ApiGeneratorOptions.json'") - .WithExample(new[] - { + .WithExample( + [ CreateArgumentCommandsOptionsFileWithValidate(), CreateArgumentConfigurationOptionsPath(), - }); + ]); }; private static Action> ConfigureGenerateCommands() @@ -55,12 +55,11 @@ private static Action> ConfigureValidateCommands( node.AddCommand(NameCommandConstants.ValidateSchema) .WithDescription("Validate OpenApi Specification") - .WithExample(new[] - { + .WithExample([ NameCommandConstants.Validate, NameCommandConstants.ValidateSchema, - CreateArgumentConfigurationSpecificationPath(), - }); + CreateArgumentConfigurationSpecificationPath() + ]); }; private static void ConfigureGenerateClientCommands( @@ -71,13 +70,12 @@ private static void ConfigureGenerateClientCommands( client.AddCommand(NameCommandConstants.GenerateClientCsharp) .WithDescription("Generate client project in C#.") - .WithExample(new[] - { + .WithExample([ NameCommandConstants.Generate, NameCommandConstants.GenerateClient, NameCommandConstants.GenerateClientCsharp, - CreateArgumentConfigurationSpecificationPath(), - }); + CreateArgumentConfigurationSpecificationPath() + ]); }); private static void ConfigureGenerateServerCommands( @@ -88,62 +86,56 @@ private static void ConfigureGenerateServerCommands( client.AddCommand(NameCommandConstants.GenerateServerAll) .WithDescription("Creates API, domain and host projects.") - .WithExample(new[] - { + .WithExample([ NameCommandConstants.Generate, NameCommandConstants.GenerateServer, CreateArgumentConfigurationSpecificationPath(), CreateArgumentProjectPrefixName(), - ".", - }) - .WithExample(new[] - { + "." + ]) + .WithExample([ NameCommandConstants.Generate, NameCommandConstants.GenerateServer, NameCommandConstants.GenerateServerAll, CreateArgumentConfigurationSpecificationPath(), CreateArgumentProjectPrefixName(), - ".", - }) - .WithExample(new[] - { + "." + ]) + .WithExample([ NameCommandConstants.Generate, NameCommandConstants.GenerateServer, NameCommandConstants.GenerateServerAll, CreateArgumentConfigurationSpecificationPath(), CreateArgumentProjectPrefixName(), CreateArgumentConfigurationOutputSolutionPath(), - CreateArgumentConfigurationSourcePath(), - }); + CreateArgumentConfigurationSourcePath() + ]); client.AddCommand(NameCommandConstants.GenerateServerApi) .WithDescription("Create API project.") - .WithExample(new[] - { + .WithExample([ NameCommandConstants.Generate, NameCommandConstants.GenerateServer, NameCommandConstants.GenerateServerApi, CreateArgumentConfigurationSpecificationPath(), CreateArgumentProjectPrefixName(), - CreateArgumentConfigurationOutputPath(), - }); + CreateArgumentConfigurationOutputPath() + ]); client.AddCommand(NameCommandConstants.GenerateServerDomain) .WithDescription("Create domain project (requires API project).") - .WithExample(new[] - { + .WithExample([ NameCommandConstants.Generate, NameCommandConstants.GenerateServer, NameCommandConstants.GenerateServerDomain, CreateArgumentConfigurationSpecificationPath(), CreateArgumentProjectPrefixName(), - CreateArgumentConfigurationOutputPath(), - }); + CreateArgumentConfigurationOutputPath() + ]); client.AddCommand(NameCommandConstants.GenerateServerHost) .WithDescription("Create ASP.NET Core host project (requires API and domain projects).") - .WithExample(new[] - { + .WithExample([ NameCommandConstants.Generate, NameCommandConstants.GenerateServer, NameCommandConstants.GenerateServerHost, @@ -151,8 +143,8 @@ private static void ConfigureGenerateServerCommands( CreateArgumentProjectPrefixName(), CreateArgumentConfigurationOutputPath(), CreateArgumentConfigurationApiPath(), - CreateArgumentConfigurationDomainPath(), - }); + CreateArgumentConfigurationDomainPath() + ]); }); private static string CreateArgumentCommandsOptionsFileWithCreate() @@ -183,5 +175,5 @@ private static string CreateArgumentConfigurationDomainPath() => @$"{ArgumentCommandConstants.LongServerOutputDomainPath} c:\temp\MyProject\src"; private static string CreateArgumentProjectPrefixName() - => $@"{ArgumentCommandConstants.ShortProjectPrefixName} MyApi"; + => $"{ArgumentCommandConstants.ShortProjectPrefixName} MyApi"; } \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.CLI/GlobalUsings.cs b/src/Atc.Rest.ApiGenerator.CLI/GlobalUsings.cs index 998a8062..49caf47d 100644 --- a/src/Atc.Rest.ApiGenerator.CLI/GlobalUsings.cs +++ b/src/Atc.Rest.ApiGenerator.CLI/GlobalUsings.cs @@ -1,4 +1,3 @@ -global using System; global using System.Collections.Concurrent; global using System.ComponentModel; global using System.Diagnostics; @@ -12,17 +11,19 @@ global using Atc.Console.Spectre.Logging; global using Atc.Helpers; global using Atc.Rest.ApiGenerator.CLI.Commands; +global using Atc.Rest.ApiGenerator.CLI.Commands.Attributes; global using Atc.Rest.ApiGenerator.CLI.Commands.Settings; global using Atc.Rest.ApiGenerator.CLI.Extensions; global using Atc.Rest.ApiGenerator.CodingRules; -global using Atc.Rest.ApiGenerator.Framework.Contracts.Options; +global using Atc.Rest.ApiGenerator.Contracts; +global using Atc.Rest.ApiGenerator.Framework.Providers; global using Atc.Rest.ApiGenerator.Framework.Readers; global using Atc.Rest.ApiGenerator.Helpers; global using Atc.Rest.ApiGenerator.Nuget.Clients; global using Atc.Rest.ApiGenerator.OpenApi.Extractors; global using Atc.Rest.ApiGenerator.OpenApi.Factories; global using Atc.Rest.ApiGenerator.OpenApi.Validators; -global using Atc.Rest.ApiGenerator.Projects; +global using Atc.Rest.ApiGenerator.Options; global using Microsoft.Extensions.Configuration; global using Microsoft.Extensions.DependencyInjection; diff --git a/src/Atc.Rest.ApiGenerator.CLI/Program.cs b/src/Atc.Rest.ApiGenerator.CLI/Program.cs index 9abef338..780176c6 100644 --- a/src/Atc.Rest.ApiGenerator.CLI/Program.cs +++ b/src/Atc.Rest.ApiGenerator.CLI/Program.cs @@ -100,10 +100,9 @@ private static string[] SetOutputPathFromDotArgumentIfNeeded( newArgs.Add(ArgumentCommandConstants.LongConfigurationValidateStrictMode); } - if (!newArgs.Contains(CommandConstants.ArgumentShortVerbose, StringComparer.OrdinalIgnoreCase) || - !newArgs.Contains(CommandConstants.ArgumentLongVerbose, StringComparer.OrdinalIgnoreCase)) + if (!newArgs.Contains(CommandConstants.ArgumentLongVerbose, StringComparer.OrdinalIgnoreCase)) { - newArgs.Add(CommandConstants.ArgumentShortVerbose); + newArgs.Add(CommandConstants.ArgumentLongVerbose); } return newArgs.ToArray(); diff --git a/src/Atc.Rest.ApiGenerator.Client.CSharp/Atc.Rest.ApiGenerator.Client.CSharp.csproj b/src/Atc.Rest.ApiGenerator.Client.CSharp/Atc.Rest.ApiGenerator.Client.CSharp.csproj new file mode 100644 index 00000000..83c852b2 --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Client.CSharp/Atc.Rest.ApiGenerator.Client.CSharp.csproj @@ -0,0 +1,19 @@ + + + + net8.0 + false + + + + + + + + + + + + + + diff --git a/src/Atc.Rest.ApiGenerator.Client.CSharp/ContentGenerators/ContentGeneratorClientEndpoint.cs b/src/Atc.Rest.ApiGenerator.Client.CSharp/ContentGenerators/ContentGeneratorClientEndpoint.cs new file mode 100644 index 00000000..e5e484ca --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Client.CSharp/ContentGenerators/ContentGeneratorClientEndpoint.cs @@ -0,0 +1,253 @@ +// ReSharper disable SwitchExpressionHandlesSomeKnownEnumValuesWithExceptionInDefault +// ReSharper disable ConvertIfStatementToSwitchStatement +// ReSharper disable ConvertIfStatementToConditionalTernaryExpression +namespace Atc.Rest.ApiGenerator.Client.CSharp.ContentGenerators; + +public class ContentGeneratorClientEndpoint : IContentGenerator +{ + private readonly GeneratedCodeHeaderGenerator codeHeaderGenerator; + private readonly GeneratedCodeAttributeGenerator codeAttributeGenerator; + private readonly CodeDocumentationTagsGenerator codeDocumentationTagsGenerator; + private readonly ContentGeneratorClientEndpointParameters parameters; + private readonly bool useProblemDetailsAsDefaultResponseBody; + + public ContentGeneratorClientEndpoint( + GeneratedCodeHeaderGenerator codeHeaderGenerator, + GeneratedCodeAttributeGenerator codeAttributeGenerator, + CodeDocumentationTagsGenerator codeDocumentationTagsGenerator, + ContentGeneratorClientEndpointParameters parameters, + bool useProblemDetailsAsDefaultResponseBody) + { + this.codeHeaderGenerator = codeHeaderGenerator; + this.codeAttributeGenerator = codeAttributeGenerator; + this.codeDocumentationTagsGenerator = codeDocumentationTagsGenerator; + this.parameters = parameters; + this.useProblemDetailsAsDefaultResponseBody = useProblemDetailsAsDefaultResponseBody; + } + + public string Generate() + { + var sb = new StringBuilder(); + + sb.Append(codeHeaderGenerator.Generate()); + sb.AppendLine($"namespace {parameters.Namespace};"); + sb.AppendLine(); + if (codeDocumentationTagsGenerator.ShouldGenerateTags(parameters.DocumentationTags)) + { + sb.Append(codeDocumentationTagsGenerator.GenerateTags(0, parameters.DocumentationTags)); + } + + sb.AppendLine(codeAttributeGenerator.Generate()); + sb.AppendLine($"public class {parameters.EndpointName} : {parameters.InterfaceName}"); + sb.AppendLine("{"); + sb.AppendLine(4, "private readonly IHttpClientFactory factory;"); + sb.AppendLine(4, "private readonly IHttpMessageFactory httpMessageFactory;"); + sb.AppendLine(); + sb.AppendLine(4, $"public {parameters.EndpointName}("); + sb.AppendLine(8, "IHttpClientFactory factory,"); + sb.AppendLine(8, "IHttpMessageFactory httpMessageFactory)"); + sb.AppendLine(4, "{"); + sb.AppendLine(8, "this.factory = factory;"); + sb.AppendLine(8, "this.httpMessageFactory = httpMessageFactory;"); + sb.AppendLine(4, "}"); + sb.AppendLine(); + sb.AppendLine(4, $"public async Task<{parameters.ResultName}> ExecuteAsync("); + if (parameters.ParameterName is not null) + { + sb.AppendLine(8, $"{parameters.ParameterName} parameters,"); + } + + sb.AppendLine(8, $"string httpClientName = \"{parameters.HttpClientName}\","); + sb.AppendLine(8, "CancellationToken cancellationToken = default)"); + sb.AppendLine(4, "{"); + sb.AppendLine(8, "var client = factory.CreateClient(httpClientName);"); + sb.AppendLine(); + sb.AppendLine(8, $"var requestBuilder = httpMessageFactory.FromTemplate(\"{parameters.UrlPath}\");"); + + if (parameters.Parameters is not null && parameters.Parameters.Any()) + { + for (var index = 0; index < parameters.Parameters.Count; index++) + { + var item = parameters.Parameters[index]; + var isLastParameter = index == parameters.Parameters.Count - 1; + + switch (item.ParameterLocationType) + { + case ParameterLocationType.Query: + AppendParameterForParameterLocation(sb, item, item.ParameterLocationType, isLastParameter); + break; + case ParameterLocationType.Header: + AppendParameterForParameterLocation(sb, item, item.ParameterLocationType, isLastParameter); + break; + case ParameterLocationType.Route: + sb.AppendLine(8, $"requestBuilder.WithPathParameter(\"{item.Name}\", parameters.{item.ParameterName});"); + break; + case ParameterLocationType.Body: + sb.AppendLine(8, "requestBuilder.WithBody(parameters.Request);"); + break; + case ParameterLocationType.Form: + sb.AppendLine(8, "// TODO: Imp. With-Form"); + break; + default: + throw new SwitchCaseDefaultException(item.ParameterLocationType); + } + } + } + + sb.AppendLine(); + sb.AppendLine(8, $"using var requestMessage = requestBuilder.Build(HttpMethod.{parameters.HttpMethod});"); + sb.AppendLine(8, "using var response = await client.SendAsync(requestMessage, cancellationToken);"); + sb.AppendLine(); + sb.AppendLine(8, "var responseBuilder = httpMessageFactory.FromResponse(response);"); + + var responseModels = parameters.ResponseModels + .AppendUnauthorizedIfNeeded(parameters.Authorization) + .AppendForbiddenIfNeeded(parameters.Authorization) + .AppendBadRequestIfNeeded(parameters.ParameterName) + .OrderBy(x => x.StatusCode) + .ToList(); + + foreach (var responseModel in responseModels) + { + switch (responseModel.StatusCode) + { + case HttpStatusCode.OK: + AppendAddSuccessResponseForStatusCodeOk(sb, responseModel); + break; + case HttpStatusCode.BadRequest: + sb.AppendLine(8, $"responseBuilder.AddErrorResponse(HttpStatusCode.{responseModel.StatusCode.ToNormalizedString()});"); + break; + case HttpStatusCode.Continue: + case HttpStatusCode.SwitchingProtocols: + case HttpStatusCode.Processing: + case HttpStatusCode.EarlyHints: + case HttpStatusCode.Created: + case HttpStatusCode.Accepted: + case HttpStatusCode.NonAuthoritativeInformation: + case HttpStatusCode.NoContent: + case HttpStatusCode.ResetContent: + case HttpStatusCode.PartialContent: + case HttpStatusCode.MultiStatus: + case HttpStatusCode.AlreadyReported: + case HttpStatusCode.IMUsed: + case HttpStatusCode.Ambiguous: + case HttpStatusCode.Moved: + case HttpStatusCode.Found: + case HttpStatusCode.RedirectMethod: + case HttpStatusCode.NotModified: + case HttpStatusCode.UseProxy: + case HttpStatusCode.Unused: + case HttpStatusCode.RedirectKeepVerb: + case HttpStatusCode.PermanentRedirect: + case HttpStatusCode.Unauthorized: + case HttpStatusCode.PaymentRequired: + case HttpStatusCode.Forbidden: + case HttpStatusCode.NotFound: + case HttpStatusCode.MethodNotAllowed: + case HttpStatusCode.NotAcceptable: + case HttpStatusCode.ProxyAuthenticationRequired: + case HttpStatusCode.RequestTimeout: + case HttpStatusCode.Conflict: + case HttpStatusCode.Gone: + case HttpStatusCode.LengthRequired: + case HttpStatusCode.PreconditionFailed: + case HttpStatusCode.RequestEntityTooLarge: + case HttpStatusCode.RequestUriTooLong: + case HttpStatusCode.UnsupportedMediaType: + case HttpStatusCode.RequestedRangeNotSatisfiable: + case HttpStatusCode.ExpectationFailed: + case HttpStatusCode.MisdirectedRequest: + case HttpStatusCode.UnprocessableEntity: + case HttpStatusCode.Locked: + case HttpStatusCode.FailedDependency: + case HttpStatusCode.UpgradeRequired: + case HttpStatusCode.PreconditionRequired: + case HttpStatusCode.TooManyRequests: + case HttpStatusCode.RequestHeaderFieldsTooLarge: + case HttpStatusCode.UnavailableForLegalReasons: + case HttpStatusCode.InternalServerError: + case HttpStatusCode.NotImplemented: + case HttpStatusCode.BadGateway: + case HttpStatusCode.ServiceUnavailable: + case HttpStatusCode.GatewayTimeout: + case HttpStatusCode.HttpVersionNotSupported: + case HttpStatusCode.VariantAlsoNegotiates: + case HttpStatusCode.InsufficientStorage: + case HttpStatusCode.LoopDetected: + case HttpStatusCode.NotExtended: + case HttpStatusCode.NetworkAuthenticationRequired: + sb.AppendLine( + 8, + useProblemDetailsAsDefaultResponseBody + ? $"responseBuilder.AddErrorResponse(HttpStatusCode.{responseModel.StatusCode});" + : $"responseBuilder.AddErrorResponse(HttpStatusCode.{responseModel.StatusCode});"); + break; + default: + sb.AppendLine(4, $"// TODO: Not Implemented for {responseModel.StatusCode}."); + break; + } + } + + sb.AppendLine(8, $"return await responseBuilder.BuildResponseAsync(x => new {parameters.ResultName}(x), cancellationToken);"); + sb.AppendLine(4, "}"); + sb.Append('}'); + + return sb.ToString(); + } + + private void AppendAddSuccessResponseForStatusCodeOk( + StringBuilder sb, + ApiOperationResponseModel responseModel) + { + if (responseModel.MediaType == MediaTypeNames.Application.Octet) + { + sb.AppendLine(8, "responseBuilder.AddSuccessResponse(HttpStatusCode.OK);"); + return; + } + + if (string.IsNullOrEmpty(responseModel.DataType)) + { + sb.AppendLine(8, "responseBuilder.AddSuccessResponse(HttpStatusCode.OK);"); + return; + } + + if (responseModel.CollectionDataType is null) + { + sb.AppendLine(8, $"responseBuilder.AddSuccessResponse<{responseModel.DataType}>(HttpStatusCode.OK);"); + return; + } + + if (responseModel.CollectionDataType == NameConstants.List) + { + sb.AppendLine(8, $"responseBuilder.AddSuccessResponse>(HttpStatusCode.OK);"); + } + else + { + sb.AppendLine(8, $"responseBuilder.AddSuccessResponse<{responseModel.CollectionDataType}<{responseModel.DataType}>>(HttpStatusCode.OK);"); + } + } + + private static void AppendParameterForParameterLocation( + StringBuilder sb, + ContentGeneratorClientEndpointParametersParameters item, + ParameterLocationType parameterLocationType, + bool isLastParameter) + { + if (item.IsList) + { + sb.AppendLine(8, $"if (parameters.{item.ParameterName}.Any())"); + sb.AppendLine(8, "{"); + sb.AppendLine(12, $"requestBuilder.With{parameterLocationType}Parameter(\"{item.Name}\", parameters.{item.ParameterName});"); + sb.AppendLine(8, "}"); + + if (!isLastParameter) + { + sb.AppendLine(); + } + } + else + { + sb.AppendLine(8, $"requestBuilder.With{parameterLocationType}Parameter(\"{item.Name}\", parameters.{item.ParameterName});"); + } + } +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Client.CSharp/ContentGenerators/ContentGeneratorClientEndpointResult.cs b/src/Atc.Rest.ApiGenerator.Client.CSharp/ContentGenerators/ContentGeneratorClientEndpointResult.cs new file mode 100644 index 00000000..7b0674c7 --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Client.CSharp/ContentGenerators/ContentGeneratorClientEndpointResult.cs @@ -0,0 +1,390 @@ +// ReSharper disable SwitchExpressionHandlesSomeKnownEnumValuesWithExceptionInDefault +namespace Atc.Rest.ApiGenerator.Client.CSharp.ContentGenerators; + +public class ContentGeneratorClientEndpointResult : IContentGenerator +{ + private readonly GeneratedCodeHeaderGenerator codeHeaderGenerator; + private readonly GeneratedCodeAttributeGenerator codeAttributeGenerator; + private readonly CodeDocumentationTagsGenerator codeDocumentationTagsGenerator; + private readonly ContentGeneratorClientEndpointResultParameters parameters; + private readonly bool useProblemDetailsAsDefaultResponseBody; + + public ContentGeneratorClientEndpointResult( + GeneratedCodeHeaderGenerator codeHeaderGenerator, + GeneratedCodeAttributeGenerator codeAttributeGenerator, + CodeDocumentationTagsGenerator codeDocumentationTagsGenerator, + ContentGeneratorClientEndpointResultParameters parameters, + bool useProblemDetailsAsDefaultResponseBody) + { + this.codeHeaderGenerator = codeHeaderGenerator; + this.codeAttributeGenerator = codeAttributeGenerator; + this.codeDocumentationTagsGenerator = codeDocumentationTagsGenerator; + this.parameters = parameters; + this.useProblemDetailsAsDefaultResponseBody = useProblemDetailsAsDefaultResponseBody; + } + + public string Generate() + { + var sb = new StringBuilder(); + + sb.Append(codeHeaderGenerator.Generate()); + sb.AppendLine($"namespace {parameters.Namespace};"); + sb.AppendLine(); + if (codeDocumentationTagsGenerator.ShouldGenerateTags(parameters.DocumentationTags)) + { + sb.Append(codeDocumentationTagsGenerator.GenerateTags(0, parameters.DocumentationTags)); + } + + sb.AppendLine(codeAttributeGenerator.Generate()); + sb.AppendLine($"public class {parameters.EndpointResultName} : {parameters.InheritClassName}, {parameters.EndpointResultInterfaceName}"); + sb.AppendLine("{"); + sb.AppendLine(4, $"public {parameters.EndpointResultName}(EndpointResponse response)"); + sb.AppendLine(8, ": base(response)"); + sb.AppendLine(4, "{"); + sb.AppendLine(4, "}"); + AppendContent(sb); + sb.Append('}'); + + return sb.ToString(); + } + + private void AppendContent( + StringBuilder sb) + { + AppendContentIsStatus(sb); + + if (useProblemDetailsAsDefaultResponseBody) + { + AppendContentWithProblemDetails(sb); + } + else + { + AppendContentWithoutProblemDetails(sb); + } + } + + private void AppendContentIsStatus( + StringBuilder sb) + { + var responseModels = parameters.ResponseModels + .AppendUnauthorizedIfNeeded(parameters.Authorization) + .AppendForbiddenIfNeeded(parameters.Authorization) + .AppendBadRequestIfNeeded(parameters.HasParameterType) + .OrderBy(x => x.StatusCode) + .ToList(); + + foreach (var responseModel in responseModels) + { + switch (responseModel.StatusCode) + { + case HttpStatusCode.Continue: + case HttpStatusCode.SwitchingProtocols: + case HttpStatusCode.Processing: + case HttpStatusCode.EarlyHints: + case HttpStatusCode.OK: + case HttpStatusCode.Created: + case HttpStatusCode.Accepted: + case HttpStatusCode.NonAuthoritativeInformation: + case HttpStatusCode.NoContent: + case HttpStatusCode.ResetContent: + case HttpStatusCode.PartialContent: + case HttpStatusCode.MultiStatus: + case HttpStatusCode.AlreadyReported: + case HttpStatusCode.IMUsed: + case HttpStatusCode.Ambiguous: + case HttpStatusCode.Moved: + case HttpStatusCode.Found: + case HttpStatusCode.RedirectMethod: + case HttpStatusCode.NotModified: + case HttpStatusCode.UseProxy: + case HttpStatusCode.Unused: + case HttpStatusCode.RedirectKeepVerb: + case HttpStatusCode.PermanentRedirect: + case HttpStatusCode.BadRequest: + case HttpStatusCode.Unauthorized: + case HttpStatusCode.PaymentRequired: + case HttpStatusCode.Forbidden: + case HttpStatusCode.NotFound: + case HttpStatusCode.MethodNotAllowed: + case HttpStatusCode.NotAcceptable: + case HttpStatusCode.ProxyAuthenticationRequired: + case HttpStatusCode.RequestTimeout: + case HttpStatusCode.Conflict: + case HttpStatusCode.Gone: + case HttpStatusCode.LengthRequired: + case HttpStatusCode.PreconditionFailed: + case HttpStatusCode.RequestEntityTooLarge: + case HttpStatusCode.RequestUriTooLong: + case HttpStatusCode.UnsupportedMediaType: + case HttpStatusCode.RequestedRangeNotSatisfiable: + case HttpStatusCode.ExpectationFailed: + case HttpStatusCode.MisdirectedRequest: + case HttpStatusCode.UnprocessableEntity: + case HttpStatusCode.Locked: + case HttpStatusCode.FailedDependency: + case HttpStatusCode.UpgradeRequired: + case HttpStatusCode.PreconditionRequired: + case HttpStatusCode.TooManyRequests: + case HttpStatusCode.RequestHeaderFieldsTooLarge: + case HttpStatusCode.UnavailableForLegalReasons: + case HttpStatusCode.InternalServerError: + case HttpStatusCode.NotImplemented: + case HttpStatusCode.BadGateway: + case HttpStatusCode.ServiceUnavailable: + case HttpStatusCode.GatewayTimeout: + case HttpStatusCode.HttpVersionNotSupported: + case HttpStatusCode.VariantAlsoNegotiates: + case HttpStatusCode.InsufficientStorage: + case HttpStatusCode.LoopDetected: + case HttpStatusCode.NotExtended: + case HttpStatusCode.NetworkAuthenticationRequired: + sb.AppendLine(); + sb.AppendLine(4, $"public bool Is{responseModel.StatusCode.ToNormalizedString()}"); + sb.AppendLine(8, $"=> StatusCode == HttpStatusCode.{responseModel.StatusCode};"); + break; + default: + sb.AppendLine(4, $"// TODO: Not Implemented for {responseModel.StatusCode}."); + break; + } + } + } + + private void AppendMethodContentStatusCodeOk( + StringBuilder sb, + ApiOperationResponseModel responseModel) + { + if (responseModel.MediaType == MediaTypeNames.Application.Octet) + { + sb.AppendLine(4, "public byte[] OkContent"); + sb.AppendLine(8, "=> IsOk && ContentObject is byte[] result"); + sb.AppendLine(12, "? result"); + sb.AppendLine(12, ": throw new InvalidOperationException(\"Content is not the expected type - please use the IsOk property first.\");"); + return; + } + + if (string.IsNullOrEmpty(responseModel.DataType)) + { + sb.AppendLine(4, "public string? OkContent"); + sb.AppendLine(8, "=> IsOk && ContentObject is string result"); + sb.AppendLine(12, "? result"); + sb.AppendLine(12, ": throw new InvalidOperationException(\"Content is not the expected type - please use the IsOk property first.\");"); + return; + } + + if (responseModel.CollectionDataType is null) + { + sb.AppendLine(4, $"public {responseModel.DataType} OkContent"); + sb.AppendLine(8, $"=> IsOk && ContentObject is {responseModel.DataType} result"); + sb.AppendLine(12, "? result"); + sb.AppendLine(12, ": throw new InvalidOperationException(\"Content is not the expected type - please use the IsOk property first.\");"); + return; + } + + if (responseModel.CollectionDataType == NameConstants.List) + { + sb.AppendLine(4, $"public IEnumerable<{responseModel.DataType}> OkContent"); + sb.AppendLine(8, $"=> IsOk && ContentObject is IEnumerable<{responseModel.DataType}> result"); + sb.AppendLine(12, "? result"); + sb.AppendLine(12, ": throw new InvalidOperationException(\"Content is not the expected type - please use the IsOk property first.\");"); + } + else + { + sb.AppendLine(4, $"public {responseModel.CollectionDataType}<{responseModel.DataType}> OkContent"); + sb.AppendLine(8, $"=> IsOk && ContentObject is {responseModel.CollectionDataType}<{responseModel.DataType}> result"); + sb.AppendLine(12, "? result"); + sb.AppendLine(12, ": throw new InvalidOperationException(\"Content is not the expected type - please use the IsOk property first.\");"); + } + } + + private void AppendContentWithProblemDetails( + StringBuilder sb) + { + var responseModels = parameters.ResponseModels + .AppendUnauthorizedIfNeeded(parameters.Authorization) + .AppendForbiddenIfNeeded(parameters.Authorization) + .AppendBadRequestIfNeeded(parameters.HasParameterType) + .OrderBy(x => x.StatusCode) + .ToList(); + + foreach (var responseModel in responseModels) + { + switch (responseModel.StatusCode) + { + case HttpStatusCode.OK: + sb.AppendLine(); + AppendMethodContentStatusCodeOk(sb, responseModel); + break; + case HttpStatusCode.BadRequest: + sb.AppendLine(); + sb.AppendLine(4, $"public ValidationProblemDetails {responseModel.StatusCode.ToNormalizedString()}Content"); + sb.AppendLine(8, $"=> Is{responseModel.StatusCode.ToNormalizedString()} && ContentObject is ValidationProblemDetails result"); + sb.AppendLine(12, "? result"); + sb.AppendLine(12, $": throw new InvalidOperationException(\"Content is not the expected type - please use the Is{responseModel.StatusCode.ToNormalizedString()} property first.\");"); + break; + case HttpStatusCode.EarlyHints: + // Skip. + break; + case HttpStatusCode.Continue: + case HttpStatusCode.SwitchingProtocols: + case HttpStatusCode.Processing: + case HttpStatusCode.Created: + case HttpStatusCode.Accepted: + case HttpStatusCode.NonAuthoritativeInformation: + case HttpStatusCode.NoContent: + case HttpStatusCode.ResetContent: + case HttpStatusCode.PartialContent: + case HttpStatusCode.MultiStatus: + case HttpStatusCode.AlreadyReported: + case HttpStatusCode.IMUsed: + case HttpStatusCode.Ambiguous: + case HttpStatusCode.Moved: + case HttpStatusCode.Found: + case HttpStatusCode.RedirectMethod: + case HttpStatusCode.NotModified: + case HttpStatusCode.UseProxy: + case HttpStatusCode.Unused: + case HttpStatusCode.RedirectKeepVerb: + case HttpStatusCode.PermanentRedirect: + case HttpStatusCode.Unauthorized: + case HttpStatusCode.PaymentRequired: + case HttpStatusCode.Forbidden: + case HttpStatusCode.NotFound: + case HttpStatusCode.MethodNotAllowed: + case HttpStatusCode.NotAcceptable: + case HttpStatusCode.ProxyAuthenticationRequired: + case HttpStatusCode.RequestTimeout: + case HttpStatusCode.Conflict: + case HttpStatusCode.Gone: + case HttpStatusCode.LengthRequired: + case HttpStatusCode.PreconditionFailed: + case HttpStatusCode.RequestEntityTooLarge: + case HttpStatusCode.RequestUriTooLong: + case HttpStatusCode.UnsupportedMediaType: + case HttpStatusCode.RequestedRangeNotSatisfiable: + case HttpStatusCode.ExpectationFailed: + case HttpStatusCode.MisdirectedRequest: + case HttpStatusCode.UnprocessableEntity: + case HttpStatusCode.Locked: + case HttpStatusCode.FailedDependency: + case HttpStatusCode.UpgradeRequired: + case HttpStatusCode.PreconditionRequired: + case HttpStatusCode.TooManyRequests: + case HttpStatusCode.RequestHeaderFieldsTooLarge: + case HttpStatusCode.UnavailableForLegalReasons: + case HttpStatusCode.InternalServerError: + case HttpStatusCode.NotImplemented: + case HttpStatusCode.BadGateway: + case HttpStatusCode.ServiceUnavailable: + case HttpStatusCode.GatewayTimeout: + case HttpStatusCode.HttpVersionNotSupported: + case HttpStatusCode.VariantAlsoNegotiates: + case HttpStatusCode.InsufficientStorage: + case HttpStatusCode.LoopDetected: + case HttpStatusCode.NotExtended: + case HttpStatusCode.NetworkAuthenticationRequired: + sb.AppendLine(); + sb.AppendLine(4, $"public ProblemDetails {responseModel.StatusCode.ToNormalizedString()}Content"); + sb.AppendLine(8, $"=> Is{responseModel.StatusCode.ToNormalizedString()} && ContentObject is ProblemDetails result"); + sb.AppendLine(12, "? result"); + sb.AppendLine(12, $": throw new InvalidOperationException(\"Content is not the expected type - please use the Is{responseModel.StatusCode.ToNormalizedString()} property first.\");"); + break; + default: + sb.AppendLine(4, $"// TODO: Not Implemented for {responseModel.StatusCode}."); + break; + } + } + } + + private void AppendContentWithoutProblemDetails( + StringBuilder sb) + { + var responseModels = parameters.ResponseModels + .AppendUnauthorizedIfNeeded(parameters.Authorization) + .AppendForbiddenIfNeeded(parameters.Authorization) + .AppendBadRequestIfNeeded(parameters.HasParameterType) + .OrderBy(x => x.StatusCode) + .ToList(); + + foreach (var responseModel in responseModels) + { + switch (responseModel.StatusCode) + { + case HttpStatusCode.OK: + sb.AppendLine(); + AppendMethodContentStatusCodeOk(sb, responseModel); + break; + case HttpStatusCode.EarlyHints: + // Skip. + break; + case HttpStatusCode.Continue: + case HttpStatusCode.SwitchingProtocols: + case HttpStatusCode.Processing: + case HttpStatusCode.Created: + case HttpStatusCode.Accepted: + case HttpStatusCode.NonAuthoritativeInformation: + case HttpStatusCode.NoContent: + case HttpStatusCode.ResetContent: + case HttpStatusCode.PartialContent: + case HttpStatusCode.MultiStatus: + case HttpStatusCode.AlreadyReported: + case HttpStatusCode.IMUsed: + case HttpStatusCode.Ambiguous: + case HttpStatusCode.Moved: + case HttpStatusCode.Found: + case HttpStatusCode.RedirectMethod: + case HttpStatusCode.NotModified: + case HttpStatusCode.UseProxy: + case HttpStatusCode.Unused: + case HttpStatusCode.RedirectKeepVerb: + case HttpStatusCode.PermanentRedirect: + case HttpStatusCode.BadRequest: + case HttpStatusCode.Unauthorized: + case HttpStatusCode.PaymentRequired: + case HttpStatusCode.Forbidden: + case HttpStatusCode.NotFound: + case HttpStatusCode.MethodNotAllowed: + case HttpStatusCode.NotAcceptable: + case HttpStatusCode.ProxyAuthenticationRequired: + case HttpStatusCode.RequestTimeout: + case HttpStatusCode.Conflict: + case HttpStatusCode.Gone: + case HttpStatusCode.LengthRequired: + case HttpStatusCode.PreconditionFailed: + case HttpStatusCode.RequestEntityTooLarge: + case HttpStatusCode.RequestUriTooLong: + case HttpStatusCode.UnsupportedMediaType: + case HttpStatusCode.RequestedRangeNotSatisfiable: + case HttpStatusCode.ExpectationFailed: + case HttpStatusCode.MisdirectedRequest: + case HttpStatusCode.UnprocessableEntity: + case HttpStatusCode.Locked: + case HttpStatusCode.FailedDependency: + case HttpStatusCode.UpgradeRequired: + case HttpStatusCode.PreconditionRequired: + case HttpStatusCode.TooManyRequests: + case HttpStatusCode.RequestHeaderFieldsTooLarge: + case HttpStatusCode.UnavailableForLegalReasons: + case HttpStatusCode.InternalServerError: + case HttpStatusCode.NotImplemented: + case HttpStatusCode.BadGateway: + case HttpStatusCode.ServiceUnavailable: + case HttpStatusCode.GatewayTimeout: + case HttpStatusCode.HttpVersionNotSupported: + case HttpStatusCode.VariantAlsoNegotiates: + case HttpStatusCode.InsufficientStorage: + case HttpStatusCode.LoopDetected: + case HttpStatusCode.NotExtended: + case HttpStatusCode.NetworkAuthenticationRequired: + sb.AppendLine(); + sb.AppendLine(4, $"public string? {responseModel.StatusCode.ToNormalizedString()}Content"); + sb.AppendLine(8, $"=> Is{responseModel.StatusCode.ToNormalizedString()} && ContentObject is string result"); + sb.AppendLine(12, "? result"); + sb.AppendLine(12, $": throw new InvalidOperationException(\"Content is not the expected type - please use the Is{responseModel.StatusCode.ToNormalizedString()} property first.\");"); + break; + default: + sb.AppendLine(4, $"// TODO: Not Implemented for {responseModel.StatusCode}."); + break; + } + } + } +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Client.CSharp/ContentGenerators/ContentGeneratorClientEndpointResultInterface.cs b/src/Atc.Rest.ApiGenerator.Client.CSharp/ContentGenerators/ContentGeneratorClientEndpointResultInterface.cs new file mode 100644 index 00000000..bd2f12c8 --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Client.CSharp/ContentGenerators/ContentGeneratorClientEndpointResultInterface.cs @@ -0,0 +1,362 @@ +// ReSharper disable ConvertIfStatementToConditionalTernaryExpression +// ReSharper disable ConvertIfStatementToSwitchStatement +namespace Atc.Rest.ApiGenerator.Client.CSharp.ContentGenerators; + +public class ContentGeneratorClientEndpointResultInterface : IContentGenerator +{ + private readonly GeneratedCodeHeaderGenerator codeHeaderGenerator; + private readonly GeneratedCodeAttributeGenerator codeAttributeGenerator; + private readonly CodeDocumentationTagsGenerator codeDocumentationTagsGenerator; + private readonly ContentGeneratorClientEndpointResultInterfaceParameters parameters; + private readonly bool useProblemDetailsAsDefaultResponseBody; + + public ContentGeneratorClientEndpointResultInterface( + GeneratedCodeHeaderGenerator codeHeaderGenerator, + GeneratedCodeAttributeGenerator codeAttributeGenerator, + CodeDocumentationTagsGenerator codeDocumentationTagsGenerator, + ContentGeneratorClientEndpointResultInterfaceParameters parameters, + bool useProblemDetailsAsDefaultResponseBody) + { + this.codeHeaderGenerator = codeHeaderGenerator; + this.codeAttributeGenerator = codeAttributeGenerator; + this.codeDocumentationTagsGenerator = codeDocumentationTagsGenerator; + this.parameters = parameters; + this.useProblemDetailsAsDefaultResponseBody = useProblemDetailsAsDefaultResponseBody; + } + + public string Generate() + { + var sb = new StringBuilder(); + + sb.Append(codeHeaderGenerator.Generate()); + sb.AppendLine($"namespace {parameters.Namespace};"); + sb.AppendLine(); + if (codeDocumentationTagsGenerator.ShouldGenerateTags(parameters.DocumentationTags)) + { + sb.Append(codeDocumentationTagsGenerator.GenerateTags(0, parameters.DocumentationTags)); + } + + sb.AppendLine(codeAttributeGenerator.Generate()); + sb.AppendLine($"public interface {parameters.InterfaceName} : {parameters.InheritInterfaceName}"); + sb.AppendLine("{"); + AppendContent(sb); + sb.Append('}'); + + return sb.ToString(); + } + + private void AppendContent( + StringBuilder sb) + { + AppendContentIsStatus(sb); + + if (useProblemDetailsAsDefaultResponseBody) + { + AppendContentWithProblemDetails(sb); + } + else + { + AppendContentWithoutProblemDetails(sb); + } + } + + private void AppendContentIsStatus( + StringBuilder sb) + { + var responseModels = parameters.ResponseModels + .AppendUnauthorizedIfNeeded(parameters.Authorization) + .AppendForbiddenIfNeeded(parameters.Authorization) + .AppendBadRequestIfNeeded(parameters.HasParameterType) + .OrderBy(x => x.StatusCode) + .ToList(); + + foreach (var responseModel in responseModels) + { + switch (responseModel.StatusCode) + { + case HttpStatusCode.Continue: + case HttpStatusCode.SwitchingProtocols: + case HttpStatusCode.Processing: + case HttpStatusCode.EarlyHints: + case HttpStatusCode.OK: + case HttpStatusCode.Created: + case HttpStatusCode.Accepted: + case HttpStatusCode.NonAuthoritativeInformation: + case HttpStatusCode.NoContent: + case HttpStatusCode.ResetContent: + case HttpStatusCode.PartialContent: + case HttpStatusCode.MultiStatus: + case HttpStatusCode.AlreadyReported: + case HttpStatusCode.IMUsed: + case HttpStatusCode.Ambiguous: + case HttpStatusCode.Moved: + case HttpStatusCode.Found: + case HttpStatusCode.RedirectMethod: + case HttpStatusCode.NotModified: + case HttpStatusCode.UseProxy: + case HttpStatusCode.Unused: + case HttpStatusCode.RedirectKeepVerb: + case HttpStatusCode.PermanentRedirect: + case HttpStatusCode.BadRequest: + case HttpStatusCode.Unauthorized: + case HttpStatusCode.PaymentRequired: + case HttpStatusCode.Forbidden: + case HttpStatusCode.NotFound: + case HttpStatusCode.MethodNotAllowed: + case HttpStatusCode.NotAcceptable: + case HttpStatusCode.ProxyAuthenticationRequired: + case HttpStatusCode.RequestTimeout: + case HttpStatusCode.Conflict: + case HttpStatusCode.Gone: + case HttpStatusCode.LengthRequired: + case HttpStatusCode.PreconditionFailed: + case HttpStatusCode.RequestEntityTooLarge: + case HttpStatusCode.RequestUriTooLong: + case HttpStatusCode.UnsupportedMediaType: + case HttpStatusCode.RequestedRangeNotSatisfiable: + case HttpStatusCode.ExpectationFailed: + case HttpStatusCode.MisdirectedRequest: + case HttpStatusCode.UnprocessableEntity: + case HttpStatusCode.Locked: + case HttpStatusCode.FailedDependency: + case HttpStatusCode.UpgradeRequired: + case HttpStatusCode.PreconditionRequired: + case HttpStatusCode.TooManyRequests: + case HttpStatusCode.RequestHeaderFieldsTooLarge: + case HttpStatusCode.UnavailableForLegalReasons: + case HttpStatusCode.InternalServerError: + case HttpStatusCode.NotImplemented: + case HttpStatusCode.BadGateway: + case HttpStatusCode.ServiceUnavailable: + case HttpStatusCode.GatewayTimeout: + case HttpStatusCode.HttpVersionNotSupported: + case HttpStatusCode.VariantAlsoNegotiates: + case HttpStatusCode.InsufficientStorage: + case HttpStatusCode.LoopDetected: + case HttpStatusCode.NotExtended: + case HttpStatusCode.NetworkAuthenticationRequired: + sb.AppendLine(); + sb.AppendLine(4, $"bool Is{responseModel.StatusCode.ToNormalizedString()} {{ get; }}"); + break; + default: + sb.AppendLine(4, $"// TODO: Not Implemented for {responseModel.StatusCode}."); + break; + } + } + } + + private void AppendMethodContentStatusCodeOk( + StringBuilder sb, + ApiOperationResponseModel responseModel) + { + if (responseModel.MediaType == MediaTypeNames.Application.Octet) + { + sb.AppendLine(4, "byte[] OkContent { get; }"); + return; + } + + if (string.IsNullOrEmpty(responseModel.DataType)) + { + sb.AppendLine(4, "string? OkContent { get; }"); + return; + } + + if (responseModel.CollectionDataType is null) + { + sb.AppendLine(4, $"{responseModel.DataType} OkContent {{ get; }}"); + return; + } + + if (responseModel.CollectionDataType == NameConstants.List) + { + sb.AppendLine(4, $"IEnumerable<{responseModel.DataType}> OkContent {{ get; }}"); + } + else + { + sb.AppendLine(4, $"{responseModel.CollectionDataType}<{responseModel.DataType}> OkContent {{ get; }}"); + } + } + + private void AppendContentWithProblemDetails( + StringBuilder sb) + { + var responseModels = parameters.ResponseModels + .AppendUnauthorizedIfNeeded(parameters.Authorization) + .AppendForbiddenIfNeeded(parameters.Authorization) + .AppendBadRequestIfNeeded(parameters.HasParameterType) + .OrderBy(x => x.StatusCode) + .ToList(); + + foreach (var responseModel in responseModels) + { + switch (responseModel.StatusCode) + { + case HttpStatusCode.OK: + sb.AppendLine(); + AppendMethodContentStatusCodeOk(sb, responseModel); + break; + case HttpStatusCode.BadRequest: + sb.AppendLine(); + sb.AppendLine(4, $"ValidationProblemDetails {responseModel.StatusCode.ToNormalizedString()}Content {{ get; }}"); + break; + case HttpStatusCode.EarlyHints: + // Skip. + break; + case HttpStatusCode.Continue: + case HttpStatusCode.SwitchingProtocols: + case HttpStatusCode.Processing: + case HttpStatusCode.Created: + case HttpStatusCode.Accepted: + case HttpStatusCode.NonAuthoritativeInformation: + case HttpStatusCode.NoContent: + case HttpStatusCode.ResetContent: + case HttpStatusCode.PartialContent: + case HttpStatusCode.MultiStatus: + case HttpStatusCode.AlreadyReported: + case HttpStatusCode.IMUsed: + case HttpStatusCode.Ambiguous: + case HttpStatusCode.Moved: + case HttpStatusCode.Found: + case HttpStatusCode.RedirectMethod: + case HttpStatusCode.NotModified: + case HttpStatusCode.UseProxy: + case HttpStatusCode.Unused: + case HttpStatusCode.RedirectKeepVerb: + case HttpStatusCode.PermanentRedirect: + case HttpStatusCode.Unauthorized: + case HttpStatusCode.PaymentRequired: + case HttpStatusCode.Forbidden: + case HttpStatusCode.NotFound: + case HttpStatusCode.MethodNotAllowed: + case HttpStatusCode.NotAcceptable: + case HttpStatusCode.ProxyAuthenticationRequired: + case HttpStatusCode.RequestTimeout: + case HttpStatusCode.Conflict: + case HttpStatusCode.Gone: + case HttpStatusCode.LengthRequired: + case HttpStatusCode.PreconditionFailed: + case HttpStatusCode.RequestEntityTooLarge: + case HttpStatusCode.RequestUriTooLong: + case HttpStatusCode.UnsupportedMediaType: + case HttpStatusCode.RequestedRangeNotSatisfiable: + case HttpStatusCode.ExpectationFailed: + case HttpStatusCode.MisdirectedRequest: + case HttpStatusCode.UnprocessableEntity: + case HttpStatusCode.Locked: + case HttpStatusCode.FailedDependency: + case HttpStatusCode.UpgradeRequired: + case HttpStatusCode.PreconditionRequired: + case HttpStatusCode.TooManyRequests: + case HttpStatusCode.RequestHeaderFieldsTooLarge: + case HttpStatusCode.UnavailableForLegalReasons: + case HttpStatusCode.InternalServerError: + case HttpStatusCode.NotImplemented: + case HttpStatusCode.BadGateway: + case HttpStatusCode.ServiceUnavailable: + case HttpStatusCode.GatewayTimeout: + case HttpStatusCode.HttpVersionNotSupported: + case HttpStatusCode.VariantAlsoNegotiates: + case HttpStatusCode.InsufficientStorage: + case HttpStatusCode.LoopDetected: + case HttpStatusCode.NotExtended: + case HttpStatusCode.NetworkAuthenticationRequired: + sb.AppendLine(); + sb.AppendLine(4, $"ProblemDetails {responseModel.StatusCode.ToNormalizedString()}Content {{ get; }}"); + break; + default: + sb.AppendLine(4, $"// TODO: Not Implemented for {responseModel.StatusCode}."); + break; + } + } + } + + private void AppendContentWithoutProblemDetails( + StringBuilder sb) + { + var responseModels = parameters.ResponseModels + .AppendUnauthorizedIfNeeded(parameters.Authorization) + .AppendForbiddenIfNeeded(parameters.Authorization) + .AppendBadRequestIfNeeded(parameters.HasParameterType) + .OrderBy(x => x.StatusCode) + .ToList(); + + foreach (var responseModel in responseModels) + { + switch (responseModel.StatusCode) + { + case HttpStatusCode.OK: + sb.AppendLine(); + AppendMethodContentStatusCodeOk(sb, responseModel); + break; + case HttpStatusCode.EarlyHints: + // Skip. + break; + case HttpStatusCode.Continue: + case HttpStatusCode.SwitchingProtocols: + case HttpStatusCode.Processing: + case HttpStatusCode.Created: + case HttpStatusCode.Accepted: + case HttpStatusCode.NonAuthoritativeInformation: + case HttpStatusCode.NoContent: + case HttpStatusCode.ResetContent: + case HttpStatusCode.PartialContent: + case HttpStatusCode.MultiStatus: + case HttpStatusCode.AlreadyReported: + case HttpStatusCode.IMUsed: + case HttpStatusCode.Ambiguous: + case HttpStatusCode.Moved: + case HttpStatusCode.Found: + case HttpStatusCode.RedirectMethod: + case HttpStatusCode.NotModified: + case HttpStatusCode.UseProxy: + case HttpStatusCode.Unused: + case HttpStatusCode.RedirectKeepVerb: + case HttpStatusCode.PermanentRedirect: + case HttpStatusCode.BadRequest: + case HttpStatusCode.Unauthorized: + case HttpStatusCode.PaymentRequired: + case HttpStatusCode.Forbidden: + case HttpStatusCode.NotFound: + case HttpStatusCode.MethodNotAllowed: + case HttpStatusCode.NotAcceptable: + case HttpStatusCode.ProxyAuthenticationRequired: + case HttpStatusCode.RequestTimeout: + case HttpStatusCode.Conflict: + case HttpStatusCode.Gone: + case HttpStatusCode.LengthRequired: + case HttpStatusCode.PreconditionFailed: + case HttpStatusCode.RequestEntityTooLarge: + case HttpStatusCode.RequestUriTooLong: + case HttpStatusCode.UnsupportedMediaType: + case HttpStatusCode.RequestedRangeNotSatisfiable: + case HttpStatusCode.ExpectationFailed: + case HttpStatusCode.MisdirectedRequest: + case HttpStatusCode.UnprocessableEntity: + case HttpStatusCode.Locked: + case HttpStatusCode.FailedDependency: + case HttpStatusCode.UpgradeRequired: + case HttpStatusCode.PreconditionRequired: + case HttpStatusCode.TooManyRequests: + case HttpStatusCode.RequestHeaderFieldsTooLarge: + case HttpStatusCode.UnavailableForLegalReasons: + case HttpStatusCode.InternalServerError: + case HttpStatusCode.NotImplemented: + case HttpStatusCode.BadGateway: + case HttpStatusCode.ServiceUnavailable: + case HttpStatusCode.GatewayTimeout: + case HttpStatusCode.HttpVersionNotSupported: + case HttpStatusCode.VariantAlsoNegotiates: + case HttpStatusCode.InsufficientStorage: + case HttpStatusCode.LoopDetected: + case HttpStatusCode.NotExtended: + case HttpStatusCode.NetworkAuthenticationRequired: + sb.AppendLine(); + sb.AppendLine(4, $"string? {responseModel.StatusCode.ToNormalizedString()}Content {{ get; }}"); + break; + default: + sb.AppendLine(4, $"// TODO: Not Implemented for {responseModel.StatusCode}."); + break; + } + } + } +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/Client/ContentGeneratorClientParameter.cs b/src/Atc.Rest.ApiGenerator.Client.CSharp/ContentGenerators/ContentGeneratorClientParameter.cs similarity index 91% rename from src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/Client/ContentGeneratorClientParameter.cs rename to src/Atc.Rest.ApiGenerator.Client.CSharp/ContentGenerators/ContentGeneratorClientParameter.cs index 8ad632ac..ffe8c126 100644 --- a/src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/Client/ContentGeneratorClientParameter.cs +++ b/src/Atc.Rest.ApiGenerator.Client.CSharp/ContentGenerators/ContentGeneratorClientParameter.cs @@ -1,7 +1,7 @@ // ReSharper disable StringLiteralTypo // ReSharper disable SwitchStatementMissingSomeEnumCasesNoDefault // ReSharper disable ConvertIfStatementToConditionalTernaryExpression -namespace Atc.Rest.ApiGenerator.Framework.Mvc.ContentGenerators.Client; +namespace Atc.Rest.ApiGenerator.Client.CSharp.ContentGenerators; public sealed class ContentGeneratorClientParameter : IContentGenerator { @@ -75,7 +75,7 @@ private static void AppendPropertyAttributes( sb.AppendLine(4, "[EmailAddress]"); break; case RegularExpressionAttribute regularExpressionAttribute: - sb.AppendLine(4, $"[RegularExpression(\"{regularExpressionAttribute.Pattern}\")]"); + sb.AppendLine(4, $"[RegularExpression({regularExpressionAttribute.GetEscapedPattern()})]"); break; case StringLengthAttribute stringLengthAttribute: sb.AppendLine(4, $"[StringLength({stringLengthAttribute.MaximumLength})]"); @@ -132,7 +132,14 @@ private static void AppendPropertyBody( } else { - sb.AppendLine($" {{ get; set; }} = {item.DefaultValueInitializer};"); + if (item.DataType.Equals("string", StringComparison.Ordinal)) + { + sb.AppendLine($" {{ get; set; }} = \"{item.DefaultValueInitializer}\";"); + } + else + { + sb.AppendLine($" {{ get; set; }} = {item.DefaultValueInitializer};"); + } } } } diff --git a/src/Atc.Rest.ApiGenerator.Client.CSharp/GlobalUsings.cs b/src/Atc.Rest.ApiGenerator.Client.CSharp/GlobalUsings.cs new file mode 100644 index 00000000..3f90ae52 --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Client.CSharp/GlobalUsings.cs @@ -0,0 +1,25 @@ +global using System.ComponentModel.DataAnnotations; +global using System.Net; +global using System.Net.Mime; +global using System.Text; + +global using Atc.CodeDocumentation.CodeComment; +global using Atc.CodeGeneration.CSharp.Content; +global using Atc.CodeGeneration.CSharp.Content.Generators; +global using Atc.CodeGeneration.CSharp.Extensions; +global using Atc.Rest.ApiGenerator.Client.CSharp.ContentGenerators; +global using Atc.Rest.ApiGenerator.Contracts; +global using Atc.Rest.ApiGenerator.Contracts.ContentGeneratorsParameters; +global using Atc.Rest.ApiGenerator.Contracts.ContentGeneratorsParameters.Client; +global using Atc.Rest.ApiGenerator.Contracts.Extensions; +global using Atc.Rest.ApiGenerator.Contracts.Models; +global using Atc.Rest.ApiGenerator.Framework.ContentGenerators; +global using Atc.Rest.ApiGenerator.Framework.Factories.Parameters.Client; +global using Atc.Rest.ApiGenerator.Framework.Factories.Parameters.ServerClient; +global using Atc.Rest.ApiGenerator.Framework.Helpers; +global using Atc.Rest.ApiGenerator.Framework.Providers; +global using Atc.Rest.ApiGenerator.Framework.Writers; +global using Atc.Rest.ApiGenerator.OpenApi.Extensions; + +global using Microsoft.Extensions.Logging; +global using Microsoft.OpenApi.Models; \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Client.CSharp/ProjectGenerator/ClientCSharpApiGenerator.cs b/src/Atc.Rest.ApiGenerator.Client.CSharp/ProjectGenerator/ClientCSharpApiGenerator.cs new file mode 100644 index 00000000..390005b0 --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Client.CSharp/ProjectGenerator/ClientCSharpApiGenerator.cs @@ -0,0 +1,540 @@ +// ReSharper disable ArrangeObjectCreationWhenTypeNotEvident +// ReSharper disable ForeachCanBeConvertedToQueryUsingAnotherGetEnumerator +// ReSharper disable ForeachCanBePartlyConvertedToQueryUsingAnotherGetEnumerator +namespace Atc.Rest.ApiGenerator.Client.CSharp.ProjectGenerator; + +public class ClientCSharpApiGenerator : IClientCSharpApiGenerator +{ + private readonly ILogger logger; + private readonly INugetPackageReferenceProvider nugetPackageReferenceProvider; + private readonly Version apiGeneratorVersion; + private readonly string projectName; + private readonly DirectoryInfo projectPath; + private readonly OpenApiDocument openApiDocument; + private readonly IList operationSchemaMappings; + private readonly string codeGeneratorContentHeader; + private readonly AttributeParameters codeGeneratorAttribute; + private readonly bool useProblemDetailsAsDefaultResponseBody; + private readonly bool includeDeprecated; + + public ClientCSharpApiGenerator( + ILoggerFactory loggerFactory, + INugetPackageReferenceProvider nugetPackageReferenceProvider, + Version apiGeneratorVersion, + string projectName, + DirectoryInfo projectPath, + OpenApiDocument openApiDocument, + IList operationSchemaMappings, + bool useProblemDetailsAsDefaultResponseBody, + bool includeDeprecated) + { + ArgumentNullException.ThrowIfNull(loggerFactory); + ArgumentNullException.ThrowIfNull(nugetPackageReferenceProvider); + ArgumentNullException.ThrowIfNull(apiGeneratorVersion); + ArgumentNullException.ThrowIfNull(projectName); + ArgumentNullException.ThrowIfNull(projectPath); + ArgumentNullException.ThrowIfNull(openApiDocument); + ArgumentNullException.ThrowIfNull(operationSchemaMappings); + + logger = loggerFactory.CreateLogger(); + this.nugetPackageReferenceProvider = nugetPackageReferenceProvider; + this.apiGeneratorVersion = apiGeneratorVersion; + this.projectName = projectName; + this.projectPath = projectPath; + this.openApiDocument = openApiDocument; + this.operationSchemaMappings = operationSchemaMappings; + this.useProblemDetailsAsDefaultResponseBody = useProblemDetailsAsDefaultResponseBody; + this.includeDeprecated = includeDeprecated; + + codeGeneratorContentHeader = GeneratedCodeHeaderGeneratorFactory + .Create(apiGeneratorVersion) + .Generate(); + codeGeneratorAttribute = AttributeParametersFactory + .CreateGeneratedCode(apiGeneratorVersion); + } + + public string? ClientFolderName { get; set; } + + public string HttpClientName { get; set; } = "DefaultHttpClient"; + + public async Task ScaffoldProjectFile() + { + var packageReferences = await nugetPackageReferenceProvider.GetPackageReferencesForApiClientProject(); + + var itemGroupPackageReferences = packageReferences + .Select(packageReference => new ItemGroupParameter( + "PackageReference", + [ + new("Include", packageReference.PackageId), + new("Version", packageReference.PackageVersion), + ], + Value: null)) + .ToList(); + + var projectFileParameters = new ProjectFileParameters( + "Microsoft.NET.Sdk", + [ + [ + new("TargetFramework", Attributes: null, "net8.0"), + new("Nullable", Attributes: null, "enable"), + new("IsPackable", Attributes: null, "false"), + ], + [ + new("GenerateDocumentationFile", Attributes: null, "true"), + ], + [ + new("DocumentationFile", Attributes: null, @$"bin\Debug\net8.0\{projectName}.xml"), + new("NoWarn", Attributes: null, "1573;1591;1701;1702;1712;8618;"), + ], + ], + [ + itemGroupPackageReferences, + ]); + + var contentGenerator = new GenerateContentForProjectFile( + projectFileParameters); + + var content = contentGenerator.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + projectPath, + projectPath.CombineFileInfo($"{projectName}.csproj"), + ContentWriterArea.Src, + content, + overrideIfExist: false); + } + + public void GenerateModels() + { + foreach (var apiGroupName in openApiDocument.GetApiGroupNames()) + { + var apiOperations = operationSchemaMappings + .Where(x => x.ApiGroupName.Equals(apiGroupName, StringComparison.OrdinalIgnoreCase)) + .ToList(); + + var apiOperationModels = GetDistinctApiOperationModels(apiOperations); + + foreach (var apiOperationModel in apiOperationModels) + { + var apiSchema = openApiDocument.Components.Schemas.First(x => x.GetFormattedKey().Equals(apiOperationModel.Name, StringComparison.OrdinalIgnoreCase)); + + var modelName = apiSchema.GetFormattedKey(); + + if (apiOperationModel.IsEnum) + { + GenerateEnumerationType(modelName, apiSchema.Value.GetEnumSchema().Item2); + } + else + { + GenerateModel(modelName, apiSchema.Value, apiGroupName, apiOperationModel.IsShared); + } + } + } + } + + public void GenerateParameters() + { + foreach (var openApiPath in openApiDocument.Paths) + { + var apiGroupName = openApiPath.GetApiGroupName(); + + var fullNamespace = string.IsNullOrEmpty(ClientFolderName) + ? $"{projectName}.{ContentGeneratorConstants.Contracts}.{apiGroupName}" + : $"{projectName}.{ClientFolderName}.{ContentGeneratorConstants.Contracts}.{apiGroupName}"; + + foreach (var openApiOperation in openApiPath.Value.Operations) + { + if (openApiOperation.Value.Deprecated && !includeDeprecated) + { + continue; + } + + if (!openApiOperation.Value.HasParametersOrRequestBody() && + !openApiPath.Value.HasParameters()) + { + continue; + } + + var parameterParameters = ContentGeneratorClientParameterParametersFactory.Create( + fullNamespace, + openApiOperation.Value, + openApiPath.Value.Parameters); + + var contentGenerator = new ContentGeneratorClientParameter( + new GeneratedCodeHeaderGenerator(new GeneratedCodeGeneratorParameters(apiGeneratorVersion)), + new GeneratedCodeAttributeGenerator(new GeneratedCodeGeneratorParameters(apiGeneratorVersion)), + new CodeDocumentationTagsGenerator(), + parameterParameters); + + var content = contentGenerator.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + projectPath, + projectPath.CombineFileInfo(ContentGeneratorConstants.Contracts, apiGroupName, ContentGeneratorConstants.RequestParameters, $"{parameterParameters.ParameterName}.cs"), + ContentWriterArea.Src, + content); + } + } + } + + public void GenerateEndpointInterfaces() + { + foreach (var openApiPath in openApiDocument.Paths) + { + var apiGroupName = openApiPath.GetApiGroupName(); + + var fullNamespace = string.IsNullOrEmpty(ClientFolderName) + ? $"{projectName}.{ContentGeneratorConstants.Endpoints}.{apiGroupName}.{ContentGeneratorConstants.Interfaces}" + : $"{projectName}.{ClientFolderName}.{ContentGeneratorConstants.Endpoints}.{apiGroupName}.{ContentGeneratorConstants.Interfaces}"; + + foreach (var openApiOperation in openApiPath.Value.Operations) + { + if (openApiOperation.Value.Deprecated && !includeDeprecated) + { + continue; + } + + var interfaceParameters = ContentGeneratorClientEndpointInterfaceParametersFactory.Create( + codeGeneratorContentHeader, + fullNamespace, + codeGeneratorAttribute, + openApiPath.Value, + openApiOperation.Value, + HttpClientName); + + var contentGenerator = new GenerateContentForInterface( + new CodeDocumentationTagsGenerator(), + interfaceParameters); + + var content = contentGenerator.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + projectPath, + projectPath.CombineFileInfo(ContentGeneratorConstants.Endpoints, apiGroupName, ContentGeneratorConstants.Interfaces, $"{interfaceParameters.TypeName}.cs"), + ContentWriterArea.Src, + content); + } + } + } + + public void GenerateEndpoints() + { + foreach (var openApiPath in openApiDocument.Paths) + { + var apiGroupName = openApiPath.GetApiGroupName(); + + var fullNamespace = string.IsNullOrEmpty(ClientFolderName) + ? $"{projectName}.{ContentGeneratorConstants.Endpoints}.{apiGroupName}" + : $"{projectName}.{ClientFolderName}.{ContentGeneratorConstants.Endpoints}.{apiGroupName}"; + + foreach (var openApiOperation in openApiPath.Value.Operations) + { + if (openApiOperation.Value.Deprecated && !includeDeprecated) + { + continue; + } + + var endpointParameters = ContentGeneratorClientEndpointParametersFactory.Create( + projectName, + apiGroupName, + fullNamespace, + openApiPath.Value, + openApiOperation.Key, + openApiOperation.Value, + HttpClientName, + $"{openApiDocument.GetServerUrlBasePath()}{openApiPath.Key}"); + + var contentGenerator = new ContentGeneratorClientEndpoint( + new GeneratedCodeHeaderGenerator(new GeneratedCodeGeneratorParameters(apiGeneratorVersion)), + new GeneratedCodeAttributeGenerator(new GeneratedCodeGeneratorParameters(apiGeneratorVersion)), + new CodeDocumentationTagsGenerator(), + endpointParameters, + useProblemDetailsAsDefaultResponseBody); + + var content = contentGenerator.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + projectPath, + projectPath.CombineFileInfo(ContentGeneratorConstants.Endpoints, apiGroupName, $"{endpointParameters.EndpointName}.cs"), + ContentWriterArea.Src, + content); + } + } + } + + public void GenerateEndpointResultInterfaces() + { + foreach (var openApiPath in openApiDocument.Paths) + { + var apiGroupName = openApiPath.GetApiGroupName(); + + var fullNamespace = string.IsNullOrEmpty(ClientFolderName) + ? $"{projectName}.{ContentGeneratorConstants.Endpoints}.{apiGroupName}.{ContentGeneratorConstants.Interfaces}" + : $"{projectName}.{ClientFolderName}.{ContentGeneratorConstants.Endpoints}.{apiGroupName}.{ContentGeneratorConstants.Interfaces}"; + + foreach (var openApiOperation in openApiPath.Value.Operations) + { + if (openApiOperation.Value.Deprecated && !includeDeprecated) + { + continue; + } + + var endpointResultInterfaceParameters = ContentGeneratorClientEndpointResultInterfaceParametersFactory.Create( + projectName, + apiGroupName, + fullNamespace, + openApiPath.Value, + openApiOperation.Value); + + var contentGenerator = new ContentGeneratorClientEndpointResultInterface( + new GeneratedCodeHeaderGenerator(new GeneratedCodeGeneratorParameters(apiGeneratorVersion)), + new GeneratedCodeAttributeGenerator(new GeneratedCodeGeneratorParameters(apiGeneratorVersion)), + new CodeDocumentationTagsGenerator(), + endpointResultInterfaceParameters, + useProblemDetailsAsDefaultResponseBody); + + var content = contentGenerator.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + projectPath, + projectPath.CombineFileInfo(ContentGeneratorConstants.Endpoints, apiGroupName, ContentGeneratorConstants.Interfaces, $"{endpointResultInterfaceParameters.InterfaceName}.cs"), + ContentWriterArea.Src, + content); + } + } + } + + public void GenerateEndpointResults() + { + foreach (var openApiPath in openApiDocument.Paths) + { + var apiGroupName = openApiPath.GetApiGroupName(); + + var fullNamespace = string.IsNullOrEmpty(ClientFolderName) + ? $"{projectName}.{ContentGeneratorConstants.Endpoints}.{apiGroupName}" + : $"{projectName}.{ClientFolderName}.{ContentGeneratorConstants.Endpoints}.{apiGroupName}"; + + foreach (var openApiOperation in openApiPath.Value.Operations) + { + if (openApiOperation.Value.Deprecated && !includeDeprecated) + { + continue; + } + + var endpointResultParameters = ContentGeneratorClientEndpointResultParametersFactory.Create( + projectName, + apiGroupName, + fullNamespace, + openApiPath.Value, + openApiOperation.Value); + + var contentGenerator = new ContentGeneratorClientEndpointResult( + new GeneratedCodeHeaderGenerator(new GeneratedCodeGeneratorParameters(apiGeneratorVersion)), + new GeneratedCodeAttributeGenerator(new GeneratedCodeGeneratorParameters(apiGeneratorVersion)), + new CodeDocumentationTagsGenerator(), + endpointResultParameters, + useProblemDetailsAsDefaultResponseBody); + + var content = contentGenerator.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + projectPath, + projectPath.CombineFileInfo(ContentGeneratorConstants.Endpoints, apiGroupName, $"{endpointResultParameters.EndpointResultName}.cs"), + ContentWriterArea.Src, + content); + } + } + } + + public void MaintainGlobalUsings( + bool removeNamespaceGroupSeparatorInGlobalUsings) + { + var requiredUsings = new List + { + "System.CodeDom.Compiler", + "System.ComponentModel.DataAnnotations", + "System", + "System.Net", + "System.Net.Http", + "System.Threading", + "System.Threading.Tasks", + "Atc.Rest.Client", + "Atc.Rest.Client.Builder", + "Microsoft.AspNetCore.Mvc", + }; + + if (openApiDocument.IsUsingRequiredForSystemLinq(includeDeprecated)) + { + requiredUsings.Add("System.Linq"); + } + + if (openApiDocument.IsUsingRequiredForSystemCollectionGeneric(includeDeprecated)) + { + requiredUsings.Add("System.Collections.Generic"); + } + + if (openApiDocument.IsUsingRequiredForSystemTextJsonSerializationAndSystemRuntimeSerialization(includeDeprecated)) + { + requiredUsings.Add("System.Runtime.Serialization"); + requiredUsings.Add("System.Text.Json.Serialization"); + } + + if (operationSchemaMappings.FirstOrDefault(x => x.Model.UsesIFormFile) is not null) + { + requiredUsings.Add("Microsoft.AspNetCore.Http"); + } + + if (openApiDocument.IsUsingRequiredForAtcRestResults()) + { + requiredUsings.Add("Atc.Rest.Results"); + } + + if (operationSchemaMappings.Any(apiOperation => apiOperation.Model.IsEnum || + apiOperation.Model.IsShared)) + { + requiredUsings.Add($"{projectName}.{ContentGeneratorConstants.Contracts}"); + } + + var apiGroupNames = openApiDocument.GetApiGroupNames(); + foreach (var openApiPath in openApiDocument.Paths) + { + var apiGroupName = openApiPath.GetApiGroupName(); + foreach (var openApiOperation in openApiPath.Value.Operations) + { + if (openApiOperation.Value.Deprecated && !includeDeprecated) + { + continue; + } + + if (!openApiPath.Value.HasParameters() && + !openApiOperation.Value.HasParametersOrRequestBody()) + { + continue; + } + + var requiredUsing = $"{projectName}.{ContentGeneratorConstants.Contracts}.{apiGroupName}"; + if (!requiredUsings.Contains(requiredUsing, StringComparer.CurrentCulture)) + { + requiredUsings.Add(requiredUsing); + } + } + } + + foreach (var apiGroupName in apiGroupNames) + { + var apiOperations = operationSchemaMappings + .Where(x => x.ApiGroupName.Equals(apiGroupName, StringComparison.OrdinalIgnoreCase)) + .ToList(); + + var apiOperationModels = GetDistinctApiOperationModels(apiOperations); + + foreach (var apiOperationModel in apiOperationModels) + { + if (apiOperationModel.IsEnum || + apiOperationModel.IsShared) + { + continue; + } + + var requiredUsing = $"{projectName}.{ContentGeneratorConstants.Contracts}.{apiGroupName}"; + if (!requiredUsings.Contains(requiredUsing, StringComparer.CurrentCulture)) + { + requiredUsings.Add(requiredUsing); + } + } + } + + requiredUsings.AddRange(apiGroupNames.Select(x => $"{projectName}.{ContentGeneratorConstants.Endpoints}.{x}.{ContentGeneratorConstants.Interfaces}")); + + GlobalUsingsHelper.CreateOrUpdate( + logger, + ContentWriterArea.Src, + projectPath, + requiredUsings, + removeNamespaceGroupSeparatorInGlobalUsings); + } + + private void GenerateEnumerationType( + string enumerationName, + OpenApiSchema openApiSchemaEnumeration) + { + var fullNamespace = $"{projectName}.{ContentGeneratorConstants.Contracts}"; + + var enumParameters = ContentGeneratorServerClientEnumParametersFactory.Create( + codeGeneratorContentHeader, + fullNamespace, + codeGeneratorAttribute, + enumerationName, + openApiSchemaEnumeration.Enum); + + var contentGenerator = new GenerateContentForEnum( + new CodeDocumentationTagsGenerator(), + enumParameters); + + var content = contentGenerator.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + projectPath, + projectPath.CombineFileInfo(ContentGeneratorConstants.Contracts, ContentGeneratorConstants.SpecialFolderEnumerationTypes, $"{enumerationName}.cs"), + ContentWriterArea.Src, + content); + } + + private void GenerateModel( + string modelName, + OpenApiSchema apiSchemaModel, + string apiGroupName, + bool isSharedContract) + { + var fullNamespace = isSharedContract + ? $"{projectName}.{ContentGeneratorConstants.Contracts}" + : $"{projectName}.{ContentGeneratorConstants.Contracts}.{apiGroupName}"; + + var parameters = ContentGeneratorServerClientModelParametersFactory.CreateForClass( + codeGeneratorContentHeader, + fullNamespace, + codeGeneratorAttribute, + modelName, + apiSchemaModel, + includeDeprecated); + + var contentGeneratorClass = new GenerateContentForClass( + new CodeDocumentationTagsGenerator(), + parameters); + + var content = contentGeneratorClass.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + projectPath, + isSharedContract + ? projectPath.CombineFileInfo(ContentGeneratorConstants.Contracts, ContentGeneratorConstants.SpecialFolderSharedModels, $"{modelName}.cs") + : projectPath.CombineFileInfo(ContentGeneratorConstants.Contracts, apiGroupName, $"{modelName}.cs"), + ContentWriterArea.Src, + content); + } + + private static List GetDistinctApiOperationModels( + List apiOperations) + { + var result = new List(); + + foreach (var apiOperation in apiOperations) + { + var apiOperationModel = result.Find(x => x.Name.Equals(apiOperation.Model.Name, StringComparison.Ordinal)); + if (apiOperationModel is null) + { + result.Add(apiOperation.Model); + } + } + + return result; + } +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Client.CSharp/ProjectGenerator/IClientCSharpApiGenerator.cs b/src/Atc.Rest.ApiGenerator.Client.CSharp/ProjectGenerator/IClientCSharpApiGenerator.cs new file mode 100644 index 00000000..c18a961c --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Client.CSharp/ProjectGenerator/IClientCSharpApiGenerator.cs @@ -0,0 +1,34 @@ +namespace Atc.Rest.ApiGenerator.Client.CSharp.ProjectGenerator; + +/// +/// Interface: IClientCSharpApiGenerator +/// +/// +/// Method prefixes: +/// - Generate => Generate file and overwrite file if exists. +/// - Scaffold => Generate file if not exists. +/// - Maintain => Update file. +/// +public interface IClientCSharpApiGenerator +{ + string? ClientFolderName { get; set; } + + string HttpClientName { get; set; } + + Task ScaffoldProjectFile(); + + void GenerateModels(); + + void GenerateParameters(); + + void GenerateEndpointInterfaces(); + + void GenerateEndpoints(); + + void GenerateEndpointResultInterfaces(); + + void GenerateEndpointResults(); + + void MaintainGlobalUsings( + bool removeNamespaceGroupSeparatorInGlobalUsings); +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.CodingRules/Atc.Rest.ApiGenerator.CodingRules.csproj b/src/Atc.Rest.ApiGenerator.CodingRules/Atc.Rest.ApiGenerator.CodingRules.csproj index 40821de4..80d8d362 100644 --- a/src/Atc.Rest.ApiGenerator.CodingRules/Atc.Rest.ApiGenerator.CodingRules.csproj +++ b/src/Atc.Rest.ApiGenerator.CodingRules/Atc.Rest.ApiGenerator.CodingRules.csproj @@ -1,13 +1,13 @@ - net6.0 + net8.0 false - - + + diff --git a/src/Atc.Rest.ApiGenerator.CodingRules/AtcCodingRulesUpdater.cs b/src/Atc.Rest.ApiGenerator.CodingRules/AtcCodingRulesUpdater.cs index 6b6760f7..12dec118 100644 --- a/src/Atc.Rest.ApiGenerator.CodingRules/AtcCodingRulesUpdater.cs +++ b/src/Atc.Rest.ApiGenerator.CodingRules/AtcCodingRulesUpdater.cs @@ -9,7 +9,7 @@ public sealed partial class AtcCodingRulesUpdater : IAtcCodingRulesUpdater public const string GitRawContentUrl = "https://raw.githubusercontent.com"; public const string GitHubPrefix = "[silver][[GitHub]][/] "; - private const string RawCodingRulesDistributionUrl = "https://raw.githubusercontent.com/atc-net/atc-coding-rules/main/distribution/dotnet6"; + private const string RawCodingRulesDistributionUrl = "https://raw.githubusercontent.com/atc-net/atc-coding-rules/main/distribution/dotnet8"; public const string FileNameEditorConfig = ".editorconfig"; public const string FileNameDirectoryBuildProps = "Directory.Build.props"; @@ -20,13 +20,13 @@ public AtcCodingRulesUpdater( } public bool Scaffold( - string outputSlnPath, - DirectoryInfo outputSrcPath, - DirectoryInfo? outputTestPath) + string slnPath, + DirectoryInfo srcPath, + DirectoryInfo? testPath) { - var rootPath = outputSlnPath.EndsWith(".sln", StringComparison.OrdinalIgnoreCase) - ? new FileInfo(outputSlnPath).Directory - : new DirectoryInfo(outputSlnPath); + var rootPath = slnPath.EndsWith(".sln", StringComparison.OrdinalIgnoreCase) + ? new FileInfo(slnPath).Directory + : new DirectoryInfo(slnPath); if (rootPath is null) { @@ -38,19 +38,16 @@ public bool Scaffold( return true; } - HandleCodingRulesFiles(outputSrcPath, outputTestPath, rootPath); - HandleEditorConfigFiles(outputSrcPath, outputTestPath, rootPath); - HandleDirectoryBuildPropsFiles(outputSrcPath, outputTestPath, rootPath); + HandleCodingRulesFiles(srcPath, testPath, rootPath); + HandleEditorConfigFiles(srcPath, testPath, rootPath); + HandleDirectoryBuildPropsFiles(srcPath, testPath, rootPath); return true; } private static bool IsFirstTime( DirectoryInfo rootPath) - { - var file = new FileInfo(Path.Combine(rootPath.FullName, FileNameEditorConfig)); - return !file.Exists; - } + => !rootPath.CombineFileInfo(FileNameEditorConfig).Exists; private void HandleCodingRulesFiles( DirectoryInfo outputSrcPath, @@ -114,7 +111,7 @@ private void HandleAtcCodingRulesJson( { var sb = new StringBuilder(); sb.AppendLine("{"); - sb.AppendLine(" \"projectTarget\": \"DotNet6\","); + sb.AppendLine(" \"projectTarget\": \"DotNet8\","); sb.AppendLine(" \"mappings\": {"); sb.Append(" \"src\": { \"paths\": [ \""); @@ -161,7 +158,7 @@ private void HandleAtcCodingRulesPowerShell( sb.AppendLine("atc-coding-rules-updater run `"); sb.AppendLine(" -p $currentPath `"); sb.AppendLine(" --optionsPath $currentPath'\\atc-coding-rules-updater.json' `"); - sb.AppendLine(" -v true"); + sb.AppendLine(" --verbose"); File.WriteAllText(file, sb.ToString()); File.WriteAllText(filePath, sb.ToString()); logger.LogDebug($"{CodingRulesConstants.LogFileCreated} root: {file} created"); @@ -177,7 +174,7 @@ private void HandleFileEditorConfig( string area, string urlPart) { - var file = new FileInfo(Path.Combine(path.FullName, FileNameEditorConfig)); + var file = path.CombineFileInfo(FileNameEditorConfig); var rawGitUrl = string.IsNullOrEmpty(urlPart) ? $"{RawCodingRulesDistributionUrl}/{FileNameEditorConfig}" @@ -208,7 +205,7 @@ private void HandleFileDirectoryBuildProps( string area, string urlPart) { - var file = new FileInfo(Path.Combine(path.FullName, FileNameDirectoryBuildProps)); + var file = path.CombineFileInfo(FileNameDirectoryBuildProps); var rawGitUrl = string.IsNullOrEmpty(urlPart) ? $"{RawCodingRulesDistributionUrl}/{FileNameDirectoryBuildProps}" diff --git a/src/Atc.Rest.ApiGenerator.CodingRules/Extensions/ListExtensions.cs b/src/Atc.Rest.ApiGenerator.CodingRules/Extensions/ListExtensions.cs index 5cd4ef8b..f52600a5 100644 --- a/src/Atc.Rest.ApiGenerator.CodingRules/Extensions/ListExtensions.cs +++ b/src/Atc.Rest.ApiGenerator.CodingRules/Extensions/ListExtensions.cs @@ -13,7 +13,7 @@ public static void TrimEndForEmptyValues( } else { - var lastLine = values.Last().Trim(); + var lastLine = values[^1].Trim(); if (lastLine.Length == 0) { values.RemoveAt(values.Count - 1); diff --git a/src/Atc.Rest.ApiGenerator.CodingRules/Extensions/StringExtensions.cs b/src/Atc.Rest.ApiGenerator.CodingRules/Extensions/StringExtensions.cs index 59248c27..9c7c2546 100644 --- a/src/Atc.Rest.ApiGenerator.CodingRules/Extensions/StringExtensions.cs +++ b/src/Atc.Rest.ApiGenerator.CodingRules/Extensions/StringExtensions.cs @@ -2,7 +2,7 @@ namespace Atc.Rest.ApiGenerator.CodingRules.Extensions; public static class StringExtensions { - private static readonly string[] LineBreaks = { "\r\n", "\r", "\n" }; + private static readonly string[] LineBreaks = ["\r\n", "\r", "\n"]; public static string TrimEndForEmptyLines( this string value) diff --git a/src/Atc.Rest.ApiGenerator.CodingRules/IAtcCodingRulesUpdater.cs b/src/Atc.Rest.ApiGenerator.CodingRules/IAtcCodingRulesUpdater.cs index 49930d34..40c88b6b 100644 --- a/src/Atc.Rest.ApiGenerator.CodingRules/IAtcCodingRulesUpdater.cs +++ b/src/Atc.Rest.ApiGenerator.CodingRules/IAtcCodingRulesUpdater.cs @@ -3,7 +3,7 @@ namespace Atc.Rest.ApiGenerator.CodingRules; public interface IAtcCodingRulesUpdater { bool Scaffold( - string outputSlnPath, - DirectoryInfo outputSrcPath, - DirectoryInfo? outputTestPath); + string slnPath, + DirectoryInfo srcPath, + DirectoryInfo? testPath); } \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Contracts/.editorconfig b/src/Atc.Rest.ApiGenerator.Contracts/.editorconfig similarity index 100% rename from src/Atc.Rest.ApiGenerator.Framework.Contracts/.editorconfig rename to src/Atc.Rest.ApiGenerator.Contracts/.editorconfig diff --git a/src/Atc.Rest.ApiGenerator.Contracts/Atc.Rest.ApiGenerator.Contracts.csproj b/src/Atc.Rest.ApiGenerator.Contracts/Atc.Rest.ApiGenerator.Contracts.csproj new file mode 100644 index 00000000..8c4585ff --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Contracts/Atc.Rest.ApiGenerator.Contracts.csproj @@ -0,0 +1,13 @@ + + + + net8.0 + false + + + + + + + + diff --git a/src/Atc.Rest.ApiGenerator.Framework.Contracts/ContentGeneratorConstants.cs b/src/Atc.Rest.ApiGenerator.Contracts/ContentGeneratorConstants.cs similarity index 91% rename from src/Atc.Rest.ApiGenerator.Framework.Contracts/ContentGeneratorConstants.cs rename to src/Atc.Rest.ApiGenerator.Contracts/ContentGeneratorConstants.cs index 2b56b554..4a1a4e04 100644 --- a/src/Atc.Rest.ApiGenerator.Framework.Contracts/ContentGeneratorConstants.cs +++ b/src/Atc.Rest.ApiGenerator.Contracts/ContentGeneratorConstants.cs @@ -1,10 +1,11 @@ -namespace Atc.Rest.ApiGenerator.Framework.Contracts; +namespace Atc.Rest.ApiGenerator.Contracts; public static class ContentGeneratorConstants { public const string Contracts = "Contracts"; public const string Controller = "Controller"; public const string Endpoint = "Endpoint"; + public const string EndpointDefinition = "EndpointDefinition"; public const string Endpoints = "Endpoints"; public const string EndpointResult = "EndpointResult"; public const string EndpointResponse = "EndpointResponse"; diff --git a/src/Atc.Rest.ApiGenerator.Contracts/ContentGeneratorsParameters/Client/ContentGeneratorClientEndpointParameters.cs b/src/Atc.Rest.ApiGenerator.Contracts/ContentGeneratorsParameters/Client/ContentGeneratorClientEndpointParameters.cs new file mode 100644 index 00000000..9d6b7fa5 --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Contracts/ContentGeneratorsParameters/Client/ContentGeneratorClientEndpointParameters.cs @@ -0,0 +1,22 @@ +namespace Atc.Rest.ApiGenerator.Contracts.ContentGeneratorsParameters.Client; + +public record ContentGeneratorClientEndpointParameters( + string Namespace, + string HttpMethod, + string OperationName, + CodeDocumentationTags DocumentationTags, + string HttpClientName, + string UrlPath, + string EndpointName, + string InterfaceName, + string ResultName, + string? ParameterName, + ApiAuthorizeModel? Authorization, + IList ResponseModels, + IList? Parameters); + +public record ContentGeneratorClientEndpointParametersParameters( + string Name, + string ParameterName, + ParameterLocationType ParameterLocationType, + bool IsList); \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Contracts/ContentGeneratorsParameters/Client/ContentGeneratorClientEndpointResultInterfaceParameters.cs b/src/Atc.Rest.ApiGenerator.Contracts/ContentGeneratorsParameters/Client/ContentGeneratorClientEndpointResultInterfaceParameters.cs new file mode 100644 index 00000000..75fdd666 --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Contracts/ContentGeneratorsParameters/Client/ContentGeneratorClientEndpointResultInterfaceParameters.cs @@ -0,0 +1,16 @@ +namespace Atc.Rest.ApiGenerator.Contracts.ContentGeneratorsParameters.Client; + +public record ContentGeneratorClientEndpointResultInterfaceParameters( + string Namespace, + string OperationName, + CodeDocumentationTags DocumentationTags, + string InterfaceName, + string InheritInterfaceName, + bool HasParameterType, + ApiAuthorizeModel? Authorization, + IList ResponseModels); + +public record ContentGeneratorClientEndpointResultInterfaceParametersParameters( + string Name, + string ParameterName, + ParameterLocationType ParameterLocationType); \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Contracts/ContentGeneratorsParameters/Client/ContentGeneratorClientEndpointResultParameters.cs b/src/Atc.Rest.ApiGenerator.Contracts/ContentGeneratorsParameters/Client/ContentGeneratorClientEndpointResultParameters.cs new file mode 100644 index 00000000..68323ef1 --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Contracts/ContentGeneratorsParameters/Client/ContentGeneratorClientEndpointResultParameters.cs @@ -0,0 +1,18 @@ +namespace Atc.Rest.ApiGenerator.Contracts.ContentGeneratorsParameters.Client; + +public record ContentGeneratorClientEndpointResultParameters( + string Namespace, + string OperationName, + CodeDocumentationTags DocumentationTags, + string EndpointResultName, + string EndpointResultInterfaceName, + string InheritClassName, + bool HasParameterType, + ApiAuthorizeModel? Authorization, + IList ResponseModels, + IList? Parameters); + +public record ContentGeneratorClientEndpointResultParametersParameters( + string Name, + string ParameterName, + ParameterLocationType ParameterLocationType); \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Contracts/ContentGeneratorsParameters/Client/ContentGeneratorClientParameterParameters.cs b/src/Atc.Rest.ApiGenerator.Contracts/ContentGeneratorsParameters/Client/ContentGeneratorClientParameterParameters.cs similarity index 87% rename from src/Atc.Rest.ApiGenerator.Framework.Contracts/ContentGeneratorsParameters/Client/ContentGeneratorClientParameterParameters.cs rename to src/Atc.Rest.ApiGenerator.Contracts/ContentGeneratorsParameters/Client/ContentGeneratorClientParameterParameters.cs index 46c3058f..103de5ad 100644 --- a/src/Atc.Rest.ApiGenerator.Framework.Contracts/ContentGeneratorsParameters/Client/ContentGeneratorClientParameterParameters.cs +++ b/src/Atc.Rest.ApiGenerator.Contracts/ContentGeneratorsParameters/Client/ContentGeneratorClientParameterParameters.cs @@ -1,4 +1,4 @@ -namespace Atc.Rest.ApiGenerator.Framework.Contracts.ContentGeneratorsParameters.Client; +namespace Atc.Rest.ApiGenerator.Contracts.ContentGeneratorsParameters.Client; public record ContentGeneratorClientParameterParameters( string Namespace, diff --git a/src/Atc.Rest.ApiGenerator.Contracts/ContentGeneratorsParameters/ContentGeneratorBaseParameters.cs b/src/Atc.Rest.ApiGenerator.Contracts/ContentGeneratorsParameters/ContentGeneratorBaseParameters.cs new file mode 100644 index 00000000..2ac6c4e7 --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Contracts/ContentGeneratorsParameters/ContentGeneratorBaseParameters.cs @@ -0,0 +1,4 @@ +namespace Atc.Rest.ApiGenerator.Contracts.ContentGeneratorsParameters; + +public record ContentGeneratorBaseParameters( + string Namespace); \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Contracts/ContentGeneratorsParameters/GeneratedCodeGeneratorParameters.cs b/src/Atc.Rest.ApiGenerator.Contracts/ContentGeneratorsParameters/GeneratedCodeGeneratorParameters.cs new file mode 100644 index 00000000..d0545d0e --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Contracts/ContentGeneratorsParameters/GeneratedCodeGeneratorParameters.cs @@ -0,0 +1,4 @@ +namespace Atc.Rest.ApiGenerator.Contracts.ContentGeneratorsParameters; + +public record GeneratedCodeGeneratorParameters( + Version ApiGeneratorVersion); \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Contracts/ContentGeneratorsParameters/Server/ContentGeneratorServerParameterParameters.cs b/src/Atc.Rest.ApiGenerator.Contracts/ContentGeneratorsParameters/Server/ContentGeneratorServerParameterParameters.cs similarity index 88% rename from src/Atc.Rest.ApiGenerator.Framework.Contracts/ContentGeneratorsParameters/Server/ContentGeneratorServerParameterParameters.cs rename to src/Atc.Rest.ApiGenerator.Contracts/ContentGeneratorsParameters/Server/ContentGeneratorServerParameterParameters.cs index 5c43ef20..d2d6f05b 100644 --- a/src/Atc.Rest.ApiGenerator.Framework.Contracts/ContentGeneratorsParameters/Server/ContentGeneratorServerParameterParameters.cs +++ b/src/Atc.Rest.ApiGenerator.Contracts/ContentGeneratorsParameters/Server/ContentGeneratorServerParameterParameters.cs @@ -1,4 +1,4 @@ -namespace Atc.Rest.ApiGenerator.Framework.Contracts.ContentGeneratorsParameters.Server; +namespace Atc.Rest.ApiGenerator.Contracts.ContentGeneratorsParameters.Server; public record ContentGeneratorServerParameterParameters( string Namespace, diff --git a/src/Atc.Rest.ApiGenerator.Contracts/ContentGeneratorsParameters/Server/ContentGeneratorServerRegistrationParameters.cs b/src/Atc.Rest.ApiGenerator.Contracts/ContentGeneratorsParameters/Server/ContentGeneratorServerRegistrationParameters.cs new file mode 100644 index 00000000..8c405eb9 --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Contracts/ContentGeneratorsParameters/Server/ContentGeneratorServerRegistrationParameters.cs @@ -0,0 +1,5 @@ +namespace Atc.Rest.ApiGenerator.Contracts.ContentGeneratorsParameters.Server; + +public record ContentGeneratorServerRegistrationParameters( + string Namespace, + string RegistrationName); \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Contracts/ContentGeneratorsParameters/Server/ContentGeneratorServerResultParameters.cs b/src/Atc.Rest.ApiGenerator.Contracts/ContentGeneratorsParameters/Server/ContentGeneratorServerResultParameters.cs new file mode 100644 index 00000000..e736c1aa --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Contracts/ContentGeneratorsParameters/Server/ContentGeneratorServerResultParameters.cs @@ -0,0 +1,17 @@ +namespace Atc.Rest.ApiGenerator.Contracts.ContentGeneratorsParameters.Server; + +public record ContentGeneratorServerResultParameters( + string Namespace, + string OperationName, + CodeDocumentationTags DocumentationTags, + string ResultName, + IList MethodParameters, + ContentGeneratorServerResultImplicitOperatorParameters? ImplicitOperatorParameters); + +public record ContentGeneratorServerResultMethodParameters( + CodeDocumentationTags DocumentationTags, + ApiOperationResponseModel ResponseModel); + +public record ContentGeneratorServerResultImplicitOperatorParameters( + string? CollectionDataType, + string? DataType); \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Contracts/ContentGeneratorsParameters/Server/ContentGeneratorServerSwaggerDocOptionsParameters.cs b/src/Atc.Rest.ApiGenerator.Contracts/ContentGeneratorsParameters/Server/ContentGeneratorServerSwaggerDocOptionsParameters.cs similarity index 82% rename from src/Atc.Rest.ApiGenerator.Framework.Contracts/ContentGeneratorsParameters/Server/ContentGeneratorServerSwaggerDocOptionsParameters.cs rename to src/Atc.Rest.ApiGenerator.Contracts/ContentGeneratorsParameters/Server/ContentGeneratorServerSwaggerDocOptionsParameters.cs index 9a657a47..3e940a18 100644 --- a/src/Atc.Rest.ApiGenerator.Framework.Contracts/ContentGeneratorsParameters/Server/ContentGeneratorServerSwaggerDocOptionsParameters.cs +++ b/src/Atc.Rest.ApiGenerator.Contracts/ContentGeneratorsParameters/Server/ContentGeneratorServerSwaggerDocOptionsParameters.cs @@ -1,4 +1,4 @@ -namespace Atc.Rest.ApiGenerator.Framework.Contracts.ContentGeneratorsParameters.Server; +namespace Atc.Rest.ApiGenerator.Contracts.ContentGeneratorsParameters.Server; public record ContentGeneratorServerSwaggerDocOptionsParameters( string Namespace, diff --git a/src/Atc.Rest.ApiGenerator.Contracts/ContentGeneratorsParameters/Server/ContentGeneratorServerWebApiStartupFactoryParameters.cs b/src/Atc.Rest.ApiGenerator.Contracts/ContentGeneratorsParameters/Server/ContentGeneratorServerWebApiStartupFactoryParameters.cs new file mode 100644 index 00000000..b183e9fb --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Contracts/ContentGeneratorsParameters/Server/ContentGeneratorServerWebApiStartupFactoryParameters.cs @@ -0,0 +1,5 @@ +namespace Atc.Rest.ApiGenerator.Contracts.ContentGeneratorsParameters.Server; + +public record ContentGeneratorServerWebApiStartupFactoryParameters( + string Namespace, + CodeDocumentationTags DocumentationTags); \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Contracts/Extensions/ApiOperationResponseModelExtensions.cs b/src/Atc.Rest.ApiGenerator.Contracts/Extensions/ApiOperationResponseModelExtensions.cs new file mode 100644 index 00000000..1e2d0fe4 --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Contracts/Extensions/ApiOperationResponseModelExtensions.cs @@ -0,0 +1,159 @@ +namespace Atc.Rest.ApiGenerator.Contracts.Extensions; + +public static class ApiOperationResponseModelExtensions +{ + public static IEnumerable AppendUnauthorizedIfNeeded( + this IEnumerable responseModels, + ApiAuthorizeModel? authorization) + { + if (authorization is null) + { + return responseModels; + } + + var models = responseModels.ToList(); + + if (models.TrueForAll(x => x.StatusCode != HttpStatusCode.Unauthorized) && + !authorization.UseAllowAnonymous) + { + models.Add( + new ApiOperationResponseModel( + HttpStatusCode.Unauthorized, + OperationName: "DummyOperation", + GroupName: null, + MediaType: null, + CollectionDataType: null, + DataType: null, + Description: null)); + } + + return models; + } + + public static IEnumerable AppendForbiddenIfNeeded( + this IEnumerable responseModels, + ApiAuthorizeModel? authorization) + { + if (authorization is null) + { + return responseModels; + } + + var models = responseModels.ToList(); + + if (models.TrueForAll(x => x.StatusCode != HttpStatusCode.Forbidden) && + authorization is + { + UseAllowAnonymous: false, + Roles.Count: > 0 + }) + { + models.Add( + new ApiOperationResponseModel( + HttpStatusCode.Forbidden, + OperationName: "DummyOperation", + GroupName: null, + MediaType: null, + CollectionDataType: null, + DataType: null, + Description: null)); + } + + return models; + } + + public static IEnumerable AppendBadRequestIfNeeded( + this IEnumerable responseModels, + bool hasParameterType) + { + var models = responseModels.ToList(); + + if (hasParameterType && + models.TrueForAll(x => x.StatusCode != HttpStatusCode.BadRequest)) + { + models.Add( + new ApiOperationResponseModel( + HttpStatusCode.BadRequest, + OperationName: "DummyOperation", + GroupName: null, + MediaType: null, + CollectionDataType: null, + DataType: null, + Description: null)); + } + + return models; + } + + public static IEnumerable AppendBadRequestIfNeeded( + this IEnumerable responseModels, + string? parameterTypeName) + { + var models = responseModels.ToList(); + + if (models.TrueForAll(x => x.StatusCode != HttpStatusCode.BadRequest) && + parameterTypeName is not null) + { + models.Add( + new ApiOperationResponseModel( + HttpStatusCode.BadRequest, + OperationName: "DummyOperation", + GroupName: null, + MediaType: null, + CollectionDataType: null, + DataType: null, + Description: null)); + } + + return models; + } + + public static IEnumerable AdjustNamespacesIfNeeded( + this IEnumerable responseModels, + IList operationSchemaMappings) + { + if (responseModels is null) + { + return Array.Empty(); + } + + var models = new List(); + foreach (var model in responseModels) + { + if (model.DataType is not null && + IsWellKnownSystemTypeName(model.DataType)) + { + var operationSchemaMapping = operationSchemaMappings.First(x => x.Model.Name == model.DataType); + if (operationSchemaMapping.Model.IsShared) + { + models.Add( + model with + { + DataType = $"{ContentGeneratorConstants.Contracts}.{model.DataType}", + }); + } + else + { + models.Add( + model with + { + DataType = $"{ContentGeneratorConstants.Contracts}.{operationSchemaMapping.ApiGroupName}.{model.DataType}", + }); + } + } + else + { + models.Add(model); + } + } + + return models; + } + + private static bool IsWellKnownSystemTypeName( + string value) + => value.EndsWith("Task", StringComparison.Ordinal) || + value.EndsWith("Tasks", StringComparison.Ordinal) || + value.EndsWith("Endpoint", StringComparison.Ordinal) || + value.EndsWith("EventArgs", StringComparison.Ordinal); +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Contracts/Extensions/ApiOperationSchemaMapExtensions.cs b/src/Atc.Rest.ApiGenerator.Contracts/Extensions/ApiOperationSchemaMapExtensions.cs similarity index 86% rename from src/Atc.Rest.ApiGenerator.Framework.Contracts/Extensions/ApiOperationSchemaMapExtensions.cs rename to src/Atc.Rest.ApiGenerator.Contracts/Extensions/ApiOperationSchemaMapExtensions.cs index c438dbbf..5836f774 100644 --- a/src/Atc.Rest.ApiGenerator.Framework.Contracts/Extensions/ApiOperationSchemaMapExtensions.cs +++ b/src/Atc.Rest.ApiGenerator.Contracts/Extensions/ApiOperationSchemaMapExtensions.cs @@ -1,4 +1,4 @@ -namespace Atc.Rest.ApiGenerator.Framework.Contracts.Extensions; +namespace Atc.Rest.ApiGenerator.Contracts.Extensions; public static class ApiOperationSchemaMapExtensions { diff --git a/src/Atc.Rest.ApiGenerator.Contracts/GlobalUsings.cs b/src/Atc.Rest.ApiGenerator.Contracts/GlobalUsings.cs new file mode 100644 index 00000000..d23fac09 --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Contracts/GlobalUsings.cs @@ -0,0 +1,6 @@ +global using System.ComponentModel.DataAnnotations; +global using System.Diagnostics.CodeAnalysis; +global using System.Net; + +global using Atc.CodeDocumentation.CodeComment; +global using Atc.Rest.ApiGenerator.Contracts.Models; \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Contracts/Models/ApiAuthorizeModel.cs b/src/Atc.Rest.ApiGenerator.Contracts/Models/ApiAuthorizeModel.cs new file mode 100644 index 00000000..6f2946af --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Contracts/Models/ApiAuthorizeModel.cs @@ -0,0 +1,6 @@ +namespace Atc.Rest.ApiGenerator.Contracts.Models; + +public record ApiAuthorizeModel( + IList? Roles, + IList? AuthenticationSchemes, + bool UseAllowAnonymous); \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Contracts/Models/ApiOperation.cs b/src/Atc.Rest.ApiGenerator.Contracts/Models/ApiOperation.cs similarity index 81% rename from src/Atc.Rest.ApiGenerator.Framework.Contracts/Models/ApiOperation.cs rename to src/Atc.Rest.ApiGenerator.Contracts/Models/ApiOperation.cs index 3a0cbcdc..a746dd45 100644 --- a/src/Atc.Rest.ApiGenerator.Framework.Contracts/Models/ApiOperation.cs +++ b/src/Atc.Rest.ApiGenerator.Contracts/Models/ApiOperation.cs @@ -1,4 +1,4 @@ -namespace Atc.Rest.ApiGenerator.Framework.Contracts.Models; +namespace Atc.Rest.ApiGenerator.Contracts.Models; public sealed class ApiOperation { @@ -63,8 +63,14 @@ private bool Equals( private static string ExtractApiGroupName( string path) - => path - .Split('/', StringSplitOptions.RemoveEmptyEntries) - .First() - .PascalCase(removeSeparators: true); + { + var sa = path.Split('/', StringSplitOptions.RemoveEmptyEntries); + return sa.Length switch + { + 0 => "Root", + > 2 when sa[0].Equals("api", StringComparison.OrdinalIgnoreCase) && + sa[1].StartsWith("v", StringComparison.OrdinalIgnoreCase) => sa[2].PascalCase(removeSeparators: true), + _ => sa[0].PascalCase(removeSeparators: true), + }; + } } \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Contracts/Models/ApiOperationModel.cs b/src/Atc.Rest.ApiGenerator.Contracts/Models/ApiOperationModel.cs similarity index 78% rename from src/Atc.Rest.ApiGenerator.Framework.Contracts/Models/ApiOperationModel.cs rename to src/Atc.Rest.ApiGenerator.Contracts/Models/ApiOperationModel.cs index fa402457..63b1e152 100644 --- a/src/Atc.Rest.ApiGenerator.Framework.Contracts/Models/ApiOperationModel.cs +++ b/src/Atc.Rest.ApiGenerator.Contracts/Models/ApiOperationModel.cs @@ -1,4 +1,4 @@ -namespace Atc.Rest.ApiGenerator.Framework.Contracts.Models; +namespace Atc.Rest.ApiGenerator.Contracts.Models; public sealed class ApiOperationModel { @@ -10,6 +10,8 @@ public sealed class ApiOperationModel public bool UsesIFormFile { get; set; } + public ApiAuthorizeModel? Authorization { get; set; } + public override string ToString() => $"{nameof(Name)}: {Name}, {nameof(IsEnum)}: {IsEnum}, {nameof(IsShared)}: {IsShared}, {nameof(UsesIFormFile)}: {UsesIFormFile}"; } \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Contracts/Models/ApiOperationResponseModel.cs b/src/Atc.Rest.ApiGenerator.Contracts/Models/ApiOperationResponseModel.cs new file mode 100644 index 00000000..d3828317 --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Contracts/Models/ApiOperationResponseModel.cs @@ -0,0 +1,10 @@ +namespace Atc.Rest.ApiGenerator.Contracts.Models; + +public record ApiOperationResponseModel( + HttpStatusCode StatusCode, + string OperationName, + string? GroupName, + string? MediaType, + string? CollectionDataType, + string? DataType, + string? Description); \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Contracts/Options/ApiOptionsValidation.cs b/src/Atc.Rest.ApiGenerator.Contracts/Options/ApiOptionsValidation.cs similarity index 86% rename from src/Atc.Rest.ApiGenerator.Framework.Contracts/Options/ApiOptionsValidation.cs rename to src/Atc.Rest.ApiGenerator.Contracts/Options/ApiOptionsValidation.cs index 8ae1638a..9eb49e0b 100644 --- a/src/Atc.Rest.ApiGenerator.Framework.Contracts/Options/ApiOptionsValidation.cs +++ b/src/Atc.Rest.ApiGenerator.Contracts/Options/ApiOptionsValidation.cs @@ -1,4 +1,4 @@ -namespace Atc.Rest.ApiGenerator.Framework.Contracts.Options; +namespace Atc.Rest.ApiGenerator.Contracts.Options; public class ApiOptionsValidation { diff --git a/src/Atc.Rest.ApiGenerator.Framework.Contracts/Resolver/OpenApiDocumentSchemaModelNameResolver.cs b/src/Atc.Rest.ApiGenerator.Contracts/Resolver/OpenApiDocumentSchemaModelNameResolver.cs similarity index 90% rename from src/Atc.Rest.ApiGenerator.Framework.Contracts/Resolver/OpenApiDocumentSchemaModelNameResolver.cs rename to src/Atc.Rest.ApiGenerator.Contracts/Resolver/OpenApiDocumentSchemaModelNameResolver.cs index 027d4e80..89708e77 100644 --- a/src/Atc.Rest.ApiGenerator.Framework.Contracts/Resolver/OpenApiDocumentSchemaModelNameResolver.cs +++ b/src/Atc.Rest.ApiGenerator.Contracts/Resolver/OpenApiDocumentSchemaModelNameResolver.cs @@ -1,6 +1,6 @@ // ReSharper disable ReplaceSubstringWithRangeIndexer // ReSharper disable InvertIf -namespace Atc.Rest.ApiGenerator.Framework.Contracts.Resolver; +namespace Atc.Rest.ApiGenerator.Contracts.Resolver; public static class OpenApiDocumentSchemaModelNameResolver { @@ -13,11 +13,11 @@ public static string GetRawModelName( } var s = modelName; - var indexEnd = s.IndexOf(">", StringComparison.Ordinal); + var indexEnd = s.IndexOf('>', StringComparison.Ordinal); if (indexEnd != -1) { s = s.Substring(0, indexEnd); - s = s.Substring(s.IndexOf("<", StringComparison.Ordinal) + 1); + s = s.Substring(s.IndexOf('<', StringComparison.Ordinal) + 1); } if (s.Contains('.', StringComparison.Ordinal)) @@ -45,7 +45,7 @@ public static string EnsureModelNameWithNamespaceIfNeeded( if (isModelNameInNamespace) { return isClient - ? $"{ContentGeneratorConstants.Contracts}.{modelName}" + ? $"{ContentGeneratorConstants.Contracts}.{apiGroupName}.{modelName}" : $"{projectName}.{ContentGeneratorConstants.Contracts}.{apiGroupName}.{modelName}"; } @@ -60,7 +60,7 @@ public static string EnsureModelNameWithNamespaceIfNeeded( if (isClient) { - return $"{ContentGeneratorConstants.Contracts}.{modelName}"; + return $"{ContentGeneratorConstants.Contracts}.{apiGroupName}.{modelName}"; } return $"{projectName}.{ContentGeneratorConstants.Contracts}.{apiGroupName}.{modelName}"; diff --git a/src/Atc.Rest.ApiGenerator.Contracts/_Enums/ApiSchemaMapLocatedAreaType.cs b/src/Atc.Rest.ApiGenerator.Contracts/_Enums/ApiSchemaMapLocatedAreaType.cs new file mode 100644 index 00000000..2a0d0ce8 --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Contracts/_Enums/ApiSchemaMapLocatedAreaType.cs @@ -0,0 +1,9 @@ +// ReSharper disable CheckNamespace +namespace Atc.Rest.ApiGenerator.Contracts; + +public enum ApiSchemaMapLocatedAreaType +{ + Parameter, + RequestBody, + Response, +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Contracts/_Enums/AspNetOutputType.cs b/src/Atc.Rest.ApiGenerator.Contracts/_Enums/AspNetOutputType.cs new file mode 100644 index 00000000..140967aa --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Contracts/_Enums/AspNetOutputType.cs @@ -0,0 +1,8 @@ +// ReSharper disable CheckNamespace +namespace Atc.Rest.ApiGenerator.Contracts; + +public enum AspNetOutputType +{ + Mvc, + MinimalApi, +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Contracts/_Enums/CardinalityType.cs b/src/Atc.Rest.ApiGenerator.Contracts/_Enums/CardinalityType.cs similarity index 79% rename from src/Atc.Rest.ApiGenerator.Framework.Contracts/_Enums/CardinalityType.cs rename to src/Atc.Rest.ApiGenerator.Contracts/_Enums/CardinalityType.cs index d30ff285..7eba8a67 100644 --- a/src/Atc.Rest.ApiGenerator.Framework.Contracts/_Enums/CardinalityType.cs +++ b/src/Atc.Rest.ApiGenerator.Contracts/_Enums/CardinalityType.cs @@ -1,5 +1,5 @@ // ReSharper disable CheckNamespace -namespace Atc.Rest.ApiGenerator.Framework.Contracts; +namespace Atc.Rest.ApiGenerator.Contracts; [SuppressMessage("Naming", "CA1720:Identifier contains type name", Justification = "OK.")] public enum CardinalityType diff --git a/src/Atc.Rest.ApiGenerator.Framework.Contracts/_Enums/HttpOperationType.cs b/src/Atc.Rest.ApiGenerator.Contracts/_Enums/HttpOperationType.cs similarity index 94% rename from src/Atc.Rest.ApiGenerator.Framework.Contracts/_Enums/HttpOperationType.cs rename to src/Atc.Rest.ApiGenerator.Contracts/_Enums/HttpOperationType.cs index 14d8ae9b..7fb15c00 100644 --- a/src/Atc.Rest.ApiGenerator.Framework.Contracts/_Enums/HttpOperationType.cs +++ b/src/Atc.Rest.ApiGenerator.Contracts/_Enums/HttpOperationType.cs @@ -1,5 +1,5 @@ // ReSharper disable CheckNamespace -namespace Atc.Rest.ApiGenerator.Framework.Contracts; +namespace Atc.Rest.ApiGenerator.Contracts; /// /// Http Operation type. diff --git a/src/Atc.Rest.ApiGenerator.Framework.Contracts/_Enums/ParameterLocationType.cs b/src/Atc.Rest.ApiGenerator.Contracts/_Enums/ParameterLocationType.cs similarity index 94% rename from src/Atc.Rest.ApiGenerator.Framework.Contracts/_Enums/ParameterLocationType.cs rename to src/Atc.Rest.ApiGenerator.Contracts/_Enums/ParameterLocationType.cs index 7822c016..eb9e346a 100644 --- a/src/Atc.Rest.ApiGenerator.Framework.Contracts/_Enums/ParameterLocationType.cs +++ b/src/Atc.Rest.ApiGenerator.Contracts/_Enums/ParameterLocationType.cs @@ -1,5 +1,5 @@ // ReSharper disable CheckNamespace -namespace Atc.Rest.ApiGenerator.Framework.Contracts; +namespace Atc.Rest.ApiGenerator.Contracts; /// /// The location of the parameter. diff --git a/src/Atc.Rest.ApiGenerator.Framework.Contracts/_Enums/SchemaType.cs b/src/Atc.Rest.ApiGenerator.Contracts/_Enums/SchemaType.cs similarity index 83% rename from src/Atc.Rest.ApiGenerator.Framework.Contracts/_Enums/SchemaType.cs rename to src/Atc.Rest.ApiGenerator.Contracts/_Enums/SchemaType.cs index e0f315ff..1636f7f0 100644 --- a/src/Atc.Rest.ApiGenerator.Framework.Contracts/_Enums/SchemaType.cs +++ b/src/Atc.Rest.ApiGenerator.Contracts/_Enums/SchemaType.cs @@ -1,5 +1,5 @@ // ReSharper disable CheckNamespace -namespace Atc.Rest.ApiGenerator.Framework.Contracts; +namespace Atc.Rest.ApiGenerator.Contracts; public enum SchemaType { diff --git a/src/Atc.Rest.ApiGenerator.Contracts/_Enums/SwaggerThemeMode.cs b/src/Atc.Rest.ApiGenerator.Contracts/_Enums/SwaggerThemeMode.cs new file mode 100644 index 00000000..defd085b --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Contracts/_Enums/SwaggerThemeMode.cs @@ -0,0 +1,10 @@ +// ReSharper disable CheckNamespace +namespace Atc.Rest.ApiGenerator.Contracts; + +public enum SwaggerThemeMode +{ + None, + Default, + Light, + Dark, +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Contracts/Atc.Rest.ApiGenerator.Framework.Contracts.csproj b/src/Atc.Rest.ApiGenerator.Framework.Contracts/Atc.Rest.ApiGenerator.Framework.Contracts.csproj deleted file mode 100644 index d61557a0..00000000 --- a/src/Atc.Rest.ApiGenerator.Framework.Contracts/Atc.Rest.ApiGenerator.Framework.Contracts.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - net6.0 - false - - - - - - - - diff --git a/src/Atc.Rest.ApiGenerator.Framework.Contracts/ContentGeneratorsParameters/Client/ContentGeneratorClientEndpointParameters.cs b/src/Atc.Rest.ApiGenerator.Framework.Contracts/ContentGeneratorsParameters/Client/ContentGeneratorClientEndpointParameters.cs deleted file mode 100644 index 02346f04..00000000 --- a/src/Atc.Rest.ApiGenerator.Framework.Contracts/ContentGeneratorsParameters/Client/ContentGeneratorClientEndpointParameters.cs +++ /dev/null @@ -1,28 +0,0 @@ -namespace Atc.Rest.ApiGenerator.Framework.Contracts.ContentGeneratorsParameters.Client; - -public record ContentGeneratorClientEndpointParameters( - string Namespace, - string HttpMethod, - string OperationName, - CodeDocumentationTags DocumentationTagsForClass, - string HttpClientName, - string UrlPath, - string EndpointName, - string InterfaceName, - string ResultName, - string? ParameterName, - string? SuccessResponseName, - HttpStatusCode? SuccessResponseStatusCode, - bool UseListForModel, - IList ErrorResponses, - IList? Parameters); - -public record ContentGeneratorClientEndpointErrorResponsesParameters( - string ResponseType, - HttpStatusCode StatusCode); - -public record ContentGeneratorClientEndpointParametersParameters( - string Name, - string ParameterName, - ParameterLocationType ParameterLocationType, - bool IsList); \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Contracts/ContentGeneratorsParameters/Client/ContentGeneratorClientEndpointResultInterfaceParameters.cs b/src/Atc.Rest.ApiGenerator.Framework.Contracts/ContentGeneratorsParameters/Client/ContentGeneratorClientEndpointResultInterfaceParameters.cs deleted file mode 100644 index c96801bc..00000000 --- a/src/Atc.Rest.ApiGenerator.Framework.Contracts/ContentGeneratorsParameters/Client/ContentGeneratorClientEndpointResultInterfaceParameters.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace Atc.Rest.ApiGenerator.Framework.Contracts.ContentGeneratorsParameters.Client; - -public record ContentGeneratorClientEndpointResultInterfaceParameters( - string Namespace, - string OperationName, - CodeDocumentationTags DocumentationTagsForClass, - string InterfaceName, - string InheritInterfaceName, - string? SuccessResponseName, - bool UseProblemDetailsAsDefaultBody, - bool UseListForModel, - IList ErrorResponses); - -public record ContentGeneratorClientEndpointResultInterfaceErrorResponsesParameters( - string ResponseType, - HttpStatusCode StatusCode); - -public record ContentGeneratorClientEndpointResultInterfaceParametersParameters( - string Name, - string ParameterName, - ParameterLocationType ParameterLocationType); \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Contracts/ContentGeneratorsParameters/Client/ContentGeneratorClientEndpointResultParameters.cs b/src/Atc.Rest.ApiGenerator.Framework.Contracts/ContentGeneratorsParameters/Client/ContentGeneratorClientEndpointResultParameters.cs deleted file mode 100644 index 038e3ccf..00000000 --- a/src/Atc.Rest.ApiGenerator.Framework.Contracts/ContentGeneratorsParameters/Client/ContentGeneratorClientEndpointResultParameters.cs +++ /dev/null @@ -1,23 +0,0 @@ -namespace Atc.Rest.ApiGenerator.Framework.Contracts.ContentGeneratorsParameters.Client; - -public record ContentGeneratorClientEndpointResultParameters( - string Namespace, - string OperationName, - CodeDocumentationTags DocumentationTagsForClass, - string EndpointResultName, - string EndpointResultInterfaceName, - string InheritClassName, - string? SuccessResponseName, - bool UseProblemDetailsAsDefaultBody, - bool UseListForModel, - IList ErrorResponses, - IList? Parameters); - -public record ContentGeneratorClientEndpointResultErrorResponsesParameters( - string ResponseType, - HttpStatusCode StatusCode); - -public record ContentGeneratorClientEndpointResultParametersParameters( - string Name, - string ParameterName, - ParameterLocationType ParameterLocationType); \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Contracts/ContentGeneratorsParameters/ContentGeneratorBaseParameters.cs b/src/Atc.Rest.ApiGenerator.Framework.Contracts/ContentGeneratorsParameters/ContentGeneratorBaseParameters.cs deleted file mode 100644 index 39103d16..00000000 --- a/src/Atc.Rest.ApiGenerator.Framework.Contracts/ContentGeneratorsParameters/ContentGeneratorBaseParameters.cs +++ /dev/null @@ -1,4 +0,0 @@ -namespace Atc.Rest.ApiGenerator.Framework.Contracts.ContentGeneratorsParameters; - -public record ContentGeneratorBaseParameters( - string Namespace); \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Contracts/ContentGeneratorsParameters/GeneratedCodeGeneratorParameters.cs b/src/Atc.Rest.ApiGenerator.Framework.Contracts/ContentGeneratorsParameters/GeneratedCodeGeneratorParameters.cs deleted file mode 100644 index 0d8ccabd..00000000 --- a/src/Atc.Rest.ApiGenerator.Framework.Contracts/ContentGeneratorsParameters/GeneratedCodeGeneratorParameters.cs +++ /dev/null @@ -1,4 +0,0 @@ -namespace Atc.Rest.ApiGenerator.Framework.Contracts.ContentGeneratorsParameters; - -public record GeneratedCodeGeneratorParameters( - Version ApiGeneratorVersion); \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Contracts/ContentGeneratorsParameters/Server/ContentGeneratorServerControllerParameters.cs b/src/Atc.Rest.ApiGenerator.Framework.Contracts/ContentGeneratorsParameters/Server/ContentGeneratorServerControllerParameters.cs deleted file mode 100644 index eedc617a..00000000 --- a/src/Atc.Rest.ApiGenerator.Framework.Contracts/ContentGeneratorsParameters/Server/ContentGeneratorServerControllerParameters.cs +++ /dev/null @@ -1,25 +0,0 @@ -namespace Atc.Rest.ApiGenerator.Framework.Contracts.ContentGeneratorsParameters.Server; - -public record ContentGeneratorServerControllerParameters( - string Namespace, - string ApiGroupName, - string RouteBase, - CodeDocumentationTags DocumentationTags, - string ControllerName, - IList MethodParameters); - -public record ContentGeneratorServerControllerMethodParameters( - string OperationTypeRepresentation, - string Name, - CodeDocumentationTags DocumentationTags, - string? RouteSuffix, - string InterfaceName, - string? ParameterTypeName, - long? MultipartBodyLengthLimit, - List ProducesResponseTypeRepresentations, - bool? ApiPathUseAuthorization, - IEnumerable ApiPathAuthorizationRoles, - IEnumerable ApiPathAuthenticationSchemes, - bool? ApiOperationUseAuthorization, - IEnumerable ApiOperationAuthorizationRoles, - IEnumerable ApiOperationAuthenticationSchemes); \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Contracts/ContentGeneratorsParameters/Server/ContentGeneratorServerRegistrationParameters.cs b/src/Atc.Rest.ApiGenerator.Framework.Contracts/ContentGeneratorsParameters/Server/ContentGeneratorServerRegistrationParameters.cs deleted file mode 100644 index 06061706..00000000 --- a/src/Atc.Rest.ApiGenerator.Framework.Contracts/ContentGeneratorsParameters/Server/ContentGeneratorServerRegistrationParameters.cs +++ /dev/null @@ -1,5 +0,0 @@ -namespace Atc.Rest.ApiGenerator.Framework.Contracts.ContentGeneratorsParameters.Server; - -public record ContentGeneratorServerRegistrationParameters( - string Namespace, - string RegistrationName); \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Contracts/ContentGeneratorsParameters/Server/ContentGeneratorServerResultParameters.cs b/src/Atc.Rest.ApiGenerator.Framework.Contracts/ContentGeneratorsParameters/Server/ContentGeneratorServerResultParameters.cs deleted file mode 100644 index eb810c6b..00000000 --- a/src/Atc.Rest.ApiGenerator.Framework.Contracts/ContentGeneratorsParameters/Server/ContentGeneratorServerResultParameters.cs +++ /dev/null @@ -1,25 +0,0 @@ -namespace Atc.Rest.ApiGenerator.Framework.Contracts.ContentGeneratorsParameters.Server; - -public record ContentGeneratorServerResultParameters( - string Namespace, - string OperationName, - CodeDocumentationTags DocumentationTags, - string ResultName, - IList MethodParameters, - ContentGeneratorServerResultImplicitOperatorParameters? ImplicitOperatorParameters); - -public record ContentGeneratorServerResultMethodParameters( - HttpStatusCode HttpStatusCode, - SchemaType SchemaType, - bool UsesProblemDetails, - string? ModelName, - CodeDocumentationTags DocumentationTags, - bool? UsesBinaryResponse, - string? SimpleDataTypeName, - string? GenericDataTypeName); - -public record ContentGeneratorServerResultImplicitOperatorParameters( - SchemaType SchemaType, - string? ModelName, - string? SimpleDataTypeName, - string? GenericDataTypeName); \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Contracts/ContentGeneratorsParameters/Server/ContentGeneratorServerWebApiStartupFactoryParameters.cs b/src/Atc.Rest.ApiGenerator.Framework.Contracts/ContentGeneratorsParameters/Server/ContentGeneratorServerWebApiStartupFactoryParameters.cs deleted file mode 100644 index 00248232..00000000 --- a/src/Atc.Rest.ApiGenerator.Framework.Contracts/ContentGeneratorsParameters/Server/ContentGeneratorServerWebApiStartupFactoryParameters.cs +++ /dev/null @@ -1,5 +0,0 @@ -namespace Atc.Rest.ApiGenerator.Framework.Contracts.ContentGeneratorsParameters.Server; - -public record ContentGeneratorServerWebApiStartupFactoryParameters( - string Namespace, - CodeDocumentationTags DocumentationTags); \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Contracts/GlobalUsings.cs b/src/Atc.Rest.ApiGenerator.Framework.Contracts/GlobalUsings.cs deleted file mode 100644 index ef43123d..00000000 --- a/src/Atc.Rest.ApiGenerator.Framework.Contracts/GlobalUsings.cs +++ /dev/null @@ -1,6 +0,0 @@ -global using System.ComponentModel.DataAnnotations; -global using System.Diagnostics.CodeAnalysis; -global using System.Net; - -global using Atc.CodeDocumentation.CodeComment; -global using Atc.Rest.ApiGenerator.Framework.Contracts.Models; \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Contracts/Options/ApiOptions.cs b/src/Atc.Rest.ApiGenerator.Framework.Contracts/Options/ApiOptions.cs deleted file mode 100644 index a0efdeee..00000000 --- a/src/Atc.Rest.ApiGenerator.Framework.Contracts/Options/ApiOptions.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Atc.Rest.ApiGenerator.Framework.Contracts.Options; - -public class ApiOptions -{ - public ApiOptionsGenerator Generator { get; set; } = new(); - - public ApiOptionsValidation Validation { get; set; } = new(); -} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Contracts/Options/ApiOptionsGenerator.cs b/src/Atc.Rest.ApiGenerator.Framework.Contracts/Options/ApiOptionsGenerator.cs deleted file mode 100644 index 948af03c..00000000 --- a/src/Atc.Rest.ApiGenerator.Framework.Contracts/Options/ApiOptionsGenerator.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace Atc.Rest.ApiGenerator.Framework.Contracts.Options; - -public class ApiOptionsGenerator -{ - public bool UseRestExtended { get; set; } = true; - - public ApiOptionsGeneratorRequest Request { get; set; } = new(); - - public ApiOptionsGeneratorResponse Response { get; set; } = new(); -} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Contracts/Options/ApiOptionsGeneratorRequest.cs b/src/Atc.Rest.ApiGenerator.Framework.Contracts/Options/ApiOptionsGeneratorRequest.cs deleted file mode 100644 index ca05c415..00000000 --- a/src/Atc.Rest.ApiGenerator.Framework.Contracts/Options/ApiOptionsGeneratorRequest.cs +++ /dev/null @@ -1,5 +0,0 @@ -namespace Atc.Rest.ApiGenerator.Framework.Contracts.Options; - -public class ApiOptionsGeneratorRequest -{ -} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Contracts/Options/ApiOptionsGeneratorResponse.cs b/src/Atc.Rest.ApiGenerator.Framework.Contracts/Options/ApiOptionsGeneratorResponse.cs deleted file mode 100644 index 11bb7321..00000000 --- a/src/Atc.Rest.ApiGenerator.Framework.Contracts/Options/ApiOptionsGeneratorResponse.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Atc.Rest.ApiGenerator.Framework.Contracts.Options; - -public class ApiOptionsGeneratorResponse -{ - public bool UseProblemDetailsAsDefaultBody { get; set; } -} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Contracts/_Enums/ApiSchemaMapLocatedAreaType.cs b/src/Atc.Rest.ApiGenerator.Framework.Contracts/_Enums/ApiSchemaMapLocatedAreaType.cs deleted file mode 100644 index d7ab1fc1..00000000 --- a/src/Atc.Rest.ApiGenerator.Framework.Contracts/_Enums/ApiSchemaMapLocatedAreaType.cs +++ /dev/null @@ -1,9 +0,0 @@ -// ReSharper disable CheckNamespace -namespace Atc.Rest.ApiGenerator.Framework.Contracts; - -public enum ApiSchemaMapLocatedAreaType -{ - Parameter, - RequestBody, - Response, -} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Minimal/Atc.Rest.ApiGenerator.Framework.Minimal.csproj b/src/Atc.Rest.ApiGenerator.Framework.Minimal/Atc.Rest.ApiGenerator.Framework.Minimal.csproj index fa9e1fe9..13b49863 100644 --- a/src/Atc.Rest.ApiGenerator.Framework.Minimal/Atc.Rest.ApiGenerator.Framework.Minimal.csproj +++ b/src/Atc.Rest.ApiGenerator.Framework.Minimal/Atc.Rest.ApiGenerator.Framework.Minimal.csproj @@ -1,17 +1,17 @@ - net6.0 - CA1014 + net8.0 false - + - + + diff --git a/src/Atc.Rest.ApiGenerator.Framework.Minimal/ContentGenerators/ContentGeneratorServeConfigureSwaggerOptions.cs b/src/Atc.Rest.ApiGenerator.Framework.Minimal/ContentGenerators/ContentGeneratorServeConfigureSwaggerOptions.cs new file mode 100644 index 00000000..a0f108bc --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Framework.Minimal/ContentGenerators/ContentGeneratorServeConfigureSwaggerOptions.cs @@ -0,0 +1,107 @@ +namespace Atc.Rest.ApiGenerator.Framework.Minimal.ContentGenerators; + +public class ContentGeneratorServeConfigureSwaggerOptions : IContentGenerator +{ + private readonly ContentGeneratorBaseParameters parameters; + + public ContentGeneratorServeConfigureSwaggerOptions( + ContentGeneratorBaseParameters parameters) + { + this.parameters = parameters; + } + + public string Generate() + { + var sb = new StringBuilder(); + + sb.AppendLine($"namespace {parameters.Namespace}.Options;"); // TODO: Move to constant + sb.AppendLine(); + sb.AppendLine("public class ConfigureSwaggerOptions : IConfigureOptions"); + sb.AppendLine("{"); + sb.AppendLine(4, "private readonly IApiVersionDescriptionProvider provider;"); + sb.AppendLine(4, "private readonly IWebHostEnvironment environment;"); + sb.AppendLine(); + sb.AppendLine(4, "/// "); + sb.AppendLine(4, "/// Initializes a new instance of the class."); + sb.AppendLine(4, "/// "); + sb.AppendLine(4, "/// The provider used to generate Swagger documents."); + sb.AppendLine(4, "/// The environment."); + sb.AppendLine(4, "public ConfigureSwaggerOptions("); + sb.AppendLine(8, "IApiVersionDescriptionProvider provider,"); + sb.AppendLine(8, "IWebHostEnvironment environment)"); + sb.AppendLine(4, "{"); + sb.AppendLine(8, "this.provider = provider;"); + sb.AppendLine(8, "this.environment = environment;"); + sb.AppendLine(4, "}"); + sb.AppendLine(); + sb.AppendLine(4, "/// "); + sb.AppendLine(4, "public void Configure("); + sb.AppendLine(8, "SwaggerGenOptions options)"); + sb.AppendLine(4, "{"); + sb.AppendLine(8, "// Add a swagger document for each discovered API version"); + sb.AppendLine(8, "// note: you might choose to skip or document deprecated API versions differently"); + sb.AppendLine(8, "foreach (var description in provider.ApiVersionDescriptions)"); + sb.AppendLine(8, "{"); + sb.AppendLine(12, "options.SwaggerDoc(description.GroupName, CreateInfoForApiVersion(description));"); + sb.AppendLine(8, "}"); + sb.AppendLine(4, "}"); + sb.AppendLine(); + sb.AppendLine(4, "private OpenApiInfo CreateInfoForApiVersion("); + sb.AppendLine(8, "ApiVersionDescription description)"); + sb.AppendLine(4, "{"); + + // TODO: Add fix details to the OpenApiInfo + sb.AppendLine(8, "var text = new StringBuilder(\"An example API to showcase minimal api implementation using the Atc.Rest.MinimalApi Nuget package.\");"); + sb.AppendLine(8, "var info = new OpenApiInfo"); + sb.AppendLine(8, "{"); + sb.AppendLine(12, "Title = $\"{environment.ApplicationName} {description.GroupName.ToUpperInvariant()}\","); + sb.AppendLine(12, "Version = description.ApiVersion.ToString(),"); + sb.AppendLine(12, "Contact = new OpenApiContact { Name = \"atc-net\", Email = \"atcnet.org@gmail.com\" },"); + sb.AppendLine(8, "};"); + sb.AppendLine(); + sb.AppendLine(8, "if (description.IsDeprecated)"); + sb.AppendLine(8, "{"); + sb.AppendLine(12, "text.Append(\" This API version has been deprecated.\");"); + sb.AppendLine(8, "}"); + sb.AppendLine(); + sb.AppendLine(8, "if (description.SunsetPolicy is { } policy)"); + sb.AppendLine(8, "{"); + sb.AppendLine(12, "if (policy.Date is { } when)"); + sb.AppendLine(12, "{"); + sb.AppendLine(16, "text.Append(\" The API will be sunset on \")"); + sb.AppendLine(20, ".Append(when.Date.ToShortDateString())"); + sb.AppendLine(20, ".Append('.');"); + sb.AppendLine(12, "}"); + sb.AppendLine(); + sb.AppendLine(12, "if (policy.HasLinks)"); + sb.AppendLine(12, "{"); + sb.AppendLine(16, "text.AppendLine();"); + sb.AppendLine(); + sb.AppendLine(16, "foreach (var link in policy.Links)"); + sb.AppendLine(16, "{"); + sb.AppendLine(20, "if (link.Type != \"text /html\")"); + sb.AppendLine(20, "{"); + sb.AppendLine(24, "continue;"); + sb.AppendLine(20, "}"); + sb.AppendLine(); + sb.AppendLine(20, "text.AppendLine();"); + sb.AppendLine(); + sb.AppendLine(20, "if (link.Title.HasValue)"); + sb.AppendLine(20, "{"); + sb.AppendLine(24, "text.Append(link.Title.Value).Append(\": \");"); + sb.AppendLine(20, "}"); + sb.AppendLine(); + sb.AppendLine(20, "text.Append(link.LinkTarget.OriginalString);"); + sb.AppendLine(16, "}"); + sb.AppendLine(12, "}"); + sb.AppendLine(8, "}"); + sb.AppendLine(); + sb.AppendLine(8, "info.Description = text.ToString();"); + sb.AppendLine(); + sb.AppendLine(8, "return info;"); + sb.AppendLine(4, "}"); + sb.Append('}'); + + return sb.ToString(); + } +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Minimal/ContentGenerators/ContentGeneratorServeWebApplicationExtensions.cs b/src/Atc.Rest.ApiGenerator.Framework.Minimal/ContentGenerators/ContentGeneratorServeWebApplicationExtensions.cs new file mode 100644 index 00000000..5a5bb314 --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Framework.Minimal/ContentGenerators/ContentGeneratorServeWebApplicationExtensions.cs @@ -0,0 +1,78 @@ +// ReSharper disable SwitchStatementMissingSomeEnumCasesNoDefault +namespace Atc.Rest.ApiGenerator.Framework.Minimal.ContentGenerators; + +public class ContentGeneratorServeWebApplicationExtensions : IContentGenerator +{ + private readonly ContentGeneratorBaseParameters parameters; + + public ContentGeneratorServeWebApplicationExtensions( + ContentGeneratorBaseParameters parameters) + { + this.parameters = parameters; + } + + public SwaggerThemeMode SwaggerThemeMode { get; set; } = SwaggerThemeMode.None; + + public string Generate() + { + var sb = new StringBuilder(); + + sb.AppendLine($"namespace {parameters.Namespace}.Extensions;"); // TODO: Move to constant + sb.AppendLine(); + sb.AppendLine("public static class WebApplicationExtensions"); + sb.AppendLine("{"); + sb.AppendLine(4, "private static readonly string[] PatchHttpMethods = { \"patch\" };"); + sb.AppendLine(); + sb.AppendLine(4, "public static RouteHandlerBuilder MapPatch("); + sb.AppendLine(8, "this WebApplication app,"); + sb.AppendLine(8, "string pattern,"); + sb.AppendLine(8, "Delegate handler)"); + sb.AppendLine(8, "=> app.MapMethods("); + sb.AppendLine(12, "pattern,"); + sb.AppendLine(12, "PatchHttpMethods,"); + sb.AppendLine(12, "handler);"); + + if (SwaggerThemeMode != SwaggerThemeMode.None) + { + sb.AppendLine(); + sb.AppendLine(4, "public static IApplicationBuilder ConfigureSwagger("); + sb.AppendLine(8, "this WebApplication app,"); + sb.AppendLine(8, "string applicationName)"); + sb.AppendLine(4, "{"); + sb.AppendLine(8, "app.UseSwagger();"); + sb.AppendLine(8, "app.UseSwaggerUI(options =>"); + sb.AppendLine(8, "{"); + sb.AppendLine(12, "options.EnableTryItOutByDefault();"); + + switch (SwaggerThemeMode) + { + case SwaggerThemeMode.Dark: + sb.AppendLine(12, "options.InjectStylesheet(\"/swagger-ui/SwaggerDark.css\");"); + break; + case SwaggerThemeMode.Light: + sb.AppendLine(12, "options.InjectStylesheet(\"/swagger-ui/SwaggerLight.css\");"); + break; + } + + sb.AppendLine(12, "options.InjectJavascript(\"/swagger-ui/main.js\");"); + sb.AppendLine(); + + sb.AppendLine(12, "var descriptions = app.DescribeApiVersions();"); + sb.AppendLine(12, "foreach (var (url, name) in"); + sb.AppendLine(20, "from description in descriptions"); + sb.AppendLine(20, "let url = $\"/swagger/{description.GroupName}/swagger.json\""); + sb.AppendLine(20, "let name = description.GroupName.ToUpperInvariant()"); + sb.AppendLine(20, "select (url, name))"); + sb.AppendLine(12, "{"); + sb.AppendLine(16, "options.SwaggerEndpoint(url, $\"{applicationName} {name}\");"); + sb.AppendLine(12, "}"); + sb.AppendLine(8, "});"); + sb.AppendLine(); + sb.AppendLine(4, " return app;"); + sb.AppendLine(4, "}"); + } + sb.Append('}'); + + return sb.ToString(); + } +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Minimal/ContentGenerators/ContentGeneratorServerEndpoints.cs b/src/Atc.Rest.ApiGenerator.Framework.Minimal/ContentGenerators/ContentGeneratorServerEndpoints.cs new file mode 100644 index 00000000..fb772496 --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Framework.Minimal/ContentGenerators/ContentGeneratorServerEndpoints.cs @@ -0,0 +1,412 @@ +namespace Atc.Rest.ApiGenerator.Framework.Minimal.ContentGenerators; + +public sealed class ContentGeneratorServerEndpoints : IContentGenerator +{ + private readonly GeneratedCodeHeaderGenerator codeHeaderGenerator; + private readonly GeneratedCodeAttributeGenerator codeAttributeGenerator; + private readonly CodeDocumentationTagsGenerator codeDocumentationTagsGenerator; + private readonly ContentGeneratorServerEndpointParameters parameters; + private readonly bool useProblemDetailsAsDefaultResponseBody; + + public ContentGeneratorServerEndpoints( + GeneratedCodeHeaderGenerator codeHeaderGenerator, + GeneratedCodeAttributeGenerator codeAttributeGenerator, + CodeDocumentationTagsGenerator codeDocumentationTagsGenerator, + ContentGeneratorServerEndpointParameters parameters, + bool useProblemDetailsAsDefaultResponseBody) + { + this.codeHeaderGenerator = codeHeaderGenerator; + this.codeAttributeGenerator = codeAttributeGenerator; + this.codeDocumentationTagsGenerator = codeDocumentationTagsGenerator; + this.parameters = parameters; + this.useProblemDetailsAsDefaultResponseBody = useProblemDetailsAsDefaultResponseBody; + } + + public string Generate() + { + var sb = new StringBuilder(); + + sb.Append(codeHeaderGenerator.Generate()); + sb.AppendLine($"namespace {parameters.Namespace};"); + sb.AppendLine(); + + if (codeDocumentationTagsGenerator.ShouldGenerateTags(parameters.DocumentationTags)) + { + sb.Append(codeDocumentationTagsGenerator.GenerateTags(0, parameters.DocumentationTags)); + } + + if (parameters.Authorization is not null) + { + sb.AppendLine(parameters.Authorization.UseAllowAnonymous + ? "[AllowAnonymous]" + : "[Authorize]"); + } + + sb.AppendLine(codeAttributeGenerator.Generate()); + + sb.AppendLine($"public sealed class {parameters.ApiGroupName}EndpointDefinition : IEndpointDefinition"); + sb.AppendLine("{"); + AppendContent(sb); + sb.Append('}'); + + return sb.ToString(); + } + + private void AppendContent( + StringBuilder sb) + { + sb.AppendLine(4, $"internal const string ApiRouteBase = \"{parameters.RouteBase}\";"); + sb.AppendLine(); + + AppendDefineEndpoints(sb); + + AppendRouteHandlers(sb); + } + + private void AppendDefineEndpoints( + StringBuilder sb) + { + var routeGroupBuilderName = parameters.ApiGroupName.EnsureFirstCharacterToLower(); + + sb.AppendLine(4, "public void DefineEndpoints("); + sb.AppendLine(8, "WebApplication app)"); + sb.AppendLine(4, "{"); + sb.AppendLine(8, $"var {routeGroupBuilderName} = app"); + sb.AppendLine(12, $".NewVersionedApi(\"{parameters.ApiGroupName}\")"); + sb.AppendLine(12, ".MapGroup(ApiRouteBase);"); + sb.AppendLine(); + + for (var i = 0; i < parameters.MethodParameters.Count; i++) + { + var item = parameters.MethodParameters[i]; + + AppendRoute(sb, routeGroupBuilderName, item); + + if (i < parameters.MethodParameters.Count - 1) + { + sb.AppendLine(); + } + } + + sb.AppendLine(4, "}"); + sb.AppendLine(); + } + + private void AppendRoute( + StringBuilder sb, + string routeGroupBuilderName, + ContentGeneratorServerEndpointMethodParameters item) + { + sb.AppendLine(8, routeGroupBuilderName); + sb.AppendLine( + 12, + item.RouteSuffix is null + ? $".Map{item.OperationTypeRepresentation}(\"/\", {item.Name})" + : $".Map{item.OperationTypeRepresentation}(\"{item.RouteSuffix}\", {item.Name})"); + sb.AppendLine(12, $".WithName(\"{item.Name}\")"); + + if (!string.IsNullOrEmpty(item.DocumentationTags.Summary)) + { + var summary = item.DocumentationTags.Summary; + var indexOfOperation = summary.IndexOf("Operation: ", StringComparison.Ordinal); + if (indexOfOperation > 0) + { + summary = summary[..indexOfOperation]; + } + + summary = summary + .Replace("Description: ", string.Empty, StringComparison.Ordinal) + .Replace(Environment.NewLine, string.Empty, StringComparison.Ordinal) + .Trim() + .EnsureEndsWithDot(); + + sb.AppendLine(12, $".WithSummary(\"{summary.EnsureEndsWithDot()}\")"); + } + + if (!string.IsNullOrEmpty(item.Description)) + { + var description = item.Description + .Replace(Environment.NewLine, string.Empty, StringComparison.Ordinal) + .Trim() + .EnsureEndsWithDot(); + + sb.AppendLine(12, $".WithDescription(\"{description}\")"); + } + + if (!string.IsNullOrEmpty(item.ParameterTypeName)) + { + sb.AppendLine(12, $".AddEndpointFilter>()"); + } + + if (useProblemDetailsAsDefaultResponseBody) + { + AppendProducesWithProblemDetails(sb, item); + } + else + { + AppendProducesWithoutProblemDetails(sb, item); + } + } + + private void AppendRouteHandlers( + StringBuilder sb) + { + for (var i = 0; i < parameters.MethodParameters.Count; i++) + { + var item = parameters.MethodParameters[i]; + + sb.AppendLine(4, $"internal async Task {item.Name}("); + sb.AppendLine(8, $"[FromServices] {item.InterfaceName} handler,"); + + if (!string.IsNullOrEmpty(item.ParameterTypeName)) + { + sb.AppendLine(8, $"[AsParameters] {item.ParameterTypeName} parameters,"); + } + + sb.AppendLine(8, "CancellationToken cancellationToken)"); + + sb.AppendLine(8, $"=> {item.ResultName}.ToIResult("); + sb.AppendLine(12, "await handler.ExecuteAsync("); + if (!string.IsNullOrEmpty(item.ParameterTypeName)) + { + sb.AppendLine(16, "parameters,"); + } + + sb.AppendLine(16, "cancellationToken));"); + + if (i < parameters.MethodParameters.Count - 1) + { + sb.AppendLine(); + } + } + } + + private static void AppendProducesWithProblemDetails( + StringBuilder sb, + ContentGeneratorServerEndpointMethodParameters item) + { + var responseModels = item.ResponseModels + .AppendUnauthorizedIfNeeded(item.Authorization) + .AppendForbiddenIfNeeded(item.Authorization) + .AppendBadRequestIfNeeded(item.ParameterTypeName) + .OrderBy(x => x.StatusCode) + .ToList(); + + foreach (var responseModel in responseModels) + { + switch (responseModel.StatusCode) + { + case HttpStatusCode.OK: + AppendProducesForOk(sb, responseModel); + break; + case HttpStatusCode.BadRequest: + sb.Append(12, ".ProducesValidationProblem()"); + break; + case HttpStatusCode.Accepted: + case HttpStatusCode.Created: + sb.Append(12, $".Produces(StatusCodes.{responseModel.StatusCode.ToStatusCodesConstant()})"); + break; + case HttpStatusCode.EarlyHints: + sb.Append(12, $".ProducesProblem({(int)HttpStatusCode.EarlyHints})"); + break; + case HttpStatusCode.Continue: + case HttpStatusCode.SwitchingProtocols: + case HttpStatusCode.Processing: + case HttpStatusCode.NonAuthoritativeInformation: + case HttpStatusCode.NoContent: + case HttpStatusCode.ResetContent: + case HttpStatusCode.PartialContent: + case HttpStatusCode.MultiStatus: + case HttpStatusCode.AlreadyReported: + case HttpStatusCode.IMUsed: + case HttpStatusCode.MultipleChoices: + case HttpStatusCode.MovedPermanently: + case HttpStatusCode.Found: + case HttpStatusCode.SeeOther: + case HttpStatusCode.NotModified: + case HttpStatusCode.UseProxy: + case HttpStatusCode.Unused: + case HttpStatusCode.RedirectKeepVerb: + case HttpStatusCode.PermanentRedirect: + case HttpStatusCode.Unauthorized: + case HttpStatusCode.PaymentRequired: + case HttpStatusCode.Forbidden: + case HttpStatusCode.NotFound: + case HttpStatusCode.MethodNotAllowed: + case HttpStatusCode.NotAcceptable: + case HttpStatusCode.ProxyAuthenticationRequired: + case HttpStatusCode.RequestTimeout: + case HttpStatusCode.Conflict: + case HttpStatusCode.Gone: + case HttpStatusCode.LengthRequired: + case HttpStatusCode.PreconditionFailed: + case HttpStatusCode.RequestEntityTooLarge: + case HttpStatusCode.RequestUriTooLong: + case HttpStatusCode.UnsupportedMediaType: + case HttpStatusCode.RequestedRangeNotSatisfiable: + case HttpStatusCode.ExpectationFailed: + case HttpStatusCode.MisdirectedRequest: + case HttpStatusCode.UnprocessableEntity: + case HttpStatusCode.Locked: + case HttpStatusCode.FailedDependency: + case HttpStatusCode.UpgradeRequired: + case HttpStatusCode.PreconditionRequired: + case HttpStatusCode.TooManyRequests: + case HttpStatusCode.RequestHeaderFieldsTooLarge: + case HttpStatusCode.UnavailableForLegalReasons: + case HttpStatusCode.InternalServerError: + case HttpStatusCode.NotImplemented: + case HttpStatusCode.BadGateway: + case HttpStatusCode.ServiceUnavailable: + case HttpStatusCode.GatewayTimeout: + case HttpStatusCode.HttpVersionNotSupported: + case HttpStatusCode.VariantAlsoNegotiates: + case HttpStatusCode.InsufficientStorage: + case HttpStatusCode.LoopDetected: + case HttpStatusCode.NotExtended: + case HttpStatusCode.NetworkAuthenticationRequired: + sb.Append(12, $".ProducesProblem(StatusCodes.{responseModel.StatusCode.ToStatusCodesConstant()})"); + break; + default: + sb.Append(12, $"// TODO: Not Implemented for {responseModel.StatusCode}."); + break; + } + + if (responseModel == responseModels[^1]) + { + sb.AppendLine(";"); + } + else + { + sb.AppendLine(); + } + } + } + + private static void AppendProducesWithoutProblemDetails( + StringBuilder sb, + ContentGeneratorServerEndpointMethodParameters item) + { + var responseModels = item.ResponseModels + .AppendUnauthorizedIfNeeded(item.Authorization) + .AppendForbiddenIfNeeded(item.Authorization) + .AppendBadRequestIfNeeded(item.ParameterTypeName) + .OrderBy(x => x.StatusCode) + .ToList(); + + foreach (var responseModel in responseModels) + { + switch (responseModel.StatusCode) + { + case HttpStatusCode.OK: + AppendProducesForOk(sb, responseModel); + break; + case HttpStatusCode.Accepted: + case HttpStatusCode.Created: + case HttpStatusCode.BadRequest: + case HttpStatusCode.NotFound: + case HttpStatusCode.Conflict: + sb.Append(12, $".Produces(StatusCodes.{responseModel.StatusCode.ToStatusCodesConstant()})"); + break; + case HttpStatusCode.NotImplemented: + case HttpStatusCode.InternalServerError: + sb.Append(12, $".ProducesProblem(StatusCodes.{responseModel.StatusCode.ToStatusCodesConstant()})"); + break; + case HttpStatusCode.EarlyHints: + sb.Append(12, $".Produces({(int)HttpStatusCode.EarlyHints})"); + break; + case HttpStatusCode.Continue: + case HttpStatusCode.SwitchingProtocols: + case HttpStatusCode.Processing: + case HttpStatusCode.NonAuthoritativeInformation: + case HttpStatusCode.NoContent: + case HttpStatusCode.ResetContent: + case HttpStatusCode.PartialContent: + case HttpStatusCode.MultiStatus: + case HttpStatusCode.AlreadyReported: + case HttpStatusCode.IMUsed: + case HttpStatusCode.MultipleChoices: + case HttpStatusCode.MovedPermanently: + case HttpStatusCode.Found: + case HttpStatusCode.SeeOther: + case HttpStatusCode.NotModified: + case HttpStatusCode.UseProxy: + case HttpStatusCode.Unused: + case HttpStatusCode.RedirectKeepVerb: + case HttpStatusCode.PermanentRedirect: + case HttpStatusCode.Unauthorized: + case HttpStatusCode.PaymentRequired: + case HttpStatusCode.Forbidden: + case HttpStatusCode.MethodNotAllowed: + case HttpStatusCode.NotAcceptable: + case HttpStatusCode.ProxyAuthenticationRequired: + case HttpStatusCode.RequestTimeout: + case HttpStatusCode.Gone: + case HttpStatusCode.LengthRequired: + case HttpStatusCode.PreconditionFailed: + case HttpStatusCode.RequestEntityTooLarge: + case HttpStatusCode.RequestUriTooLong: + case HttpStatusCode.UnsupportedMediaType: + case HttpStatusCode.RequestedRangeNotSatisfiable: + case HttpStatusCode.ExpectationFailed: + case HttpStatusCode.MisdirectedRequest: + case HttpStatusCode.UnprocessableEntity: + case HttpStatusCode.Locked: + case HttpStatusCode.FailedDependency: + case HttpStatusCode.UpgradeRequired: + case HttpStatusCode.PreconditionRequired: + case HttpStatusCode.TooManyRequests: + case HttpStatusCode.RequestHeaderFieldsTooLarge: + case HttpStatusCode.UnavailableForLegalReasons: + case HttpStatusCode.BadGateway: + case HttpStatusCode.ServiceUnavailable: + case HttpStatusCode.GatewayTimeout: + case HttpStatusCode.HttpVersionNotSupported: + case HttpStatusCode.VariantAlsoNegotiates: + case HttpStatusCode.InsufficientStorage: + case HttpStatusCode.LoopDetected: + case HttpStatusCode.NotExtended: + case HttpStatusCode.NetworkAuthenticationRequired: + sb.Append(12, $".Produces(StatusCodes.{responseModel.StatusCode.ToStatusCodesConstant()})"); + break; + default: + sb.Append(12, $"// TODO: Not Implemented for {responseModel.StatusCode}."); + break; + } + + if (responseModel == responseModels[^1]) + { + sb.AppendLine(";"); + } + else + { + sb.AppendLine(); + } + } + } + + private static void AppendProducesForOk( + StringBuilder sb, + ApiOperationResponseModel responseModel) + { + if (responseModel.DataType is null) + { + sb.Append(12, ".Produces()"); + } + else + { + if (string.IsNullOrEmpty(responseModel.CollectionDataType)) + { + sb.Append(12, $".Produces<{responseModel.DataType}>()"); + } + else + { + sb.AppendLine( + 4, + responseModel.CollectionDataType == "List" + ? $".Produces>()" + : $".Produces<{responseModel.CollectionDataType}<{responseModel.DataType}>>()"); + } + } + } +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Minimal/ContentGenerators/ContentGeneratorServerJsonSerializerOptionsExtensions.cs b/src/Atc.Rest.ApiGenerator.Framework.Minimal/ContentGenerators/ContentGeneratorServerJsonSerializerOptionsExtensions.cs new file mode 100644 index 00000000..f024fdb1 --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Framework.Minimal/ContentGenerators/ContentGeneratorServerJsonSerializerOptionsExtensions.cs @@ -0,0 +1,64 @@ +namespace Atc.Rest.ApiGenerator.Framework.Minimal.ContentGenerators; + +public class ContentGeneratorServerJsonSerializerOptionsExtensions : IContentGenerator +{ + private readonly ContentGeneratorBaseParameters parameters; + + public ContentGeneratorServerJsonSerializerOptionsExtensions( + ContentGeneratorBaseParameters parameters) + { + this.parameters = parameters; + } + + public string Generate() + { + var sb = new StringBuilder(); + + sb.AppendLine($"namespace {parameters.Namespace}.Extensions;"); // TODO: Move to constant + sb.AppendLine(); + sb.AppendLine("public static class JsonSerializerOptionsExtensions"); + sb.AppendLine("{"); + sb.AppendLine(4, "public static Microsoft.AspNetCore.Http.Json.JsonOptions Configure("); + sb.AppendLine(8, "this System.Text.Json.JsonSerializerOptions jsonSerializerOptions,"); + sb.AppendLine(8, "Microsoft.AspNetCore.Http.Json.JsonOptions options)"); + sb.AppendLine(4, "{"); + sb.AppendLine(8, "ArgumentNullException.ThrowIfNull(jsonSerializerOptions);"); + sb.AppendLine(8, "ArgumentNullException.ThrowIfNull(options);"); + sb.AppendLine(); + sb.AppendLine(8, "options.SerializerOptions.DefaultIgnoreCondition = jsonSerializerOptions.DefaultIgnoreCondition;"); + sb.AppendLine(8, "options.SerializerOptions.PropertyNameCaseInsensitive = jsonSerializerOptions.PropertyNameCaseInsensitive;"); + sb.AppendLine(8, "options.SerializerOptions.WriteIndented = jsonSerializerOptions.WriteIndented;"); + sb.AppendLine(8, "options.SerializerOptions.PropertyNamingPolicy = jsonSerializerOptions.PropertyNamingPolicy;"); + sb.AppendLine(); + sb.AppendLine(8, "foreach (var jsonConverter in jsonSerializerOptions.Converters)"); + sb.AppendLine(8, "{"); + sb.AppendLine(12, "options.SerializerOptions.Converters.Add(jsonConverter);"); + sb.AppendLine(8, "}"); + sb.AppendLine(); + sb.AppendLine(8, "return options;"); + sb.AppendLine(4, "}"); + sb.AppendLine(); + sb.AppendLine(4, "public static Microsoft.AspNetCore.Mvc.JsonOptions Configure("); + sb.AppendLine(8, "this System.Text.Json.JsonSerializerOptions jsonSerializerOptions,"); + sb.AppendLine(8, "Microsoft.AspNetCore.Mvc.JsonOptions options)"); + sb.AppendLine(4, "{"); + sb.AppendLine(8, "ArgumentNullException.ThrowIfNull(jsonSerializerOptions);"); + sb.AppendLine(8, "ArgumentNullException.ThrowIfNull(options);"); + sb.AppendLine(); + sb.AppendLine(8, "options.JsonSerializerOptions.DefaultIgnoreCondition = jsonSerializerOptions.DefaultIgnoreCondition;"); + sb.AppendLine(8, "options.JsonSerializerOptions.PropertyNameCaseInsensitive = jsonSerializerOptions.PropertyNameCaseInsensitive;"); + sb.AppendLine(8, "options.JsonSerializerOptions.WriteIndented = jsonSerializerOptions.WriteIndented;"); + sb.AppendLine(8, "options.JsonSerializerOptions.PropertyNamingPolicy = jsonSerializerOptions.PropertyNamingPolicy;"); + sb.AppendLine(); + sb.AppendLine(8, "foreach (var jsonConverter in jsonSerializerOptions.Converters)"); + sb.AppendLine(8, "{"); + sb.AppendLine(12, "options.JsonSerializerOptions.Converters.Add(jsonConverter);"); + sb.AppendLine(8, "}"); + sb.AppendLine(); + sb.AppendLine(8, "return options;"); + sb.AppendLine(4, "}"); + sb.Append('}'); + + return sb.ToString(); + } +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Minimal/ContentGenerators/ContentGeneratorServerParameter.cs b/src/Atc.Rest.ApiGenerator.Framework.Minimal/ContentGenerators/ContentGeneratorServerParameter.cs new file mode 100644 index 00000000..739d3dd7 --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Framework.Minimal/ContentGenerators/ContentGeneratorServerParameter.cs @@ -0,0 +1,88 @@ +namespace Atc.Rest.ApiGenerator.Framework.Minimal.ContentGenerators; + +public sealed class ContentGeneratorServerParameter : IContentGenerator +{ + private readonly GeneratedCodeHeaderGenerator codeHeaderGenerator; + private readonly GeneratedCodeAttributeGenerator codeAttributeGenerator; + private readonly CodeDocumentationTagsGenerator codeDocumentationTagsGenerator; + private readonly ContentGeneratorServerParameterParameters parameters; + + public ContentGeneratorServerParameter( + GeneratedCodeHeaderGenerator codeHeaderGenerator, + GeneratedCodeAttributeGenerator codeAttributeGenerator, + CodeDocumentationTagsGenerator codeDocumentationTagsGenerator, + ContentGeneratorServerParameterParameters parameters) + { + this.codeHeaderGenerator = codeHeaderGenerator; + this.codeAttributeGenerator = codeAttributeGenerator; + this.codeDocumentationTagsGenerator = codeDocumentationTagsGenerator; + this.parameters = parameters; + } + + public string Generate() + { + var sb = new StringBuilder(); + + sb.Append(codeHeaderGenerator.Generate()); + sb.AppendLine($"namespace {parameters.Namespace};"); + sb.AppendLine(); + + if (codeDocumentationTagsGenerator.ShouldGenerateTags(parameters.DocumentationTags)) + { + sb.Append(codeDocumentationTagsGenerator.GenerateTags(0, parameters.DocumentationTags)); + } + + sb.AppendLine(codeAttributeGenerator.Generate()); + sb.Append($"public record {parameters.ParameterName}"); + + if (!parameters.PropertyParameters.Any()) + { + sb.Append("();"); + } + else + { + sb.AppendLine("("); + const int indentSpaces = 4; + + for (var j = 0; j < parameters.PropertyParameters.Count; j++) + { + var item = parameters.PropertyParameters[j]; + var useCommaForEndChar = j != parameters.PropertyParameters.Count - 1; + sb.AppendInputParameter( + indentSpaces, + usePropertyPrefix: true, + attributes: ExtractAttributes(item), + genericTypeName: null, + typeName: item.DataType, + item.IsNullable, + item.ParameterName, + item.DefaultValueInitializer, + useCommaForEndChar); + } + + sb.Append(';'); + } + + return sb.ToString(); + } + + private static IList ExtractAttributes( + ContentGeneratorServerParameterParametersProperty item) + { + var result = new List(); + + if (item.ParameterLocationType != ParameterLocationType.None) + { + result.Add(AttributeParametersFactory.Create($"From{item.ParameterLocationType}")); + } + + if (item.IsRequired) + { + result.Add(AttributeParametersFactory.Create("Required")); + } + + result.AddRange(AttributesParametersFactory.Create(item.AdditionalValidationAttributes)); + + return result; + } +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Minimal/ContentGenerators/ContentGeneratorServerProgram.cs b/src/Atc.Rest.ApiGenerator.Framework.Minimal/ContentGenerators/ContentGeneratorServerProgram.cs new file mode 100644 index 00000000..5103691c --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Framework.Minimal/ContentGenerators/ContentGeneratorServerProgram.cs @@ -0,0 +1,105 @@ +namespace Atc.Rest.ApiGenerator.Framework.Minimal.ContentGenerators; + +public sealed class ContentGeneratorServerProgram : IContentGenerator +{ + private readonly ContentGeneratorBaseParameters parameters; + + public ContentGeneratorServerProgram( + ContentGeneratorBaseParameters parameters) + { + this.parameters = parameters; + } + + public SwaggerThemeMode SwaggerThemeMode { get; set; } = SwaggerThemeMode.None; + + public string Generate() + { + var sb = new StringBuilder(); + + sb.AppendLine($"namespace {parameters.Namespace};"); + sb.AppendLine(); + sb.AppendLine("public static class Program"); + sb.AppendLine("{"); + sb.AppendLine(4, "[SuppressMessage(\"Design\", \"MA0051:Method is too long\", Justification = \"OK.\")]"); + sb.AppendLine(4, "public static void Main(string[] args)"); + sb.AppendLine(4, "{"); + sb.AppendLine(8, "var builder = WebApplication.CreateBuilder(args);"); + sb.AppendLine(); + sb.AppendLine(8, "builder.ConfigureLogging();"); + sb.AppendLine(); + sb.AppendLine(8, "var services = builder.Services;"); + sb.AppendLine(); + sb.AppendLine(8, "services.AddMemoryCache();"); + sb.AppendLine(); + sb.AppendLine(8, "services.ConfigureDomainServices(builder.Configuration);"); + sb.AppendLine(); + sb.AppendLine(8, "services.AddValidatorsFromAssemblyContaining(ServiceLifetime.Singleton);"); + sb.AppendLine(); + sb.AppendLine(8, "services.ConfigureApiVersioning();"); + sb.AppendLine(); + sb.AppendLine(8, "services.AddEndpointDefinitions(typeof(IApiContractAssemblyMarker));"); + sb.AppendLine(); + + if (SwaggerThemeMode != SwaggerThemeMode.None) + { + sb.AppendLine(8, "services.ConfigureSwagger();"); + sb.AppendLine(); + } + + sb.AppendLine(8, "services.AddCors(corsOptions =>"); + sb.AppendLine(8, "{"); + sb.AppendLine(12, "corsOptions.AddPolicy(\"DemoCorsPolicy\", configurePolicy =>"); + sb.AppendLine(12, "{"); + sb.AppendLine(16, "configurePolicy"); + sb.AppendLine(20, ".AllowAnyOrigin()"); + sb.AppendLine(20, ".AllowAnyMethod()"); + sb.AppendLine(20, ".AllowAnyHeader();"); + sb.AppendLine(12, "});"); + sb.AppendLine(8, "});"); + sb.AppendLine(); + sb.AppendLine(8, "// This enables proper enum as string in Swagger UI"); + sb.AppendLine(8, "services.AddControllers().AddJsonOptions(o => JsonSerializerOptionsFactory.Create().Configure(o));"); + sb.AppendLine(8, "services.Configure(o => JsonSerializerOptionsFactory.Create().Configure(o));"); + sb.AppendLine(); + sb.AppendLine(8, "services.AddSingleton(_ => new ValidationFilterOptions"); + sb.AppendLine(8, "{"); + sb.AppendLine(12, "SkipFirstLevelOnValidationKeys = true,"); + sb.AppendLine(8, "});"); + sb.AppendLine(); + sb.AppendLine(8, "var app = builder.Build();"); + sb.AppendLine(); + sb.AppendLine(8, "app.UseEndpointDefinitions();"); + sb.AppendLine(); + sb.AppendLine(8, "app.UseGlobalErrorHandler();"); + sb.AppendLine(); + sb.AppendLine(8, "// Enabling the status code pages middleware, will allow Problem Details to be used in some extra non-exception related framework scenarios,"); + sb.AppendLine(8, "// such as a 404 occurring due to a non-existent route or a 405 occurring due to a caller using an invalid HTTP method on an existing endpoint."); + sb.AppendLine(8, "app.UseStatusCodePages();"); + sb.AppendLine(); + sb.AppendLine(8, "app.UseStaticFiles();"); + sb.AppendLine(); + + if (SwaggerThemeMode != SwaggerThemeMode.None) + { + sb.AppendLine(8, "app.ConfigureSwagger(builder.Environment.ApplicationName);"); + } + + sb.AppendLine(); + sb.AppendLine(8, "app.UseHttpsRedirection();"); + sb.AppendLine(8, "app.UseHsts();"); + sb.AppendLine(); + sb.AppendLine(8, "app.UseCors(\"DemoCorsPolicy\");"); + sb.AppendLine(); + sb.AppendLine(8, "if (!app.Environment.IsDevelopment())"); + sb.AppendLine(8, "{"); + sb.AppendLine(12, "app.UseAuthentication();"); + sb.AppendLine(12, "app.UseAuthorization();"); + sb.AppendLine(8, "}"); + sb.AppendLine(); + sb.AppendLine(8, "app.Run();"); + sb.AppendLine(4, "}"); + sb.Append('}'); + + return sb.ToString(); + } +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Minimal/ContentGenerators/ContentGeneratorServerResult.cs b/src/Atc.Rest.ApiGenerator.Framework.Minimal/ContentGenerators/ContentGeneratorServerResult.cs new file mode 100644 index 00000000..fc7cfd1d --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Framework.Minimal/ContentGenerators/ContentGeneratorServerResult.cs @@ -0,0 +1,318 @@ +namespace Atc.Rest.ApiGenerator.Framework.Minimal.ContentGenerators; + +public sealed class ContentGeneratorServerResult : IContentGenerator +{ + private readonly GeneratedCodeHeaderGenerator codeHeaderGenerator; + private readonly GeneratedCodeAttributeGenerator codeAttributeGenerator; + private readonly CodeDocumentationTagsGenerator codeDocumentationTagsGenerator; + private readonly ContentGeneratorServerResultParameters parameters; + private readonly bool useProblemDetailsAsDefaultResponseBody; + + public ContentGeneratorServerResult( + GeneratedCodeHeaderGenerator codeHeaderGenerator, + GeneratedCodeAttributeGenerator codeAttributeGenerator, + CodeDocumentationTagsGenerator codeDocumentationTagsGenerator, + ContentGeneratorServerResultParameters parameters, + bool useProblemDetailsAsDefaultResponseBody) + { + this.codeHeaderGenerator = codeHeaderGenerator; + this.codeAttributeGenerator = codeAttributeGenerator; + this.codeDocumentationTagsGenerator = codeDocumentationTagsGenerator; + this.parameters = parameters; + this.useProblemDetailsAsDefaultResponseBody = useProblemDetailsAsDefaultResponseBody; + } + + public string Generate() + { + var sb = new StringBuilder(); + + sb.Append(codeHeaderGenerator.Generate()); + sb.AppendLine($"namespace {parameters.Namespace};"); + sb.AppendLine(); + if (codeDocumentationTagsGenerator.ShouldGenerateTags(parameters.DocumentationTags)) + { + sb.Append(codeDocumentationTagsGenerator.GenerateTags(0, parameters.DocumentationTags)); + } + + sb.AppendLine(codeAttributeGenerator.Generate()); + sb.AppendLine($"public class {parameters.ResultName}"); + sb.AppendLine("{"); + sb.AppendLine(4, $"private {parameters.ResultName}(IResult result)"); + sb.AppendLine(4, "{"); + sb.AppendLine(8, "Result = result;"); + sb.AppendLine(4, "}"); + sb.AppendLine(); + sb.AppendLine(4, "public IResult Result { get; }"); + sb.AppendLine(); + + for (var i = 0; i < parameters.MethodParameters.Count; i++) + { + var item = parameters.MethodParameters[i]; + + AppendMethodContent(sb, item, parameters.ResultName); + + if (i < parameters.MethodParameters.Count - 1) + { + sb.AppendLine(); + } + } + + if (parameters.ImplicitOperatorParameters is not null) + { + AppendImplicitOperatorContent(sb, parameters); + } + + sb.Append('}'); + + return sb.ToString(); + } + + private void AppendMethodContent( + StringBuilder sb, + ContentGeneratorServerResultMethodParameters item, + string resultName) + { + if (codeDocumentationTagsGenerator.ShouldGenerateTags(item.DocumentationTags)) + { + sb.Append(codeDocumentationTagsGenerator.GenerateTags(4, item.DocumentationTags)); + } + + if (item.ResponseModel.StatusCode == HttpStatusCode.OK) + { + AppendMethodContentStatusCodeOk(sb, item, resultName); + } + else + { + if (useProblemDetailsAsDefaultResponseBody) + { + AppendMethodContentForOtherStatusCodesThenOkWithProblemDetails(sb, item, resultName); + } + else + { + AppendMethodContentForOtherStatusCodesThenOkWithoutProblemDetails(sb, item, resultName); + } + } + } + + private void AppendMethodContentStatusCodeOk( + StringBuilder sb, + ContentGeneratorServerResultMethodParameters item, + string resultName) + { + // TODO: byte[] bytes, string fileName + + if (string.IsNullOrEmpty(item.ResponseModel.DataType)) + { + sb.AppendLine(4, $"public static {resultName} Ok(string? message = null)"); + sb.AppendLine(8, "=> new(TypedResults.Ok(message));"); + return; + } + + sb.AppendLine( + 4, + string.IsNullOrEmpty(item.ResponseModel.CollectionDataType) + ? $"public static {resultName} Ok({item.ResponseModel.DataType} result)" + : $"public static {resultName} Ok({item.ResponseModel.CollectionDataType}<{item.ResponseModel.DataType}> result)"); + sb.AppendLine(8, "=> new(TypedResults.Ok(result));"); + } + + private void AppendMethodContentForOtherStatusCodesThenOkWithProblemDetails( + StringBuilder sb, + ContentGeneratorServerResultMethodParameters item, + string resultName) + { + switch (item.ResponseModel.StatusCode) + { + case HttpStatusCode.OK: + throw new InvalidOperationException("This should not happen."); + case HttpStatusCode.BadRequest: + sb.AppendLine(4, $"public static {resultName} {item.ResponseModel.StatusCode.ToNormalizedString()}(string? message = null, IDictionary? errors = null)"); + sb.AppendLine(8, $"=> new(Results.ValidationProblem(errors ?? new Dictionary(), message, null, StatusCodes.{item.ResponseModel.StatusCode.ToStatusCodesConstant()}));"); + break; + case HttpStatusCode.Accepted: + case HttpStatusCode.Created: + sb.AppendLine(4, $"public static {resultName} {item.ResponseModel.StatusCode.ToNormalizedString()}(string? uri = null)"); + sb.AppendLine(8, $"=> new(Results.Problem(uri, null, StatusCodes.{item.ResponseModel.StatusCode.ToStatusCodesConstant()}));"); + break; + case HttpStatusCode.NotFound: + case HttpStatusCode.Conflict: + sb.AppendLine(4, $"public static {resultName} {item.ResponseModel.StatusCode.ToNormalizedString()}(string? message = null)"); + sb.AppendLine(8, $"=> new(Results.Problem(message, null, StatusCodes.{item.ResponseModel.StatusCode.ToStatusCodesConstant()}));"); + break; + case HttpStatusCode.EarlyHints: + sb.AppendLine(4, $"public static {resultName} {item.ResponseModel.StatusCode.ToNormalizedString()}()"); + sb.AppendLine(8, $"=> new(Results.Problem(null, null, {(int)HttpStatusCode.EarlyHints}));"); + break; + case HttpStatusCode.Continue: + case HttpStatusCode.SwitchingProtocols: + case HttpStatusCode.Processing: + case HttpStatusCode.NonAuthoritativeInformation: + case HttpStatusCode.NoContent: + case HttpStatusCode.ResetContent: + case HttpStatusCode.PartialContent: + case HttpStatusCode.MultiStatus: + case HttpStatusCode.AlreadyReported: + case HttpStatusCode.IMUsed: + case HttpStatusCode.MultipleChoices: + case HttpStatusCode.MovedPermanently: + case HttpStatusCode.Found: + case HttpStatusCode.SeeOther: + case HttpStatusCode.NotModified: + case HttpStatusCode.UseProxy: + case HttpStatusCode.Unused: + case HttpStatusCode.RedirectKeepVerb: + case HttpStatusCode.PermanentRedirect: + case HttpStatusCode.Unauthorized: + case HttpStatusCode.PaymentRequired: + case HttpStatusCode.Forbidden: + case HttpStatusCode.MethodNotAllowed: + case HttpStatusCode.NotAcceptable: + case HttpStatusCode.ProxyAuthenticationRequired: + case HttpStatusCode.RequestTimeout: + case HttpStatusCode.Gone: + case HttpStatusCode.LengthRequired: + case HttpStatusCode.PreconditionFailed: + case HttpStatusCode.RequestEntityTooLarge: + case HttpStatusCode.RequestUriTooLong: + case HttpStatusCode.UnsupportedMediaType: + case HttpStatusCode.RequestedRangeNotSatisfiable: + case HttpStatusCode.ExpectationFailed: + case HttpStatusCode.MisdirectedRequest: + case HttpStatusCode.UnprocessableEntity: + case HttpStatusCode.Locked: + case HttpStatusCode.FailedDependency: + case HttpStatusCode.UpgradeRequired: + case HttpStatusCode.PreconditionRequired: + case HttpStatusCode.TooManyRequests: + case HttpStatusCode.RequestHeaderFieldsTooLarge: + case HttpStatusCode.UnavailableForLegalReasons: + case HttpStatusCode.InternalServerError: + case HttpStatusCode.NotImplemented: + case HttpStatusCode.BadGateway: + case HttpStatusCode.ServiceUnavailable: + case HttpStatusCode.GatewayTimeout: + case HttpStatusCode.HttpVersionNotSupported: + case HttpStatusCode.VariantAlsoNegotiates: + case HttpStatusCode.InsufficientStorage: + case HttpStatusCode.LoopDetected: + case HttpStatusCode.NotExtended: + case HttpStatusCode.NetworkAuthenticationRequired: + sb.AppendLine(4, $"public static {resultName} {item.ResponseModel.StatusCode.ToNormalizedString()}()"); + sb.AppendLine(8, $"=> new(Results.Problem(null, null, StatusCodes.{item.ResponseModel.StatusCode.ToStatusCodesConstant()}));"); + break; + default: + sb.AppendLine(4, $"// TODO: Not Implemented for {item.ResponseModel.StatusCode}."); + break; + } + } + + private void AppendMethodContentForOtherStatusCodesThenOkWithoutProblemDetails( + StringBuilder sb, + ContentGeneratorServerResultMethodParameters item, + string resultName) + { + switch (item.ResponseModel.StatusCode) + { + case HttpStatusCode.OK: + throw new InvalidOperationException("This should not happen."); + case HttpStatusCode.Forbidden: + sb.AppendLine(4, $"public static {resultName} {item.ResponseModel.StatusCode.ToNormalizedString()}()"); + sb.AppendLine(8, "=> new(TypedResults.Forbid());"); + break; + case HttpStatusCode.NoContent: + case HttpStatusCode.Unauthorized: + sb.AppendLine(4, $"public static {resultName} {item.ResponseModel.StatusCode.ToNormalizedString()}()"); + sb.AppendLine(8, $"=> new(TypedResults.{item.ResponseModel.StatusCode}());"); + break; + case HttpStatusCode.Accepted: + case HttpStatusCode.Created: + sb.AppendLine(4, $"public static {resultName} {item.ResponseModel.StatusCode.ToNormalizedString()}(string? uri = null)"); + sb.AppendLine(8, $"=> new(TypedResults.{item.ResponseModel.StatusCode}(uri));"); + break; + case HttpStatusCode.BadRequest: + case HttpStatusCode.NotFound: + case HttpStatusCode.Conflict: + sb.AppendLine(4, $"public static {resultName} {item.ResponseModel.StatusCode.ToNormalizedString()}(string? message = null)"); + sb.AppendLine(8, $"=> new(TypedResults.{item.ResponseModel.StatusCode}(message));"); + break; + case HttpStatusCode.EarlyHints: + sb.AppendLine(4, $"public static {resultName} {item.ResponseModel.StatusCode.ToNormalizedString()}()"); + sb.AppendLine(8, $"=> new(Results.StatusCode({(int)HttpStatusCode.EarlyHints}));"); + break; + case HttpStatusCode.Continue: + case HttpStatusCode.SwitchingProtocols: + case HttpStatusCode.Processing: + case HttpStatusCode.NonAuthoritativeInformation: + case HttpStatusCode.ResetContent: + case HttpStatusCode.PartialContent: + case HttpStatusCode.MultiStatus: + case HttpStatusCode.AlreadyReported: + case HttpStatusCode.IMUsed: + case HttpStatusCode.MultipleChoices: + case HttpStatusCode.MovedPermanently: + case HttpStatusCode.Found: + case HttpStatusCode.SeeOther: + case HttpStatusCode.NotModified: + case HttpStatusCode.UseProxy: + case HttpStatusCode.Unused: + case HttpStatusCode.RedirectKeepVerb: + case HttpStatusCode.PermanentRedirect: + case HttpStatusCode.PaymentRequired: + case HttpStatusCode.MethodNotAllowed: + case HttpStatusCode.NotAcceptable: + case HttpStatusCode.ProxyAuthenticationRequired: + case HttpStatusCode.RequestTimeout: + case HttpStatusCode.Gone: + case HttpStatusCode.LengthRequired: + case HttpStatusCode.PreconditionFailed: + case HttpStatusCode.RequestEntityTooLarge: + case HttpStatusCode.RequestUriTooLong: + case HttpStatusCode.UnsupportedMediaType: + case HttpStatusCode.RequestedRangeNotSatisfiable: + case HttpStatusCode.ExpectationFailed: + case HttpStatusCode.MisdirectedRequest: + case HttpStatusCode.UnprocessableEntity: + case HttpStatusCode.Locked: + case HttpStatusCode.FailedDependency: + case HttpStatusCode.UpgradeRequired: + case HttpStatusCode.PreconditionRequired: + case HttpStatusCode.TooManyRequests: + case HttpStatusCode.RequestHeaderFieldsTooLarge: + case HttpStatusCode.UnavailableForLegalReasons: + case HttpStatusCode.InternalServerError: + case HttpStatusCode.NotImplemented: + case HttpStatusCode.BadGateway: + case HttpStatusCode.ServiceUnavailable: + case HttpStatusCode.GatewayTimeout: + case HttpStatusCode.HttpVersionNotSupported: + case HttpStatusCode.VariantAlsoNegotiates: + case HttpStatusCode.InsufficientStorage: + case HttpStatusCode.LoopDetected: + case HttpStatusCode.NotExtended: + case HttpStatusCode.NetworkAuthenticationRequired: + sb.AppendLine(4, $"public static {resultName} {item.ResponseModel.StatusCode.ToNormalizedString()}()"); + sb.AppendLine(8, $"=> new(Results.StatusCode(StatusCodes.{item.ResponseModel.StatusCode.ToStatusCodesConstant()}));"); + break; + default: + sb.AppendLine(4, $"// TODO: Not Implemented for {item.ResponseModel.StatusCode}."); + break; + } + } + + private static void AppendImplicitOperatorContent( + StringBuilder sb, + ContentGeneratorServerResultParameters item) + { + if (item.ImplicitOperatorParameters is null) + { + return; + } + + sb.AppendLine(); + sb.AppendLine(4, "/// "); + sb.AppendLine(4, $"/// Performs an implicit conversion from {item.ResultName} to IResult."); + sb.AppendLine(4, "/// "); + sb.AppendLine(4, $"public static IResult ToIResult({item.ResultName} result)"); + sb.AppendLine(8, "=> result.Result;"); + } +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Minimal/ContentGenerators/ContentGeneratorServerServiceCollectionExtensions.cs b/src/Atc.Rest.ApiGenerator.Framework.Minimal/ContentGenerators/ContentGeneratorServerServiceCollectionExtensions.cs new file mode 100644 index 00000000..b07e4378 --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Framework.Minimal/ContentGenerators/ContentGeneratorServerServiceCollectionExtensions.cs @@ -0,0 +1,74 @@ +namespace Atc.Rest.ApiGenerator.Framework.Minimal.ContentGenerators; + +public class ContentGeneratorServerServiceCollectionExtensions : IContentGenerator +{ + private readonly ContentGeneratorBaseParameters parameters; + + public ContentGeneratorServerServiceCollectionExtensions( + ContentGeneratorBaseParameters parameters) + { + this.parameters = parameters; + } + + public string Generate() + { + var sb = new StringBuilder(); + + sb.AppendLine($"namespace {parameters.Namespace}.Extensions;"); // TODO: Move to constant + sb.AppendLine(); + sb.AppendLine("public static class ServiceCollectionExtensions"); + sb.AppendLine("{"); + sb.AppendLine(4, "public static void ConfigureApiVersioning("); + sb.AppendLine(8, "this IServiceCollection services)"); + sb.AppendLine(4, "{"); + sb.AppendLine(8, "services.AddEndpointsApiExplorer();"); + sb.AppendLine(8, "services.AddApiVersioning("); + sb.AppendLine(16, "options =>"); + sb.AppendLine(16, "{"); + sb.AppendLine(20, "// Specify the default API Version"); + sb.AppendLine(20, "options.DefaultApiVersion = new ApiVersion(1, 0);"); + sb.AppendLine(); + sb.AppendLine(20, "// If the client hasn't specified the API version in the request, use the default API version number"); + sb.AppendLine(20, "options.AssumeDefaultVersionWhenUnspecified = true;"); + sb.AppendLine(); + sb.AppendLine(20, "// reporting api versions will return the headers"); + sb.AppendLine(20, "// \"api-supported-versions\" and \"api-deprecated-versions\""); + sb.AppendLine(20, "options.ReportApiVersions = true;"); + sb.AppendLine(); + sb.AppendLine(20, "//// DEFAULT Version reader is QueryStringApiVersionReader();"); + sb.AppendLine(20, "//// clients request the specific version using the x-api-version header"); + sb.AppendLine(20, "//// Supporting multiple versioning scheme"); + sb.AppendLine(20, "options.ApiVersionReader = ApiVersionReader.Combine("); + sb.AppendLine(24, "new HeaderApiVersionReader(ApiVersionConstants.ApiVersionHeaderParameter),"); + sb.AppendLine(24, "new MediaTypeApiVersionReader(ApiVersionConstants.ApiVersionMediaTypeParameter),"); + sb.AppendLine(24, "new QueryStringApiVersionReader(ApiVersionConstants.ApiVersionQueryParameter),"); + sb.AppendLine(24, "new QueryStringApiVersionReader(ApiVersionConstants.ApiVersionQueryParameterShort),"); + sb.AppendLine(24, "new UrlSegmentApiVersionReader());"); + sb.AppendLine(16, "})"); + sb.AppendLine(12, ".AddApiExplorer(options =>"); + sb.AppendLine(12, "{"); + sb.AppendLine(16, "// add the versioned api explorer, which also adds IApiVersionDescriptionProvider service"); + sb.AppendLine(16, "// note: the specified format code will format the version as \'v'major[.minor][-status]\""); + sb.AppendLine(16, "options.GroupNameFormat = \"'v'VVV\";"); + sb.AppendLine(); + sb.AppendLine(16, "// note: this option is only necessary when versioning by url segment. The SubstitutionFormat"); + sb.AppendLine(16, "// can also be used to control the format of the API version in route templates"); + sb.AppendLine(16, "options.SubstituteApiVersionInUrl = true;"); + sb.AppendLine(12, "});"); + sb.AppendLine(8, "}"); + sb.AppendLine(); + sb.AppendLine(4, "public static void ConfigureSwagger("); + sb.AppendLine(8, "this IServiceCollection services)"); + sb.AppendLine(4, "{"); + sb.AppendLine(8, "services.AddTransient, ConfigureSwaggerOptions>();"); + sb.AppendLine(8, "services.AddSwaggerGen(options =>"); + sb.AppendLine(8, "{"); + sb.AppendLine(12, "options.OperationFilter();"); + sb.AppendLine(12, "options.DocumentFilter();"); + sb.AppendLine(8, "});"); + sb.AppendLine(4, "}"); + sb.Append('}'); + + return sb.ToString(); + } +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Minimal/ContentGenerators/ContentGeneratorServerWebApplicationBuilderExtensions.cs b/src/Atc.Rest.ApiGenerator.Framework.Minimal/ContentGenerators/ContentGeneratorServerWebApplicationBuilderExtensions.cs new file mode 100644 index 00000000..21e29af4 --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Framework.Minimal/ContentGenerators/ContentGeneratorServerWebApplicationBuilderExtensions.cs @@ -0,0 +1,52 @@ +namespace Atc.Rest.ApiGenerator.Framework.Minimal.ContentGenerators; + +public class ContentGeneratorServerWebApplicationBuilderExtensions : IContentGenerator +{ + private readonly ContentGeneratorBaseParameters parameters; + + public ContentGeneratorServerWebApplicationBuilderExtensions( + ContentGeneratorBaseParameters parameters) + { + this.parameters = parameters; + } + + public string Generate() + { + var sb = new StringBuilder(); + + sb.AppendLine($"namespace {parameters.Namespace}.Extensions;"); // TODO: Move to constant + sb.AppendLine(); + sb.AppendLine("public static class WebApplicationBuilderExtensions"); + sb.AppendLine("{"); + sb.AppendLine(4, "public static void ConfigureLogging("); + sb.AppendLine(8, "this WebApplicationBuilder builder)"); + sb.AppendLine(4, "{"); + sb.AppendLine(8, "ArgumentNullException.ThrowIfNull(builder);"); + sb.AppendLine(); + sb.AppendLine(8, "builder.Services.AddLogging(logging =>"); + sb.AppendLine(8, "{"); + sb.AppendLine(12, "logging.SetMinimumLevel(LogLevel.Information);"); + sb.AppendLine(12, "logging.AddConsole();"); + sb.AppendLine(12, "logging.AddDebug();"); + sb.AppendLine(8, "});"); + sb.AppendLine(); + sb.AppendLine(8, "builder.Services.AddHttpLogging(logging =>"); + sb.AppendLine(8, "{"); + sb.AppendLine(12, "logging.LoggingFields = HttpLoggingFields.All;"); + sb.AppendLine(12, "logging.RequestHeaders.Add(\"Authorization\");"); + sb.AppendLine(12, "logging.RequestBodyLogLimit = 4096;"); + sb.AppendLine(12, "logging.ResponseBodyLogLimit = 4096;"); + sb.AppendLine(12, "logging.MediaTypeOptions.AddText(\"application/json\");"); + sb.AppendLine(8, "});"); + sb.AppendLine(); + sb.AppendLine(8, "builder.Services.AddApplicationInsightsTelemetry();"); + sb.AppendLine(); + sb.AppendLine(8, "builder.Logging.AddFilter("); + sb.AppendLine(12, "\"Microsoft.AspNetCore.HttpLogging.HttpLoggingMiddleware\","); + sb.AppendLine(12, "LogLevel.Trace);"); + sb.AppendLine(4, "}"); + sb.Append('}'); + + return sb.ToString(); + } +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Minimal/Factories/ContentGeneratorServerHandlerInterfaceParametersFactory.cs b/src/Atc.Rest.ApiGenerator.Framework.Minimal/Factories/ContentGeneratorServerHandlerInterfaceParametersFactory.cs new file mode 100644 index 00000000..93316a3d --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Framework.Minimal/Factories/ContentGeneratorServerHandlerInterfaceParametersFactory.cs @@ -0,0 +1,81 @@ +namespace Atc.Rest.ApiGenerator.Framework.Minimal.Factories; + +public static class ContentGeneratorServerHandlerInterfaceParametersFactory +{ + public static InterfaceParameters Create( + string headerContent, + string @namespace, + AttributeParameters codeGeneratorAttribute, + OpenApiPathItem openApiPath, + OpenApiOperation openApiOperation) + { + ArgumentNullException.ThrowIfNull(openApiOperation); + + var operationName = openApiOperation.GetOperationName(); + + var methodParametersAttributes = new Dictionary(StringComparer.Ordinal); + var methodParametersParameters = new List(); + if (openApiPath.HasParameters() || + openApiOperation.HasParametersOrRequestBody()) + { + methodParametersAttributes.Add("parameters", "The parameters."); + methodParametersParameters.Add( + new ParameterBaseParameters( + Attributes: null, + GenericTypeName: null, + IsGenericListType: false, + TypeName: $"{operationName}{ContentGeneratorConstants.Parameters}", + IsNullableType: false, + IsReferenceType: true, + Name: "parameters", + DefaultValue: null)); + } + + methodParametersAttributes.Add("cancellationToken", "The cancellation token."); + methodParametersParameters.Add( + new ParameterBaseParameters( + Attributes: null, + GenericTypeName: null, + IsGenericListType: false, + TypeName: "CancellationToken", + IsNullableType: false, + IsReferenceType: true, + Name: "cancellationToken", + DefaultValue: "default")); + + var returnTypeName = $"{operationName}{ContentGeneratorConstants.Result}"; + + var methodParameters = new List + { + new( + DocumentationTags: new CodeDocumentationTags( + "Execute method", + parameters: methodParametersAttributes, + remark: null, + code: null, + example: null, + exceptions: null, + @return: null), + Attributes: null, + AccessModifier: AccessModifiers.None, + ReturnTypeName: returnTypeName, + ReturnGenericTypeName: "Task", + Name: "ExecuteAsync", + Parameters: methodParametersParameters, + AlwaysBreakDownParameters: true, + UseExpressionBody: false, + Content: null), + }; + + return new InterfaceParameters( + headerContent, + @namespace, + DocumentationTags: openApiOperation.ExtractDocumentationTagsForHandlerInterface(), + new List { codeGeneratorAttribute }, + AccessModifiers.Public, + InterfaceTypeName: $"I{operationName}{ContentGeneratorConstants.Handler}", + InheritedInterfaceTypeName: null, + Properties: null, + Methods: methodParameters); + } +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Minimal/Factories/ContentGeneratorServerHandlerParametersFactory.cs b/src/Atc.Rest.ApiGenerator.Framework.Minimal/Factories/ContentGeneratorServerHandlerParametersFactory.cs new file mode 100644 index 00000000..03e8379e --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Framework.Minimal/Factories/ContentGeneratorServerHandlerParametersFactory.cs @@ -0,0 +1,141 @@ +namespace Atc.Rest.ApiGenerator.Framework.Minimal.Factories; + +public static class ContentGeneratorServerHandlerParametersFactory +{ + public static ClassParameters Create( + string @namespace, + string contractNamespace, + OpenApiPathItem openApiPath, + OpenApiOperation openApiOperation) + { + ArgumentNullException.ThrowIfNull(openApiOperation); + + var operationName = openApiOperation.GetOperationName(); + + var hasParameters = openApiPath.HasParameters() || + openApiOperation.HasParametersOrRequestBody(); + + var methodParametersParameters = new List(); + if (hasParameters) + { + methodParametersParameters.Add( + new ParameterBaseParameters( + Attributes: null, + GenericTypeName: null, + IsGenericListType: false, + TypeName: $"{operationName}{ContentGeneratorConstants.Parameters}", + IsNullableType: false, + IsReferenceType: true, + Name: "parameters", + DefaultValue: null)); + } + + methodParametersParameters.Add( + new ParameterBaseParameters( + Attributes: null, + GenericTypeName: null, + IsGenericListType: false, + TypeName: "CancellationToken", + IsNullableType: false, + IsReferenceType: true, + Name: "cancellationToken", + DefaultValue: "default")); + + var methodParameters = new List + { + new( + DocumentationTags: null, + Attributes: null, + AccessModifier: AccessModifiers.Public, + ReturnTypeName: $"{operationName}{ContentGeneratorConstants.Result}", + ReturnGenericTypeName: "Task", + Name: "ExecuteAsync", + Parameters: methodParametersParameters, + AlwaysBreakDownParameters: true, + UseExpressionBody: false, + Content: GenerateContentExecuteMethod(hasParameters, operationName)), + }; + + return new ClassParameters( + HeaderContent: null, + @namespace, + openApiOperation.ExtractDocumentationTagsForHandler(), + Attributes: null, + AccessModifiers.PublicClass, + ClassTypeName: $"{operationName}{ContentGeneratorConstants.Handler}", + GenericTypeName: null, + InheritedClassTypeName: $"I{operationName}{ContentGeneratorConstants.Handler}", + InheritedGenericClassTypeName: null, + InheritedInterfaceTypeName: null, + Constructors: null, + Properties: null, + Methods: methodParameters, + GenerateToStringMethod: false); + } + + public static ClassParameters CreateForCustomTest( + string @namespace, + OpenApiOperation openApiOperation) + { + var operationName = openApiOperation.GetOperationName(); + + var methodParameters = new List + { + new( + DocumentationTags: null, + Attributes: AttributesParametersFactory.Create("Fact", "Skip = \"Change this to a real test\""), + AccessModifier: AccessModifiers.Public, + ReturnTypeName: "void", + ReturnGenericTypeName: null, + Name: "Sample", + Parameters: null, + AlwaysBreakDownParameters: false, + UseExpressionBody: false, + Content: GenerateContentTestSample()), + }; + + return new ClassParameters( + HeaderContent: null, + @namespace, + DocumentationTags: null, + Attributes: null, + AccessModifiers.PublicClass, + ClassTypeName: $"{operationName}{ContentGeneratorConstants.HandlerTests}", + GenericTypeName: null, + InheritedClassTypeName: null, + InheritedGenericClassTypeName: null, + InheritedInterfaceTypeName: null, + Constructors: null, + Properties: null, + Methods: methodParameters, + GenerateToStringMethod: false); + } + + private static string GenerateContentExecuteMethod( + bool hasParameters, + string operationName) + { + var sb = new StringBuilder(); + if (hasParameters) + { + sb.AppendLine("ArgumentNullException.ThrowIfNull(parameters);"); + sb.AppendLine(); + } + + sb.Append($"throw new NotImplementedException(\"Add logic here for {operationName}{ContentGeneratorConstants.Handler}\");"); + return sb.ToString(); + } + + private static string GenerateContentTestSample() + { + var sb = new StringBuilder(); + sb.AppendLine(4, "{"); + sb.AppendLine(8, "// Arrange"); + sb.AppendLine(); + sb.AppendLine(8, "// Act"); + sb.AppendLine(); + sb.AppendLine(8, "// Assert"); + sb.Append(4, "}"); + return sb.ToString(); + } +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Minimal/Factories/ContentGeneratorServerResultParametersFactory.cs b/src/Atc.Rest.ApiGenerator.Framework.Minimal/Factories/ContentGeneratorServerResultParametersFactory.cs new file mode 100644 index 00000000..6069cd24 --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Framework.Minimal/Factories/ContentGeneratorServerResultParametersFactory.cs @@ -0,0 +1,92 @@ +// ReSharper disable ConvertIfStatementToReturnStatement +// ReSharper disable SwitchStatementMissingSomeEnumCasesNoDefault +// ReSharper disable InvertIf +// ReSharper disable LoopCanBeConvertedToQuery +namespace Atc.Rest.ApiGenerator.Framework.Minimal.Factories; + +public static class ContentGeneratorServerResultParametersFactory +{ + public static ContentGeneratorServerResultParameters Create( + string @namespace, + OpenApiOperation openApiOperation) + { + ArgumentNullException.ThrowIfNull(openApiOperation); + + var operationName = openApiOperation.GetOperationName(); + var httpStatusCodes = openApiOperation.Responses.GetHttpStatusCodes(); + + // Methods + var methodParameters = new List(); + var responseModels = openApiOperation.ExtractApiOperationResponseModels().ToList(); + + foreach (var responseModel in responseModels.OrderBy(x => x.StatusCode)) + { + var httpStatusCode = responseModel.StatusCode; + var documentationTags = new CodeDocumentationTags($"{(int)httpStatusCode} - {httpStatusCode.ToNormalizedString()} response."); + + methodParameters.Add( + new ContentGeneratorServerResultMethodParameters( + documentationTags, + responseModel)); + } + + ContentGeneratorServerResultImplicitOperatorParameters? implicitOperatorParameters = null; + + var okResponseModel = responseModels.Find(x => x.StatusCode == HttpStatusCode.OK) ?? + responseModels.Find(x => x.StatusCode == HttpStatusCode.Created); + + if (ShouldAppendImplicitOperatorContent(httpStatusCodes, okResponseModel?.DataType, openApiOperation.Responses.IsSchemaUsingBinaryFormatForOkResponse())) + { + var collectionDataType = okResponseModel?.CollectionDataType; + var dataType = okResponseModel?.DataType; + + // Implicit Operator + implicitOperatorParameters = new ContentGeneratorServerResultImplicitOperatorParameters( + CollectionDataType: collectionDataType, + DataType: dataType); + } + + return new ContentGeneratorServerResultParameters( + @namespace, + operationName, + openApiOperation.ExtractDocumentationTagsForResult(), + $"{operationName}{ContentGeneratorConstants.Result}", + methodParameters, + implicitOperatorParameters); + } + + private static bool ShouldAppendImplicitOperatorContent( + ICollection httpStatusCodes, + string? modelName, + bool isSchemaUsingBinaryFormatForOkResponse) + { + if (!httpStatusCodes.Contains(HttpStatusCode.OK) && + !httpStatusCodes.Contains(HttpStatusCode.Created)) + { + return false; + } + + var httpStatusCode = HttpStatusCode.Continue; // Dummy + if (httpStatusCodes.Contains(HttpStatusCode.OK)) + { + httpStatusCode = HttpStatusCode.OK; + } + else if (httpStatusCodes.Contains(HttpStatusCode.Created)) + { + httpStatusCode = HttpStatusCode.Created; + } + + if (string.IsNullOrEmpty(modelName) && + httpStatusCode == HttpStatusCode.Created) + { + return false; + } + + if (isSchemaUsingBinaryFormatForOkResponse) + { + return false; + } + + return true; + } +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Minimal/GlobalUsings.cs b/src/Atc.Rest.ApiGenerator.Framework.Minimal/GlobalUsings.cs new file mode 100644 index 00000000..d29d6928 --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Framework.Minimal/GlobalUsings.cs @@ -0,0 +1,27 @@ +global using System.Net; +global using System.Text; + +global using Atc.CodeDocumentation.CodeComment; +global using Atc.CodeGeneration.CSharp.Content; +global using Atc.CodeGeneration.CSharp.Content.Factories; +global using Atc.CodeGeneration.CSharp.Content.Generators; +global using Atc.CodeGeneration.CSharp.Extensions; +global using Atc.Rest.ApiGenerator.Contracts; +global using Atc.Rest.ApiGenerator.Contracts.ContentGeneratorsParameters; +global using Atc.Rest.ApiGenerator.Contracts.ContentGeneratorsParameters.Server; +global using Atc.Rest.ApiGenerator.Contracts.Extensions; +global using Atc.Rest.ApiGenerator.Contracts.Models; +global using Atc.Rest.ApiGenerator.Framework.ContentGenerators; +global using Atc.Rest.ApiGenerator.Framework.ContentGeneratorsParameters.Server; +global using Atc.Rest.ApiGenerator.Framework.Factories.Parameters.Server; +global using Atc.Rest.ApiGenerator.Framework.Factories.Parameters.ServerClient; +global using Atc.Rest.ApiGenerator.Framework.Factories.Server; +global using Atc.Rest.ApiGenerator.Framework.Helpers; +global using Atc.Rest.ApiGenerator.Framework.Minimal.Factories; +global using Atc.Rest.ApiGenerator.Framework.ProjectGenerator; +global using Atc.Rest.ApiGenerator.Framework.Providers; +global using Atc.Rest.ApiGenerator.Framework.Writers; +global using Atc.Rest.ApiGenerator.OpenApi.Extensions; + +global using Microsoft.Extensions.Logging; +global using Microsoft.OpenApi.Models; \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Minimal/ProjectGenerator/ServerApiGenerator.cs b/src/Atc.Rest.ApiGenerator.Framework.Minimal/ProjectGenerator/ServerApiGenerator.cs new file mode 100644 index 00000000..50563a8a --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Framework.Minimal/ProjectGenerator/ServerApiGenerator.cs @@ -0,0 +1,465 @@ +// ReSharper disable ArrangeObjectCreationWhenTypeNotEvident +namespace Atc.Rest.ApiGenerator.Framework.Minimal.ProjectGenerator; + +public class ServerApiGenerator : IServerApiGenerator +{ + private readonly ILogger logger; + private readonly INugetPackageReferenceProvider nugetPackageReferenceProvider; + private readonly Version apiGeneratorVersion; + private readonly string projectName; + private readonly DirectoryInfo projectPath; + private readonly OpenApiDocument openApiDocument; + private readonly IList operationSchemaMappings; + private readonly string routeBase; + private readonly string codeGeneratorContentHeader; + private readonly AttributeParameters codeGeneratorAttribute; + private readonly bool useProblemDetailsAsDefaultResponseBody; + private readonly bool includeDeprecated; + + public ServerApiGenerator( + ILoggerFactory loggerFactory, + INugetPackageReferenceProvider nugetPackageReferenceProvider, + Version apiGeneratorVersion, + string projectName, + DirectoryInfo projectPath, + OpenApiDocument openApiDocument, + IList operationSchemaMappings, + string routeBase, + bool useProblemDetailsAsDefaultResponseBody, + bool includeDeprecated) + { + ArgumentNullException.ThrowIfNull(loggerFactory); + ArgumentNullException.ThrowIfNull(nugetPackageReferenceProvider); + ArgumentNullException.ThrowIfNull(apiGeneratorVersion); + ArgumentNullException.ThrowIfNull(projectName); + ArgumentNullException.ThrowIfNull(projectPath); + ArgumentNullException.ThrowIfNull(openApiDocument); + ArgumentNullException.ThrowIfNull(routeBase); + + logger = loggerFactory.CreateLogger(); + this.nugetPackageReferenceProvider = nugetPackageReferenceProvider; + this.apiGeneratorVersion = apiGeneratorVersion; + this.projectName = projectName; + this.projectPath = projectPath; + this.openApiDocument = openApiDocument; + this.operationSchemaMappings = operationSchemaMappings; + this.routeBase = routeBase; + this.useProblemDetailsAsDefaultResponseBody = useProblemDetailsAsDefaultResponseBody; + this.includeDeprecated = includeDeprecated; + + codeGeneratorContentHeader = GeneratedCodeHeaderGeneratorFactory + .Create(apiGeneratorVersion) + .Generate(); + codeGeneratorAttribute = new AttributeParameters( + "GeneratedCode", + $"\"{ContentWriterConstants.ApiGeneratorName}\", \"{apiGeneratorVersion}\""); + } + + public async Task ScaffoldProjectFile() + { + var packageReferences = await nugetPackageReferenceProvider.GetPackageReferencesForApiProjectForMinimalApi(); + + var itemGroupPackageReferences = packageReferences + .Select(packageReference => new ItemGroupParameter( + "PackageReference", + [ + new("Include", packageReference.PackageId), + new("Version", packageReference.PackageVersion), + ], + Value: null)) + .ToList(); + + var projectFileParameters = new ProjectFileParameters( + "Microsoft.NET.Sdk", + [ + [ + new("TargetFramework", Attributes: null, "net8.0"), + new("IsPackable", Attributes: null, "false"), + ], + [ + new("GenerateDocumentationFile", Attributes: null, "true"), + ], + [ + new("DocumentationFile", Attributes: null, @$"bin\Debug\net8.0\{projectName}.xml"), + new("NoWarn", Attributes: null, "1573;1591;1701;1702;1712;8618;"), + ], + ], + [ + itemGroupPackageReferences, + ]); + + var contentGenerator = new GenerateContentForProjectFile( + projectFileParameters); + + var content = contentGenerator.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + projectPath, + projectPath.CombineFileInfo($"{projectName}.csproj"), + ContentWriterArea.Src, + content, + overrideIfExist: false); + } + + public void GenerateAssemblyMarker() + { + ArgumentNullException.ThrowIfNull(apiGeneratorVersion); + + var suppressMessageAvoidEmptyInterfaceAttribute = new AttributeParameters( + "SuppressMessage", + "\"Design\", \"CA1040:Avoid empty interfaces\", Justification = \"OK.\""); + + var interfaceParameters = InterfaceParametersFactory.Create( + codeGeneratorContentHeader, + projectName, + [suppressMessageAvoidEmptyInterfaceAttribute, codeGeneratorAttribute], + "IApiContractAssemblyMarker"); + + var contentGenerator = new GenerateContentForInterface( + new CodeDocumentationTagsGenerator(), + interfaceParameters); + + var content = contentGenerator.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + projectPath, + projectPath.CombineFileInfo("IApiContractAssemblyMarker.cs"), + ContentWriterArea.Src, + content); + } + + public void GenerateModels() + { + foreach (var apiGroupName in openApiDocument.GetApiGroupNames()) + { + var apiOperations = operationSchemaMappings + .Where(x => x.ApiGroupName.Equals(apiGroupName, StringComparison.OrdinalIgnoreCase)) + .ToList(); + + var apiOperationModels = GetDistinctApiOperationModels(apiOperations); + + foreach (var apiOperationModel in apiOperationModels) + { + var apiSchema = openApiDocument.Components.Schemas.First(x => x.GetFormattedKey().Equals(apiOperationModel.Name, StringComparison.OrdinalIgnoreCase)); + + var modelName = apiSchema.GetFormattedKey(); + + if (apiOperationModel.IsEnum) + { + GenerateEnumerationType(modelName, apiSchema.Value.GetEnumSchema().Item2); + } + else + { + GenerateModel(modelName, apiSchema.Value, apiGroupName, apiOperationModel.IsShared); + } + } + } + } + + public void GenerateParameters() + { + foreach (var openApiPath in openApiDocument.Paths) + { + var apiGroupName = openApiPath.GetApiGroupName(); + + var fullNamespace = $"{projectName}.{ContentGeneratorConstants.Contracts}.{apiGroupName}"; + + foreach (var openApiOperation in openApiPath.Value.Operations) + { + if (openApiOperation.Value.Deprecated && !includeDeprecated) + { + continue; + } + + if (!openApiPath.Value.HasParameters() && + !openApiOperation.Value.HasParametersOrRequestBody()) + { + continue; + } + + var parameterParameters = ContentGeneratorServerParameterParametersFactory.CreateForRecord( + fullNamespace, + openApiOperation.Value, + openApiPath.Value.Parameters); + + var contentGenerator = new ContentGenerators.ContentGeneratorServerParameter( + new GeneratedCodeHeaderGenerator(new GeneratedCodeGeneratorParameters(apiGeneratorVersion)), + new GeneratedCodeAttributeGenerator(new GeneratedCodeGeneratorParameters(apiGeneratorVersion)), + new CodeDocumentationTagsGenerator(), + parameterParameters); + + var content = contentGenerator.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + projectPath, + projectPath.CombineFileInfo(ContentGeneratorConstants.Contracts, apiGroupName, ContentGeneratorConstants.Parameters, $"{parameterParameters.ParameterName}.cs"), + ContentWriterArea.Src, + content); + } + } + } + + public void GenerateResults() + { + foreach (var openApiPath in openApiDocument.Paths) + { + var apiGroupName = openApiPath.GetApiGroupName(); + + var fullNamespace = $"{projectName}.{ContentGeneratorConstants.Contracts}.{apiGroupName}"; + + foreach (var openApiOperation in openApiPath.Value.Operations) + { + if (openApiOperation.Value.Deprecated && !includeDeprecated) + { + continue; + } + + var resultParameters = ContentGeneratorServerResultParametersFactory.Create( + fullNamespace, + openApiOperation.Value); + + var contentGenerator = new ContentGenerators.ContentGeneratorServerResult( + new GeneratedCodeHeaderGenerator(new GeneratedCodeGeneratorParameters(apiGeneratorVersion)), + new GeneratedCodeAttributeGenerator(new GeneratedCodeGeneratorParameters(apiGeneratorVersion)), + new CodeDocumentationTagsGenerator(), + resultParameters, + useProblemDetailsAsDefaultResponseBody); + + var content = contentGenerator.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + projectPath, + projectPath.CombineFileInfo(ContentGeneratorConstants.Contracts, apiGroupName, ContentGeneratorConstants.Results, $"{resultParameters.ResultName}.cs"), + ContentWriterArea.Src, + content); + } + } + } + + public void GenerateInterfaces() + { + foreach (var openApiPath in openApiDocument.Paths) + { + var apiGroupName = openApiPath.GetApiGroupName(); + + var fullNamespace = $"{projectName}.{ContentGeneratorConstants.Contracts}.{apiGroupName}"; + + foreach (var openApiOperation in openApiPath.Value.Operations) + { + if (openApiOperation.Value.Deprecated && !includeDeprecated) + { + continue; + } + + var interfaceParameters = ContentGeneratorServerHandlerInterfaceParametersFactory.Create( + codeGeneratorContentHeader, + fullNamespace, + codeGeneratorAttribute, + openApiPath.Value, + openApiOperation.Value); + + var contentGeneratorInterface = new GenerateContentForInterface( + new CodeDocumentationTagsGenerator(), + interfaceParameters); + + var content = contentGeneratorInterface.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + projectPath, + projectPath.CombineFileInfo(ContentGeneratorConstants.Contracts, apiGroupName, ContentGeneratorConstants.Interfaces, $"{interfaceParameters.InterfaceTypeName}.cs"), + ContentWriterArea.Src, + content); + } + } + } + + public void GenerateEndpoints() + { + foreach (var apiGroupName in openApiDocument.GetApiGroupNames()) + { + var endpointParameters = ContentGeneratorServerEndpointParametersFactory.Create( + operationSchemaMappings, + projectName, + $"{projectName}.{ContentGeneratorConstants.Endpoints}", + apiGroupName, + GetRouteByApiGroupName(apiGroupName), + ContentGeneratorConstants.EndpointDefinition, + openApiDocument); + + var contentGenerator = new ContentGenerators.ContentGeneratorServerEndpoints( + new GeneratedCodeHeaderGenerator(new GeneratedCodeGeneratorParameters(apiGeneratorVersion)), + new GeneratedCodeAttributeGenerator(new GeneratedCodeGeneratorParameters(apiGeneratorVersion)), + new CodeDocumentationTagsGenerator(), + endpointParameters, + useProblemDetailsAsDefaultResponseBody); + + var content = contentGenerator.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + projectPath, + projectPath.CombineFileInfo(ContentGeneratorConstants.Endpoints, $"{endpointParameters.EndpointName}.cs"), + ContentWriterArea.Src, + content); + } + } + + public void MaintainApiSpecification( + FileInfo apiSpecificationFile) + => ResourcesHelper.CopyApiSpecification( + apiSpecificationFile, + openApiDocument, + projectPath); + + public void MaintainGlobalUsings( + bool removeNamespaceGroupSeparatorInGlobalUsings) + { + var requiredUsings = new List + { + "System.CodeDom.Compiler", + "System.ComponentModel.DataAnnotations", + "System.Diagnostics.CodeAnalysis", + "Atc.Rest.MinimalApi.Abstractions", + "Microsoft.AspNetCore.Builder", + "Microsoft.AspNetCore.Http", + "Microsoft.AspNetCore.Mvc", + }; + + if (openApiDocument.IsUsingRequiredForSystemTextJsonSerializationAndSystemRuntimeSerialization(includeDeprecated)) + { + requiredUsings.Add("System.Runtime.Serialization"); + requiredUsings.Add("System.Text.Json.Serialization"); + } + + if (openApiDocument.IsUsingRequiredForAtcRestResults()) + { + requiredUsings.Add("Atc.Rest.Results"); + } + + if (openApiDocument.IsUsingRequiredForMicrosoftAspNetCoreAuthorization(includeDeprecated)) + { + requiredUsings.Add("Microsoft.AspNetCore.Authorization"); + } + + if (openApiDocument.IsUsingRequiredForAtcRestMinimalApiFiltersEndpoints()) + { + requiredUsings.Add("Atc.Rest.MinimalApi.Filters.Endpoints"); + } + + // TODO: Check for any use ?? + requiredUsings.Add("Microsoft.AspNetCore.Authorization"); + + var apiGroupNames = openApiDocument.GetApiGroupNames(); + + // TODO: Check for any use ?? + requiredUsings.Add($"{projectName}.{ContentGeneratorConstants.Contracts}"); + + requiredUsings.AddRange(apiGroupNames.Select(x => $"{projectName}.{ContentGeneratorConstants.Contracts}.{x}")); + + GlobalUsingsHelper.CreateOrUpdate( + logger, + ContentWriterArea.Src, + projectPath, + requiredUsings, + removeNamespaceGroupSeparatorInGlobalUsings); + } + + private string GetRouteByApiGroupName( + string apiGroupName) + { + var (key, _) = openApiDocument.Paths.FirstOrDefault(x => x.IsPathStartingSegmentName(apiGroupName)); + if (key is null) + { + throw new NotSupportedException($"{nameof(apiGroupName)} was not found in any route."); + } + + var routeSuffix = key + .Split('/', StringSplitOptions.RemoveEmptyEntries) + .FirstOrDefault(); + + return $"{routeBase}/{routeSuffix}"; + } + + private void GenerateEnumerationType( + string enumerationName, + OpenApiSchema openApiSchemaEnumeration) + { + var fullNamespace = $"{projectName}.{ContentGeneratorConstants.Contracts}"; + + var enumParameters = ContentGeneratorServerClientEnumParametersFactory.Create( + codeGeneratorContentHeader, + fullNamespace, + codeGeneratorAttribute, + enumerationName, + openApiSchemaEnumeration.Enum); + + var contentGenerator = new GenerateContentForEnum( + new CodeDocumentationTagsGenerator(), + enumParameters); + + var content = contentGenerator.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + projectPath, + projectPath.CombineFileInfo(ContentGeneratorConstants.Contracts, ContentGeneratorConstants.SpecialFolderEnumerationTypes, $"{enumerationName}.cs"), + ContentWriterArea.Src, + content); + } + + private void GenerateModel( + string modelName, + OpenApiSchema apiSchemaModel, + string apiGroupName, + bool isSharedContract) + { + var fullNamespace = isSharedContract + ? $"{projectName}.{ContentGeneratorConstants.Contracts}" + : $"{projectName}.{ContentGeneratorConstants.Contracts}.{apiGroupName}"; + + var parameters = ContentGeneratorServerClientModelParametersFactory.CreateForRecord( + codeGeneratorContentHeader, + fullNamespace, + codeGeneratorAttribute, + modelName, + apiSchemaModel, + includeDeprecated); + + var contentGeneratorRecord = new GenerateContentForRecords( + new CodeDocumentationTagsGenerator(), + parameters); + + var content = contentGeneratorRecord.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + projectPath, + isSharedContract + ? projectPath.CombineFileInfo(ContentGeneratorConstants.Contracts, ContentGeneratorConstants.SpecialFolderSharedModels, $"{modelName}.cs") + : projectPath.CombineFileInfo(ContentGeneratorConstants.Contracts, apiGroupName, ContentGeneratorConstants.Models, $"{modelName}.cs"), + ContentWriterArea.Src, + content); + } + + private static List GetDistinctApiOperationModels( + List apiOperations) + { + var result = new List(); + + foreach (var apiOperation in apiOperations) + { + var apiOperationModel = result.Find(x => x.Name.Equals(apiOperation.Model.Name, StringComparison.Ordinal)); + if (apiOperationModel is null) + { + result.Add(apiOperation.Model); + } + } + + return result; + } +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Minimal/ProjectGenerator/ServerDomainGenerator.cs b/src/Atc.Rest.ApiGenerator.Framework.Minimal/ProjectGenerator/ServerDomainGenerator.cs new file mode 100644 index 00000000..3b5ae9a1 --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Framework.Minimal/ProjectGenerator/ServerDomainGenerator.cs @@ -0,0 +1,340 @@ +// ReSharper disable ArrangeObjectCreationWhenTypeNotEvident +// ReSharper disable ForeachCanBePartlyConvertedToQueryUsingAnotherGetEnumerator +namespace Atc.Rest.ApiGenerator.Framework.Minimal.ProjectGenerator; + +public class ServerDomainGenerator : IServerDomainGenerator +{ + private readonly ILogger logger; + private readonly INugetPackageReferenceProvider nugetPackageReferenceProvider; + private readonly string projectName; + private readonly string apiProjectName; + private readonly DirectoryInfo projectPath; + private readonly OpenApiDocument openApiDocument; + private readonly string codeGeneratorContentHeader; + private readonly AttributeParameters codeGeneratorAttribute; + + public ServerDomainGenerator( + ILoggerFactory loggerFactory, + INugetPackageReferenceProvider nugetPackageReferenceProvider, + Version apiGeneratorVersion, + string projectName, + string apiProjectName, + DirectoryInfo projectPath, + OpenApiDocument openApiDocument) + { + ArgumentNullException.ThrowIfNull(loggerFactory); + ArgumentNullException.ThrowIfNull(nugetPackageReferenceProvider); + ArgumentNullException.ThrowIfNull(apiGeneratorVersion); + ArgumentNullException.ThrowIfNull(projectName); + ArgumentNullException.ThrowIfNull(apiProjectName); + ArgumentNullException.ThrowIfNull(projectPath); + ArgumentNullException.ThrowIfNull(openApiDocument); + + logger = loggerFactory.CreateLogger(); + this.nugetPackageReferenceProvider = nugetPackageReferenceProvider; + this.projectName = projectName; + this.apiProjectName = apiProjectName; + this.projectPath = projectPath; + this.openApiDocument = openApiDocument; + + codeGeneratorContentHeader = GeneratedCodeHeaderGeneratorFactory + .Create(apiGeneratorVersion) + .Generate(); + codeGeneratorAttribute = AttributeParametersFactory + .CreateGeneratedCode(apiGeneratorVersion); + } + + public async Task ScaffoldProjectFile() + { + var packageReferences = await nugetPackageReferenceProvider.GetPackageReferencesForDomainProjectForMinimalApi(); + + var itemGroupPackageReferences = packageReferences! + .Select(packageReference => new ItemGroupParameter( + "PackageReference", + [ + new("Include", packageReference.PackageId), + new("Version", packageReference.PackageVersion), + ], + Value: null)) + .ToList(); + + var projectFileParameters = new ProjectFileParameters( + "Microsoft.NET.Sdk", + [ + [ + new("TargetFramework", Attributes: null, "net8.0"), + new("IsPackable", Attributes: null, "false"), + ], + [ + new("GenerateDocumentationFile", Attributes: null, "true"), + ], + [ + new("DocumentationFile", Attributes: null, @$"bin\Debug\net8.0\{projectName}.xml"), + new("NoWarn", Attributes: null, "1573;1591;1701;1702;1712;8618;"), + ], + ], + [ + [ + new( + "FrameworkReference", + [ + new("Include", "Microsoft.AspNetCore.App"), + ], + Value: null), + ], + itemGroupPackageReferences, + [ + new( + "ProjectReference", + [ + new("Include", @$"..\{apiProjectName}\{apiProjectName}.csproj"), + ], + Value: null), + ], + ]); + + var contentGenerator = new GenerateContentForProjectFile( + projectFileParameters); + + var content = contentGenerator.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + projectPath, + projectPath.CombineFileInfo($"{projectName}.csproj"), + ContentWriterArea.Src, + content, + overrideIfExist: false); + } + + public void ScaffoldHandlers() + { + foreach (var urlPath in openApiDocument.Paths) + { + var apiGroupName = urlPath.GetApiGroupName(); + + foreach (var openApiOperation in urlPath.Value.Operations) + { + var fullNamespace = $"{projectName}.{ContentGeneratorConstants.Handlers}.{apiGroupName}"; + + var classParameters = ContentGeneratorServerHandlerParametersFactory.Create( + fullNamespace, + $"Api.Generated.{ContentGeneratorConstants.Contracts}.{apiGroupName}", + urlPath.Value, + openApiOperation.Value); + + var contentGenerator = new GenerateContentForClass( + new CodeDocumentationTagsGenerator(), + classParameters); + + var content = contentGenerator.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + projectPath, + projectPath.CombineFileInfo( + ContentGeneratorConstants.Handlers, + apiGroupName, + $"{classParameters.TypeName}.cs"), + ContentWriterArea.Src, + content, + overrideIfExist: false); + } + } + } + + public void GenerateAssemblyMarker() + { + var suppressMessageAvoidEmptyInterfaceAttribute = new AttributeParameters( + "SuppressMessage", + "\"Design\", \"CA1040:Avoid empty interfaces\", Justification = \"OK.\""); + + var interfaceParameters = InterfaceParametersFactory.Create( + codeGeneratorContentHeader, + projectName, + [suppressMessageAvoidEmptyInterfaceAttribute, codeGeneratorAttribute], + "IDomainAssemblyMarker"); + + var contentGenerator = new GenerateContentForInterface( + new CodeDocumentationTagsGenerator(), + interfaceParameters); + + var content = contentGenerator.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + projectPath, + projectPath.CombineFileInfo("IDomainAssemblyMarker.cs"), + ContentWriterArea.Src, + content); + } + + public void GenerateServiceCollectionExtensions() + { + var sbServicesHandlerRegistrations = new StringBuilder(); + foreach (var urlPath in openApiDocument.Paths) + { + foreach (var openApiOperation in urlPath.Value.Operations) + { + var operationName = openApiOperation.Value.GetOperationName(); + + sbServicesHandlerRegistrations.AppendLine($"services.AddTransient();"); + } + } + + var methodConfigureDomainServices = new MethodParameters( + DocumentationTags: null, + Attributes: null, + AccessModifiers.PublicStatic, + ReturnGenericTypeName: null, + ReturnTypeName: "IServiceCollection", + Name: "ConfigureDomainServices", + Parameters: + [ + new( + Attributes: null, + GenericTypeName: null, + IsGenericListType: false, + TypeName: "this IServiceCollection", + IsNullableType: false, + IsReferenceType: false, + Name: "services", + DefaultValue: null), + new( + Attributes: null, + GenericTypeName: null, + IsGenericListType: false, + TypeName: "IConfiguration", + IsNullableType: false, + IsReferenceType: false, + Name: "configuration", + DefaultValue: null), + ], + AlwaysBreakDownParameters: true, + UseExpressionBody: false, + Content: """ + services.ConfigureOptions(configuration); + services.DefineHandlersAndServices(); + return services; + """); + + var methodConfigureOptions = new MethodParameters( + DocumentationTags: null, + Attributes: null, + AccessModifiers.PublicStatic, + ReturnGenericTypeName: null, + ReturnTypeName: "void", + Name: "ConfigureOptions", + Parameters: + [ + new( + Attributes: null, + GenericTypeName: null, + IsGenericListType: false, + TypeName: "this IServiceCollection", + IsNullableType: false, + IsReferenceType: false, + Name: "services", + DefaultValue: null), + new( + Attributes: null, + GenericTypeName: null, + IsGenericListType: false, + TypeName: "IConfiguration", + IsNullableType: false, + IsReferenceType: false, + Name: "configuration", + DefaultValue: null), + ], + AlwaysBreakDownParameters: true, + UseExpressionBody: false, + Content: """ + services.Configure(options => configuration.GetRequiredSection(nameof(ServiceOptions)).Bind(options)); + services.Configure(options => configuration.GetRequiredSection(nameof(EnvironmentOptions)).Bind(options)); + services.Configure(options => configuration.GetRequiredSection(nameof(NamingOptions)).Bind(options)); + """); + + var methodDefineHandlersAndServices = new MethodParameters( + DocumentationTags: null, + Attributes: null, + AccessModifiers.PublicStatic, + ReturnGenericTypeName: null, + ReturnTypeName: "void", + Name: "DefineHandlersAndServices", + Parameters: + [ + new( + Attributes: null, + GenericTypeName: null, + IsGenericListType: false, + TypeName: "this IServiceCollection", + IsNullableType: false, + IsReferenceType: false, + Name: "services", + DefaultValue: null), + ], + AlwaysBreakDownParameters: true, + UseExpressionBody: false, + Content: sbServicesHandlerRegistrations.ToString()); + + var classParameters = new ClassParameters( + codeGeneratorContentHeader, + Namespace: projectName, + DocumentationTags: null, + Attributes: [codeGeneratorAttribute], + AccessModifiers.PublicStaticClass, + ClassTypeName: "ServiceCollectionExtensions", + GenericTypeName: null, + InheritedClassTypeName: null, + InheritedGenericClassTypeName: null, + InheritedInterfaceTypeName: null, + Constructors: null, + Properties: null, + Methods: + [ + methodConfigureDomainServices, + methodConfigureOptions, + methodDefineHandlersAndServices, + ], + GenerateToStringMethod: false); + + var contentGenerator = new GenerateContentForClass( + new CodeDocumentationTagsGenerator(), + classParameters); + + var content = contentGenerator.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + projectPath, + projectPath.CombineFileInfo("Extensions", "ServiceCollectionExtensions.cs"), + ContentWriterArea.Src, + content); + } + + public void MaintainGlobalUsings( + bool removeNamespaceGroupSeparatorInGlobalUsings) + { + var requiredUsings = new List + { + "System.CodeDom.Compiler", + "System.Diagnostics.CodeAnalysis", + "Atc.Azure.Options", + "Atc.Azure.Options.Environment", + "Microsoft.Extensions.Configuration", + "Microsoft.Extensions.DependencyInjection", + }; + + var apiGroupNames = openApiDocument.GetApiGroupNames(); + + requiredUsings.AddRange(apiGroupNames.Select(x => $"{apiProjectName}.{ContentGeneratorConstants.Contracts}.{x}")); + requiredUsings.AddRange(apiGroupNames.Select(x => $"{projectName}.{ContentGeneratorConstants.Handlers}.{x}")); + + GlobalUsingsHelper.CreateOrUpdate( + logger, + ContentWriterArea.Src, + projectPath, + requiredUsings, + removeNamespaceGroupSeparatorInGlobalUsings); + } +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Minimal/ProjectGenerator/ServerGenerator.cs b/src/Atc.Rest.ApiGenerator.Framework.Minimal/ProjectGenerator/ServerGenerator.cs new file mode 100644 index 00000000..04b002db --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Framework.Minimal/ProjectGenerator/ServerGenerator.cs @@ -0,0 +1,65 @@ +namespace Atc.Rest.ApiGenerator.Framework.Minimal.ProjectGenerator; + +public class ServerGenerator : IServerGenerator +{ + private readonly ILogger logger; + private readonly string projectName; + private readonly DirectoryInfo rootPath; + private readonly DirectoryInfo srcPath; + private readonly DirectoryInfo? testPath; + + public ServerGenerator( + ILoggerFactory loggerFactory, + string projectName, + DirectoryInfo rootPath, + DirectoryInfo srcPath, + DirectoryInfo? testPath) + { + ArgumentNullException.ThrowIfNull(loggerFactory); + ArgumentNullException.ThrowIfNull(projectName); + ArgumentNullException.ThrowIfNull(rootPath); + ArgumentNullException.ThrowIfNull(srcPath); + ArgumentNullException.ThrowIfNull(testPath); + + logger = loggerFactory.CreateLogger(); + this.projectName = projectName; + this.rootPath = rootPath; + this.srcPath = srcPath; + this.testPath = testPath; + } + + public void ScaffoldSolutionFile() + { + var content = GenerateContentForSolutionFileHelper.Generate( + projectName, + rootPath, + srcPath, + testPath); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + rootPath, + rootPath.CombineFileInfo($"{projectName}.sln"), + ContentWriterArea.Src, + content, + overrideIfExist: false); + } + + public void ScaffoldSolutionDotSettingsFile() + { + var parameters = new SolutionDotSettingsFileParameters(); + + var contentGenerator = new GenerateContentForSolutionDotSettingsFile( + parameters); + + var content = contentGenerator.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + rootPath, + rootPath.CombineFileInfo($"{projectName}.sln.DotSettings"), + ContentWriterArea.Src, + content, + overrideIfExist: false); + } +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Minimal/ProjectGenerator/ServerHostGenerator.cs b/src/Atc.Rest.ApiGenerator.Framework.Minimal/ProjectGenerator/ServerHostGenerator.cs new file mode 100644 index 00000000..9fa150c3 --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Framework.Minimal/ProjectGenerator/ServerHostGenerator.cs @@ -0,0 +1,299 @@ +// ReSharper disable ArrangeObjectCreationWhenTypeNotEvident +namespace Atc.Rest.ApiGenerator.Framework.Minimal.ProjectGenerator; + +public class ServerHostGenerator : IServerHostGenerator +{ + private readonly ILogger logger; + private readonly INugetPackageReferenceProvider nugetPackageReferenceProvider; + private readonly Version apiGeneratorVersion; + private readonly string projectName; + private readonly string apiProjectName; + private readonly string domainProjectName; + private readonly DirectoryInfo projectPath; + private readonly OpenApiDocument openApiDocument; + + public ServerHostGenerator( + ILoggerFactory loggerFactory, + INugetPackageReferenceProvider nugetPackageReferenceProvider, + Version apiGeneratorVersion, + string projectName, + string apiProjectName, + string domainProjectName, + DirectoryInfo projectPath, + OpenApiDocument openApiDocument) + { + ArgumentNullException.ThrowIfNull(loggerFactory); + ArgumentNullException.ThrowIfNull(nugetPackageReferenceProvider); + ArgumentNullException.ThrowIfNull(apiGeneratorVersion); + ArgumentNullException.ThrowIfNull(projectName); + ArgumentNullException.ThrowIfNull(apiProjectName); + ArgumentNullException.ThrowIfNull(domainProjectName); + ArgumentNullException.ThrowIfNull(projectPath); + ArgumentNullException.ThrowIfNull(openApiDocument); + + logger = loggerFactory.CreateLogger(); + this.nugetPackageReferenceProvider = nugetPackageReferenceProvider; + this.apiGeneratorVersion = apiGeneratorVersion; + this.projectName = projectName; + this.apiProjectName = apiProjectName; + this.domainProjectName = domainProjectName; + this.projectPath = projectPath; + this.openApiDocument = openApiDocument; + } + + /// + /// NOTE: This property is not used in MinimalApi + /// + public bool UseRestExtended { get; set; } + + public async Task ScaffoldProjectFile() + { + var packageReferences = await nugetPackageReferenceProvider.GetPackageReferencesForHostProjectForMinimalApi(); + + var itemGroupPackageReferences = packageReferences + .Select(packageReference => new ItemGroupParameter( + "PackageReference", + [ + new("Include", packageReference.PackageId), + new("Version", packageReference.PackageVersion), + ], + Value: null)) + .ToList(); + + var projectFileParameters = new ProjectFileParameters( + "Microsoft.NET.Sdk.Web", + [ + [ + new("TargetFramework", Attributes: null, "net8.0"), + new("IsPackable", Attributes: null, "false"), + ], + [ + new("GenerateDocumentationFile", Attributes: null, "true"), + ], + [ + new("DocumentationFile", Attributes: null, @$"bin\Debug\net8.0\{projectName}.xml"), + new("NoWarn", Attributes: null, "1573;1591;1701;1702;1712;8618;"), + ], + ], + [ + itemGroupPackageReferences, + [ + new( + "ProjectReference", + [ + new("Include", @$"..\{apiProjectName}\{apiProjectName}.csproj"), + ], + Value: null), + new( + "ProjectReference", + [ + new("Include", @$"..\{domainProjectName}\{domainProjectName}.csproj"), + ], + Value: null), + ], + ]); + + var contentGenerator = new GenerateContentForProjectFile( + projectFileParameters); + + var content = contentGenerator.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + projectPath, + projectPath.CombineFileInfo($"{projectName}.csproj"), + ContentWriterArea.Src, + content, + overrideIfExist: false); + } + + public void ScaffoldPropertiesLaunchSettingsFile() + => ResourcesHelper.ScaffoldPropertiesLaunchSettingsFile( + projectName, + projectPath, + useExtended: true); + + public void ScaffoldJsonSerializerOptionsExtensions() + { + var contentGenerator = new ContentGenerators.ContentGeneratorServerJsonSerializerOptionsExtensions( + new ContentGeneratorBaseParameters(Namespace: projectName)); + + var content = contentGenerator.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + projectPath, + projectPath.CombineFileInfo("Extensions", "JsonSerializerOptionsExtensions.cs"), + ContentWriterArea.Src, + content, + overrideIfExist: false); + } + + public void ScaffoldServiceCollectionExtensions() + { + var contentGenerator = new ContentGenerators.ContentGeneratorServerServiceCollectionExtensions( + new ContentGeneratorBaseParameters(Namespace: projectName)); + + var content = contentGenerator.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + projectPath, + projectPath.CombineFileInfo("Extensions", "ServiceCollectionExtensions.cs"), + ContentWriterArea.Src, + content, + overrideIfExist: false); + } + + public void ScaffoldWebApplicationBuilderExtensions() + { + var contentGenerator = new ContentGenerators.ContentGeneratorServerWebApplicationBuilderExtensions( + new ContentGeneratorBaseParameters(Namespace: projectName)); + + var content = contentGenerator.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + projectPath, + projectPath.CombineFileInfo("Extensions", "WebApplicationBuilderExtensions.cs"), + ContentWriterArea.Src, + content, + overrideIfExist: false); + } + + public void ScaffoldWebApplicationExtensions( + SwaggerThemeMode swaggerThemeMode) + { + var contentGenerator = new ContentGenerators.ContentGeneratorServeWebApplicationExtensions( + new ContentGeneratorBaseParameters(Namespace: projectName)) + { + SwaggerThemeMode = swaggerThemeMode, + }; + + var content = contentGenerator.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + projectPath, + projectPath.CombineFileInfo("Extensions", "WebApplicationExtensions.cs"), + ContentWriterArea.Src, + content, + overrideIfExist: false); + } + + public void ScaffoldConfigureSwaggerOptions() + { + var contentGenerator = new ContentGenerators.ContentGeneratorServeConfigureSwaggerOptions( + new ContentGeneratorBaseParameters(Namespace: projectName)); + + var content = contentGenerator.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + projectPath, + projectPath.CombineFileInfo("Options", "ConfigureSwaggerOptions.cs"), + ContentWriterArea.Src, + content, + overrideIfExist: false); + } + + public void ScaffoldProgramFile( + SwaggerThemeMode swaggerThemeMode) + { + var contentGenerator = new ContentGenerators.ContentGeneratorServerProgram( + new ContentGeneratorBaseParameters(Namespace: projectName)) + { + SwaggerThemeMode = swaggerThemeMode, + }; + + var content = contentGenerator.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + projectPath, + projectPath.CombineFileInfo("Program.cs"), + ContentWriterArea.Src, + content, + overrideIfExist: false); + } + + public void ScaffoldStartupFile() + => throw new NotSupportedException($"{nameof(ScaffoldStartupFile)} is not supported for MinimalApi"); + + public void ScaffoldWebConfig() + { + var contentGenerator = new Framework.ContentGenerators.Server.ContentGeneratorServerWebConfig(); + + var content = contentGenerator.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + projectPath, + projectPath.CombineFileInfo("web.config"), + ContentWriterArea.Src, + content, + overrideIfExist: false); + } + + public void GenerateConfigureSwaggerDocOptions() + { + var fullNamespace = $"{projectName}"; + + var contentGeneratorServerSwaggerDocOptionsParameters = ContentGeneratorServerSwaggerDocOptionsParameterFactory + .Create( + fullNamespace, + openApiDocument.ToSwaggerDocOptionsParameters()); + + var contentGenerator = new Framework.ContentGenerators.Server.ContentGeneratorServerSwaggerDocOptions( + new GeneratedCodeHeaderGenerator(new GeneratedCodeGeneratorParameters(apiGeneratorVersion)), + new GeneratedCodeAttributeGenerator(new GeneratedCodeGeneratorParameters(apiGeneratorVersion)), + contentGeneratorServerSwaggerDocOptionsParameters); + + var content = contentGenerator.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + projectPath, + projectPath.CombineFileInfo("Options", "ConfigureSwaggerDocOptions.cs"), + ContentWriterArea.Src, + content); + } + + public void MaintainGlobalUsings( + bool removeNamespaceGroupSeparatorInGlobalUsings) + { + var requiredUsings = new List + { + "System.CodeDom.Compiler", + "System.Diagnostics.CodeAnalysis", + "System.Text", + "Asp.Versioning", + "Asp.Versioning.ApiExplorer", + "Atc.Rest.MinimalApi.Extensions", + "Atc.Rest.MinimalApi.Filters.Endpoints", + "Atc.Rest.MinimalApi.Filters.Swagger", + "Atc.Rest.MinimalApi.Versioning", + "Atc.Serialization", + "FluentValidation", + "Microsoft.AspNetCore.HttpLogging", + "Microsoft.Extensions.Logging.ApplicationInsights", + "Microsoft.Extensions.Options", + "Microsoft.OpenApi.Models", + "Swashbuckle.AspNetCore.SwaggerGen", + $"{projectName}.Extensions", + $"{projectName}.Generated", + $"{projectName}.Options", + $"{projectName}".Replace(".Api", ".Domain", StringComparison.Ordinal), + }; + + GlobalUsingsHelper.CreateOrUpdate( + logger, + ContentWriterArea.Src, + projectPath, + requiredUsings, + removeNamespaceGroupSeparatorInGlobalUsings); + } + + public void MaintainWwwResources() + => ResourcesHelper.MaintainWwwResources(projectPath); +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Minimal/ProjectGenerator/ServerHostTestGenerator.cs b/src/Atc.Rest.ApiGenerator.Framework.Minimal/ProjectGenerator/ServerHostTestGenerator.cs new file mode 100644 index 00000000..e671832c --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Framework.Minimal/ProjectGenerator/ServerHostTestGenerator.cs @@ -0,0 +1,304 @@ +namespace Atc.Rest.ApiGenerator.Framework.Minimal.ProjectGenerator; + +public class ServerHostTestGenerator : IServerHostTestGenerator +{ + private readonly ILogger logger; + private readonly INugetPackageReferenceProvider nugetPackageReferenceProvider; + private readonly string projectName; + private readonly string hostProjectName; + private readonly string apiProjectName; + private readonly string domainProjectName; + private readonly DirectoryInfo projectPath; + private readonly OpenApiDocument openApiDocument; + private readonly IList operationSchemaMappings; + private readonly string codeGeneratorContentHeader; + private readonly AttributeParameters codeGeneratorAttribute; + + public ServerHostTestGenerator( + ILoggerFactory loggerFactory, + INugetPackageReferenceProvider nugetPackageReferenceProvider, + Version apiGeneratorVersion, + string projectName, + string hostProjectName, + string apiProjectName, + string domainProjectName, + DirectoryInfo projectPath, + OpenApiDocument openApiDocument, + IList operationSchemaMappings) + { + ArgumentNullException.ThrowIfNull(loggerFactory); + ArgumentNullException.ThrowIfNull(nugetPackageReferenceProvider); + ArgumentNullException.ThrowIfNull(apiGeneratorVersion); + ArgumentNullException.ThrowIfNull(projectName); + ArgumentNullException.ThrowIfNull(hostProjectName); + ArgumentNullException.ThrowIfNull(apiProjectName); + ArgumentNullException.ThrowIfNull(domainProjectName); + ArgumentNullException.ThrowIfNull(projectPath); + ArgumentNullException.ThrowIfNull(openApiDocument); + ArgumentNullException.ThrowIfNull(operationSchemaMappings); + + logger = loggerFactory.CreateLogger(); + this.nugetPackageReferenceProvider = nugetPackageReferenceProvider; + this.projectName = projectName; + this.hostProjectName = hostProjectName; + this.apiProjectName = apiProjectName; + this.domainProjectName = domainProjectName; + this.projectPath = projectPath; + this.openApiDocument = openApiDocument; + this.operationSchemaMappings = operationSchemaMappings; + + codeGeneratorContentHeader = GeneratedCodeHeaderGeneratorFactory + .Create(apiGeneratorVersion) + .Generate(); + codeGeneratorAttribute = AttributeParametersFactory + .CreateGeneratedCode(apiGeneratorVersion); + } + + public async Task ScaffoldProjectFile() + { + var packageReferences = await nugetPackageReferenceProvider.GetPackageReferencesForTestHostProjectForMinimalApi(); + + var itemGroupPackageReferences = packageReferences + .Select(packageReference => new ItemGroupParameter( + "PackageReference", + [ + new("Include", packageReference.PackageId), + new("Version", packageReference.PackageVersion), + ], + Value: null)) + .ToList(); + + var projectFileParameters = new ProjectFileParameters( + "Microsoft.NET.Sdk", + [ + [ + new("TargetFramework", Attributes: null, "net8.0"), + ], + [ + new("DocumentationFile", Attributes: null, @$"bin\Debug\net8.0\{projectName}.xml"), + new("NoWarn", Attributes: null, "1573;1591;1701;1702;1712;8618;"), + ], + ], + [ + itemGroupPackageReferences, + [ + new( + "ProjectReference", + [ + new("Include", @$"..\..\src\{hostProjectName}\{hostProjectName}.csproj"), + ], + Value: null), + new( + "ProjectReference", + [ + new("Include", @$"..\..\src\{apiProjectName}\{apiProjectName}.csproj"), + ], + Value: null), + new( + "ProjectReference", + [ + new("Include", @$"..\..\src\{domainProjectName}\{domainProjectName}.csproj"), + ], + Value: null), + ], + + ]); + + var contentGenerator = new GenerateContentForProjectFile( + projectFileParameters); + + var content = contentGenerator.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + projectPath, + projectPath.CombineFileInfo($"{projectName}.csproj"), + ContentWriterArea.Src, + content, + overrideIfExist: false); + } + + public void ScaffoldAppSettingsIntegrationTestFile() + { + // TODO: Implement if needed + ////var contentGenerator = new ContentGenerators.Server.ContentGeneratorServerAppSettingsIntegrationTest(); + + ////var content = contentGenerator.Generate(); + + ////var contentWriter = new ContentWriter(logger); + ////contentWriter.Write( + //// projectPath, + //// projectPath.CombineFileInfo("appsettings.integrationtest.json"), + //// ContentWriterArea.Test, + //// content, + //// overrideIfExist: false); + } + + public void GenerateWebApiStartupFactoryFile() + { + // TODO: Implement if needed + ////var contentGeneratorServerWebApiStartupFactoryParameters = ContentGeneratorServerWebApiStartupFactoryParametersFactory.Create( + //// projectName); + + ////var contentGenerator = new ContentGenerators.Server.ContentGeneratorServerWebApiStartupFactory( + //// new GeneratedCodeHeaderGenerator(new GeneratedCodeGeneratorParameters(apiGeneratorVersion)), + //// new GeneratedCodeAttributeGenerator(new GeneratedCodeGeneratorParameters(apiGeneratorVersion)), + //// new CodeDocumentationTagsGenerator(), + //// contentGeneratorServerWebApiStartupFactoryParameters); + + ////var content = contentGenerator.Generate(); + + ////var contentWriter = new ContentWriter(logger); + ////contentWriter.Write( + //// projectPath, + //// projectPath.CombineFileInfo("WebApiStartupFactory.cs"), + //// ContentWriterArea.Test, + //// content, + //// overrideIfExist: false); + } + + public void GenerateWebApiControllerBaseTestFile() + { + // TODO: Implement if needed + ////var contentGenerator = new ContentGenerators.Server.ContentGeneratorServerWebApiControllerBaseTest( + //// new GeneratedCodeHeaderGenerator(new GeneratedCodeGeneratorParameters(apiGeneratorVersion)), + //// new GeneratedCodeAttributeGenerator(new GeneratedCodeGeneratorParameters(apiGeneratorVersion)), + //// new ContentGeneratorBaseParameters(projectName)); + + ////var content = contentGenerator.Generate(); + + ////var contentWriter = new ContentWriter(logger); + ////contentWriter.Write( + //// projectPath, + //// projectPath.CombineFileInfo("WebApiControllerBaseTest.cs"), + //// ContentWriterArea.Test, + //// content, + //// overrideIfExist: false); + } + + public void GenerateEndpointHandlerStubs() + { + foreach (var openApiPath in openApiDocument.Paths) + { + var apiGroupName = openApiPath.GetApiGroupName(); + + foreach (var openApiOperation in openApiPath.Value.Operations) + { + if (openApiOperation.Value.Deprecated) + { + continue; + } + + var fullNamespace = $"{projectName}.{ContentGeneratorConstants.Endpoints}.{apiGroupName}"; + + var classParameters = ContentGeneratorServerTestEndpointHandlerStubParametersFactory.Create( + codeGeneratorContentHeader, + fullNamespace, + codeGeneratorAttribute, + openApiPath.Value, + openApiOperation.Value); + + var contentGenerator = new GenerateContentForClass( + new CodeDocumentationTagsGenerator(), + classParameters); + + var content = contentGenerator.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + projectPath, + projectPath.CombineFileInfo(ContentGeneratorConstants.Endpoints, apiGroupName, $"{classParameters.TypeName}.cs"), + ContentWriterArea.Test, + content); + } + } + } + + public void GenerateEndpointTests() + { + // TODO: Implement then WebApiControllerBaseTest and WebApiStartupFactory is implemented + ////foreach (var openApiPath in openApiDocument.Paths) + ////{ + //// if (openApiOperation.Value.Deprecated) + //// { + //// continue; + //// } + //// + //// var apiGroupName = openApiPath.GetApiGroupName(); + + //// foreach (var openApiOperation in openApiPath.Value.Operations) + //// { + //// var fullNamespace = $"{projectName}.{ContentGeneratorConstants.Endpoints}.{apiGroupName}"; + + //// var classParameters = ContentGeneratorServerTestEndpointTestsParametersFactory.Create( + //// fullNamespace, + //// openApiOperation.Value); + + //// var contentGenerator = new GenerateContentForClass( + //// new CodeDocumentationTagsGenerator(), + //// classParameters); + + //// var content = contentGenerator.Generate(); + + //// var contentWriter = new ContentWriter(logger); + //// contentWriter.Write( + //// projectPath, + //// projectPath.CombineFileInfo(ContentGeneratorConstants.Endpoints, apiGroupName, $"{classParameters.TypeName}.cs"), + //// ContentWriterArea.Test, + //// content); + //// } + ////} + } + + public void MaintainGlobalUsings( + bool usingCodingRules, + bool removeNamespaceGroupSeparatorInGlobalUsings) + { + var requiredUsings = new List + { + "System.CodeDom.Compiler", + "System.Text", + "System.Text.Json", + "System.Text.Json.Serialization", + "System.Reflection", + "Atc.XUnit", + "Atc.Rest.Options", + "AutoFixture", + "Microsoft.AspNetCore.Hosting", + "Microsoft.AspNetCore.Http", + "Microsoft.Extensions.Configuration", + "Microsoft.Extensions.DependencyInjection", + "Xunit", + apiProjectName, + }; + + if (openApiDocument.IsUsingRequiredForAtcRestResults()) + { + requiredUsings.Add("Atc.Rest.Results"); + } + + if (operationSchemaMappings.Any(apiOperation => apiOperation.Model.IsShared)) + { + requiredUsings.Add($"{apiProjectName}.Contracts"); + } + + var apiGroupNames = openApiDocument.GetApiGroupNames(); + + foreach (var apiGroupName in apiGroupNames) + { + if (apiGroupName.Equals("Tasks", StringComparison.OrdinalIgnoreCase)) + { + continue; + } + + requiredUsings.Add($"{apiProjectName}.Contracts.{apiGroupName}"); + } + + GlobalUsingsHelper.CreateOrUpdate( + logger, + ContentWriterArea.Test, + projectPath, + requiredUsings, + removeNamespaceGroupSeparatorInGlobalUsings); + } +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Mvc/Atc.Rest.ApiGenerator.Framework.Mvc.csproj b/src/Atc.Rest.ApiGenerator.Framework.Mvc/Atc.Rest.ApiGenerator.Framework.Mvc.csproj index 143702a3..897337aa 100644 --- a/src/Atc.Rest.ApiGenerator.Framework.Mvc/Atc.Rest.ApiGenerator.Framework.Mvc.csproj +++ b/src/Atc.Rest.ApiGenerator.Framework.Mvc/Atc.Rest.ApiGenerator.Framework.Mvc.csproj @@ -1,16 +1,18 @@ - net6.0 + net8.0 + false - - + + - + + diff --git a/src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/Client/ContentGeneratorClientEndpoint.cs b/src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/Client/ContentGeneratorClientEndpoint.cs deleted file mode 100644 index c2a1625b..00000000 --- a/src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/Client/ContentGeneratorClientEndpoint.cs +++ /dev/null @@ -1,151 +0,0 @@ -// ReSharper disable SwitchExpressionHandlesSomeKnownEnumValuesWithExceptionInDefault -namespace Atc.Rest.ApiGenerator.Framework.Mvc.ContentGenerators.Client; - -public class ContentGeneratorClientEndpoint : IContentGenerator -{ - private readonly GeneratedCodeHeaderGenerator codeHeaderGenerator; - private readonly GeneratedCodeAttributeGenerator codeAttributeGenerator; - private readonly CodeDocumentationTagsGenerator codeDocumentationTagsGenerator; - private readonly ContentGeneratorClientEndpointParameters parameters; - - public ContentGeneratorClientEndpoint( - GeneratedCodeHeaderGenerator codeHeaderGenerator, - GeneratedCodeAttributeGenerator codeAttributeGenerator, - CodeDocumentationTagsGenerator codeDocumentationTagsGenerator, - ContentGeneratorClientEndpointParameters parameters) - { - this.codeHeaderGenerator = codeHeaderGenerator; - this.codeAttributeGenerator = codeAttributeGenerator; - this.codeDocumentationTagsGenerator = codeDocumentationTagsGenerator; - this.parameters = parameters; - } - - public string Generate() - { - var sb = new StringBuilder(); - - sb.Append(codeHeaderGenerator.Generate()); - sb.AppendLine($"namespace {parameters.Namespace};"); - sb.AppendLine(); - if (codeDocumentationTagsGenerator.ShouldGenerateTags(parameters.DocumentationTagsForClass)) - { - sb.Append(codeDocumentationTagsGenerator.GenerateTags(0, parameters.DocumentationTagsForClass)); - } - - sb.AppendLine(codeAttributeGenerator.Generate()); - sb.AppendLine($"public class {parameters.EndpointName} : {parameters.InterfaceName}"); - sb.AppendLine("{"); - sb.AppendLine(4, "private readonly IHttpClientFactory factory;"); - sb.AppendLine(4, "private readonly IHttpMessageFactory httpMessageFactory;"); - sb.AppendLine(); - sb.AppendLine(4, $"public {parameters.EndpointName}("); - sb.AppendLine(8, "IHttpClientFactory factory,"); - sb.AppendLine(8, "IHttpMessageFactory httpMessageFactory)"); - sb.AppendLine(4, "{"); - sb.AppendLine(8, "this.factory = factory;"); - sb.AppendLine(8, "this.httpMessageFactory = httpMessageFactory;"); - sb.AppendLine(4, "}"); - sb.AppendLine(); - sb.AppendLine(4, $"public async Task ExecuteAsync("); - if (parameters.ParameterName is not null) - { - sb.AppendLine(8, $"{parameters.ParameterName} parameters,"); - } - - sb.AppendLine(8, $"string httpClientName = \"{parameters.HttpClientName}\","); - sb.AppendLine(8, "CancellationToken cancellationToken = default)"); - sb.AppendLine(4, "{"); - sb.AppendLine(8, "var client = factory.CreateClient(httpClientName);"); - sb.AppendLine(); - sb.AppendLine(8, $"var requestBuilder = httpMessageFactory.FromTemplate(\"{parameters.UrlPath}\");"); - - if (parameters.Parameters is not null && parameters.Parameters.Any()) - { - for (var index = 0; index < parameters.Parameters.Count; index++) - { - var item = parameters.Parameters[index]; - var isLastParameter = index == parameters.Parameters.Count - 1; - - switch (item.ParameterLocationType) - { - case ParameterLocationType.Query: - AppendParameterForParameterLocation(sb, item, item.ParameterLocationType, isLastParameter); - break; - case ParameterLocationType.Header: - AppendParameterForParameterLocation(sb, item, item.ParameterLocationType, isLastParameter); - break; - case ParameterLocationType.Route: - sb.AppendLine(8, $"requestBuilder.WithPathParameter(\"{item.Name}\", parameters.{item.ParameterName});"); - break; - case ParameterLocationType.Body: - sb.AppendLine(8, "requestBuilder.WithBody(parameters.Request);"); - break; - case ParameterLocationType.Form: - sb.AppendLine(8, "// TODO: Imp. With-Form"); - break; - default: - throw new SwitchCaseDefaultException(item.ParameterLocationType); - } - } - } - - sb.AppendLine(); - sb.AppendLine(8, $"using var requestMessage = requestBuilder.Build(HttpMethod.{parameters.HttpMethod});"); - sb.AppendLine(8, "using var response = await client.SendAsync(requestMessage, cancellationToken);"); - sb.AppendLine(); - sb.AppendLine(8, "var responseBuilder = httpMessageFactory.FromResponse(response);"); - - if (string.IsNullOrEmpty(parameters.SuccessResponseName)) - { - sb.AppendLine(8, $"responseBuilder.AddSuccessResponse(HttpStatusCode.{parameters.SuccessResponseStatusCode});"); - } - else - { - sb.AppendLine( - 8, - parameters.UseListForModel - ? $"responseBuilder.AddSuccessResponse>(HttpStatusCode.OK);" - : $"responseBuilder.AddSuccessResponse<{parameters.SuccessResponseName}>(HttpStatusCode.{parameters.SuccessResponseStatusCode});"); - } - - foreach (var item in parameters.ErrorResponses) - { - sb.AppendLine( - 8, - string.IsNullOrEmpty(item.ResponseType) - ? $"responseBuilder.AddErrorResponse(HttpStatusCode.{item.StatusCode});" - : $"responseBuilder.AddErrorResponse<{item.ResponseType}>(HttpStatusCode.{item.StatusCode});"); - } - - sb.AppendLine(); - sb.AppendLine(8, $"return await responseBuilder.BuildResponseAsync(x => new {parameters.ResultName}(x), cancellationToken);"); - sb.AppendLine(4, "}"); - sb.Append('}'); - - return sb.ToString(); - } - - private static void AppendParameterForParameterLocation( - StringBuilder sb, - ContentGeneratorClientEndpointParametersParameters item, - ParameterLocationType parameterLocationType, - bool isLastParameter) - { - if (item.IsList) - { - sb.AppendLine(8, $"if (parameters.{item.ParameterName}.Any())"); - sb.AppendLine(8, "{"); - sb.AppendLine(12, $"requestBuilder.With{parameterLocationType}Parameter(\"{item.Name}\", parameters.{item.ParameterName});"); - sb.AppendLine(8, "}"); - - if (!isLastParameter) - { - sb.AppendLine(); - } - } - else - { - sb.AppendLine(8, $"requestBuilder.With{parameterLocationType}Parameter(\"{item.Name}\", parameters.{item.ParameterName});"); - } - } -} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/Client/ContentGeneratorClientEndpointResult.cs b/src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/Client/ContentGeneratorClientEndpointResult.cs deleted file mode 100644 index 112b9e8b..00000000 --- a/src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/Client/ContentGeneratorClientEndpointResult.cs +++ /dev/null @@ -1,113 +0,0 @@ -// ReSharper disable SwitchExpressionHandlesSomeKnownEnumValuesWithExceptionInDefault -namespace Atc.Rest.ApiGenerator.Framework.Mvc.ContentGenerators.Client; - -public class ContentGeneratorClientEndpointResult : IContentGenerator -{ - private readonly GeneratedCodeHeaderGenerator codeHeaderGenerator; - private readonly GeneratedCodeAttributeGenerator codeAttributeGenerator; - private readonly CodeDocumentationTagsGenerator codeDocumentationTagsGenerator; - private readonly ContentGeneratorClientEndpointResultParameters parameters; - - public ContentGeneratorClientEndpointResult( - GeneratedCodeHeaderGenerator codeHeaderGenerator, - GeneratedCodeAttributeGenerator codeAttributeGenerator, - CodeDocumentationTagsGenerator codeDocumentationTagsGenerator, - ContentGeneratorClientEndpointResultParameters parameters) - { - this.codeHeaderGenerator = codeHeaderGenerator; - this.codeAttributeGenerator = codeAttributeGenerator; - this.codeDocumentationTagsGenerator = codeDocumentationTagsGenerator; - this.parameters = parameters; - } - - public string Generate() - { - var sb = new StringBuilder(); - - sb.Append(codeHeaderGenerator.Generate()); - sb.AppendLine($"namespace {parameters.Namespace};"); - sb.AppendLine(); - if (codeDocumentationTagsGenerator.ShouldGenerateTags(parameters.DocumentationTagsForClass)) - { - sb.Append(codeDocumentationTagsGenerator.GenerateTags(0, parameters.DocumentationTagsForClass)); - } - - sb.AppendLine(codeAttributeGenerator.Generate()); - sb.AppendLine($"public class {parameters.EndpointResultName} : {parameters.InheritClassName}, {parameters.EndpointResultInterfaceName}"); - sb.AppendLine("{"); - sb.AppendLine(4, $"public {parameters.EndpointResultName}(EndpointResponse response)"); - sb.AppendLine(8, ": base(response)"); - sb.AppendLine(4, "{"); - sb.AppendLine(4, "}"); - sb.AppendLine(); - sb.AppendLine(4, "public bool IsOk"); - sb.AppendLine(8, "=> StatusCode == HttpStatusCode.OK;"); - foreach (var item in parameters.ErrorResponses) - { - sb.AppendLine(); - sb.AppendLine(4, $"public bool Is{item.StatusCode.ToNormalizedString()}"); - sb.AppendLine(8, $"=> StatusCode == HttpStatusCode.{item.StatusCode};"); - } - - sb.AppendLine(); - sb.AppendLine( - 4, - parameters.UseListForModel - ? $"public List<{parameters.SuccessResponseName}> OkContent" - : $"public {parameters.SuccessResponseName} OkContent"); - sb.AppendLine( - 8, - parameters.UseListForModel - ? $"=> IsOk && ContentObject is List<{parameters.SuccessResponseName}> result" - : $"=> IsOk && ContentObject is {parameters.SuccessResponseName} result"); - sb.AppendLine(12, "? result"); - sb.AppendLine(12, ": throw new InvalidOperationException(\"Content is not the expected type - please use the IsOk property first.\");"); - foreach (var item in parameters.ErrorResponses) - { - if (item.StatusCode == HttpStatusCode.BadRequest) - { - sb.AppendLine(); - sb.AppendLine(4, $"public ValidationProblemDetails {item.StatusCode.ToNormalizedString()}Content"); - sb.AppendLine(8, $"=> Is{item.StatusCode.ToNormalizedString()} && ContentObject is ValidationProblemDetails result"); - sb.AppendLine(12, "? result"); - sb.AppendLine(12, $": throw new InvalidOperationException(\"Content is not the expected type - please use the Is{item.StatusCode.ToNormalizedString()} property first.\");"); - } - else - { - if (item.StatusCode == HttpStatusCode.NotModified) - { - // NotModified does not return any content to the client - continue; - } - - if (parameters.UseProblemDetailsAsDefaultBody) - { - sb.AppendLine(); - sb.AppendLine(4, $"public ProblemDetails {item.StatusCode.ToNormalizedString()}Content"); - sb.AppendLine(8, $"=> Is{item.StatusCode.ToNormalizedString()} && ContentObject is ProblemDetails result"); - sb.AppendLine(12, "? result"); - sb.AppendLine(12, $": throw new InvalidOperationException(\"Content is not the expected type - please use the Is{item.StatusCode.ToNormalizedString()} property first.\");"); - } - else - { - if (string.IsNullOrEmpty(item.ResponseType)) - { - // Skip - } - else - { - sb.AppendLine(); - sb.AppendLine(4, $"public string {item.StatusCode.ToNormalizedString()}Content"); - sb.AppendLine(8, $"=> Is{item.StatusCode.ToNormalizedString()} && ContentObject is string result"); - sb.AppendLine(12, "? result"); - sb.AppendLine(12, $": throw new InvalidOperationException(\"Content is not the expected type - please use the Is{item.StatusCode.ToNormalizedString()} property first.\");"); - } - } - } - } - - sb.Append('}'); - - return sb.ToString(); - } -} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/Client/ContentGeneratorClientEndpointResultInterface.cs b/src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/Client/ContentGeneratorClientEndpointResultInterface.cs deleted file mode 100644 index 09cc0a83..00000000 --- a/src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/Client/ContentGeneratorClientEndpointResultInterface.cs +++ /dev/null @@ -1,90 +0,0 @@ -namespace Atc.Rest.ApiGenerator.Framework.Mvc.ContentGenerators.Client; - -public class ContentGeneratorClientEndpointResultInterface : IContentGenerator -{ - private readonly GeneratedCodeHeaderGenerator codeHeaderGenerator; - private readonly GeneratedCodeAttributeGenerator codeAttributeGenerator; - private readonly CodeDocumentationTagsGenerator codeDocumentationTagsGenerator; - private readonly ContentGeneratorClientEndpointResultInterfaceParameters parameters; - - public ContentGeneratorClientEndpointResultInterface( - GeneratedCodeHeaderGenerator codeHeaderGenerator, - GeneratedCodeAttributeGenerator codeAttributeGenerator, - CodeDocumentationTagsGenerator codeDocumentationTagsGenerator, - ContentGeneratorClientEndpointResultInterfaceParameters parameters) - { - this.codeHeaderGenerator = codeHeaderGenerator; - this.codeAttributeGenerator = codeAttributeGenerator; - this.codeDocumentationTagsGenerator = codeDocumentationTagsGenerator; - this.parameters = parameters; - } - - public string Generate() - { - var sb = new StringBuilder(); - - sb.Append(codeHeaderGenerator.Generate()); - sb.AppendLine($"namespace {parameters.Namespace};"); - sb.AppendLine(); - if (codeDocumentationTagsGenerator.ShouldGenerateTags(parameters.DocumentationTagsForClass)) - { - sb.Append(codeDocumentationTagsGenerator.GenerateTags(0, parameters.DocumentationTagsForClass)); - } - - sb.AppendLine(codeAttributeGenerator.Generate()); - sb.AppendLine($"public interface {parameters.InterfaceName} : {parameters.InheritInterfaceName}"); - sb.AppendLine("{"); - sb.AppendLine(4, "bool IsOk { get; }"); - foreach (var item in parameters.ErrorResponses) - { - sb.AppendLine(); - sb.AppendLine(4, $"bool Is{item.StatusCode.ToNormalizedString()} {{ get; }}"); - } - - sb.AppendLine(); - sb.AppendLine( - 4, - parameters.UseListForModel - ? $"List<{parameters.SuccessResponseName}> OkContent {{ get; }}" - : $"{parameters.SuccessResponseName} OkContent {{ get; }}"); - - foreach (var item in parameters.ErrorResponses) - { - if (item.StatusCode == HttpStatusCode.BadRequest) - { - sb.AppendLine(); - sb.AppendLine(4, $"ValidationProblemDetails {item.StatusCode.ToNormalizedString()}Content {{ get; }}"); - } - else - { - if (item.StatusCode == HttpStatusCode.NotModified) - { - // NotModified does not return any content to the client - continue; - } - - if (parameters.UseProblemDetailsAsDefaultBody) - { - sb.AppendLine(); - sb.AppendLine(4, $"ProblemDetails {item.StatusCode.ToNormalizedString()}Content {{ get; }}"); - } - else - { - if (string.IsNullOrEmpty(item.ResponseType)) - { - // Skip - } - else - { - sb.AppendLine(); - sb.AppendLine(4, $"{item.ResponseType} {item.StatusCode.ToNormalizedString()}Content {{ get; }}"); - } - } - } - } - - sb.Append('}'); - - return sb.ToString(); - } -} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/Server/ContentGeneratorServerAppSettingsIntegrationTest.cs b/src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/ContentGeneratorServerAppSettingsIntegrationTest.cs similarity index 78% rename from src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/Server/ContentGeneratorServerAppSettingsIntegrationTest.cs rename to src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/ContentGeneratorServerAppSettingsIntegrationTest.cs index 585a73cc..e3ca41bb 100644 --- a/src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/Server/ContentGeneratorServerAppSettingsIntegrationTest.cs +++ b/src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/ContentGeneratorServerAppSettingsIntegrationTest.cs @@ -1,4 +1,4 @@ -namespace Atc.Rest.ApiGenerator.Framework.Mvc.ContentGenerators.Server; +namespace Atc.Rest.ApiGenerator.Framework.Mvc.ContentGenerators; public sealed class ContentGeneratorServerAppSettingsIntegrationTest : IContentGenerator { diff --git a/src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/ContentGeneratorServerController.cs b/src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/ContentGeneratorServerController.cs new file mode 100644 index 00000000..8eaa5245 --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/ContentGeneratorServerController.cs @@ -0,0 +1,384 @@ +namespace Atc.Rest.ApiGenerator.Framework.Mvc.ContentGenerators; + +public sealed class ContentGeneratorServerController : IContentGenerator +{ + private readonly GeneratedCodeHeaderGenerator codeHeaderGenerator; + private readonly GeneratedCodeAttributeGenerator codeAttributeGenerator; + private readonly CodeDocumentationTagsGenerator codeDocumentationTagsGenerator; + private readonly ContentGeneratorServerEndpointParameters parameters; + private readonly bool useProblemDetailsAsDefaultResponseBody; + + public ContentGeneratorServerController( + GeneratedCodeHeaderGenerator codeHeaderGenerator, + GeneratedCodeAttributeGenerator codeAttributeGenerator, + CodeDocumentationTagsGenerator codeDocumentationTagsGenerator, + ContentGeneratorServerEndpointParameters parameters, + bool useProblemDetailsAsDefaultResponseBody) + { + this.codeHeaderGenerator = codeHeaderGenerator; + this.codeAttributeGenerator = codeAttributeGenerator; + this.codeDocumentationTagsGenerator = codeDocumentationTagsGenerator; + this.parameters = parameters; + this.useProblemDetailsAsDefaultResponseBody = useProblemDetailsAsDefaultResponseBody; + } + + public string Generate() + { + var sb = new StringBuilder(); + + sb.Append(codeHeaderGenerator.Generate()); + sb.AppendLine($"namespace {parameters.Namespace};"); + sb.AppendLine(); + + if (codeDocumentationTagsGenerator.ShouldGenerateTags(parameters.DocumentationTags)) + { + sb.Append(codeDocumentationTagsGenerator.GenerateTags(0, parameters.DocumentationTags)); + } + + if (parameters.Authorization is not null) + { + sb.AppendLine(parameters.Authorization.UseAllowAnonymous + ? "[AllowAnonymous]" + : "[Authorize]"); + } + + sb.AppendLine("[ApiController]"); + sb.AppendLine($"[Route(\"{parameters.RouteBase}\")]"); + sb.AppendLine(codeAttributeGenerator.Generate()); + + sb.AppendLine($"public sealed class {parameters.ApiGroupName}Controller : ControllerBase"); + sb.AppendLine("{"); + AppendContent(sb); + sb.Append('}'); + + return sb.ToString(); + } + + private void AppendContent( + StringBuilder sb) + { + for (var i = 0; i < parameters.MethodParameters.Count; i++) + { + var item = parameters.MethodParameters[i]; + + if (codeDocumentationTagsGenerator.ShouldGenerateTags(item.DocumentationTags)) + { + sb.Append(codeDocumentationTagsGenerator.GenerateTags(4, item.DocumentationTags)); + } + + AppendMethodContentAuthorizationIfNeeded(sb, item); + + sb.AppendLine(4, string.IsNullOrEmpty(item.RouteSuffix) + ? $"[Http{item.OperationTypeRepresentation}]" + : $"[Http{item.OperationTypeRepresentation}(\"{item.RouteSuffix}\")]"); + + if (item.MultipartBodyLengthLimit.HasValue) + { + sb.AppendLine(4, item.MultipartBodyLengthLimit.Value == long.MaxValue + ? "[RequestFormLimits(MultipartBodyLengthLimit = long.MaxValue)]" + : $"[RequestFormLimits(MultipartBodyLengthLimit = {item.MultipartBodyLengthLimit.Value})]"); + } + + if (useProblemDetailsAsDefaultResponseBody) + { + AppendProducesWithProblemDetails(sb, item); + } + else + { + AppendProducesWithoutProblemDetails(sb, item); + } + + sb.AppendLine(4, $"public async Task {item.Name}("); + + if (!string.IsNullOrEmpty(item.ParameterTypeName)) + { + sb.AppendLine(8, $"{item.ParameterTypeName} parameters,"); + } + + sb.AppendLine(8, $"[FromServices] {item.InterfaceName} handler,"); + sb.AppendLine(8, "CancellationToken cancellationToken)"); + + sb.AppendLine(8, !string.IsNullOrEmpty(item.ParameterTypeName) + ? "=> await handler.ExecuteAsync(parameters, cancellationToken);" + : "=> await handler.ExecuteAsync(cancellationToken);"); + + if (i < parameters.MethodParameters.Count - 1) + { + sb.AppendLine(); + } + } + } + + private void AppendMethodContentAuthorizationIfNeeded( + StringBuilder sb, + ContentGeneratorServerEndpointMethodParameters item) + { + if (item.Authorization is null) + { + return; + } + + if (item.Authorization.UseAllowAnonymous) + { + if (parameters.Authorization is not null && + parameters.Authorization.UseAllowAnonymous) + { + return; + } + + sb.AppendLine(4, "[AllowAnonymous]"); + return; + } + + if (parameters.Authorization is not null && + !parameters.Authorization.UseAllowAnonymous && + (item.Authorization.Roles is null || item.Authorization.Roles.Count == 0) && + (item.Authorization.AuthenticationSchemes is null || item.Authorization.AuthenticationSchemes.Count == 0)) + { + return; + } + + var authorizeLineBuilder = new StringBuilder(); + var authRoles = item.Authorization.Roles is null + ? null + : string.Join(',', item.Authorization.Roles); + var authSchemes = item.Authorization.AuthenticationSchemes is null + ? null + : string.Join(',', item.Authorization.AuthenticationSchemes); + + authorizeLineBuilder.Append(4, "[Authorize"); + + if (!string.IsNullOrEmpty(authRoles)) + { + authorizeLineBuilder.Append($"(Roles = \"{authRoles}\""); + } + + if (!string.IsNullOrEmpty(authSchemes)) + { + authorizeLineBuilder.Append(string.IsNullOrEmpty(authRoles) + ? $"(AuthenticationSchemes = \"{authSchemes}\"" + : $", AuthenticationSchemes = \"{authSchemes}\""); + } + + if (!string.IsNullOrEmpty(authRoles) || !string.IsNullOrEmpty(authSchemes)) + { + authorizeLineBuilder.Append(')'); + } + + authorizeLineBuilder.Append(']'); + sb.AppendLine(authorizeLineBuilder.ToString()); + } + + private static void AppendProducesWithProblemDetails( + StringBuilder sb, + ContentGeneratorServerEndpointMethodParameters item) + { + var responseModels = item.ResponseModels + .AppendUnauthorizedIfNeeded(item.Authorization) + .AppendForbiddenIfNeeded(item.Authorization) + .AppendBadRequestIfNeeded(item.ParameterTypeName) + .OrderBy(x => x.StatusCode) + .ToList(); + + foreach (var responseModel in responseModels) + { + switch (responseModel.StatusCode) + { + case HttpStatusCode.OK: + AppendProducesForOk(sb, responseModel); + break; + case HttpStatusCode.BadRequest: + sb.AppendLine(4, $"[ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.{responseModel.StatusCode.ToStatusCodesConstant()})]"); + break; + case HttpStatusCode.EarlyHints: + sb.AppendLine(4, $"[ProducesResponseType(typeof(ProblemDetails), {(int)HttpStatusCode.EarlyHints})]"); + break; + case HttpStatusCode.Continue: + case HttpStatusCode.SwitchingProtocols: + case HttpStatusCode.Processing: + case HttpStatusCode.Created: + case HttpStatusCode.Accepted: + case HttpStatusCode.NonAuthoritativeInformation: + case HttpStatusCode.NoContent: + case HttpStatusCode.ResetContent: + case HttpStatusCode.PartialContent: + case HttpStatusCode.MultiStatus: + case HttpStatusCode.AlreadyReported: + case HttpStatusCode.IMUsed: + case HttpStatusCode.MultipleChoices: + case HttpStatusCode.MovedPermanently: + case HttpStatusCode.Found: + case HttpStatusCode.SeeOther: + case HttpStatusCode.NotModified: + case HttpStatusCode.UseProxy: + case HttpStatusCode.Unused: + case HttpStatusCode.RedirectKeepVerb: + case HttpStatusCode.PermanentRedirect: + case HttpStatusCode.Unauthorized: + case HttpStatusCode.PaymentRequired: + case HttpStatusCode.Forbidden: + case HttpStatusCode.NotFound: + case HttpStatusCode.MethodNotAllowed: + case HttpStatusCode.NotAcceptable: + case HttpStatusCode.ProxyAuthenticationRequired: + case HttpStatusCode.RequestTimeout: + case HttpStatusCode.Conflict: + case HttpStatusCode.Gone: + case HttpStatusCode.LengthRequired: + case HttpStatusCode.PreconditionFailed: + case HttpStatusCode.RequestEntityTooLarge: + case HttpStatusCode.RequestUriTooLong: + case HttpStatusCode.UnsupportedMediaType: + case HttpStatusCode.RequestedRangeNotSatisfiable: + case HttpStatusCode.ExpectationFailed: + case HttpStatusCode.MisdirectedRequest: + case HttpStatusCode.UnprocessableEntity: + case HttpStatusCode.Locked: + case HttpStatusCode.FailedDependency: + case HttpStatusCode.UpgradeRequired: + case HttpStatusCode.PreconditionRequired: + case HttpStatusCode.TooManyRequests: + case HttpStatusCode.RequestHeaderFieldsTooLarge: + case HttpStatusCode.UnavailableForLegalReasons: + case HttpStatusCode.InternalServerError: + case HttpStatusCode.NotImplemented: + case HttpStatusCode.BadGateway: + case HttpStatusCode.ServiceUnavailable: + case HttpStatusCode.GatewayTimeout: + case HttpStatusCode.HttpVersionNotSupported: + case HttpStatusCode.VariantAlsoNegotiates: + case HttpStatusCode.InsufficientStorage: + case HttpStatusCode.LoopDetected: + case HttpStatusCode.NotExtended: + case HttpStatusCode.NetworkAuthenticationRequired: + sb.AppendLine(4, $"[ProducesResponseType(typeof(ProblemDetails), StatusCodes.{responseModel.StatusCode.ToStatusCodesConstant()})]"); + break; + default: + sb.AppendLine(4, $"// TODO: Not Implemented for {responseModel.StatusCode}."); + break; + } + } + } + + private static void AppendProducesWithoutProblemDetails( + StringBuilder sb, + ContentGeneratorServerEndpointMethodParameters item) + { + var responseModels = item.ResponseModels + .AppendUnauthorizedIfNeeded(item.Authorization) + .AppendForbiddenIfNeeded(item.Authorization) + .AppendBadRequestIfNeeded(item.ParameterTypeName) + .OrderBy(x => x.StatusCode) + .ToList(); + + foreach (var responseModel in responseModels) + { + switch (responseModel.StatusCode) + { + case HttpStatusCode.OK: + AppendProducesForOk(sb, responseModel); + break; + case HttpStatusCode.BadRequest: + sb.AppendLine(4, $"[ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.{responseModel.StatusCode.ToStatusCodesConstant()})]"); + break; + case HttpStatusCode.Accepted: + case HttpStatusCode.Created: + case HttpStatusCode.NotFound: + case HttpStatusCode.Conflict: + case HttpStatusCode.InternalServerError: + sb.AppendLine(4, $"[ProducesResponseType(typeof(string), StatusCodes.{responseModel.StatusCode.ToStatusCodesConstant()})]"); + break; + case HttpStatusCode.EarlyHints: + sb.AppendLine(4, $"[ProducesResponseType({(int)HttpStatusCode.EarlyHints})]"); + break; + case HttpStatusCode.Continue: + case HttpStatusCode.SwitchingProtocols: + case HttpStatusCode.Processing: + case HttpStatusCode.NonAuthoritativeInformation: + case HttpStatusCode.NoContent: + case HttpStatusCode.ResetContent: + case HttpStatusCode.PartialContent: + case HttpStatusCode.MultiStatus: + case HttpStatusCode.AlreadyReported: + case HttpStatusCode.IMUsed: + case HttpStatusCode.MultipleChoices: + case HttpStatusCode.MovedPermanently: + case HttpStatusCode.Found: + case HttpStatusCode.SeeOther: + case HttpStatusCode.NotModified: + case HttpStatusCode.UseProxy: + case HttpStatusCode.Unused: + case HttpStatusCode.RedirectKeepVerb: + case HttpStatusCode.PermanentRedirect: + case HttpStatusCode.Unauthorized: + case HttpStatusCode.PaymentRequired: + case HttpStatusCode.Forbidden: + case HttpStatusCode.MethodNotAllowed: + case HttpStatusCode.NotAcceptable: + case HttpStatusCode.ProxyAuthenticationRequired: + case HttpStatusCode.RequestTimeout: + case HttpStatusCode.Gone: + case HttpStatusCode.LengthRequired: + case HttpStatusCode.PreconditionFailed: + case HttpStatusCode.RequestEntityTooLarge: + case HttpStatusCode.RequestUriTooLong: + case HttpStatusCode.UnsupportedMediaType: + case HttpStatusCode.RequestedRangeNotSatisfiable: + case HttpStatusCode.ExpectationFailed: + case HttpStatusCode.MisdirectedRequest: + case HttpStatusCode.UnprocessableEntity: + case HttpStatusCode.Locked: + case HttpStatusCode.FailedDependency: + case HttpStatusCode.UpgradeRequired: + case HttpStatusCode.PreconditionRequired: + case HttpStatusCode.TooManyRequests: + case HttpStatusCode.RequestHeaderFieldsTooLarge: + case HttpStatusCode.UnavailableForLegalReasons: + case HttpStatusCode.NotImplemented: + case HttpStatusCode.BadGateway: + case HttpStatusCode.ServiceUnavailable: + case HttpStatusCode.GatewayTimeout: + case HttpStatusCode.HttpVersionNotSupported: + case HttpStatusCode.VariantAlsoNegotiates: + case HttpStatusCode.InsufficientStorage: + case HttpStatusCode.LoopDetected: + case HttpStatusCode.NotExtended: + case HttpStatusCode.NetworkAuthenticationRequired: + sb.AppendLine(4, $"[ProducesResponseType(StatusCodes.{responseModel.StatusCode.ToStatusCodesConstant()})]"); + break; + default: + sb.AppendLine(4, $"// TODO: Not Implemented for {responseModel.StatusCode}."); + break; + } + } + } + + private static void AppendProducesForOk( + StringBuilder sb, + ApiOperationResponseModel responseModel) + { + if (responseModel.MediaType == MediaTypeNames.Application.Octet) + { + sb.AppendLine(4, $"[ProducesResponseType(typeof(byte[]), StatusCodes.{responseModel.StatusCode.ToStatusCodesConstant()})]"); + } + else if (responseModel.DataType is null) + { + sb.AppendLine(4, $"[ProducesResponseType(typeof(string), StatusCodes.{responseModel.StatusCode.ToStatusCodesConstant()})]"); + } + else + { + if (string.IsNullOrEmpty(responseModel.CollectionDataType)) + { + sb.AppendLine(4, $"[ProducesResponseType(typeof({responseModel.DataType}), StatusCodes.{responseModel.StatusCode.ToStatusCodesConstant()})]"); + } + else + { + sb.AppendLine( + 4, + responseModel.CollectionDataType == "List" + ? $"[ProducesResponseType(typeof(IEnumerable<{responseModel.DataType}>), StatusCodes.{responseModel.StatusCode.ToStatusCodesConstant()})]" + : $"[ProducesResponseType(typeof({responseModel.CollectionDataType}<{responseModel.DataType}>), StatusCodes.{responseModel.StatusCode.ToStatusCodesConstant()})]"); + } + } + } +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/ContentGeneratorServerParameter.cs b/src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/ContentGeneratorServerParameter.cs new file mode 100644 index 00000000..96756b95 --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/ContentGeneratorServerParameter.cs @@ -0,0 +1,197 @@ +// ReSharper disable StringLiteralTypo +// ReSharper disable SwitchStatementMissingSomeEnumCasesNoDefault +// ReSharper disable ConvertIfStatementToConditionalTernaryExpression +namespace Atc.Rest.ApiGenerator.Framework.Mvc.ContentGenerators; + +public sealed class ContentGeneratorServerParameter : IContentGenerator +{ + private readonly GeneratedCodeHeaderGenerator codeHeaderGenerator; + private readonly GeneratedCodeAttributeGenerator codeAttributeGenerator; + private readonly CodeDocumentationTagsGenerator codeDocumentationTagsGenerator; + private readonly ContentGeneratorServerParameterParameters parameters; + + public ContentGeneratorServerParameter( + GeneratedCodeHeaderGenerator codeHeaderGenerator, + GeneratedCodeAttributeGenerator codeAttributeGenerator, + CodeDocumentationTagsGenerator codeDocumentationTagsGenerator, + ContentGeneratorServerParameterParameters parameters) + { + this.codeHeaderGenerator = codeHeaderGenerator; + this.codeAttributeGenerator = codeAttributeGenerator; + this.codeDocumentationTagsGenerator = codeDocumentationTagsGenerator; + this.parameters = parameters; + } + + public string Generate() + { + var sb = new StringBuilder(); + + sb.Append(codeHeaderGenerator.Generate()); + sb.AppendLine($"namespace {parameters.Namespace};"); + sb.AppendLine(); + + if (codeDocumentationTagsGenerator.ShouldGenerateTags(parameters.DocumentationTags)) + { + sb.Append(codeDocumentationTagsGenerator.GenerateTags(0, parameters.DocumentationTags)); + } + + sb.AppendLine(codeAttributeGenerator.Generate()); + sb.AppendLine($"public class {parameters.ParameterName}"); + sb.AppendLine("{"); + + foreach (var parameter in parameters.PropertyParameters) + { + if (codeDocumentationTagsGenerator.ShouldGenerateTags(parameter.DocumentationTags)) + { + sb.Append(codeDocumentationTagsGenerator.GenerateTags(4, parameter.DocumentationTags)); + } + + AppendPropertyAttributes(sb, parameter); + AppendPropertyBody(sb, parameter); + + sb.AppendLine(); + } + + AppendMethodToStringContent(sb, parameters.PropertyParameters); + + sb.Append('}'); + + return sb.ToString(); + } + + private static void AppendPropertyAttributes( + StringBuilder sb, + ContentGeneratorServerParameterParametersProperty item) + { + switch (item.ParameterLocationType) + { + case ParameterLocationType.Query: + case ParameterLocationType.Header: + case ParameterLocationType.Route: + case ParameterLocationType.Cookie: + sb.AppendLine(4, $"[From{item.ParameterLocationType}(Name = \"{item.Name}\")]"); + break; + case ParameterLocationType.Body: + case ParameterLocationType.Form: + sb.AppendLine(4, $"[From{item.ParameterLocationType}]"); + break; + } + + if (item.IsRequired) + { + sb.AppendLine(4, "[Required]"); + } + + foreach (var additionalValidationAttribute in item.AdditionalValidationAttributes) + { + switch (additionalValidationAttribute) + { + case EmailAddressAttribute: + sb.AppendLine(4, "[EmailAddress]"); + break; + case RegularExpressionAttribute regularExpressionAttribute: + sb.AppendLine(4, $"[RegularExpression({regularExpressionAttribute.GetEscapedPattern()})]"); + break; + case StringLengthAttribute stringLengthAttribute: + sb.AppendLine(4, $"[StringLength({stringLengthAttribute.MaximumLength})]"); + break; + case MinLengthAttribute minLengthAttribute: + sb.AppendLine(4, $"[MinLength({minLengthAttribute.Length})]"); + break; + case MaxLengthAttribute maxLengthAttribute: + sb.AppendLine(4, $"[MaxLength({maxLengthAttribute.Length})]"); + break; + case RangeAttribute rangeAttribute: + sb.AppendLine(4, $"[Range({rangeAttribute.Minimum}, {rangeAttribute.Maximum})]"); + break; + case UriAttribute: + sb.AppendLine(4, "[Uri]"); + break; + } + } + } + + private static void AppendPropertyBody( + StringBuilder sb, + ContentGeneratorServerParameterParametersProperty item) + { + sb.Append(4, "public "); + if (item.UseListForDataType) + { + sb.Append("List<"); + } + + sb.Append(item.DataType); + if (item.UseListForDataType) + { + sb.Append('>'); + } + + if (item is { IsNullable: true, UseListForDataType: false }) + { + sb.Append('?'); + } + + sb.Append(' '); + sb.Append(item.ParameterName); + + if (item.UseListForDataType) + { + sb.AppendLine($" {{ get; set; }} = new List<{item.DataType}>();"); + } + else + { + if (string.IsNullOrEmpty(item.DefaultValueInitializer)) + { + sb.AppendLine(" { get; set; }"); + } + else + { + if (item.DataType.Equals("string", StringComparison.Ordinal)) + { + sb.AppendLine($" {{ get; set; }} = \"{item.DefaultValueInitializer}\";"); + } + else + { + sb.AppendLine($" {{ get; set; }} = {item.DefaultValueInitializer};"); + } + } + } + } + + private static void AppendMethodToStringContent( + StringBuilder sb, + IList items) + { + var sbToStringContent = new StringBuilder(); + for (var i = 0; i < items.Count; i++) + { + var parameter = items[i]; + var parameterName = parameter.ParameterName; + if (parameter.UseListForDataType) + { + sbToStringContent.Append($"{{nameof({parameterName})}}.Count: {{{parameterName}?.Count ?? 0}}"); + } + else + { + if (parameter.IsSimpleType) + { + sbToStringContent.Append($"{{nameof({parameterName})}}: {{{parameterName}}}"); + } + else + { + sbToStringContent.Append($"{{nameof({parameterName})}}: ({{{parameterName}}})"); + } + } + + if (i != items.Count - 1) + { + sbToStringContent.Append(", "); + } + } + + sb.AppendLine(4, "/// "); + sb.AppendLine(4, "public override string ToString()"); + sb.AppendLine(8, $"=> $\"{sbToStringContent}\";"); + } +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/ContentGeneratorServerProgram.cs b/src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/ContentGeneratorServerProgram.cs new file mode 100644 index 00000000..7cf1280f --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/ContentGeneratorServerProgram.cs @@ -0,0 +1,43 @@ +namespace Atc.Rest.ApiGenerator.Framework.Mvc.ContentGenerators; + +public sealed class ContentGeneratorServerProgram : IContentGenerator +{ + private readonly ContentGeneratorBaseParameters parameters; + + public ContentGeneratorServerProgram( + ContentGeneratorBaseParameters parameters) + { + this.parameters = parameters; + } + + public string Generate() + { + var sb = new StringBuilder(); + + sb.AppendLine($"namespace {parameters.Namespace};"); + sb.AppendLine(); + sb.AppendLine("public static class Program"); + sb.AppendLine("{"); + sb.AppendLine(4, "public static void Main(string[] args)"); + sb.AppendLine(4, "{"); + sb.AppendLine(8, "CreateHostBuilder(args)"); + sb.AppendLine(12, ".Build()"); + sb.AppendLine(12, ".Run();"); + sb.AppendLine(4, "}"); + sb.AppendLine(); + sb.AppendLine(4, "public static IHostBuilder CreateHostBuilder(string[] args)"); + sb.AppendLine(4, "{"); + sb.AppendLine(8, "var builder = Host"); + sb.AppendLine(12, ".CreateDefaultBuilder(args)"); + sb.AppendLine(12, ".ConfigureWebHostDefaults(webBuilder =>"); + sb.AppendLine(12, "{"); + sb.AppendLine(16, "webBuilder.UseStartup();"); + sb.AppendLine(12, "});"); + sb.AppendLine(); + sb.AppendLine(8, "return builder;"); + sb.AppendLine(4, "}"); + sb.Append('}'); + + return sb.ToString(); + } +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/ContentGeneratorServerResult.cs b/src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/ContentGeneratorServerResult.cs new file mode 100644 index 00000000..fa54e35b --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/ContentGeneratorServerResult.cs @@ -0,0 +1,335 @@ +// ReSharper disable SwitchStatementHandlesSomeKnownEnumValuesWithDefault +// ReSharper disable SwitchStatementMissingSomeEnumCasesNoDefault +// ReSharper disable ConvertIfStatementToReturnStatement +namespace Atc.Rest.ApiGenerator.Framework.Mvc.ContentGenerators; + +public sealed class ContentGeneratorServerResult : IContentGenerator +{ + private readonly GeneratedCodeHeaderGenerator codeHeaderGenerator; + private readonly GeneratedCodeAttributeGenerator codeAttributeGenerator; + private readonly CodeDocumentationTagsGenerator codeDocumentationTagsGenerator; + private readonly ContentGeneratorServerResultParameters parameters; + private readonly bool useProblemDetailsAsDefaultResponseBody; + + public ContentGeneratorServerResult( + GeneratedCodeHeaderGenerator codeHeaderGenerator, + GeneratedCodeAttributeGenerator codeAttributeGenerator, + CodeDocumentationTagsGenerator codeDocumentationTagsGenerator, + ContentGeneratorServerResultParameters parameters, + bool useProblemDetailsAsDefaultResponseBody) + { + this.codeHeaderGenerator = codeHeaderGenerator; + this.codeAttributeGenerator = codeAttributeGenerator; + this.codeDocumentationTagsGenerator = codeDocumentationTagsGenerator; + this.parameters = parameters; + this.useProblemDetailsAsDefaultResponseBody = useProblemDetailsAsDefaultResponseBody; + } + + public string Generate() + { + var sb = new StringBuilder(); + + sb.Append(codeHeaderGenerator.Generate()); + sb.AppendLine($"namespace {parameters.Namespace};"); + sb.AppendLine(); + if (codeDocumentationTagsGenerator.ShouldGenerateTags(parameters.DocumentationTags)) + { + sb.Append(codeDocumentationTagsGenerator.GenerateTags(0, parameters.DocumentationTags)); + } + + sb.AppendLine(codeAttributeGenerator.Generate()); + sb.AppendLine($"public class {parameters.ResultName} : {nameof(Results.ResultBase)}"); + sb.AppendLine("{"); + sb.AppendLine(4, $"private {parameters.ResultName}(ActionResult result) : base(result) {{ }}"); + sb.AppendLine(); + + for (var i = 0; i < parameters.MethodParameters.Count; i++) + { + var item = parameters.MethodParameters[i]; + + AppendMethodContent(sb, item, parameters.ResultName); + + if (i < parameters.MethodParameters.Count - 1) + { + sb.AppendLine(); + } + } + + if (parameters.ImplicitOperatorParameters is not null) + { + AppendImplicitOperatorContent(sb, parameters); + } + + sb.Append('}'); + + return sb.ToString(); + } + + private void AppendMethodContent( + StringBuilder sb, + ContentGeneratorServerResultMethodParameters item, + string resultName) + { + if (codeDocumentationTagsGenerator.ShouldGenerateTags(item.DocumentationTags)) + { + sb.Append(codeDocumentationTagsGenerator.GenerateTags(4, item.DocumentationTags)); + } + + if (item.ResponseModel.StatusCode == HttpStatusCode.OK) + { + AppendMethodContentStatusCodeOk(sb, item, resultName); + } + else + { + if (useProblemDetailsAsDefaultResponseBody) + { + AppendMethodContentForOtherStatusCodesThenOkWithProblemDetails(sb, item, resultName); + } + else + { + AppendMethodContentForOtherStatusCodesThenOkWithoutProblemDetails(sb, item, resultName); + } + } + } + + private void AppendMethodContentStatusCodeOk( + StringBuilder sb, + ContentGeneratorServerResultMethodParameters item, + string resultName) + { + if (item.ResponseModel.MediaType == MediaTypeNames.Application.Octet) + { + sb.AppendLine(4, $"public static {resultName} Ok(byte[] bytes, string fileName)"); + sb.AppendLine(8, $"=> new {resultName}(ResultFactory.CreateFileContentResult(bytes, fileName));"); + return; + } + + if (string.IsNullOrEmpty(item.ResponseModel.DataType)) + { + sb.AppendLine(4, $"public static {resultName} Ok(string? message = null)"); + sb.AppendLine(8, $"=> new {resultName}(new OkObjectResult(message));"); + return; + } + + if (item.ResponseModel.CollectionDataType is null) + { + sb.AppendLine(4, $"public static {resultName} Ok({item.ResponseModel.DataType} response)"); + sb.AppendLine(8, $"=> new {resultName}(new OkObjectResult(response));"); + return; + } + + if (item.ResponseModel.CollectionDataType == NameConstants.List) + { + sb.AppendLine(4, $"public static {resultName} Ok(IEnumerable<{item.ResponseModel.DataType}> response)"); + sb.AppendLine(8, $"=> new {resultName}(new OkObjectResult(response ?? Enumerable.Empty<{item.ResponseModel.DataType}>()));"); + } + else + { + sb.AppendLine(4, $"public static {resultName} Ok({item.ResponseModel.CollectionDataType}<{item.ResponseModel.DataType}> response)"); + sb.AppendLine(8, $"=> new {resultName}(new OkObjectResult(response));"); + } + } + + private void AppendMethodContentForOtherStatusCodesThenOkWithProblemDetails( + StringBuilder sb, + ContentGeneratorServerResultMethodParameters item, + string resultName) + { + switch (item.ResponseModel.StatusCode) + { + case HttpStatusCode.OK: + throw new InvalidOperationException("This should not happen."); + case HttpStatusCode.Accepted: + case HttpStatusCode.Created: + sb.AppendLine(4, $"public static {resultName} {item.ResponseModel.StatusCode.ToNormalizedString()}(string? uri = null)"); + sb.AppendLine(8, $"=> new {resultName}({nameof(Results.ResultFactory)}.{nameof(Results.ResultFactory.CreateContentResult)}({nameof(HttpStatusCode)}.{item.ResponseModel.StatusCode}, uri));"); + break; + case HttpStatusCode.BadRequest: + sb.AppendLine(4, $"public static {resultName} {item.ResponseModel.StatusCode.ToNormalizedString()}(string? message = null)"); + sb.AppendLine(8, $"=> new {resultName}({nameof(Results.ResultFactory)}.{nameof(Results.ResultFactory.CreateContentResultWithValidationProblemDetails)}({nameof(HttpStatusCode)}.{item.ResponseModel.StatusCode}, message));"); + break; + case HttpStatusCode.EarlyHints: + sb.AppendLine(4, $"public static {resultName} {item.ResponseModel.StatusCode.ToNormalizedString()}()"); + sb.AppendLine(8, $"=> new {resultName}({nameof(Results.ResultFactory)}.{nameof(Results.ResultFactory.CreateContentResultWithProblemDetails)}({nameof(HttpStatusCode)}.{item.ResponseModel.StatusCode}));"); + break; + case HttpStatusCode.Continue: + case HttpStatusCode.SwitchingProtocols: + case HttpStatusCode.Processing: + case HttpStatusCode.NonAuthoritativeInformation: + case HttpStatusCode.NoContent: + case HttpStatusCode.ResetContent: + case HttpStatusCode.PartialContent: + case HttpStatusCode.MultiStatus: + case HttpStatusCode.AlreadyReported: + case HttpStatusCode.IMUsed: + case HttpStatusCode.MultipleChoices: + case HttpStatusCode.MovedPermanently: + case HttpStatusCode.Found: + case HttpStatusCode.SeeOther: + case HttpStatusCode.NotModified: + case HttpStatusCode.UseProxy: + case HttpStatusCode.Unused: + case HttpStatusCode.RedirectKeepVerb: + case HttpStatusCode.PermanentRedirect: + case HttpStatusCode.Unauthorized: + case HttpStatusCode.PaymentRequired: + case HttpStatusCode.Forbidden: + case HttpStatusCode.NotFound: + case HttpStatusCode.MethodNotAllowed: + case HttpStatusCode.NotAcceptable: + case HttpStatusCode.ProxyAuthenticationRequired: + case HttpStatusCode.RequestTimeout: + case HttpStatusCode.Conflict: + case HttpStatusCode.Gone: + case HttpStatusCode.LengthRequired: + case HttpStatusCode.PreconditionFailed: + case HttpStatusCode.RequestEntityTooLarge: + case HttpStatusCode.RequestUriTooLong: + case HttpStatusCode.UnsupportedMediaType: + case HttpStatusCode.RequestedRangeNotSatisfiable: + case HttpStatusCode.ExpectationFailed: + case HttpStatusCode.MisdirectedRequest: + case HttpStatusCode.UnprocessableEntity: + case HttpStatusCode.Locked: + case HttpStatusCode.FailedDependency: + case HttpStatusCode.UpgradeRequired: + case HttpStatusCode.PreconditionRequired: + case HttpStatusCode.TooManyRequests: + case HttpStatusCode.RequestHeaderFieldsTooLarge: + case HttpStatusCode.UnavailableForLegalReasons: + case HttpStatusCode.InternalServerError: + case HttpStatusCode.NotImplemented: + case HttpStatusCode.BadGateway: + case HttpStatusCode.ServiceUnavailable: + case HttpStatusCode.GatewayTimeout: + case HttpStatusCode.HttpVersionNotSupported: + case HttpStatusCode.VariantAlsoNegotiates: + case HttpStatusCode.InsufficientStorage: + case HttpStatusCode.LoopDetected: + case HttpStatusCode.NotExtended: + case HttpStatusCode.NetworkAuthenticationRequired: + sb.AppendLine(4, $"public static {resultName} {item.ResponseModel.StatusCode.ToNormalizedString()}(string? message = null)"); + sb.AppendLine(8, $"=> new {resultName}({nameof(Results.ResultFactory)}.{nameof(Results.ResultFactory.CreateContentResultWithProblemDetails)}({nameof(HttpStatusCode)}.{item.ResponseModel.StatusCode}, message));"); + break; + default: + sb.AppendLine(4, $"// TODO: Not Implemented for {item.ResponseModel.StatusCode}."); + break; + } + } + + private void AppendMethodContentForOtherStatusCodesThenOkWithoutProblemDetails( + StringBuilder sb, + ContentGeneratorServerResultMethodParameters item, + string resultName) + { + switch (item.ResponseModel.StatusCode) + { + case HttpStatusCode.OK: + throw new InvalidOperationException("This should not happen."); + case HttpStatusCode.Accepted: + case HttpStatusCode.Created: + sb.AppendLine(4, $"public static {resultName} {item.ResponseModel.StatusCode.ToNormalizedString()}(string? uri = null)"); + sb.AppendLine(8, $"=> new {resultName}({nameof(Results.ResultFactory)}.{nameof(Results.ResultFactory.CreateContentResult)}({nameof(HttpStatusCode)}.{item.ResponseModel.StatusCode}, uri));"); + break; + case HttpStatusCode.BadRequest: + case HttpStatusCode.NotFound: + case HttpStatusCode.Conflict: + sb.AppendLine(4, $"public static {resultName} {item.ResponseModel.StatusCode.ToNormalizedString()}(string? message = null)"); + sb.AppendLine(8, $"=> new {resultName}(new {item.ResponseModel.StatusCode.ToNormalizedString()}ObjectResult(message));"); + break; + case HttpStatusCode.EarlyHints: + sb.AppendLine(4, $"public static {resultName} {item.ResponseModel.StatusCode.ToNormalizedString()}()"); + sb.AppendLine(8, $"=> new {resultName}({nameof(Results.ResultFactory)}.{nameof(Results.ResultFactory.CreateContentResult)}({nameof(HttpStatusCode)}.{item.ResponseModel.StatusCode}, string? message = null));"); + break; + case HttpStatusCode.Continue: + case HttpStatusCode.SwitchingProtocols: + case HttpStatusCode.Processing: + case HttpStatusCode.NonAuthoritativeInformation: + case HttpStatusCode.NoContent: + case HttpStatusCode.ResetContent: + case HttpStatusCode.PartialContent: + case HttpStatusCode.MultiStatus: + case HttpStatusCode.AlreadyReported: + case HttpStatusCode.IMUsed: + case HttpStatusCode.MultipleChoices: + case HttpStatusCode.MovedPermanently: + case HttpStatusCode.Found: + case HttpStatusCode.SeeOther: + case HttpStatusCode.NotModified: + case HttpStatusCode.UseProxy: + case HttpStatusCode.Unused: + case HttpStatusCode.RedirectKeepVerb: + case HttpStatusCode.PermanentRedirect: + case HttpStatusCode.Unauthorized: + case HttpStatusCode.PaymentRequired: + case HttpStatusCode.Forbidden: + case HttpStatusCode.MethodNotAllowed: + case HttpStatusCode.NotAcceptable: + case HttpStatusCode.ProxyAuthenticationRequired: + case HttpStatusCode.RequestTimeout: + case HttpStatusCode.Gone: + case HttpStatusCode.LengthRequired: + case HttpStatusCode.PreconditionFailed: + case HttpStatusCode.RequestEntityTooLarge: + case HttpStatusCode.RequestUriTooLong: + case HttpStatusCode.UnsupportedMediaType: + case HttpStatusCode.RequestedRangeNotSatisfiable: + case HttpStatusCode.ExpectationFailed: + case HttpStatusCode.MisdirectedRequest: + case HttpStatusCode.UnprocessableEntity: + case HttpStatusCode.Locked: + case HttpStatusCode.FailedDependency: + case HttpStatusCode.UpgradeRequired: + case HttpStatusCode.PreconditionRequired: + case HttpStatusCode.TooManyRequests: + case HttpStatusCode.RequestHeaderFieldsTooLarge: + case HttpStatusCode.UnavailableForLegalReasons: + case HttpStatusCode.InternalServerError: + case HttpStatusCode.NotImplemented: + case HttpStatusCode.BadGateway: + case HttpStatusCode.ServiceUnavailable: + case HttpStatusCode.GatewayTimeout: + case HttpStatusCode.HttpVersionNotSupported: + case HttpStatusCode.VariantAlsoNegotiates: + case HttpStatusCode.InsufficientStorage: + case HttpStatusCode.LoopDetected: + case HttpStatusCode.NotExtended: + case HttpStatusCode.NetworkAuthenticationRequired: + sb.AppendLine(4, $"public static {resultName} {item.ResponseModel.StatusCode.ToNormalizedString()}(string? message = null)"); + sb.AppendLine(8, $"=> new {resultName}({nameof(Results.ResultFactory)}.{nameof(Results.ResultFactory.CreateContentResult)}({nameof(HttpStatusCode)}.{item.ResponseModel.StatusCode}, message));"); + break; + default: + sb.AppendLine(4, $"// TODO: Not Implemented for {item.ResponseModel.StatusCode}."); + break; + } + } + + private static void AppendImplicitOperatorContent( + StringBuilder sb, + ContentGeneratorServerResultParameters item) + { + if (item.ImplicitOperatorParameters is null) + { + return; + } + + sb.AppendLine(); + sb.AppendLine(4, "/// "); + sb.AppendLine(4, $"/// Performs an implicit conversion from {item.ResultName} to ActionResult."); + sb.AppendLine(4, "/// "); + if (item.ImplicitOperatorParameters.DataType is null) + { + sb.AppendLine(4, $"public static implicit operator {item.ResultName}(string response)"); + } + else + { + sb.AppendLine( + 4, + item.ImplicitOperatorParameters.CollectionDataType is null + ? $"public static implicit operator {item.ResultName}({item.ImplicitOperatorParameters.DataType} response)" + : $"public static implicit operator {item.ResultName}({item.ImplicitOperatorParameters.CollectionDataType}<{item.ImplicitOperatorParameters.DataType}> response)"); + } + + sb.AppendLine(8, "=> Ok(response);"); + } +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/Server/ContentGeneratorServerStartup.cs b/src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/ContentGeneratorServerStartup.cs similarity index 96% rename from src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/Server/ContentGeneratorServerStartup.cs rename to src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/ContentGeneratorServerStartup.cs index da5393ce..9f84856b 100644 --- a/src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/Server/ContentGeneratorServerStartup.cs +++ b/src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/ContentGeneratorServerStartup.cs @@ -1,4 +1,4 @@ -namespace Atc.Rest.ApiGenerator.Framework.Mvc.ContentGenerators.Server; +namespace Atc.Rest.ApiGenerator.Framework.Mvc.ContentGenerators; public sealed class ContentGeneratorServerStartup : IContentGenerator { diff --git a/src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/Server/ContentGeneratorServerWebApiControllerBaseTest.cs b/src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/ContentGeneratorServerWebApiControllerBaseTest.cs similarity index 98% rename from src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/Server/ContentGeneratorServerWebApiControllerBaseTest.cs rename to src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/ContentGeneratorServerWebApiControllerBaseTest.cs index 1b5dc2a2..5c725bc8 100644 --- a/src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/Server/ContentGeneratorServerWebApiControllerBaseTest.cs +++ b/src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/ContentGeneratorServerWebApiControllerBaseTest.cs @@ -1,4 +1,4 @@ -namespace Atc.Rest.ApiGenerator.Framework.Mvc.ContentGenerators.Server; +namespace Atc.Rest.ApiGenerator.Framework.Mvc.ContentGenerators; public sealed class ContentGeneratorServerWebApiControllerBaseTest : IContentGenerator { diff --git a/src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/Server/ContentGeneratorServerWebApiStartupFactory.cs b/src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/ContentGeneratorServerWebApiStartupFactory.cs similarity index 97% rename from src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/Server/ContentGeneratorServerWebApiStartupFactory.cs rename to src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/ContentGeneratorServerWebApiStartupFactory.cs index 481454e3..42c8476b 100644 --- a/src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/Server/ContentGeneratorServerWebApiStartupFactory.cs +++ b/src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/ContentGeneratorServerWebApiStartupFactory.cs @@ -1,4 +1,4 @@ -namespace Atc.Rest.ApiGenerator.Framework.Mvc.ContentGenerators.Server; +namespace Atc.Rest.ApiGenerator.Framework.Mvc.ContentGenerators; public sealed class ContentGeneratorServerWebApiStartupFactory : IContentGenerator { diff --git a/src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/Server/ContentGeneratorServerController.cs b/src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/Server/ContentGeneratorServerController.cs deleted file mode 100644 index 87d05a82..00000000 --- a/src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/Server/ContentGeneratorServerController.cs +++ /dev/null @@ -1,183 +0,0 @@ -namespace Atc.Rest.ApiGenerator.Framework.Mvc.ContentGenerators.Server; - -public sealed class ContentGeneratorServerController : IContentGenerator -{ - private readonly GeneratedCodeHeaderGenerator codeHeaderGenerator; - private readonly GeneratedCodeAttributeGenerator codeAttributeGenerator; - private readonly CodeDocumentationTagsGenerator codeDocumentationTagsGenerator; - private readonly ContentGeneratorServerControllerParameters parameters; - - public ContentGeneratorServerController( - GeneratedCodeHeaderGenerator codeHeaderGenerator, - GeneratedCodeAttributeGenerator codeAttributeGenerator, - CodeDocumentationTagsGenerator codeDocumentationTagsGenerator, - ContentGeneratorServerControllerParameters parameters) - { - this.codeHeaderGenerator = codeHeaderGenerator; - this.codeAttributeGenerator = codeAttributeGenerator; - this.codeDocumentationTagsGenerator = codeDocumentationTagsGenerator; - this.parameters = parameters; - } - - public string Generate() - { - var sb = new StringBuilder(); - - sb.Append(codeHeaderGenerator.Generate()); - sb.AppendLine($"namespace {parameters.Namespace};"); - sb.AppendLine(); - if (codeDocumentationTagsGenerator.ShouldGenerateTags(parameters.DocumentationTags)) - { - sb.Append(codeDocumentationTagsGenerator.GenerateTags(0, parameters.DocumentationTags)); - } - - sb.AppendLine("[Authorize]"); - sb.AppendLine("[ApiController]"); - sb.AppendLine($"[Route(\"{parameters.RouteBase}\")]"); - sb.AppendLine(codeAttributeGenerator.Generate()); - sb.AppendLine($"public class {parameters.ApiGroupName}Controller : ControllerBase"); - sb.AppendLine("{"); - - for (var i = 0; i < parameters.MethodParameters.Count; i++) - { - var item = parameters.MethodParameters[i]; - - AppendMethodContent(sb, item); - - if (i < parameters.MethodParameters.Count - 1) - { - sb.AppendLine(); - } - } - - sb.Append('}'); - - return sb.ToString(); - } - - private void AppendMethodContent( - StringBuilder sb, - ContentGeneratorServerControllerMethodParameters item) - { - if (codeDocumentationTagsGenerator.ShouldGenerateTags(item.DocumentationTags)) - { - sb.Append(codeDocumentationTagsGenerator.GenerateTags(4, item.DocumentationTags)); - } - - AppendMethodContentAuthorizationIfNeeded(sb, item); - - sb.AppendLine(4, string.IsNullOrEmpty(item.RouteSuffix) - ? $"[Http{item.OperationTypeRepresentation}]" - : $"[Http{item.OperationTypeRepresentation}(\"{item.RouteSuffix}\")]"); - - if (item.MultipartBodyLengthLimit.HasValue) - { - sb.AppendLine(4, item.MultipartBodyLengthLimit.Value == long.MaxValue - ? "[RequestFormLimits(MultipartBodyLengthLimit = long.MaxValue)]" - : $"[RequestFormLimits(MultipartBodyLengthLimit = {item.MultipartBodyLengthLimit.Value})]"); - } - - foreach (var producesResponseTypeRepresentation in item.ProducesResponseTypeRepresentations) - { - sb.AppendLine(4, $"[{producesResponseTypeRepresentation}]"); - } - - sb.AppendLine(4, $"public async Task {item.Name}("); - - if (!string.IsNullOrEmpty(item.ParameterTypeName)) - { - sb.AppendLine(8, $"{item.ParameterTypeName} parameters,"); - } - - sb.AppendLine(8, $"[FromServices] {item.InterfaceName} handler,"); - sb.AppendLine(8, "CancellationToken cancellationToken)"); - - sb.AppendLine(8, !string.IsNullOrEmpty(item.ParameterTypeName) - ? "=> await handler.ExecuteAsync(parameters, cancellationToken);" - : "=> await handler.ExecuteAsync(cancellationToken);"); - } - - private static void AppendMethodContentAuthorizationIfNeeded( - StringBuilder sb, - ContentGeneratorServerControllerMethodParameters item) - { - if (ShouldUseAuthorizeAttribute(item)) - { - var authorizeLineBuilder = new StringBuilder(); - var authRoles = string.Join(',', item.ApiPathAuthorizationRoles.Concat(item.ApiOperationAuthorizationRoles).Distinct(StringComparer.Ordinal).OrderBy(x => x, StringComparer.Ordinal)); - var authSchemes = string.Join(',', item.ApiPathAuthenticationSchemes.Concat(item.ApiOperationAuthenticationSchemes).Distinct(StringComparer.Ordinal).OrderBy(x => x, StringComparer.Ordinal)); - - authorizeLineBuilder.Append(4, "[Authorize"); - - if (!string.IsNullOrEmpty(authRoles)) - { - authorizeLineBuilder.Append($"(Roles = \"{authRoles}\""); - } - - if (!string.IsNullOrEmpty(authSchemes)) - { - authorizeLineBuilder.Append(string.IsNullOrEmpty(authRoles) - ? $"(AuthenticationSchemes = \"{authSchemes}\"" - : $", AuthenticationSchemes = \"{authSchemes}\""); - } - - if (!string.IsNullOrEmpty(authRoles) || !string.IsNullOrEmpty(authSchemes)) - { - authorizeLineBuilder.Append(')'); - } - - authorizeLineBuilder.Append(']'); - sb.AppendLine(authorizeLineBuilder.ToString()); - } - else if (ShouldUseAllowAnonymousAttribute(item)) - { - sb.AppendLine(4, "[AllowAnonymous]"); - } - } - - private static bool ShouldUseAuthorizeAttribute( - ContentGeneratorServerControllerMethodParameters item) - { - var apiPathUseAuthorization = item.ApiPathUseAuthorization.HasValue && - item.ApiPathUseAuthorization.Value; - - var apiPathAnyRolesOrAuthenticationSchemes = item.ApiPathAuthorizationRoles.Any() || - item.ApiPathAuthenticationSchemes.Any(); - - var apiOperationUseAuthorizationIsSet = item.ApiOperationUseAuthorization.HasValue; - var apiOperationUseAuthorization = item.ApiOperationUseAuthorization.HasValue && - item.ApiOperationUseAuthorization.Value; - - var apiOperationAnyRolesOrAuthenticationSchemes = item.ApiOperationAuthorizationRoles.Any() || - item.ApiOperationAuthenticationSchemes.Any(); - - var result = apiPathUseAuthorization || - apiOperationUseAuthorization || - apiPathAnyRolesOrAuthenticationSchemes || - apiOperationAnyRolesOrAuthenticationSchemes; - - if (result && - apiOperationUseAuthorizationIsSet && - !apiOperationUseAuthorization) - { - return false; - } - - return result; - } - - private static bool ShouldUseAllowAnonymousAttribute( - ContentGeneratorServerControllerMethodParameters item) - { - var apiPathUseAuthorizationIsSet = item.ApiPathUseAuthorization.HasValue; - var apiPathUseAuthorization = item.ApiPathUseAuthorization.HasValue && - item.ApiPathUseAuthorization.Value; - - var apiOperationUseAuthorizationIsSet = item.ApiOperationUseAuthorization.HasValue; - var apiOperationUseAuthorization = item.ApiOperationUseAuthorization.HasValue && - item.ApiOperationUseAuthorization.Value; - - return (apiPathUseAuthorizationIsSet && !apiPathUseAuthorization) || - (apiOperationUseAuthorizationIsSet && !apiOperationUseAuthorization); - } -} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/Server/ContentGeneratorServerParameter.cs b/src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/Server/ContentGeneratorServerParameter.cs deleted file mode 100644 index ac51c8e0..00000000 --- a/src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/Server/ContentGeneratorServerParameter.cs +++ /dev/null @@ -1,189 +0,0 @@ -// ReSharper disable StringLiteralTypo -// ReSharper disable SwitchStatementMissingSomeEnumCasesNoDefault -// ReSharper disable ConvertIfStatementToConditionalTernaryExpression -namespace Atc.Rest.ApiGenerator.Framework.Mvc.ContentGenerators.Server; - -public sealed class ContentGeneratorServerParameter : IContentGenerator -{ - private readonly GeneratedCodeHeaderGenerator codeHeaderGenerator; - private readonly GeneratedCodeAttributeGenerator codeAttributeGenerator; - private readonly CodeDocumentationTagsGenerator codeDocumentationTagsGenerator; - private readonly ContentGeneratorServerParameterParameters parameters; - - public ContentGeneratorServerParameter( - GeneratedCodeHeaderGenerator codeHeaderGenerator, - GeneratedCodeAttributeGenerator codeAttributeGenerator, - CodeDocumentationTagsGenerator codeDocumentationTagsGenerator, - ContentGeneratorServerParameterParameters parameters) - { - this.codeHeaderGenerator = codeHeaderGenerator; - this.codeAttributeGenerator = codeAttributeGenerator; - this.codeDocumentationTagsGenerator = codeDocumentationTagsGenerator; - this.parameters = parameters; - } - - public string Generate() - { - var sb = new StringBuilder(); - - sb.Append(codeHeaderGenerator.Generate()); - sb.AppendLine($"namespace {parameters.Namespace};"); - sb.AppendLine(); - if (codeDocumentationTagsGenerator.ShouldGenerateTags(parameters.DocumentationTags)) - { - sb.Append(codeDocumentationTagsGenerator.GenerateTags(0, parameters.DocumentationTags)); - } - - sb.AppendLine(codeAttributeGenerator.Generate()); - sb.AppendLine($"public class {parameters.ParameterName}"); - sb.AppendLine("{"); - - foreach (var parameter in parameters.PropertyParameters) - { - if (codeDocumentationTagsGenerator.ShouldGenerateTags(parameter.DocumentationTags)) - { - sb.Append(codeDocumentationTagsGenerator.GenerateTags(4, parameter.DocumentationTags)); - } - - AppendPropertyAttributes(sb, parameter); - AppendPropertyBody(sb, parameter); - - sb.AppendLine(); - } - - AppendMethodToStringContent(sb, parameters.PropertyParameters); - - sb.Append('}'); - - return sb.ToString(); - } - - private static void AppendPropertyAttributes( - StringBuilder sb, - ContentGeneratorServerParameterParametersProperty item) - { - switch (item.ParameterLocationType) - { - case ParameterLocationType.Query: - case ParameterLocationType.Header: - case ParameterLocationType.Route: - case ParameterLocationType.Cookie: - sb.AppendLine(4, $"[From{item.ParameterLocationType}(Name = \"{item.Name}\")]"); - break; - case ParameterLocationType.Body: - case ParameterLocationType.Form: - sb.AppendLine(4, $"[From{item.ParameterLocationType}]"); - break; - } - - if (item.IsRequired) - { - sb.AppendLine(4, "[Required]"); - } - - foreach (var additionalValidationAttribute in item.AdditionalValidationAttributes) - { - switch (additionalValidationAttribute) - { - case EmailAddressAttribute: - sb.AppendLine(4, "[EmailAddress]"); - break; - case RegularExpressionAttribute regularExpressionAttribute: - sb.AppendLine(4, $"[RegularExpression(\"{regularExpressionAttribute.Pattern}\")]"); - break; - case StringLengthAttribute stringLengthAttribute: - sb.AppendLine(4, $"[StringLength({stringLengthAttribute.MaximumLength})]"); - break; - case MinLengthAttribute minLengthAttribute: - sb.AppendLine(4, $"[MinLength({minLengthAttribute.Length})]"); - break; - case MaxLengthAttribute maxLengthAttribute: - sb.AppendLine(4, $"[MaxLength({maxLengthAttribute.Length})]"); - break; - case RangeAttribute rangeAttribute: - sb.AppendLine(4, $"[Range({rangeAttribute.Minimum}, {rangeAttribute.Maximum})]"); - break; - case UriAttribute: - sb.AppendLine(4, "[Uri]"); - break; - } - } - } - - private static void AppendPropertyBody( - StringBuilder sb, - ContentGeneratorServerParameterParametersProperty item) - { - sb.Append(4, "public "); - if (item.UseListForDataType) - { - sb.Append("List<"); - } - - sb.Append(item.DataType); - if (item.UseListForDataType) - { - sb.Append('>'); - } - - if (item.IsNullable) - { - sb.Append('?'); - } - - sb.Append(' '); - sb.Append(item.ParameterName); - - if (item.UseListForDataType) - { - sb.AppendLine($" {{ get; set; }} = new List<{item.DataType}>();"); - } - else - { - if (string.IsNullOrEmpty(item.DefaultValueInitializer)) - { - sb.AppendLine(" { get; set; }"); - } - else - { - sb.AppendLine($" {{ get; set; }} = {item.DefaultValueInitializer};"); - } - } - } - - private static void AppendMethodToStringContent( - StringBuilder sb, - IList items) - { - var sbToStringContent = new StringBuilder(); - for (var i = 0; i < items.Count; i++) - { - var parameter = items[i]; - var parameterName = parameter.ParameterName; - if (parameter.UseListForDataType) - { - sbToStringContent.Append($"{{nameof({parameterName})}}.Count: {{{parameterName}?.Count ?? 0}}"); - } - else - { - if (parameter.IsSimpleType) - { - sbToStringContent.Append($"{{nameof({parameterName})}}: {{{parameterName}}}"); - } - else - { - sbToStringContent.Append($"{{nameof({parameterName})}}: ({{{parameterName}}})"); - } - } - - if (i != items.Count - 1) - { - sbToStringContent.Append(", "); - } - } - - sb.AppendLine(4, "/// "); - sb.AppendLine(4, "public override string ToString()"); - sb.AppendLine(8, $"=> $\"{sbToStringContent}\";"); - } -} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/Server/ContentGeneratorServerProgram.cs b/src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/Server/ContentGeneratorServerProgram.cs deleted file mode 100644 index fd134e1d..00000000 --- a/src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/Server/ContentGeneratorServerProgram.cs +++ /dev/null @@ -1,43 +0,0 @@ -namespace Atc.Rest.ApiGenerator.Framework.Mvc.ContentGenerators.Server; - -public sealed class ContentGeneratorServerProgram : IContentGenerator -{ - private readonly ContentGeneratorBaseParameters parameters; - - public ContentGeneratorServerProgram( - ContentGeneratorBaseParameters parameters) - { - this.parameters = parameters; - } - - public string Generate() - { - var sb = new StringBuilder(); - - sb.AppendLine($"namespace {parameters.Namespace};"); - sb.AppendLine(); - sb.AppendLine("public static class Program"); - sb.AppendLine("{"); - sb.AppendLine(4, "public static void Main(string[] args)"); - sb.AppendLine(4, "{"); - sb.AppendLine(8, "CreateHostBuilder(args)"); - sb.AppendLine(12, ".Build()"); - sb.AppendLine(12, ".Run();"); - sb.AppendLine(4, "}"); - sb.AppendLine(); - sb.AppendLine(4, "public static IHostBuilder CreateHostBuilder(string[] args)"); - sb.AppendLine(4, "{"); - sb.AppendLine(8, "var builder = Host"); - sb.AppendLine(12, ".CreateDefaultBuilder(args)"); - sb.AppendLine(12, ".ConfigureWebHostDefaults(webBuilder =>"); - sb.AppendLine(12, "{"); - sb.AppendLine(16, "webBuilder.UseStartup();"); - sb.AppendLine(12, "});"); - sb.AppendLine(); - sb.AppendLine(8, "return builder;"); - sb.AppendLine(4, "}"); - sb.Append('}'); - - return sb.ToString(); - } -} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/Server/ContentGeneratorServerResult.cs b/src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/Server/ContentGeneratorServerResult.cs deleted file mode 100644 index e8180b06..00000000 --- a/src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/Server/ContentGeneratorServerResult.cs +++ /dev/null @@ -1,349 +0,0 @@ -// ReSharper disable SwitchStatementHandlesSomeKnownEnumValuesWithDefault -// ReSharper disable SwitchStatementMissingSomeEnumCasesNoDefault -// ReSharper disable ConvertIfStatementToReturnStatement -namespace Atc.Rest.ApiGenerator.Framework.Mvc.ContentGenerators.Server; - -public sealed class ContentGeneratorServerResult : IContentGenerator -{ - private readonly GeneratedCodeHeaderGenerator codeHeaderGenerator; - private readonly GeneratedCodeAttributeGenerator codeAttributeGenerator; - private readonly CodeDocumentationTagsGenerator codeDocumentationTagsGenerator; - private readonly ContentGeneratorServerResultParameters parameters; - - public ContentGeneratorServerResult( - GeneratedCodeHeaderGenerator codeHeaderGenerator, - GeneratedCodeAttributeGenerator codeAttributeGenerator, - CodeDocumentationTagsGenerator codeDocumentationTagsGenerator, - ContentGeneratorServerResultParameters parameters) - { - this.codeHeaderGenerator = codeHeaderGenerator; - this.codeAttributeGenerator = codeAttributeGenerator; - this.codeDocumentationTagsGenerator = codeDocumentationTagsGenerator; - this.parameters = parameters; - } - - public string Generate() - { - var sb = new StringBuilder(); - - sb.Append(codeHeaderGenerator.Generate()); - sb.AppendLine($"namespace {parameters.Namespace};"); - sb.AppendLine(); - if (codeDocumentationTagsGenerator.ShouldGenerateTags(parameters.DocumentationTags)) - { - sb.Append(codeDocumentationTagsGenerator.GenerateTags(0, parameters.DocumentationTags)); - } - - sb.AppendLine(codeAttributeGenerator.Generate()); - sb.AppendLine($"public class {parameters.ResultName} : {nameof(Results.ResultBase)}"); - sb.AppendLine("{"); - sb.AppendLine(4, $"private {parameters.ResultName}(ActionResult result) : base(result) {{ }}"); - sb.AppendLine(); - - for (var i = 0; i < parameters.MethodParameters.Count; i++) - { - var item = parameters.MethodParameters[i]; - - AppendMethodContent(sb, item, parameters.ResultName); - - if (i < parameters.MethodParameters.Count - 1) - { - sb.AppendLine(); - } - } - - if (parameters.ImplicitOperatorParameters is not null) - { - AppendImplicitOperatorContent(sb, parameters); - } - - sb.Append('}'); - - return sb.ToString(); - } - - private void AppendMethodContent( - StringBuilder sb, - ContentGeneratorServerResultMethodParameters item, - string resultName) - { - if (codeDocumentationTagsGenerator.ShouldGenerateTags(item.DocumentationTags)) - { - sb.Append(codeDocumentationTagsGenerator.GenerateTags(4, item.DocumentationTags)); - } - - if (item.HttpStatusCode == HttpStatusCode.OK) - { - AppendMethodContentStatusCodeOk(sb, item, resultName); - return; - } - - if (item.UsesProblemDetails) - { - AppendMethodContentWithProblemDetails(sb, item, resultName); - } - else - { - AppendMethodContentWithoutProblemDetails(sb, item, resultName); - } - } - - private static void AppendImplicitOperatorContent( - StringBuilder sb, - ContentGeneratorServerResultParameters item) - { - if (item.ImplicitOperatorParameters is null) - { - return; - } - - if (item.ImplicitOperatorParameters.SchemaType == SchemaType.SimpleType && - "object".Equals(item.ImplicitOperatorParameters.SimpleDataTypeName, StringComparison.Ordinal)) - { - return; - } - - sb.AppendLine(); - sb.AppendLine(4, "/// "); - sb.AppendLine(4, $"/// Performs an implicit conversion from {item.ResultName} to ActionResult."); - sb.AppendLine(4, "/// "); - - if (string.IsNullOrEmpty(item.ImplicitOperatorParameters.ModelName)) - { - switch (item.ImplicitOperatorParameters.SchemaType) - { - case SchemaType.None: - sb.AppendLine(4, $"public static implicit operator {item.ResultName}(string response)"); - break; - case SchemaType.SimpleType: - sb.AppendLine(4, $"public static implicit operator {item.ResultName}({item.ImplicitOperatorParameters.SimpleDataTypeName} response)"); - break; - case SchemaType.SimpleTypeList: - sb.AppendLine(4, $"public static implicit operator {item.ResultName}(List<{item.ImplicitOperatorParameters.SimpleDataTypeName}> response)"); - break; - case SchemaType.SimpleTypePagedList: - sb.AppendLine(4, $"public static implicit operator {item.ResultName}(Pagination<{item.ImplicitOperatorParameters.SimpleDataTypeName}> response)"); - break; - case SchemaType.SimpleTypeCustomPagedList: - sb.AppendLine(4, $"public static implicit operator {item.ResultName}({item.ImplicitOperatorParameters.GenericDataTypeName}<{item.ImplicitOperatorParameters.SimpleDataTypeName}> response)"); - break; - default: - sb.AppendLine("//// TODO: This is unexpected when we do not have a model-name!"); // TODO: Remove eventually - break; - } - } - else - { - switch (item.ImplicitOperatorParameters.SchemaType) - { - case SchemaType.ComplexType: - sb.AppendLine(4, $"public static implicit operator {item.ResultName}({item.ImplicitOperatorParameters.ModelName} response)"); - break; - case SchemaType.ComplexTypeList: - sb.AppendLine(4, $"public static implicit operator {item.ResultName}(List<{item.ImplicitOperatorParameters.ModelName}> response)"); - break; - case SchemaType.ComplexTypePagedList: - sb.AppendLine(4, $"public static implicit operator {item.ResultName}(Pagination<{item.ImplicitOperatorParameters.ModelName}> response)"); - break; - case SchemaType.ComplexTypeCustomPagedList: - sb.AppendLine(4, $"public static implicit operator {item.ResultName}({item.ImplicitOperatorParameters.GenericDataTypeName}<{item.ImplicitOperatorParameters.ModelName}> response)"); - break; - default: - sb.AppendLine("//// TODO: This is unexpected when we have a model-name!"); // TODO: Remove eventually - break; - } - } - - sb.AppendLine(8, "=> Ok(response);"); - } - - private static void AppendMethodContentStatusCodeOk( - StringBuilder sb, - ContentGeneratorServerResultMethodParameters item, - string resultName) - { - if (item.UsesBinaryResponse.HasValue && - item.UsesBinaryResponse.Value) - { - AppendMethodContentStatusCodeOkForBinary(sb, resultName); - } - else - { - if (string.IsNullOrEmpty(item.ModelName)) - { - switch (item.SchemaType) - { - case SchemaType.None: - sb.AppendLine(4, $"public static {resultName} Ok(string? message = null)"); - sb.AppendLine(8, $"=> new {resultName}(new OkObjectResult(message));"); - break; - case SchemaType.SimpleType: - sb.AppendLine(4, $"public static {resultName} Ok({item.SimpleDataTypeName} response)"); - sb.AppendLine(8, $"=> new {resultName}(new OkObjectResult(response));"); - break; - case SchemaType.SimpleTypeList: - sb.AppendLine(4, $"public static {resultName} Ok(IEnumerable<{item.SimpleDataTypeName}> response)"); - sb.AppendLine(8, $"=> new {resultName}(new OkObjectResult(response ?? Enumerable.Empty<{item.SimpleDataTypeName}>()));"); - break; - case SchemaType.SimpleTypePagedList: - sb.AppendLine(4, $"public static {resultName} Ok(Pagination<{item.SimpleDataTypeName}> response)"); - sb.AppendLine(8, $"=> new {resultName}(new OkObjectResult(response));"); - break; - case SchemaType.SimpleTypeCustomPagedList: - sb.AppendLine(4, $"public static {resultName} Ok({item.GenericDataTypeName}<{item.SimpleDataTypeName}> response)"); - sb.AppendLine(8, $"=> new {resultName}(new OkObjectResult(response));"); - break; - default: - sb.AppendLine("//// TODO: This is unexpected when we do not have a model-name!"); // TODO: Remove eventually - break; - } - } - else - { - switch (item.SchemaType) - { - case SchemaType.ComplexType: - sb.AppendLine(4, $"public static {resultName} Ok({item.ModelName} response)"); - sb.AppendLine(8, $"=> new {resultName}(new OkObjectResult(response));"); - break; - case SchemaType.ComplexTypeList: - sb.AppendLine(4, $"public static {resultName} Ok(IEnumerable<{item.ModelName}> response)"); - sb.AppendLine(8, $"=> new {resultName}(new OkObjectResult(response ?? Enumerable.Empty<{item.ModelName}>()));"); - break; - case SchemaType.ComplexTypePagedList: - sb.AppendLine(4, $"public static {resultName} Ok(Pagination<{item.ModelName}> response)"); - sb.AppendLine(8, $"=> new {resultName}(new OkObjectResult(response));"); - break; - case SchemaType.ComplexTypeCustomPagedList: - sb.AppendLine(4, $"public static {resultName} Ok({item.GenericDataTypeName}<{item.ModelName}> response)"); - sb.AppendLine(8, $"=> new {resultName}(new OkObjectResult(response));"); - break; - default: - sb.AppendLine("//// TODO: This is unexpected when we have a model-name!"); // TODO: Remove eventually - break; - } - } - } - } - - private static void AppendMethodContentStatusCodeOkForBinary( - StringBuilder sb, - string resultName) - { - sb.AppendLine(4, $"public static {resultName} Ok(byte[] bytes, string fileName)"); - sb.AppendLine(8, $"=> new {resultName}({nameof(Results.ResultFactory)}.{nameof(Results.ResultFactory.CreateFileContentResult)}(bytes, fileName));"); - } - - private static void AppendMethodContentWithProblemDetails( - StringBuilder sb, - ContentGeneratorServerResultMethodParameters item, - string resultName) - { - switch (item.HttpStatusCode) - { - case HttpStatusCode.Created: - sb.AppendLine(4, $"public static {resultName} Created()"); - sb.AppendLine(8, $"=> new {resultName}({nameof(Results.ResultFactory)}.{nameof(Results.ResultFactory.CreateContentResult)}(HttpStatusCode.Created, null));"); - break; - case HttpStatusCode.Accepted: - sb.AppendLine(4, $"public static {resultName} Accepted()"); - sb.AppendLine(8, $"=> new {resultName}({nameof(Results.ResultFactory)}.{nameof(Results.ResultFactory.CreateContentResultWithProblemDetails)}(HttpStatusCode.Accepted, null));"); - break; - case HttpStatusCode.NoContent: - sb.AppendLine(4, $"public static {resultName} NoContent()"); - sb.AppendLine(8, $"=> new {resultName}({nameof(Results.ResultFactory)}.{nameof(Results.ResultFactory.CreateContentResultWithProblemDetails)}(HttpStatusCode.NoContent, null));"); - break; - case HttpStatusCode.NotModified: - sb.AppendLine(4, $"public static {resultName} NotModified()"); - sb.AppendLine(8, $"=> new {resultName}(new StatusCodeResult(StatusCodes.Status304NotModified));"); - break; - case HttpStatusCode.BadRequest: - sb.AppendLine(4, $"public static {resultName} BadRequest(string message)"); - sb.AppendLine(8, $"=> new {resultName}({nameof(Results.ResultFactory)}.{nameof(Results.ResultFactory.CreateContentResultWithValidationProblemDetails)}(HttpStatusCode.BadRequest, message));"); - break; - case HttpStatusCode.Unauthorized: - sb.AppendLine(4, $"public static {resultName} Unauthorized()"); - sb.AppendLine(8, $"=> new {resultName}({nameof(Results.ResultFactory)}.{nameof(Results.ResultFactory.CreateContentResultWithProblemDetails)}(HttpStatusCode.Unauthorized, null));"); - break; - case HttpStatusCode.Forbidden: - sb.AppendLine(4, $"public static {resultName} Forbidden(string? message = null)"); - sb.AppendLine(8, $"=> new {resultName}({nameof(Results.ResultFactory)}.{nameof(Results.ResultFactory.CreateContentResultWithProblemDetails)}(HttpStatusCode.Forbidden, message));"); - break; - case HttpStatusCode.NotFound: - sb.AppendLine(4, $"public static {resultName} NotFound(string? message = null)"); - sb.AppendLine(8, $"=> new {resultName}({nameof(Results.ResultFactory)}.{nameof(Results.ResultFactory.CreateContentResultWithProblemDetails)}(HttpStatusCode.NotFound, message));"); - break; - case HttpStatusCode.Conflict: - sb.AppendLine(4, $"public static {resultName} Conflict(object? error = null)"); - sb.AppendLine(8, $"=> new {resultName}({nameof(Results.ResultFactory)}.{nameof(Results.ResultFactory.CreateContentResultWithProblemDetails)}(HttpStatusCode.Conflict, error));"); - break; - case HttpStatusCode.MethodNotAllowed: - case HttpStatusCode.InternalServerError: - case HttpStatusCode.NotImplemented: - case HttpStatusCode.BadGateway: - case HttpStatusCode.ServiceUnavailable: - case HttpStatusCode.GatewayTimeout: - sb.AppendLine(4, $"public static {resultName} {item.HttpStatusCode}(string? message = null)"); - sb.AppendLine(8, $"=> new {resultName}({nameof(Results.ResultFactory)}.{nameof(Results.ResultFactory.CreateContentResultWithProblemDetails)}(HttpStatusCode.{item.HttpStatusCode}, message));"); - break; - default: - sb.AppendLine($"// TODO: Not Implemented with WithProblemDetails for {item.HttpStatusCode}."); - break; - } - } - - private static void AppendMethodContentWithoutProblemDetails( - StringBuilder sb, - ContentGeneratorServerResultMethodParameters item, - string resultName) - { - switch (item.HttpStatusCode) - { - case HttpStatusCode.Created: - sb.AppendLine(4, $"public static {resultName} Created()"); - sb.AppendLine(8, $"=> new {resultName}(new StatusCodeResult(StatusCodes.Status201Created));"); - break; - case HttpStatusCode.Accepted: - sb.AppendLine(4, $"public static {resultName} Accepted()"); - sb.AppendLine(8, $"=> new {resultName}(new AcceptedResult());"); - break; - case HttpStatusCode.NoContent: - sb.AppendLine(4, $"public static {resultName} NoContent()"); - sb.AppendLine(8, $"=> new {resultName}(new NoContentResult());"); - break; - case HttpStatusCode.NotModified: - sb.AppendLine(4, $"public static {resultName} NotModified()"); - sb.AppendLine(8, $"=> new {resultName}(new StatusCodeResult(StatusCodes.Status304NotModified));"); - break; - case HttpStatusCode.BadRequest: - sb.AppendLine(4, $"public static {resultName} BadRequest(string message)"); - sb.AppendLine(8, $"=> new {resultName}(new BadRequestObjectResult(message));"); - break; - case HttpStatusCode.Unauthorized: - sb.AppendLine(4, $"public static {resultName} Unauthorized()"); - sb.AppendLine(8, $"=> new {resultName}(new UnauthorizedResult());"); - break; - case HttpStatusCode.NotFound: - sb.AppendLine(4, $"public static {resultName} NotFound(string? message = null)"); - sb.AppendLine(8, $"=> new {resultName}(new NotFoundObjectResult(message));"); - break; - case HttpStatusCode.Conflict: - sb.AppendLine(4, $"public static {resultName} Conflict(string? error = null)"); - sb.AppendLine(8, $"=> new {resultName}(new ConflictObjectResult(error));"); - break; - case HttpStatusCode.Forbidden: - case HttpStatusCode.MethodNotAllowed: - case HttpStatusCode.InternalServerError: - case HttpStatusCode.NotImplemented: - case HttpStatusCode.BadGateway: - case HttpStatusCode.ServiceUnavailable: - case HttpStatusCode.GatewayTimeout: - sb.AppendLine(4, $"public static {resultName} {item.HttpStatusCode}(string? message = null)"); - sb.AppendLine(8, $"=> new {resultName}(new ContentResult {{ StatusCode = (int)HttpStatusCode.{item.HttpStatusCode}, Content = message }} );"); - break; - default: - sb.AppendLine($"// TODO: Not Implemented with WithoutProblemDetails for {item.HttpStatusCode}."); - break; - } - } -} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Mvc/Factories/ContentGeneratorServerHandlerInterfaceParametersFactory.cs b/src/Atc.Rest.ApiGenerator.Framework.Mvc/Factories/ContentGeneratorServerHandlerInterfaceParametersFactory.cs new file mode 100644 index 00000000..5db774af --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Framework.Mvc/Factories/ContentGeneratorServerHandlerInterfaceParametersFactory.cs @@ -0,0 +1,77 @@ +namespace Atc.Rest.ApiGenerator.Framework.Mvc.Factories; + +public static class ContentGeneratorServerHandlerInterfaceParametersFactory +{ + public static InterfaceParameters Create( + string headerContent, + string @namespace, + AttributeParameters codeGeneratorAttribute, + OpenApiPathItem openApiPath, + OpenApiOperation openApiOperation) + { + var operationName = openApiOperation.GetOperationName(); + + var methodParametersAttributes = new Dictionary(StringComparer.Ordinal); + var methodParametersParameters = new List(); + if (openApiPath.HasParameters() || + openApiOperation.HasParametersOrRequestBody()) + { + methodParametersAttributes.Add("parameters", "The parameters."); + methodParametersParameters.Add( + new ParameterBaseParameters( + Attributes: null, + GenericTypeName: null, + IsGenericListType: false, + TypeName: $"{operationName}{ContentGeneratorConstants.Parameters}", + IsNullableType: false, + IsReferenceType: true, + Name: "parameters", + DefaultValue: null)); + } + + methodParametersAttributes.Add("cancellationToken", "The cancellation token."); + methodParametersParameters.Add( + new ParameterBaseParameters( + Attributes: null, + GenericTypeName: null, + IsGenericListType: false, + TypeName: "CancellationToken", + IsNullableType: false, + IsReferenceType: true, + Name: "cancellationToken", + DefaultValue: "default")); + + var methodParameters = new List + { + new( + DocumentationTags: new CodeDocumentationTags( + "Execute method", + parameters: methodParametersAttributes, + remark: null, + code: null, + example: null, + exceptions: null, + @return: null), + Attributes: null, + AccessModifier: AccessModifiers.None, + ReturnTypeName: $"{operationName}{ContentGeneratorConstants.Result}", + ReturnGenericTypeName: "Task", + Name: "ExecuteAsync", + Parameters: methodParametersParameters, + AlwaysBreakDownParameters: true, + UseExpressionBody: false, + Content: null), + }; + + return new InterfaceParameters( + headerContent, + @namespace, + DocumentationTags: openApiOperation.ExtractDocumentationTagsForHandlerInterface(), + new List { codeGeneratorAttribute }, + AccessModifiers.Public, + InterfaceTypeName: $"I{operationName}{ContentGeneratorConstants.Handler}", + InheritedInterfaceTypeName: null, + Properties: null, + Methods: methodParameters); + } +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Mvc/Factories/ContentGeneratorServerHandlerParametersFactory.cs b/src/Atc.Rest.ApiGenerator.Framework.Mvc/Factories/ContentGeneratorServerHandlerParametersFactory.cs new file mode 100644 index 00000000..4d54eb46 --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Framework.Mvc/Factories/ContentGeneratorServerHandlerParametersFactory.cs @@ -0,0 +1,87 @@ +namespace Atc.Rest.ApiGenerator.Framework.Mvc.Factories; + +public static class ContentGeneratorServerHandlerParametersFactory +{ + public static ClassParameters Create( + string @namespace, + OpenApiPathItem openApiPath, + OpenApiOperation openApiOperation) + { + var operationName = openApiOperation.GetOperationName(); + + var hasParameters = openApiPath.HasParameters() || + openApiOperation.HasParametersOrRequestBody(); + + var methodParametersParameters = new List(); + if (hasParameters) + { + methodParametersParameters.Add( + new ParameterBaseParameters( + Attributes: null, + GenericTypeName: null, + IsGenericListType: false, + TypeName: $"{operationName}{ContentGeneratorConstants.Parameters}", + IsNullableType: false, + IsReferenceType: true, + Name: "parameters", + DefaultValue: null)); + } + + methodParametersParameters.Add( + new ParameterBaseParameters( + Attributes: null, + GenericTypeName: null, + IsGenericListType: false, + TypeName: "CancellationToken", + IsNullableType: false, + IsReferenceType: true, + Name: "cancellationToken", + DefaultValue: "default")); + + var methodParameters = new List + { + new( + DocumentationTags: null, + Attributes: null, + AccessModifier: AccessModifiers.Public, + ReturnTypeName: $"{operationName}{ContentGeneratorConstants.Result}", + ReturnGenericTypeName: "Task", + Name: "ExecuteAsync", + Parameters: methodParametersParameters, + AlwaysBreakDownParameters: true, + UseExpressionBody: false, + Content: GenerateContentExecuteMethod(hasParameters, operationName)), + }; + + return new ClassParameters( + HeaderContent: null, + @namespace, + openApiOperation.ExtractDocumentationTagsForHandler(), + Attributes: null, + AccessModifiers.PublicClass, + ClassTypeName: $"{operationName}{ContentGeneratorConstants.Handler}", + GenericTypeName: null, + InheritedClassTypeName: $"I{operationName}{ContentGeneratorConstants.Handler}", + InheritedGenericClassTypeName: null, + InheritedInterfaceTypeName: null, + Constructors: null, + Properties: null, + Methods: methodParameters, + GenerateToStringMethod: false); + } + + private static string GenerateContentExecuteMethod( + bool hasParameters, + string operationName) + { + var sb = new StringBuilder(); + if (hasParameters) + { + sb.AppendLine("ArgumentNullException.ThrowIfNull(parameters);"); + sb.AppendLine(); + } + + sb.Append($"throw new NotImplementedException(\"Add logic here for {operationName}{ContentGeneratorConstants.Handler}\");"); + return sb.ToString(); + } +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Mvc/Factories/ContentGeneratorServerResultParametersFactory.cs b/src/Atc.Rest.ApiGenerator.Framework.Mvc/Factories/ContentGeneratorServerResultParametersFactory.cs new file mode 100644 index 00000000..454d79ee --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Framework.Mvc/Factories/ContentGeneratorServerResultParametersFactory.cs @@ -0,0 +1,100 @@ +// ReSharper disable ConvertIfStatementToReturnStatement +// ReSharper disable SwitchStatementMissingSomeEnumCasesNoDefault +// ReSharper disable InvertIf +namespace Atc.Rest.ApiGenerator.Framework.Mvc.Factories; + +public static class ContentGeneratorServerResultParametersFactory +{ + public static ContentGeneratorServerResultParameters Create( + string @namespace, + OpenApiOperation openApiOperation) + { + ArgumentNullException.ThrowIfNull(openApiOperation); + + var operationName = openApiOperation.GetOperationName(); + var httpStatusCodes = openApiOperation.Responses.GetHttpStatusCodes(); + + // TODO: ??? + string? modelNameForImplicitOperator = null; + + // Methods + var methodParameters = new List(); + var responseModels = openApiOperation.ExtractApiOperationResponseModels().ToList(); + + foreach (var responseModel in responseModels.OrderBy(x => x.StatusCode)) + { + var httpStatusCode = responseModel.StatusCode; + var documentationTags = new CodeDocumentationTags($"{(int)httpStatusCode} - {httpStatusCode.ToNormalizedString()} response."); + + methodParameters.Add( + new ContentGeneratorServerResultMethodParameters( + documentationTags, + responseModel)); + } + + ContentGeneratorServerResultImplicitOperatorParameters? implicitOperatorParameters = null; + + if (ShouldAppendImplicitOperatorContent(httpStatusCodes, modelNameForImplicitOperator, openApiOperation.Responses.IsSchemaUsingBinaryFormatForOkResponse())) + { + var responseModel = responseModels.FirstOrDefault(x => x.StatusCode == HttpStatusCode.OK) ?? + responseModels.FirstOrDefault(x => x.StatusCode == HttpStatusCode.Created); + + var collectionDataType = responseModel?.CollectionDataType; + var dataType = responseModel?.DataType; + + // Implicit Operator + implicitOperatorParameters = new ContentGeneratorServerResultImplicitOperatorParameters( + CollectionDataType: collectionDataType, + DataType: dataType); + } + + return new ContentGeneratorServerResultParameters( + @namespace, + operationName, + openApiOperation.ExtractDocumentationTagsForResult(), + $"{operationName}{ContentGeneratorConstants.Result}", + methodParameters, + implicitOperatorParameters); + } + + private static bool ShouldAppendImplicitOperatorContent( + ICollection httpStatusCodes, + string? modelName, + bool isSchemaUsingBinaryFormatForOkResponse) + { + if (!httpStatusCodes.Contains(HttpStatusCode.OK) && + !httpStatusCodes.Contains(HttpStatusCode.Created)) + { + return false; + } + + if (httpStatusCodes.Contains(HttpStatusCode.OK) && + httpStatusCodes.Contains(HttpStatusCode.Created)) + { + return false; + } + + var httpStatusCode = HttpStatusCode.Continue; // Dummy + if (httpStatusCodes.Contains(HttpStatusCode.OK)) + { + httpStatusCode = HttpStatusCode.OK; + } + else if (httpStatusCodes.Contains(HttpStatusCode.Created)) + { + httpStatusCode = HttpStatusCode.Created; + } + + if (string.IsNullOrEmpty(modelName) && + httpStatusCode == HttpStatusCode.Created) + { + return false; + } + + if (isSchemaUsingBinaryFormatForOkResponse) + { + return false; + } + + return true; + } +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Mvc/GlobalUsings.cs b/src/Atc.Rest.ApiGenerator.Framework.Mvc/GlobalUsings.cs index e4d7b9f9..5724b9a9 100644 --- a/src/Atc.Rest.ApiGenerator.Framework.Mvc/GlobalUsings.cs +++ b/src/Atc.Rest.ApiGenerator.Framework.Mvc/GlobalUsings.cs @@ -1,11 +1,29 @@ global using System.ComponentModel.DataAnnotations; global using System.Net; +global using System.Net.Mime; global using System.Text; global using Atc.CodeDocumentation.CodeComment; +global using Atc.CodeGeneration.CSharp.Content; +global using Atc.CodeGeneration.CSharp.Content.Factories; global using Atc.CodeGeneration.CSharp.Content.Generators; +global using Atc.CodeGeneration.CSharp.Extensions; +global using Atc.Rest.ApiGenerator.Contracts; +global using Atc.Rest.ApiGenerator.Contracts.ContentGeneratorsParameters; +global using Atc.Rest.ApiGenerator.Contracts.ContentGeneratorsParameters.Server; +global using Atc.Rest.ApiGenerator.Contracts.Extensions; +global using Atc.Rest.ApiGenerator.Contracts.Models; global using Atc.Rest.ApiGenerator.Framework.ContentGenerators; -global using Atc.Rest.ApiGenerator.Framework.Contracts; -global using Atc.Rest.ApiGenerator.Framework.Contracts.ContentGeneratorsParameters; -global using Atc.Rest.ApiGenerator.Framework.Contracts.ContentGeneratorsParameters.Client; -global using Atc.Rest.ApiGenerator.Framework.Contracts.ContentGeneratorsParameters.Server; \ No newline at end of file +global using Atc.Rest.ApiGenerator.Framework.ContentGeneratorsParameters.Server; +global using Atc.Rest.ApiGenerator.Framework.Factories.Parameters.Server; +global using Atc.Rest.ApiGenerator.Framework.Factories.Parameters.ServerClient; +global using Atc.Rest.ApiGenerator.Framework.Factories.Server; +global using Atc.Rest.ApiGenerator.Framework.Helpers; +global using Atc.Rest.ApiGenerator.Framework.Mvc.Factories; +global using Atc.Rest.ApiGenerator.Framework.ProjectGenerator; +global using Atc.Rest.ApiGenerator.Framework.Providers; +global using Atc.Rest.ApiGenerator.Framework.Writers; +global using Atc.Rest.ApiGenerator.OpenApi.Extensions; + +global using Microsoft.Extensions.Logging; +global using Microsoft.OpenApi.Models; \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Mvc/ProjectGenerator/ServerApiGenerator.cs b/src/Atc.Rest.ApiGenerator.Framework.Mvc/ProjectGenerator/ServerApiGenerator.cs new file mode 100644 index 00000000..963d86e4 --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Framework.Mvc/ProjectGenerator/ServerApiGenerator.cs @@ -0,0 +1,469 @@ +// ReSharper disable ArrangeObjectCreationWhenTypeNotEvident +namespace Atc.Rest.ApiGenerator.Framework.Mvc.ProjectGenerator; + +public class ServerApiGenerator : IServerApiGenerator +{ + private readonly ILogger logger; + private readonly INugetPackageReferenceProvider nugetPackageReferenceProvider; + private readonly Version apiGeneratorVersion; + private readonly string projectName; + private readonly DirectoryInfo projectPath; + private readonly OpenApiDocument openApiDocument; + private readonly IList operationSchemaMappings; + private readonly string routeBase; + private readonly string codeGeneratorContentHeader; + private readonly AttributeParameters codeGeneratorAttribute; + private readonly bool useProblemDetailsAsDefaultResponseBody; + private readonly bool includeDeprecated; + + public ServerApiGenerator( + ILoggerFactory loggerFactory, + INugetPackageReferenceProvider nugetPackageReferenceProvider, + Version apiGeneratorVersion, + string projectName, + DirectoryInfo projectPath, + OpenApiDocument openApiDocument, + IList operationSchemaMappings, + string routeBase, + bool useProblemDetailsAsDefaultResponseBody, + bool includeDeprecated) + { + ArgumentNullException.ThrowIfNull(loggerFactory); + ArgumentNullException.ThrowIfNull(nugetPackageReferenceProvider); + ArgumentNullException.ThrowIfNull(apiGeneratorVersion); + ArgumentNullException.ThrowIfNull(projectName); + ArgumentNullException.ThrowIfNull(projectPath); + ArgumentNullException.ThrowIfNull(openApiDocument); + ArgumentNullException.ThrowIfNull(operationSchemaMappings); + ArgumentNullException.ThrowIfNull(routeBase); + + logger = loggerFactory.CreateLogger(); + this.nugetPackageReferenceProvider = nugetPackageReferenceProvider; + this.apiGeneratorVersion = apiGeneratorVersion; + this.projectName = projectName; + this.projectPath = projectPath; + this.openApiDocument = openApiDocument; + this.operationSchemaMappings = operationSchemaMappings; + this.routeBase = routeBase; + this.useProblemDetailsAsDefaultResponseBody = useProblemDetailsAsDefaultResponseBody; + this.includeDeprecated = includeDeprecated; + + codeGeneratorContentHeader = GeneratedCodeHeaderGeneratorFactory + .Create(apiGeneratorVersion) + .Generate(); + codeGeneratorAttribute = AttributeParametersFactory + .CreateGeneratedCode(apiGeneratorVersion); + } + + public async Task ScaffoldProjectFile() + { + var packageReferences = await nugetPackageReferenceProvider.GetPackageReferencesForApiProjectForMvc(); + + var itemGroupPackageReferences = packageReferences + .Select(packageReference => new ItemGroupParameter( + "PackageReference", + [ + new("Include", packageReference.PackageId), + new("Version", packageReference.PackageVersion), + ], + Value: null)) + .ToList(); + + var projectFileParameters = new ProjectFileParameters( + "Microsoft.NET.Sdk", + [ + [ + new("TargetFramework", Attributes: null, "net8.0"), + new("IsPackable", Attributes: null, "false"), + ], + [ + new("GenerateDocumentationFile", Attributes: null, "true"), + ], + [ + new("DocumentationFile", Attributes: null, @$"bin\Debug\net8.0\{projectName}.xml"), + new("NoWarn", Attributes: null, "1573;1591;1701;1702;1712;8618;"), + ], + ], + [ + [ + new( + "None", + [ + new("Remove", @"Resources\ApiSpecification.yaml"), + ], + Value: null), + new( + "EmbeddedResource", + [ + new("Include", @"Resources\ApiSpecification.yaml"), + ], + Value: null), + ], + [ + new( + "FrameworkReference", + [ + new("Include", "Microsoft.AspNetCore.App"), + ], + Value: null), + ], + itemGroupPackageReferences, + ]); + + var contentGenerator = new GenerateContentForProjectFile( + projectFileParameters); + + var content = contentGenerator.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + projectPath, + projectPath.CombineFileInfo($"{projectName}.csproj"), + ContentWriterArea.Src, + content, + overrideIfExist: false); + } + + public void GenerateAssemblyMarker() + { + var classParameters = ClassParametersFactory.Create( + codeGeneratorContentHeader, + projectName, + codeGeneratorAttribute, + "ApiRegistration"); + + var contentGenerator = new GenerateContentForClass( + new CodeDocumentationTagsGenerator(), + classParameters); + + var content = contentGenerator.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + projectPath, + projectPath.CombineFileInfo("ApiRegistration.cs"), + ContentWriterArea.Src, + content); + } + + public void GenerateModels() + { + foreach (var apiGroupName in openApiDocument.GetApiGroupNames()) + { + var apiOperations = operationSchemaMappings + .Where(x => x.ApiGroupName.Equals(apiGroupName, StringComparison.OrdinalIgnoreCase)) + .ToList(); + + var apiOperationModels = GetDistinctApiOperationModels(apiOperations); + + foreach (var apiOperationModel in apiOperationModels) + { + var apiSchema = openApiDocument.Components.Schemas.First(x => x.GetFormattedKey().Equals(apiOperationModel.Name, StringComparison.OrdinalIgnoreCase)); + + var modelName = apiSchema.GetFormattedKey(); + + if (apiOperationModel.IsEnum) + { + GenerateEnumerationType(modelName, apiSchema.Value.GetEnumSchema().Item2); + } + else + { + GenerateModel(modelName, apiSchema.Value, apiGroupName, apiOperationModel.IsShared); + } + } + } + } + + public void GenerateParameters() + { + foreach (var openApiPath in openApiDocument.Paths) + { + var apiGroupName = openApiPath.GetApiGroupName(); + + var fullNamespace = $"{projectName}.{ContentGeneratorConstants.Contracts}.{apiGroupName}"; + + foreach (var openApiOperation in openApiPath.Value.Operations) + { + if (openApiOperation.Value.Deprecated && !includeDeprecated) + { + continue; + } + + if (!openApiPath.Value.HasParameters() && + !openApiOperation.Value.HasParametersOrRequestBody()) + { + continue; + } + + var parameterParameters = ContentGeneratorServerParameterParametersFactory.CreateForClass( + fullNamespace, + openApiOperation.Value, + openApiPath.Value.Parameters); + + var contentGenerator = new ContentGenerators.ContentGeneratorServerParameter( + new GeneratedCodeHeaderGenerator(new GeneratedCodeGeneratorParameters(apiGeneratorVersion)), + new GeneratedCodeAttributeGenerator(new GeneratedCodeGeneratorParameters(apiGeneratorVersion)), + new CodeDocumentationTagsGenerator(), + parameterParameters); + + var content = contentGenerator.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + projectPath, + projectPath.CombineFileInfo(ContentGeneratorConstants.Contracts, apiGroupName, ContentGeneratorConstants.Parameters, $"{parameterParameters.ParameterName}.cs"), + ContentWriterArea.Src, + content); + } + } + } + + public void GenerateResults() + { + foreach (var openApiPath in openApiDocument.Paths) + { + var apiGroupName = openApiPath.GetApiGroupName(); + + var fullNamespace = $"{projectName}.{ContentGeneratorConstants.Contracts}.{apiGroupName}"; + + foreach (var openApiOperation in openApiPath.Value.Operations) + { + if (openApiOperation.Value.Deprecated && !includeDeprecated) + { + continue; + } + + var resultParameters = ContentGeneratorServerResultParametersFactory.Create( + fullNamespace, + openApiOperation.Value); + + var contentGenerator = new ContentGenerators.ContentGeneratorServerResult( + new GeneratedCodeHeaderGenerator(new GeneratedCodeGeneratorParameters(apiGeneratorVersion)), + new GeneratedCodeAttributeGenerator(new GeneratedCodeGeneratorParameters(apiGeneratorVersion)), + new CodeDocumentationTagsGenerator(), + resultParameters, + useProblemDetailsAsDefaultResponseBody); + + var content = contentGenerator.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + projectPath, + projectPath.CombineFileInfo(ContentGeneratorConstants.Contracts, apiGroupName, ContentGeneratorConstants.Results, $"{resultParameters.ResultName}.cs"), + ContentWriterArea.Src, + content); + } + } + } + + public void GenerateInterfaces() + { + foreach (var openApiPath in openApiDocument.Paths) + { + var apiGroupName = openApiPath.GetApiGroupName(); + + var fullNamespace = $"{projectName}.{ContentGeneratorConstants.Contracts}.{apiGroupName}"; + + foreach (var openApiOperation in openApiPath.Value.Operations) + { + if (openApiOperation.Value.Deprecated && !includeDeprecated) + { + continue; + } + + var interfaceParameters = ContentGeneratorServerHandlerInterfaceParametersFactory.Create( + codeGeneratorContentHeader, + fullNamespace, + codeGeneratorAttribute, + openApiPath.Value, + openApiOperation.Value); + + var contentGeneratorInterface = new GenerateContentForInterface( + new CodeDocumentationTagsGenerator(), + interfaceParameters); + + var content = contentGeneratorInterface.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + projectPath, + projectPath.CombineFileInfo(ContentGeneratorConstants.Contracts, apiGroupName, ContentGeneratorConstants.Interfaces, $"{interfaceParameters.InterfaceTypeName}.cs"), + ContentWriterArea.Src, + content); + } + } + } + + public void GenerateEndpoints() + { + foreach (var apiGroupName in openApiDocument.GetApiGroupNames()) + { + var controllerParameters = ContentGeneratorServerEndpointParametersFactory.Create( + operationSchemaMappings, + projectName, + $"{projectName}.{ContentGeneratorConstants.Endpoints}", + apiGroupName, + GetRouteByApiGroupName(apiGroupName), + ContentGeneratorConstants.Controller, + openApiDocument); + + var contentGenerator = new ContentGenerators.ContentGeneratorServerController( + new GeneratedCodeHeaderGenerator(new GeneratedCodeGeneratorParameters(apiGeneratorVersion)), + new GeneratedCodeAttributeGenerator(new GeneratedCodeGeneratorParameters(apiGeneratorVersion)), + new CodeDocumentationTagsGenerator(), + controllerParameters, + useProblemDetailsAsDefaultResponseBody); + + var content = contentGenerator.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + projectPath, + projectPath.CombineFileInfo(ContentGeneratorConstants.Endpoints, $"{controllerParameters.EndpointName}.cs"), + ContentWriterArea.Src, + content); + } + } + + public void MaintainApiSpecification( + FileInfo apiSpecificationFile) + => ResourcesHelper.CopyApiSpecification( + apiSpecificationFile, + openApiDocument, + projectPath); + + public void MaintainGlobalUsings( + bool removeNamespaceGroupSeparatorInGlobalUsings) + { + var requiredUsings = new List + { + "System.CodeDom.Compiler", + "System.ComponentModel.DataAnnotations", + "Microsoft.AspNetCore.Http", + "Microsoft.AspNetCore.Mvc", + "Atc.Rest.Results", + }; + + // TODO: Check for any use ?? + requiredUsings.Add("System.Net"); + + if (openApiDocument.IsUsingRequiredForSystemTextJsonSerializationAndSystemRuntimeSerialization(includeDeprecated)) + { + requiredUsings.Add("System.Runtime.Serialization"); + requiredUsings.Add("System.Text.Json.Serialization"); + } + + // TODO: Check for any use ?? + requiredUsings.Add("Microsoft.AspNetCore.Authorization"); + + if (operationSchemaMappings.Any(apiOperation => apiOperation.Model.IsShared)) + { + requiredUsings.Add($"{projectName}.Contracts"); + } + + var apiGroupNames = openApiDocument.GetApiGroupNames(); + + requiredUsings.AddRange(apiGroupNames.Select(x => $"{projectName}.Contracts.{x}")); + + GlobalUsingsHelper.CreateOrUpdate( + logger, + ContentWriterArea.Src, + projectPath, + requiredUsings, + removeNamespaceGroupSeparatorInGlobalUsings); + } + + private string GetRouteByApiGroupName( + string apiGroupName) + { + var (key, _) = openApiDocument.Paths.FirstOrDefault(x => x.IsPathStartingSegmentName(apiGroupName)); + if (key is null) + { + throw new NotSupportedException($"{nameof(apiGroupName)} was not found in any route."); + } + + var routeSuffix = key + .Split('/', StringSplitOptions.RemoveEmptyEntries) + .FirstOrDefault(); + + return $"{routeBase}/{routeSuffix}"; + } + + private void GenerateEnumerationType( + string enumerationName, + OpenApiSchema openApiSchemaEnumeration) + { + var fullNamespace = $"{projectName}.{ContentGeneratorConstants.Contracts}"; + + var enumParameters = ContentGeneratorServerClientEnumParametersFactory.Create( + codeGeneratorContentHeader, + fullNamespace, + codeGeneratorAttribute, + enumerationName, + openApiSchemaEnumeration.Enum); + + var contentGenerator = new GenerateContentForEnum( + new CodeDocumentationTagsGenerator(), + enumParameters); + + var content = contentGenerator.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + projectPath, + projectPath.CombineFileInfo(ContentGeneratorConstants.Contracts, ContentGeneratorConstants.SpecialFolderEnumerationTypes, $"{enumerationName}.cs"), + ContentWriterArea.Src, + content); + } + + private void GenerateModel( + string modelName, + OpenApiSchema apiSchemaModel, + string apiGroupName, + bool isSharedContract) + { + var fullNamespace = isSharedContract + ? $"{projectName}.{ContentGeneratorConstants.Contracts}" + : $"{projectName}.{ContentGeneratorConstants.Contracts}.{apiGroupName}"; + + var parameters = ContentGeneratorServerClientModelParametersFactory.CreateForClass( + codeGeneratorContentHeader, + fullNamespace, + codeGeneratorAttribute, + modelName, + apiSchemaModel, + includeDeprecated); + + var contentGeneratorClass = new GenerateContentForClass( + new CodeDocumentationTagsGenerator(), + parameters); + + var content = contentGeneratorClass.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + projectPath, + isSharedContract + ? projectPath.CombineFileInfo(ContentGeneratorConstants.Contracts, ContentGeneratorConstants.SpecialFolderSharedModels, $"{modelName}.cs") + : projectPath.CombineFileInfo(ContentGeneratorConstants.Contracts, apiGroupName, ContentGeneratorConstants.Models, $"{modelName}.cs"), + ContentWriterArea.Src, + content); + } + + private static List GetDistinctApiOperationModels( + List apiOperations) + { + var result = new List(); + + foreach (var apiOperation in apiOperations) + { + var apiOperationModel = result.Find(x => x.Name.Equals(apiOperation.Model.Name, StringComparison.Ordinal)); + if (apiOperationModel is null) + { + result.Add(apiOperation.Model); + } + } + + return result; + } +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Mvc/ProjectGenerator/ServerDomainGenerator.cs b/src/Atc.Rest.ApiGenerator.Framework.Mvc/ProjectGenerator/ServerDomainGenerator.cs new file mode 100644 index 00000000..a0dd79de --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Framework.Mvc/ProjectGenerator/ServerDomainGenerator.cs @@ -0,0 +1,173 @@ +// ReSharper disable ArrangeObjectCreationWhenTypeNotEvident +namespace Atc.Rest.ApiGenerator.Framework.Mvc.ProjectGenerator; + +public class ServerDomainGenerator : IServerDomainGenerator +{ + private readonly ILogger logger; + private readonly string projectName; + private readonly string apiProjectName; + private readonly DirectoryInfo projectPath; + private readonly OpenApiDocument openApiDocument; + private readonly string codeGeneratorContentHeader; + private readonly AttributeParameters codeGeneratorAttribute; + + public ServerDomainGenerator( + ILoggerFactory loggerFactory, + Version apiGeneratorVersion, + string projectName, + string apiProjectName, + DirectoryInfo projectPath, + OpenApiDocument openApiDocument) + { + ArgumentNullException.ThrowIfNull(loggerFactory); + ArgumentNullException.ThrowIfNull(apiGeneratorVersion); + ArgumentNullException.ThrowIfNull(projectName); + ArgumentNullException.ThrowIfNull(apiProjectName); + ArgumentNullException.ThrowIfNull(projectPath); + ArgumentNullException.ThrowIfNull(openApiDocument); + + logger = loggerFactory.CreateLogger(); + this.projectName = projectName; + this.apiProjectName = apiProjectName; + this.projectPath = projectPath; + this.openApiDocument = openApiDocument; + + codeGeneratorContentHeader = GeneratedCodeHeaderGeneratorFactory + .Create(apiGeneratorVersion) + .Generate(); + codeGeneratorAttribute = AttributeParametersFactory + .CreateGeneratedCode(apiGeneratorVersion); + } + + public async Task ScaffoldProjectFile() + { + await Task.CompletedTask; + + var projectFileParameters = new ProjectFileParameters( + "Microsoft.NET.Sdk", + [ + [ + new("TargetFramework", Attributes: null, "net8.0"), + new("IsPackable", Attributes: null, "false"), + ], + [ + new("GenerateDocumentationFile", Attributes: null, "true"), + ], + [ + new("DocumentationFile", Attributes: null, @$"bin\Debug\net8.0\{projectName}.xml"), + new("NoWarn", Attributes: null, "1573;1591;1701;1702;1712;8618;"), + ], + ], + [ + [ + new( + "FrameworkReference", + [ + new("Include", "Microsoft.AspNetCore.App"), + ], + Value: null), + ], + [ + new( + "ProjectReference", + [ + new("Include", @$"..\{apiProjectName}\{apiProjectName}.csproj"), + ], + Value: null), + ], + ]); + + var contentGenerator = new GenerateContentForProjectFile( + projectFileParameters); + + var content = contentGenerator.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + projectPath, + projectPath.CombineFileInfo($"{projectName}.csproj"), + ContentWriterArea.Src, + content, + overrideIfExist: false); + } + + public void ScaffoldHandlers() + { + foreach (var urlPath in openApiDocument.Paths) + { + var apiGroupName = urlPath.GetApiGroupName(); + + foreach (var openApiOperation in urlPath.Value.Operations) + { + var fullNamespace = $"{projectName}.{ContentGeneratorConstants.Handlers}.{apiGroupName}"; + + var classParameters = ContentGeneratorServerHandlerParametersFactory.Create( + fullNamespace, + urlPath.Value, + openApiOperation.Value); + + var contentGenerator = new GenerateContentForClass( + new CodeDocumentationTagsGenerator(), + classParameters); + + var content = contentGenerator.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + projectPath, + projectPath.CombineFileInfo( + ContentGeneratorConstants.Handlers, + apiGroupName, + $"{classParameters.TypeName}.cs"), + ContentWriterArea.Src, + content, + overrideIfExist: false); + } + } + } + + public void GenerateAssemblyMarker() + { + var classParameters = ClassParametersFactory.Create( + codeGeneratorContentHeader, + projectName, + codeGeneratorAttribute, + "DomainRegistration"); + + var contentGenerator = new GenerateContentForClass( + new CodeDocumentationTagsGenerator(), + classParameters); + + var content = contentGenerator.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + projectPath, + projectPath.CombineFileInfo("DomainRegistration.cs"), + ContentWriterArea.Src, + content); + } + + public void GenerateServiceCollectionExtensions() + => throw new NotSupportedException($"{nameof(GenerateServiceCollectionExtensions)} is not supported for MVC"); + + public void MaintainGlobalUsings( + bool removeNamespaceGroupSeparatorInGlobalUsings) + { + var requiredUsings = new List + { + "System.CodeDom.Compiler", + }; + + var apiGroupNames = openApiDocument.GetApiGroupNames(); + + requiredUsings.AddRange(apiGroupNames.Select(x => $"{apiProjectName}.{ContentGeneratorConstants.Contracts}.{x}")); + + GlobalUsingsHelper.CreateOrUpdate( + logger, + ContentWriterArea.Src, + projectPath, + requiredUsings, + removeNamespaceGroupSeparatorInGlobalUsings); + } +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Mvc/ProjectGenerator/ServerGenerator.cs b/src/Atc.Rest.ApiGenerator.Framework.Mvc/ProjectGenerator/ServerGenerator.cs new file mode 100644 index 00000000..dcee4337 --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Framework.Mvc/ProjectGenerator/ServerGenerator.cs @@ -0,0 +1,65 @@ +namespace Atc.Rest.ApiGenerator.Framework.Mvc.ProjectGenerator; + +public class ServerGenerator : IServerGenerator +{ + private readonly ILogger logger; + private readonly string projectName; + private readonly DirectoryInfo rootPath; + private readonly DirectoryInfo srcPath; + private readonly DirectoryInfo? testPath; + + public ServerGenerator( + ILoggerFactory loggerFactory, + string projectName, + DirectoryInfo rootPath, + DirectoryInfo srcPath, + DirectoryInfo? testPath) + { + ArgumentNullException.ThrowIfNull(loggerFactory); + ArgumentNullException.ThrowIfNull(projectName); + ArgumentNullException.ThrowIfNull(rootPath); + ArgumentNullException.ThrowIfNull(srcPath); + ArgumentNullException.ThrowIfNull(testPath); + + logger = loggerFactory.CreateLogger(); + this.projectName = projectName; + this.rootPath = rootPath; + this.srcPath = srcPath; + this.testPath = testPath; + } + + public void ScaffoldSolutionFile() + { + var content = GenerateContentForSolutionFileHelper.Generate( + projectName, + rootPath, + srcPath, + testPath); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + rootPath, + rootPath.CombineFileInfo($"{projectName}.sln"), + ContentWriterArea.Src, + content, + overrideIfExist: false); + } + + public void ScaffoldSolutionDotSettingsFile() + { + var parameters = new SolutionDotSettingsFileParameters(); + + var contentGenerator = new GenerateContentForSolutionDotSettingsFile( + parameters); + + var content = contentGenerator.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + rootPath, + rootPath.CombineFileInfo($"{projectName}.sln.DotSettings"), + ContentWriterArea.Src, + content, + overrideIfExist: false); + } +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Mvc/ProjectGenerator/ServerHostGenerator.cs b/src/Atc.Rest.ApiGenerator.Framework.Mvc/ProjectGenerator/ServerHostGenerator.cs new file mode 100644 index 00000000..558106a2 --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Framework.Mvc/ProjectGenerator/ServerHostGenerator.cs @@ -0,0 +1,233 @@ +// ReSharper disable ArrangeObjectCreationWhenTypeNotEvident +namespace Atc.Rest.ApiGenerator.Framework.Mvc.ProjectGenerator; + +public class ServerHostGenerator : IServerHostGenerator +{ + private readonly ILogger logger; + private readonly INugetPackageReferenceProvider nugetPackageReferenceProvider; + private readonly Version apiGeneratorVersion; + private readonly string projectName; + private readonly string apiProjectName; + private readonly string domainProjectName; + private readonly DirectoryInfo projectPath; + private readonly OpenApiDocument openApiDocument; + + public ServerHostGenerator( + ILoggerFactory loggerFactory, + INugetPackageReferenceProvider nugetPackageReferenceProvider, + Version apiGeneratorVersion, + string projectName, + string apiProjectName, + string domainProjectName, + DirectoryInfo projectPath, + OpenApiDocument openApiDocument) + { + ArgumentNullException.ThrowIfNull(loggerFactory); + ArgumentNullException.ThrowIfNull(nugetPackageReferenceProvider); + ArgumentNullException.ThrowIfNull(apiGeneratorVersion); + ArgumentNullException.ThrowIfNull(projectName); + ArgumentNullException.ThrowIfNull(apiProjectName); + ArgumentNullException.ThrowIfNull(domainProjectName); + ArgumentNullException.ThrowIfNull(projectPath); + ArgumentNullException.ThrowIfNull(openApiDocument); + + logger = loggerFactory.CreateLogger(); + this.nugetPackageReferenceProvider = nugetPackageReferenceProvider; + this.apiGeneratorVersion = apiGeneratorVersion; + this.projectName = projectName; + this.apiProjectName = apiProjectName; + this.domainProjectName = domainProjectName; + this.projectPath = projectPath; + this.openApiDocument = openApiDocument; + } + + public bool UseRestExtended { get; set; } + + public async Task ScaffoldProjectFile() + { + var packageReferences = await nugetPackageReferenceProvider.GetPackageReferencesForHostProjectForMvc(UseRestExtended); + + var itemGroupPackageReferences = packageReferences + .Select(packageReference => new ItemGroupParameter( + "PackageReference", + [ + new("Include", packageReference.PackageId), + new("Version", packageReference.PackageVersion), + ], + Value: null)) + .ToList(); + + var projectFileParameters = new ProjectFileParameters( + "Microsoft.NET.Sdk.Web", + [ + [ + new("TargetFramework", Attributes: null, "net8.0"), + new("IsPackable", Attributes: null, "false"), + ], + [ + new("GenerateDocumentationFile", Attributes: null, "true"), + ], + [ + new("DocumentationFile", Attributes: null, @$"bin\Debug\net8.0\{projectName}.xml"), + new("NoWarn", Attributes: null, "1573;1591;1701;1702;1712;8618;"), + ], + ], + [ + itemGroupPackageReferences, + [ + new( + "ProjectReference", + [ + new("Include", @$"..\{apiProjectName}\{apiProjectName}.csproj"), + ], + Value: null), + new( + "ProjectReference", + [ + new("Include", @$"..\{domainProjectName}\{domainProjectName}.csproj"), + ], + Value: null), + ], + + ]); + + var contentGenerator = new GenerateContentForProjectFile( + projectFileParameters); + + var content = contentGenerator.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + projectPath, + projectPath.CombineFileInfo($"{projectName}.csproj"), + ContentWriterArea.Src, + content, + overrideIfExist: false); + } + + public void ScaffoldPropertiesLaunchSettingsFile() + => ResourcesHelper.ScaffoldPropertiesLaunchSettingsFile( + projectName, + projectPath, + useExtended: true); + + public void ScaffoldJsonSerializerOptionsExtensions() + => throw new NotSupportedException($"{nameof(ScaffoldJsonSerializerOptionsExtensions)} is not supported for MVC"); + + public void ScaffoldServiceCollectionExtensions() + => throw new NotSupportedException($"{nameof(ScaffoldServiceCollectionExtensions)} is not supported for MVC"); + + public void ScaffoldWebApplicationBuilderExtensions() + => throw new NotSupportedException($"{nameof(ScaffoldWebApplicationBuilderExtensions)} is not supported for MVC"); + + public void ScaffoldWebApplicationExtensions( + SwaggerThemeMode swaggerThemeMode) + => throw new NotSupportedException($"{nameof(ScaffoldWebApplicationExtensions)} is not supported for MVC"); + + public void ScaffoldConfigureSwaggerOptions() + => throw new NotSupportedException($"{nameof(ScaffoldConfigureSwaggerOptions)} is not supported for MVC"); + + public void ScaffoldProgramFile( + SwaggerThemeMode swaggerThemeMode) + { + var contentGenerator = new ContentGenerators.ContentGeneratorServerProgram( + new ContentGeneratorBaseParameters(Namespace: projectName)); + + var content = contentGenerator.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + projectPath, + projectPath.CombineFileInfo("Program.cs"), + ContentWriterArea.Src, + content, + overrideIfExist: false); + } + + public void ScaffoldStartupFile() + { + var contentGenerator = new ContentGenerators.ContentGeneratorServerStartup( + new ContentGeneratorBaseParameters(Namespace: projectName)); + + var content = contentGenerator.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + projectPath, + projectPath.CombineFileInfo("Startup.cs"), + ContentWriterArea.Src, + content, + overrideIfExist: false); + } + + public void ScaffoldWebConfig() + { + var contentGenerator = new Framework.ContentGenerators.Server.ContentGeneratorServerWebConfig(); + + var content = contentGenerator.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + projectPath, + projectPath.CombineFileInfo("web.config"), + ContentWriterArea.Src, + content, + overrideIfExist: false); + } + + public void GenerateConfigureSwaggerDocOptions() + { + var fullNamespace = $"{projectName}"; + + var contentGeneratorServerSwaggerDocOptionsParameters = ContentGeneratorServerSwaggerDocOptionsParameterFactory + .Create( + fullNamespace, + openApiDocument.ToSwaggerDocOptionsParameters()); + + var contentGenerator = new Framework.ContentGenerators.Server.ContentGeneratorServerSwaggerDocOptions( + new GeneratedCodeHeaderGenerator(new GeneratedCodeGeneratorParameters(apiGeneratorVersion)), + new GeneratedCodeAttributeGenerator(new GeneratedCodeGeneratorParameters(apiGeneratorVersion)), + contentGeneratorServerSwaggerDocOptionsParameters); + + var content = contentGenerator.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + projectPath, + projectPath.CombineFileInfo("Options", "ConfigureSwaggerDocOptions.cs"), + ContentWriterArea.Src, + content); + } + + public void MaintainGlobalUsings( + bool removeNamespaceGroupSeparatorInGlobalUsings) + { + var requiredUsings = new List + { + "System.CodeDom.Compiler", + "System.Reflection", + domainProjectName, + $"{projectName}.Generated", + $"{projectName}.Options", + }; + + if (UseRestExtended) + { + requiredUsings.Add("Asp.Versioning.ApiExplorer"); + requiredUsings.Add("Atc.Rest.Extended.Options"); + requiredUsings.Add("Microsoft.Extensions.Options"); + requiredUsings.Add("Microsoft.OpenApi.Models"); + requiredUsings.Add("Swashbuckle.AspNetCore.SwaggerGen"); + } + + GlobalUsingsHelper.CreateOrUpdate( + logger, + ContentWriterArea.Src, + projectPath, + requiredUsings, + removeNamespaceGroupSeparatorInGlobalUsings); + } + + public void MaintainWwwResources() + => ResourcesHelper.MaintainWwwResources(projectPath); +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework.Mvc/ProjectGenerator/ServerHostTestGenerator.cs b/src/Atc.Rest.ApiGenerator.Framework.Mvc/ProjectGenerator/ServerHostTestGenerator.cs new file mode 100644 index 00000000..42277e71 --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Framework.Mvc/ProjectGenerator/ServerHostTestGenerator.cs @@ -0,0 +1,312 @@ +// ReSharper disable ArrangeObjectCreationWhenTypeNotEvident +// ReSharper disable StringLiteralTypo +namespace Atc.Rest.ApiGenerator.Framework.Mvc.ProjectGenerator; + +public class ServerHostTestGenerator : IServerHostTestGenerator +{ + private readonly ILogger logger; + private readonly INugetPackageReferenceProvider nugetPackageReferenceProvider; + private readonly Version apiGeneratorVersion; + private readonly string projectName; + private readonly string hostProjectName; + private readonly string apiProjectName; + private readonly string domainProjectName; + private readonly DirectoryInfo projectPath; + private readonly OpenApiDocument openApiDocument; + private readonly IList operationSchemaMappings; + private readonly string codeGeneratorContentHeader; + private readonly AttributeParameters codeGeneratorAttribute; + private readonly bool includeDeprecated; + + public ServerHostTestGenerator( + ILoggerFactory loggerFactory, + INugetPackageReferenceProvider nugetPackageReferenceProvider, + Version apiGeneratorVersion, + string projectName, + string hostProjectName, + string apiProjectName, + string domainProjectName, + DirectoryInfo projectPath, + OpenApiDocument openApiDocument, + IList operationSchemaMappings, + bool includeDeprecated) + { + ArgumentNullException.ThrowIfNull(loggerFactory); + ArgumentNullException.ThrowIfNull(nugetPackageReferenceProvider); + ArgumentNullException.ThrowIfNull(apiGeneratorVersion); + ArgumentNullException.ThrowIfNull(projectName); + ArgumentNullException.ThrowIfNull(hostProjectName); + ArgumentNullException.ThrowIfNull(apiProjectName); + ArgumentNullException.ThrowIfNull(domainProjectName); + ArgumentNullException.ThrowIfNull(projectPath); + ArgumentNullException.ThrowIfNull(openApiDocument); + ArgumentNullException.ThrowIfNull(operationSchemaMappings); + + logger = loggerFactory.CreateLogger(); + this.nugetPackageReferenceProvider = nugetPackageReferenceProvider; + this.apiGeneratorVersion = apiGeneratorVersion; + this.projectName = projectName; + this.hostProjectName = hostProjectName; + this.apiProjectName = apiProjectName; + this.domainProjectName = domainProjectName; + this.projectPath = projectPath; + this.openApiDocument = openApiDocument; + this.operationSchemaMappings = operationSchemaMappings; + this.includeDeprecated = includeDeprecated; + + codeGeneratorContentHeader = GeneratedCodeHeaderGeneratorFactory + .Create(apiGeneratorVersion) + .Generate(); + codeGeneratorAttribute = AttributeParametersFactory + .CreateGeneratedCode(apiGeneratorVersion); + } + + public async Task ScaffoldProjectFile() + { + var packageReferences = await nugetPackageReferenceProvider.GetPackageReferencesForTestHostProjectForMvc(); + + var itemGroupPackageReferences = packageReferences + .Select(packageReference => new ItemGroupParameter( + "PackageReference", + [ + new("Include", packageReference.PackageId), + new("Version", packageReference.PackageVersion), + ], + Value: null)) + .ToList(); + + var projectFileParameters = new ProjectFileParameters( + "Microsoft.NET.Sdk", + [ + [ + new("TargetFramework", Attributes: null, "net8.0"), + ], + [ + new("DocumentationFile", Attributes: null, @$"bin\Debug\net8.0\{projectName}.xml"), + new("NoWarn", Attributes: null, "1573;1591;1701;1702;1712;8618;"), + ], + ], + [ + itemGroupPackageReferences, + [ + new( + "ProjectReference", + [ + new("Include", @$"..\..\src\{hostProjectName}\{hostProjectName}.csproj"), + ], + Value: null), + new( + "ProjectReference", + [ + new("Include", @$"..\..\src\{apiProjectName}\{apiProjectName}.csproj"), + ], + Value: null), + new( + "ProjectReference", + [ + new("Include", @$"..\..\src\{domainProjectName}\{domainProjectName}.csproj"), + ], + Value: null), + ], + + ]); + + var contentGenerator = new GenerateContentForProjectFile( + projectFileParameters); + + var content = contentGenerator.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + projectPath, + projectPath.CombineFileInfo($"{projectName}.csproj"), + ContentWriterArea.Src, + content, + overrideIfExist: false); + } + + public void ScaffoldAppSettingsIntegrationTestFile() + { + var contentGenerator = new ContentGenerators.ContentGeneratorServerAppSettingsIntegrationTest(); + + var content = contentGenerator.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + projectPath, + projectPath.CombineFileInfo("appsettings.integrationtest.json"), + ContentWriterArea.Test, + content, + overrideIfExist: false); + } + + public void GenerateWebApiStartupFactoryFile() + { + var contentGeneratorServerWebApiStartupFactoryParameters = ContentGeneratorServerWebApiStartupFactoryParametersFactory.Create( + projectName); + + var contentGenerator = new ContentGenerators.ContentGeneratorServerWebApiStartupFactory( + new GeneratedCodeHeaderGenerator(new GeneratedCodeGeneratorParameters(apiGeneratorVersion)), + new GeneratedCodeAttributeGenerator(new GeneratedCodeGeneratorParameters(apiGeneratorVersion)), + new CodeDocumentationTagsGenerator(), + contentGeneratorServerWebApiStartupFactoryParameters); + + var content = contentGenerator.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + projectPath, + projectPath.CombineFileInfo("WebApiStartupFactory.cs"), + ContentWriterArea.Test, + content, + overrideIfExist: false); + } + + public void GenerateWebApiControllerBaseTestFile() + { + var contentGenerator = new ContentGenerators.ContentGeneratorServerWebApiControllerBaseTest( + new GeneratedCodeHeaderGenerator(new GeneratedCodeGeneratorParameters(apiGeneratorVersion)), + new GeneratedCodeAttributeGenerator(new GeneratedCodeGeneratorParameters(apiGeneratorVersion)), + new ContentGeneratorBaseParameters(projectName)); + + var content = contentGenerator.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + projectPath, + projectPath.CombineFileInfo("WebApiControllerBaseTest.cs"), + ContentWriterArea.Test, + content, + overrideIfExist: false); + } + + public void GenerateEndpointHandlerStubs() + { + foreach (var openApiPath in openApiDocument.Paths) + { + var apiGroupName = openApiPath.GetApiGroupName(); + + foreach (var openApiOperation in openApiPath.Value.Operations) + { + if (openApiOperation.Value.Deprecated && !includeDeprecated) + { + continue; + } + + var fullNamespace = $"{projectName}.{ContentGeneratorConstants.Endpoints}.{apiGroupName}"; + + var classParameters = ContentGeneratorServerTestEndpointHandlerStubParametersFactory.Create( + codeGeneratorContentHeader, + fullNamespace, + codeGeneratorAttribute, + openApiPath.Value, + openApiOperation.Value); + + var contentGenerator = new GenerateContentForClass( + new CodeDocumentationTagsGenerator(), + classParameters); + + var content = contentGenerator.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + projectPath, + projectPath.CombineFileInfo(ContentGeneratorConstants.Endpoints, apiGroupName, $"{classParameters.TypeName}.cs"), + ContentWriterArea.Test, + content); + } + } + } + + public void GenerateEndpointTests() + { + foreach (var openApiPath in openApiDocument.Paths) + { + var apiGroupName = openApiPath.GetApiGroupName(); + + foreach (var openApiOperation in openApiPath.Value.Operations) + { + if (openApiOperation.Value.Deprecated && !includeDeprecated) + { + continue; + } + + var fullNamespace = $"{projectName}.{ContentGeneratorConstants.Endpoints}.{apiGroupName}"; + + var classParameters = ContentGeneratorServerTestEndpointTestsParametersFactory.Create( + fullNamespace, + openApiOperation.Value); + + var contentGenerator = new GenerateContentForClass( + new CodeDocumentationTagsGenerator(), + classParameters); + + var content = contentGenerator.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + projectPath, + projectPath.CombineFileInfo(ContentGeneratorConstants.Endpoints, apiGroupName, $"{classParameters.TypeName}.cs"), + ContentWriterArea.Test, + content); + } + } + } + + public void MaintainGlobalUsings( + bool usingCodingRules, + bool removeNamespaceGroupSeparatorInGlobalUsings) + { + var requiredUsings = new List + { + "System.CodeDom.Compiler", + "System.Text", + "System.Text.Json", + "System.Text.Json.Serialization", + "System.Reflection", + "Atc.XUnit", + "Atc.Rest.Options", + "AutoFixture", + "Microsoft.AspNetCore.Hosting", + "Microsoft.AspNetCore.Http", + "Microsoft.AspNetCore.TestHost", + "Microsoft.AspNetCore.Mvc.Testing", + "Microsoft.Extensions.Configuration", + "Microsoft.Extensions.DependencyInjection", + "Xunit", + apiProjectName, + }; + + if (openApiDocument.IsUsingRequiredForAtcRestResults()) + { + requiredUsings.Add("Atc.Rest.Results"); + } + + if (operationSchemaMappings.Any(apiOperation => apiOperation.Model.IsShared)) + { + requiredUsings.Add($"{apiProjectName}.Contracts"); + } + + requiredUsings.Add("AutoFixture"); + requiredUsings.Add("Xunit"); + + var apiGroupNames = openApiDocument.GetApiGroupNames(); + + foreach (var apiGroupName in apiGroupNames) + { + if (apiGroupName.Equals("Tasks", StringComparison.OrdinalIgnoreCase)) + { + continue; + } + + requiredUsings.Add($"{apiProjectName}.Contracts.{apiGroupName}"); + } + + GlobalUsingsHelper.CreateOrUpdate( + logger, + ContentWriterArea.Test, + projectPath, + requiredUsings, + removeNamespaceGroupSeparatorInGlobalUsings); + } +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework/Atc.Rest.ApiGenerator.Framework.csproj b/src/Atc.Rest.ApiGenerator.Framework/Atc.Rest.ApiGenerator.Framework.csproj index 33cc0b1d..0597910c 100644 --- a/src/Atc.Rest.ApiGenerator.Framework/Atc.Rest.ApiGenerator.Framework.csproj +++ b/src/Atc.Rest.ApiGenerator.Framework/Atc.Rest.ApiGenerator.Framework.csproj @@ -1,19 +1,41 @@ - net6.0 + net8.0 false - - - + + + + + + + + + + + + + + + + + + + + + + + + - + + diff --git a/src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/Server/ContentGeneratorServerSwaggerDocOptions.cs b/src/Atc.Rest.ApiGenerator.Framework/ContentGenerators/Server/ContentGeneratorServerSwaggerDocOptions.cs similarity index 90% rename from src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/Server/ContentGeneratorServerSwaggerDocOptions.cs rename to src/Atc.Rest.ApiGenerator.Framework/ContentGenerators/Server/ContentGeneratorServerSwaggerDocOptions.cs index a428395c..9b28f085 100644 --- a/src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/Server/ContentGeneratorServerSwaggerDocOptions.cs +++ b/src/Atc.Rest.ApiGenerator.Framework/ContentGenerators/Server/ContentGeneratorServerSwaggerDocOptions.cs @@ -1,4 +1,4 @@ -namespace Atc.Rest.ApiGenerator.Framework.Mvc.ContentGenerators.Server; +namespace Atc.Rest.ApiGenerator.Framework.ContentGenerators.Server; public sealed class ContentGeneratorServerSwaggerDocOptions : IContentGenerator { @@ -21,7 +21,7 @@ public string Generate() var sb = new StringBuilder(); sb.Append(codeHeaderGenerator.Generate()); - sb.AppendLine($"namespace {parameters.Namespace};"); + sb.AppendLine($"namespace {parameters.Namespace}.Options;"); // TODO: Move to constant sb.AppendLine(); sb.AppendLine(codeAttributeGenerator.Generate()); sb.AppendLine("public class ConfigureSwaggerDocOptions : IConfigureOptions"); @@ -54,7 +54,11 @@ public string Generate() if (!string.IsNullOrWhiteSpace(parameters.SwaggerDocOptions.Description)) { - sb.AppendLine(20, $"Description = @\"{parameters.SwaggerDocOptions.Description}\","); + sb.AppendLine( + 20, + parameters.SwaggerDocOptions.Description.Contains('\n', StringComparison.Ordinal) + ? $"Description = @\"{parameters.SwaggerDocOptions.Description}\"," + : $"Description = \"{parameters.SwaggerDocOptions.Description}\","); } if (!string.IsNullOrWhiteSpace(parameters.SwaggerDocOptions.ContactName) || diff --git a/src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/Server/ContentGeneratorServerWebConfig.cs b/src/Atc.Rest.ApiGenerator.Framework/ContentGenerators/Server/ContentGeneratorServerWebConfig.cs similarity index 90% rename from src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/Server/ContentGeneratorServerWebConfig.cs rename to src/Atc.Rest.ApiGenerator.Framework/ContentGenerators/Server/ContentGeneratorServerWebConfig.cs index 9521761b..d5e3acb1 100644 --- a/src/Atc.Rest.ApiGenerator.Framework.Mvc/ContentGenerators/Server/ContentGeneratorServerWebConfig.cs +++ b/src/Atc.Rest.ApiGenerator.Framework/ContentGenerators/Server/ContentGeneratorServerWebConfig.cs @@ -1,4 +1,4 @@ -namespace Atc.Rest.ApiGenerator.Framework.Mvc.ContentGenerators.Server; +namespace Atc.Rest.ApiGenerator.Framework.ContentGenerators.Server; public sealed class ContentGeneratorServerWebConfig : IContentGenerator { diff --git a/src/Atc.Rest.ApiGenerator.Framework/ContentGeneratorsParameters/Server/ContentGeneratorServerEndpointMethodParameters.cs b/src/Atc.Rest.ApiGenerator.Framework/ContentGeneratorsParameters/Server/ContentGeneratorServerEndpointMethodParameters.cs new file mode 100644 index 00000000..9c9e9811 --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Framework/ContentGeneratorsParameters/Server/ContentGeneratorServerEndpointMethodParameters.cs @@ -0,0 +1,14 @@ +namespace Atc.Rest.ApiGenerator.Framework.ContentGeneratorsParameters.Server; + +public record ContentGeneratorServerEndpointMethodParameters( + string OperationTypeRepresentation, + string Name, + CodeDocumentationTags DocumentationTags, + string? Description, + string? RouteSuffix, + string InterfaceName, + string? ParameterTypeName, + long? MultipartBodyLengthLimit, + string ResultName, + ApiAuthorizeModel? Authorization, + IEnumerable ResponseModels); \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework/ContentGeneratorsParameters/Server/ContentGeneratorServerEndpointParameters.cs b/src/Atc.Rest.ApiGenerator.Framework/ContentGeneratorsParameters/Server/ContentGeneratorServerEndpointParameters.cs new file mode 100644 index 00000000..10045568 --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Framework/ContentGeneratorsParameters/Server/ContentGeneratorServerEndpointParameters.cs @@ -0,0 +1,10 @@ +namespace Atc.Rest.ApiGenerator.Framework.ContentGeneratorsParameters.Server; + +public record ContentGeneratorServerEndpointParameters( + string Namespace, + string ApiGroupName, + string RouteBase, + CodeDocumentationTags DocumentationTags, + string EndpointName, + ApiAuthorizeModel? Authorization, + IList MethodParameters); \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework/Factories/Parameters/Client/ContentGeneratorClientEndpointInterfaceParametersFactory.cs b/src/Atc.Rest.ApiGenerator.Framework/Factories/Parameters/Client/ContentGeneratorClientEndpointInterfaceParametersFactory.cs index 729914ea..a960d2c5 100644 --- a/src/Atc.Rest.ApiGenerator.Framework/Factories/Parameters/Client/ContentGeneratorClientEndpointInterfaceParametersFactory.cs +++ b/src/Atc.Rest.ApiGenerator.Framework/Factories/Parameters/Client/ContentGeneratorClientEndpointInterfaceParametersFactory.cs @@ -25,6 +25,7 @@ public static InterfaceParameters Create( GenericTypeName: null, IsGenericListType: false, TypeName: $"{operationName}{ContentGeneratorConstants.Parameters}", + IsNullableType: false, IsReferenceType: true, Name: "parameters", DefaultValue: null)); @@ -37,6 +38,7 @@ public static InterfaceParameters Create( GenericTypeName: null, IsGenericListType: false, TypeName: "string", + IsNullableType: false, IsReferenceType: false, Name: "httpClientName", DefaultValue: httpClientName)); @@ -48,6 +50,7 @@ public static InterfaceParameters Create( GenericTypeName: null, IsGenericListType: false, TypeName: "CancellationToken", + IsNullableType: false, IsReferenceType: true, Name: "cancellationToken", DefaultValue: "default")); @@ -65,7 +68,7 @@ public static InterfaceParameters Create( @return: null), Attributes: null, AccessModifier: AccessModifiers.None, - ReturnTypeName: $"I{operationName}{ContentGeneratorConstants.EndpointResult}", + ReturnTypeName: $"{operationName}{ContentGeneratorConstants.EndpointResult}", ReturnGenericTypeName: "Task", Name: "ExecuteAsync", Parameters: methodParametersParameters, diff --git a/src/Atc.Rest.ApiGenerator.Framework/Factories/Parameters/Client/ContentGeneratorClientEndpointParametersFactory.cs b/src/Atc.Rest.ApiGenerator.Framework/Factories/Parameters/Client/ContentGeneratorClientEndpointParametersFactory.cs index 0cbd6cfb..e244a86d 100644 --- a/src/Atc.Rest.ApiGenerator.Framework/Factories/Parameters/Client/ContentGeneratorClientEndpointParametersFactory.cs +++ b/src/Atc.Rest.ApiGenerator.Framework/Factories/Parameters/Client/ContentGeneratorClientEndpointParametersFactory.cs @@ -3,7 +3,6 @@ namespace Atc.Rest.ApiGenerator.Framework.Factories.Parameters.Client; public static class ContentGeneratorClientEndpointParametersFactory { public static ContentGeneratorClientEndpointParameters Create( - bool useProblemDetailsAsDefaultResponseBody, string projectName, string apiGroupName, string @namespace, @@ -23,32 +22,8 @@ public static ContentGeneratorClientEndpointParameters Create( AppendParametersFromBody(parameters, openApiOperation.RequestBody); var operationName = openApiOperation.GetOperationName(); - var successResponseStatusCodes = openApiOperation.Responses - .GetHttpStatusCodes() - .Where(x => x.IsSuccessful()) - .ToList(); - - OpenApiSchema? modelSchema = null; - string? successResponseName = null; - HttpStatusCode? successResponseStatusCode = null; - - if (successResponseStatusCodes.Count == 1) - { - successResponseStatusCode = successResponseStatusCodes[0]; - - if (successResponseStatusCode is not HttpStatusCode.Accepted or HttpStatusCode.NoContent) - { - modelSchema = openApiOperation.Responses.GetSchemaForStatusCode(successResponseStatusCode.Value); - successResponseName = GetSuccessResponseName(projectName, apiGroupName, modelSchema); - } - } - - var useListForDataType = modelSchema?.IsTypeArray() ?? false; - - var errorResponses = GetErrorResponses( - useProblemDetailsAsDefaultResponseBody, - openApiOperation, - parameters.Any()); + var endpointAuthorization = openApiOperation.ExtractApiOperationAuthorization(openApiPath); + var responseModels = openApiOperation.ExtractApiOperationResponseModels().ToList(); if (openApiPath.HasParameters() || openApiOperation.HasParametersOrRequestBody()) @@ -57,17 +32,15 @@ public static ContentGeneratorClientEndpointParameters Create( Namespace: @namespace, HttpMethod: httpMethod.ToString(), OperationName: operationName, - DocumentationTagsForClass: openApiOperation.ExtractDocumentationTagsForEndpoint(), + DocumentationTags: openApiOperation.ExtractDocumentationTagsForEndpoint(), HttpClientName: httpClientName, UrlPath: urlPath, EndpointName: $"{operationName}{ContentGeneratorConstants.Endpoint}", InterfaceName: $"I{operationName}{ContentGeneratorConstants.Endpoint}", ResultName: $"{operationName}{ContentGeneratorConstants.EndpointResult}", ParameterName: $"{operationName}{ContentGeneratorConstants.Parameters}", - SuccessResponseName: successResponseName, - SuccessResponseStatusCode: successResponseStatusCode, - UseListForModel: useListForDataType, - ErrorResponses: errorResponses, + Authorization: endpointAuthorization, + ResponseModels: responseModels, parameters); } @@ -75,17 +48,15 @@ public static ContentGeneratorClientEndpointParameters Create( Namespace: @namespace, HttpMethod: httpMethod.ToString(), OperationName: operationName, - DocumentationTagsForClass: openApiOperation.ExtractDocumentationTagsForEndpoint(), + DocumentationTags: openApiOperation.ExtractDocumentationTagsForEndpoint(), HttpClientName: httpClientName, UrlPath: urlPath, EndpointName: $"{operationName}{ContentGeneratorConstants.Endpoint}", InterfaceName: $"I{operationName}{ContentGeneratorConstants.Endpoint}", ResultName: $"{operationName}{ContentGeneratorConstants.EndpointResult}", ParameterName: null, - SuccessResponseName: successResponseName, - SuccessResponseStatusCode: successResponseStatusCode, - UseListForModel: useListForDataType, - ErrorResponses: errorResponses, + Authorization: endpointAuthorization, + ResponseModels: responseModels, Parameters: null); } @@ -135,119 +106,4 @@ private static ParameterLocationType ConvertToParameterLocationType( null => ParameterLocationType.None, _ => throw new SwitchCaseDefaultException(openApiParameterLocation), }; - - private static string GetSuccessResponseName( - string projectName, - string apiGroupName, - OpenApiSchema? modelSchema) - { - var modelName = "string"; - if (modelSchema is null) - { - return modelName; - } - - var tmpModelName = modelSchema.GetModelName(); - if (string.IsNullOrEmpty(tmpModelName)) - { - if (!modelSchema.IsTypeCustomPagination()) - { - return modelSchema.GetDataType(); - } - - tmpModelName = modelSchema.GetCustomPaginationGenericTypeWithItemType(projectName, apiGroupName, isClient: true); - return string.IsNullOrEmpty(tmpModelName) - ? modelName - : tmpModelName; - } - - modelName = OpenApiDocumentSchemaModelNameResolver.EnsureModelNameWithNamespaceIfNeeded( - projectName, - apiGroupName, - tmpModelName, - isShared: false, - isClient: true); - - return modelName; - } - - private static List GetErrorResponses( - bool useProblemDetailsAsDefaultResponseBody, - OpenApiOperation openApiOperation, - bool hasParameters) - { - var httpStatusCodes = openApiOperation.Responses - .GetHttpStatusCodes() - .Where(x => x.IsClientOrServerError() || x.IsRedirect()) - .ToList(); - - if (hasParameters && - !httpStatusCodes.Contains(HttpStatusCode.BadRequest)) - { - httpStatusCodes.Add(HttpStatusCode.BadRequest); - } - - if (!httpStatusCodes.Contains(HttpStatusCode.Unauthorized)) - { - httpStatusCodes.Add(HttpStatusCode.Unauthorized); - } - - if (!httpStatusCodes.Contains(HttpStatusCode.Forbidden)) - { - httpStatusCodes.Add(HttpStatusCode.Forbidden); - } - - if (!httpStatusCodes.Contains(HttpStatusCode.InternalServerError)) - { - httpStatusCodes.Add(HttpStatusCode.InternalServerError); - } - - var errorResponses = new List(); - foreach (var httpStatusCode in httpStatusCodes.OrderBy(x => x)) - { - if (httpStatusCode == HttpStatusCode.BadRequest) - { - errorResponses.Add( - new ContentGeneratorClientEndpointErrorResponsesParameters( - "ValidationProblemDetails", - httpStatusCode)); - } - else if (httpStatusCode == HttpStatusCode.NotModified) - { - errorResponses.Add( - new ContentGeneratorClientEndpointErrorResponsesParameters( - string.Empty, - httpStatusCode)); - } - else - { - if (useProblemDetailsAsDefaultResponseBody) - { - errorResponses.Add( - new ContentGeneratorClientEndpointErrorResponsesParameters( - "ProblemDetails", - httpStatusCode)); - } - else - { - if (httpStatusCode == HttpStatusCode.InternalServerError) - { - errorResponses.Add( - new ContentGeneratorClientEndpointErrorResponsesParameters( - "string", - httpStatusCode)); - } - else - { - errorResponses.Add( - new ContentGeneratorClientEndpointErrorResponsesParameters( - string.Empty, - httpStatusCode)); - } - } - } - } - - return errorResponses; - } } \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework/Factories/Parameters/Client/ContentGeneratorClientEndpointResultInterfaceParametersFactory.cs b/src/Atc.Rest.ApiGenerator.Framework/Factories/Parameters/Client/ContentGeneratorClientEndpointResultInterfaceParametersFactory.cs index 93fa2d0f..d0b578c4 100644 --- a/src/Atc.Rest.ApiGenerator.Framework/Factories/Parameters/Client/ContentGeneratorClientEndpointResultInterfaceParametersFactory.cs +++ b/src/Atc.Rest.ApiGenerator.Framework/Factories/Parameters/Client/ContentGeneratorClientEndpointResultInterfaceParametersFactory.cs @@ -3,7 +3,6 @@ namespace Atc.Rest.ApiGenerator.Framework.Factories.Parameters.Client; public static class ContentGeneratorClientEndpointResultInterfaceParametersFactory { public static ContentGeneratorClientEndpointResultInterfaceParameters Create( - bool useProblemDetailsAsDefaultResponseBody, string projectName, string apiGroupName, string @namespace, @@ -20,25 +19,19 @@ public static ContentGeneratorClientEndpointResultInterfaceParameters Create( AppendParametersFromBody(parameters, openApiOperation.RequestBody); var operationName = openApiOperation.GetOperationName(); - var modelSchema = openApiOperation.Responses.GetSchemaForStatusCode(HttpStatusCode.OK); - var successResponseName = GetSuccessResponseName(projectName, apiGroupName, modelSchema); - var useListForDataType = modelSchema?.IsTypeArray() ?? false; - - var errorResponses = GetErrorResponses( - useProblemDetailsAsDefaultResponseBody, - openApiOperation, - parameters.Any()); + var endpointAuthorization = openApiOperation.ExtractApiOperationAuthorization(openApiPath); + var responseModels = openApiOperation.ExtractApiOperationResponseModels().ToList(); + var hasParameterType = openApiPath.HasParameters() || openApiOperation.HasParametersOrRequestBody(); return new ContentGeneratorClientEndpointResultInterfaceParameters( Namespace: @namespace, OperationName: operationName, - DocumentationTagsForClass: openApiOperation.ExtractDocumentationTagsForEndpointResultInterface(), + DocumentationTags: openApiOperation.ExtractDocumentationTagsForEndpointResultInterface(), InterfaceName: $"I{operationName}{ContentGeneratorConstants.EndpointResult}", InheritInterfaceName: "IEndpointResponse", - SuccessResponseName: successResponseName, - UseProblemDetailsAsDefaultBody: useProblemDetailsAsDefaultResponseBody, - UseListForModel: useListForDataType, - ErrorResponses: errorResponses); + HasParameterType: hasParameterType, + Authorization: endpointAuthorization, + ResponseModels: responseModels); } private static void AppendParameters( @@ -85,116 +78,4 @@ private static ParameterLocationType ConvertToParameterLocationType( null => ParameterLocationType.None, _ => throw new SwitchCaseDefaultException(openApiParameterLocation), }; - - private static string GetSuccessResponseName( - string projectName, - string apiGroupName, - OpenApiSchema? modelSchema) - { - var modelName = "string"; - if (modelSchema is null) - { - return modelName; - } - - var tmpModelName = modelSchema.GetModelName(); - if (string.IsNullOrEmpty(tmpModelName)) - { - if (!modelSchema.IsTypeCustomPagination()) - { - return modelSchema.GetDataType(); - } - - tmpModelName = modelSchema.GetCustomPaginationGenericTypeWithItemType(projectName, apiGroupName, isClient: true); - return string.IsNullOrEmpty(tmpModelName) - ? modelName - : tmpModelName; - } - - modelName = OpenApiDocumentSchemaModelNameResolver.EnsureModelNameWithNamespaceIfNeeded( - projectName, - apiGroupName, - tmpModelName, - isShared: false, - isClient: true); - - return modelName; - } - - private static List GetErrorResponses( - bool useProblemDetailsAsDefaultResponseBody, - OpenApiOperation openApiOperation, - bool hasParameters) - { - var httpStatusCodes = openApiOperation.Responses - .GetHttpStatusCodes() - .Where(x => x.IsClientOrServerError() || x.IsRedirect()) - .ToList(); - - if (hasParameters && - !httpStatusCodes.Contains(HttpStatusCode.BadRequest)) - { - httpStatusCodes.Add(HttpStatusCode.BadRequest); - } - - if (!httpStatusCodes.Contains(HttpStatusCode.Unauthorized)) - { - httpStatusCodes.Add(HttpStatusCode.Unauthorized); - } - - if (!httpStatusCodes.Contains(HttpStatusCode.Forbidden)) - { - httpStatusCodes.Add(HttpStatusCode.Forbidden); - } - - if (!httpStatusCodes.Contains(HttpStatusCode.InternalServerError)) - { - httpStatusCodes.Add(HttpStatusCode.InternalServerError); - } - - var errorResponses = new List(); - foreach (var httpStatusCode in httpStatusCodes.OrderBy(x => x)) - { - if (httpStatusCode == HttpStatusCode.BadRequest) - { - errorResponses.Add( - new ContentGeneratorClientEndpointResultInterfaceErrorResponsesParameters( - "ValidationProblemDetails", - httpStatusCode)); - } - else - { - if (useProblemDetailsAsDefaultResponseBody) - { - errorResponses.Add( - new ContentGeneratorClientEndpointResultInterfaceErrorResponsesParameters( - "ProblemDetails", - httpStatusCode)); - } - else - { - if (httpStatusCode == HttpStatusCode.Accepted || - httpStatusCode == HttpStatusCode.NoContent || - httpStatusCode == HttpStatusCode.NotModified || - httpStatusCode == HttpStatusCode.Unauthorized || - httpStatusCode == HttpStatusCode.Forbidden) - { - errorResponses.Add( - new ContentGeneratorClientEndpointResultInterfaceErrorResponsesParameters( - string.Empty, - httpStatusCode)); - } - else - { - errorResponses.Add( - new ContentGeneratorClientEndpointResultInterfaceErrorResponsesParameters( - "string", - httpStatusCode)); - } - } - } - } - - return errorResponses; - } } \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework/Factories/Parameters/Client/ContentGeneratorClientEndpointResultParametersFactory.cs b/src/Atc.Rest.ApiGenerator.Framework/Factories/Parameters/Client/ContentGeneratorClientEndpointResultParametersFactory.cs index c6cbe9b2..b5b1c391 100644 --- a/src/Atc.Rest.ApiGenerator.Framework/Factories/Parameters/Client/ContentGeneratorClientEndpointResultParametersFactory.cs +++ b/src/Atc.Rest.ApiGenerator.Framework/Factories/Parameters/Client/ContentGeneratorClientEndpointResultParametersFactory.cs @@ -3,11 +3,9 @@ namespace Atc.Rest.ApiGenerator.Framework.Factories.Parameters.Client; public static class ContentGeneratorClientEndpointResultParametersFactory { public static ContentGeneratorClientEndpointResultParameters Create( - bool useProblemDetailsAsDefaultResponseBody, string projectName, string apiGroupName, string @namespace, - bool useProblemDetailsAsDefaultBody, OpenApiPathItem openApiPath, OpenApiOperation openApiOperation) { @@ -21,43 +19,35 @@ public static ContentGeneratorClientEndpointResultParameters Create( AppendParametersFromBody(parameters, openApiOperation.RequestBody); var operationName = openApiOperation.GetOperationName(); - var modelSchema = openApiOperation.Responses.GetSchemaForStatusCode(HttpStatusCode.OK); - var successResponseName = GetSuccessResponseName(projectName, apiGroupName, modelSchema); - var useListForDataType = modelSchema?.IsTypeArray() ?? false; + var endpointAuthorization = openApiOperation.ExtractApiOperationAuthorization(openApiPath); + var responseModels = openApiOperation.ExtractApiOperationResponseModels().ToList(); + var hasParameterType = openApiPath.HasParameters() || openApiOperation.HasParametersOrRequestBody(); - var errorResponses = GetErrorResponses( - useProblemDetailsAsDefaultResponseBody, - openApiOperation, - parameters.Any()); - - if (openApiPath.HasParameters() || - openApiOperation.HasParametersOrRequestBody()) + if (hasParameterType) { return new ContentGeneratorClientEndpointResultParameters( Namespace: @namespace, OperationName: operationName, - DocumentationTagsForClass: openApiOperation.ExtractDocumentationTagsForEndpointResult(), + DocumentationTags: openApiOperation.ExtractDocumentationTagsForEndpointResult(), EndpointResultName: $"{operationName}{ContentGeneratorConstants.EndpointResult}", EndpointResultInterfaceName: $"I{operationName}{ContentGeneratorConstants.EndpointResult}", InheritClassName: ContentGeneratorConstants.EndpointResponse, - SuccessResponseName: successResponseName, - UseProblemDetailsAsDefaultBody: useProblemDetailsAsDefaultBody, - UseListForModel: useListForDataType, - ErrorResponses: errorResponses, + HasParameterType: hasParameterType, + Authorization: endpointAuthorization, + ResponseModels: responseModels, parameters); } return new ContentGeneratorClientEndpointResultParameters( Namespace: @namespace, OperationName: operationName, - DocumentationTagsForClass: openApiOperation.ExtractDocumentationTagsForEndpointResult(), + DocumentationTags: openApiOperation.ExtractDocumentationTagsForEndpointResult(), EndpointResultName: $"{operationName}{ContentGeneratorConstants.EndpointResult}", EndpointResultInterfaceName: $"I{operationName}{ContentGeneratorConstants.EndpointResult}", InheritClassName: ContentGeneratorConstants.EndpointResponse, - SuccessResponseName: successResponseName, - UseProblemDetailsAsDefaultBody: useProblemDetailsAsDefaultBody, - UseListForModel: useListForDataType, - ErrorResponses: errorResponses, + HasParameterType: hasParameterType, + Authorization: endpointAuthorization, + ResponseModels: responseModels, Parameters: null); } @@ -105,116 +95,4 @@ private static ParameterLocationType ConvertToParameterLocationType( null => ParameterLocationType.None, _ => throw new SwitchCaseDefaultException(openApiParameterLocation), }; - - private static string GetSuccessResponseName( - string projectName, - string apiGroupName, - OpenApiSchema? modelSchema) - { - var modelName = "string"; - if (modelSchema is null) - { - return modelName; - } - - var tmpModelName = modelSchema.GetModelName(); - if (string.IsNullOrEmpty(tmpModelName)) - { - if (!modelSchema.IsTypeCustomPagination()) - { - return modelSchema.GetDataType(); - } - - tmpModelName = modelSchema.GetCustomPaginationGenericTypeWithItemType(projectName, apiGroupName, isClient: true); - return string.IsNullOrEmpty(tmpModelName) - ? modelName - : tmpModelName; - } - - modelName = OpenApiDocumentSchemaModelNameResolver.EnsureModelNameWithNamespaceIfNeeded( - projectName, - apiGroupName, - tmpModelName, - isShared: false, - isClient: true); - - return modelName; - } - - private static List GetErrorResponses( - bool useProblemDetailsAsDefaultResponseBody, - OpenApiOperation openApiOperation, - bool hasParameters) - { - var httpStatusCodes = openApiOperation.Responses - .GetHttpStatusCodes() - .Where(x => x.IsClientOrServerError() || x.IsRedirect()) - .ToList(); - - if (hasParameters && - !httpStatusCodes.Contains(HttpStatusCode.BadRequest)) - { - httpStatusCodes.Add(HttpStatusCode.BadRequest); - } - - if (!httpStatusCodes.Contains(HttpStatusCode.Unauthorized)) - { - httpStatusCodes.Add(HttpStatusCode.Unauthorized); - } - - if (!httpStatusCodes.Contains(HttpStatusCode.Forbidden)) - { - httpStatusCodes.Add(HttpStatusCode.Forbidden); - } - - if (!httpStatusCodes.Contains(HttpStatusCode.InternalServerError)) - { - httpStatusCodes.Add(HttpStatusCode.InternalServerError); - } - - var errorResponses = new List(); - foreach (var httpStatusCode in httpStatusCodes.OrderBy(x => x)) - { - if (httpStatusCode == HttpStatusCode.BadRequest) - { - errorResponses.Add( - new ContentGeneratorClientEndpointResultErrorResponsesParameters( - "ValidationProblemDetails", - httpStatusCode)); - } - else - { - if (useProblemDetailsAsDefaultResponseBody) - { - errorResponses.Add( - new ContentGeneratorClientEndpointResultErrorResponsesParameters( - "ProblemDetails", - httpStatusCode)); - } - else - { - if (httpStatusCode == HttpStatusCode.Accepted || - httpStatusCode == HttpStatusCode.NoContent || - httpStatusCode == HttpStatusCode.NotModified || - httpStatusCode == HttpStatusCode.Unauthorized || - httpStatusCode == HttpStatusCode.Forbidden) - { - errorResponses.Add( - new ContentGeneratorClientEndpointResultErrorResponsesParameters( - string.Empty, - httpStatusCode)); - } - else - { - errorResponses.Add( - new ContentGeneratorClientEndpointResultErrorResponsesParameters( - "string", - httpStatusCode)); - } - } - } - } - - return errorResponses; - } } \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework/Factories/Parameters/Server/ContentGeneratorServerControllerParametersFactory.cs b/src/Atc.Rest.ApiGenerator.Framework/Factories/Parameters/Server/ContentGeneratorServerControllerParametersFactory.cs deleted file mode 100644 index 77b9cbba..00000000 --- a/src/Atc.Rest.ApiGenerator.Framework/Factories/Parameters/Server/ContentGeneratorServerControllerParametersFactory.cs +++ /dev/null @@ -1,145 +0,0 @@ -// ReSharper disable LoopCanBeConvertedToQuery -// ReSharper disable ReplaceWithSingleAssignment.True -namespace Atc.Rest.ApiGenerator.Framework.Factories.Parameters.Server; - -public static class ContentGeneratorServerControllerParametersFactory -{ - public static ContentGeneratorServerControllerParameters Create( - IList operationSchemaMappings, - string projectName, - bool useProblemDetailsAsDefaultBody, - string @namespace, - string apiGroupName, - string route, - OpenApiDocument openApiDocument) - { - var methodParameters = new List(); - - foreach (var (apiPath, apiPathData) in openApiDocument.GetPathsByBasePathSegmentName(apiGroupName)) - { - var apiPathAuthenticationRequired = apiPathData.Extensions.ExtractAuthenticationRequired(); - var apiPathAuthorizationRoles = apiPathData.Extensions.ExtractAuthorizationRoles(); - var apiPathAuthenticationSchemes = apiPathData.Extensions.ExtractAuthenticationSchemes(); - - foreach (var apiOperation in apiPathData.Operations) - { - var apiOperationAuthenticationRequired = apiOperation.Value.Extensions.ExtractAuthenticationRequired(); - var apiOperationAuthorizationRoles = apiOperation.Value.Extensions.ExtractAuthorizationRoles(); - var apiOperationAuthenticationSchemes = apiOperation.Value.Extensions.ExtractAuthenticationSchemes(); - - var operationName = apiOperation.Value.GetOperationName(); - - methodParameters.Add(new ContentGeneratorServerControllerMethodParameters( - OperationTypeRepresentation: apiOperation.Key.ToString(), - Name: operationName, - DocumentationTags: apiOperation.Value.ExtractDocumentationTags(), - RouteSuffix: GetRouteSuffix(apiPath), - InterfaceName: $"I{operationName}{ContentGeneratorConstants.Handler}", - ParameterTypeName: GetParameterTypeName(operationName, apiPathData, apiOperation.Value), - MultipartBodyLengthLimit: GetMultipartBodyLengthLimit(apiOperation.Value), - ProducesResponseTypeRepresentations: GetProducesResponseTypeRepresentations( - operationSchemaMappings, - apiOperation.Value, - apiGroupName, - projectName, - useProblemDetailsAsDefaultBody, - ShouldUseAuthorization(apiPathAuthenticationRequired, apiOperationAuthenticationRequired)), - apiPathAuthenticationRequired, - apiPathAuthorizationRoles, - apiPathAuthenticationSchemes, - apiOperationAuthenticationRequired, - apiOperationAuthorizationRoles, - apiOperationAuthenticationSchemes)); - } - } - - var documentationTags = new CodeDocumentationTags("Endpoint definitions."); - - return new ContentGeneratorServerControllerParameters( - Namespace: @namespace, - ApiGroupName: apiGroupName, - route, - documentationTags, - ControllerName: $"{apiGroupName}{ContentGeneratorConstants.Controller}", - methodParameters); - } - - private static string? GetRouteSuffix( - string apiPath) - { - var apiPathParts = apiPath.Split('/', StringSplitOptions.RemoveEmptyEntries); - if (apiPathParts.Length <= 1) - { - return null; - } - - var sb = new StringBuilder(); - for (var i = 1; i < apiPathParts.Length; i++) - { - if (i != 1) - { - sb.Append('/'); - } - - sb.Append(apiPathParts[i]); - } - - return sb.ToString(); - } - - private static string? GetParameterTypeName( - string operationName, - OpenApiPathItem apiPathData, - OpenApiOperation apiOperation) - => apiPathData.HasParameters() || - apiOperation.HasParametersOrRequestBody() - ? $"{operationName}{ContentGeneratorConstants.Parameters}" - : null; - - private static long? GetMultipartBodyLengthLimit( - OpenApiOperation apiOperation) - { - if (apiOperation.HasRequestBodyWithAnythingAsFormatTypeBinary()) - { - // TODO: Use project settings - return long.MaxValue; - } - - return null; - } - - private static List GetProducesResponseTypeRepresentations( - IList operationSchemaMappings, - OpenApiOperation apiOperation, - string apiGroupName, - string projectName, - bool useProblemDetailsAsDefaultBody, - bool shouldUseAuthorization) - => apiOperation.Responses.GetProducesResponseAttributeParts( - operationSchemaMappings, - apiGroupName, - projectName, - useProblemDetailsAsDefaultBody, - apiOperation.HasParametersOrRequestBody(), - shouldUseAuthorization, - includeIfNotDefinedInternalServerError: false); - - private static bool ShouldUseAuthorization( - bool? apiPathAuthenticationRequired, - bool? apiOperationAuthenticationRequired) - { - var shouldUseAuthorization = true; - - if (apiPathAuthenticationRequired.HasValue && !apiPathAuthenticationRequired.Value) - { - shouldUseAuthorization = false; - } - - if (shouldUseAuthorization && apiOperationAuthenticationRequired.HasValue && !apiOperationAuthenticationRequired.Value) - { - shouldUseAuthorization = false; - } - - return shouldUseAuthorization; - } -} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework/Factories/Parameters/Server/ContentGeneratorServerHandlerInterfaceParametersFactory.cs b/src/Atc.Rest.ApiGenerator.Framework/Factories/Parameters/Server/ContentGeneratorServerHandlerInterfaceParametersFactory.cs deleted file mode 100644 index a528ce1f..00000000 --- a/src/Atc.Rest.ApiGenerator.Framework/Factories/Parameters/Server/ContentGeneratorServerHandlerInterfaceParametersFactory.cs +++ /dev/null @@ -1,75 +0,0 @@ -namespace Atc.Rest.ApiGenerator.Framework.Factories.Parameters.Server; - -public static class ContentGeneratorServerHandlerInterfaceParametersFactory -{ - public static InterfaceParameters Create( - string headerContent, - string @namespace, - AttributeParameters codeGeneratorAttribute, - OpenApiPathItem openApiPath, - OpenApiOperation openApiOperation) - { - var operationName = openApiOperation.GetOperationName(); - - var methodParametersAttributes = new Dictionary(StringComparer.Ordinal); - var methodParametersParameters = new List(); - if (openApiPath.HasParameters() || - openApiOperation.HasParametersOrRequestBody()) - { - methodParametersAttributes.Add("parameters", "The parameters."); - methodParametersParameters.Add( - new ParameterBaseParameters( - Attributes: null, - GenericTypeName: null, - IsGenericListType: false, - TypeName: $"{operationName}{ContentGeneratorConstants.Parameters}", - IsReferenceType: true, - Name: "parameters", - DefaultValue: null)); - } - - methodParametersAttributes.Add("cancellationToken", "The cancellation token."); - methodParametersParameters.Add( - new ParameterBaseParameters( - Attributes: null, - GenericTypeName: null, - IsGenericListType: false, - TypeName: "CancellationToken", - IsReferenceType: true, - Name: "cancellationToken", - DefaultValue: "default")); - - var methodParameters = new List - { - new( - DocumentationTags: new CodeDocumentationTags( - "Execute method", - parameters: methodParametersAttributes, - remark: null, - code: null, - example: null, - exceptions: null, - @return: null), - Attributes: null, - AccessModifier: AccessModifiers.None, - ReturnTypeName: $"{operationName}{ContentGeneratorConstants.Result}", - ReturnGenericTypeName: "Task", - Name: "ExecuteAsync", - Parameters: methodParametersParameters, - AlwaysBreakDownParameters: true, - UseExpressionBody: false, - Content: null), - }; - - return new InterfaceParameters( - headerContent, - @namespace, - DocumentationTags: openApiOperation.ExtractDocumentationTagsForHandlerInterface(), - new List { codeGeneratorAttribute }, - AccessModifiers.Public, - InterfaceTypeName: $"I{operationName}{ContentGeneratorConstants.Handler}", - InheritedInterfaceTypeName: null, - Properties: null, - Methods: methodParameters); - } -} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework/Factories/Parameters/Server/ContentGeneratorServerHandlerParametersFactory.cs b/src/Atc.Rest.ApiGenerator.Framework/Factories/Parameters/Server/ContentGeneratorServerHandlerParametersFactory.cs deleted file mode 100644 index f5c7683f..00000000 --- a/src/Atc.Rest.ApiGenerator.Framework/Factories/Parameters/Server/ContentGeneratorServerHandlerParametersFactory.cs +++ /dev/null @@ -1,136 +0,0 @@ -namespace Atc.Rest.ApiGenerator.Framework.Factories.Parameters.Server; - -public static class ContentGeneratorServerHandlerParametersFactory -{ - public static ClassParameters Create( - string @namespace, - OpenApiPathItem openApiPath, - OpenApiOperation openApiOperation) - { - var operationName = openApiOperation.GetOperationName(); - - var hasParameters = openApiPath.HasParameters() || - openApiOperation.HasParametersOrRequestBody(); - - var methodParametersParameters = new List(); - if (hasParameters) - { - methodParametersParameters.Add( - new ParameterBaseParameters( - Attributes: null, - GenericTypeName: null, - IsGenericListType: false, - TypeName: $"{operationName}{ContentGeneratorConstants.Parameters}", - IsReferenceType: true, - Name: "parameters", - DefaultValue: null)); - } - - methodParametersParameters.Add( - new ParameterBaseParameters( - Attributes: null, - GenericTypeName: null, - IsGenericListType: false, - TypeName: "CancellationToken", - IsReferenceType: true, - Name: "cancellationToken", - DefaultValue: "default")); - - var methodParameters = new List - { - new( - DocumentationTags: null, - Attributes: null, - AccessModifier: AccessModifiers.Public, - ReturnTypeName: $"{operationName}{ContentGeneratorConstants.Result}", - ReturnGenericTypeName: "Task", - Name: "ExecuteAsync", - Parameters: methodParametersParameters, - AlwaysBreakDownParameters: true, - UseExpressionBody: false, - Content: GenerateContentExecuteMethod(hasParameters, operationName)), - }; - - return new ClassParameters( - HeaderContent: null, - @namespace, - openApiOperation.ExtractDocumentationTagsForHandler(), - Attributes: null, - AccessModifiers.Public, - ClassTypeName: $"{operationName}{ContentGeneratorConstants.Handler}", - GenericTypeName: null, - InheritedClassTypeName: $"I{operationName}{ContentGeneratorConstants.Handler}", - InheritedGenericClassTypeName: null, - InheritedInterfaceTypeName: null, - Constructors: null, - Properties: null, - Methods: methodParameters, - GenerateToStringMethod: false); - } - - public static ClassParameters CreateForCustomTest( - string @namespace, - OpenApiOperation openApiOperation) - { - var operationName = openApiOperation.GetOperationName(); - - var methodParameters = new List - { - new( - DocumentationTags: null, - Attributes: AttributesParametersFactory.Create("Fact", "Skip = \"Change this to a real test\""), - AccessModifier: AccessModifiers.Public, - ReturnTypeName: "void", - ReturnGenericTypeName: null, - Name: "Sample", - Parameters: null, - AlwaysBreakDownParameters: false, - UseExpressionBody: false, - Content: GenerateContentTestSample()), - }; - - return new ClassParameters( - HeaderContent: null, - @namespace, - DocumentationTags: null, - Attributes: null, - AccessModifiers.Public, - ClassTypeName: $"{operationName}{ContentGeneratorConstants.HandlerTests}", - GenericTypeName: null, - InheritedClassTypeName: null, - InheritedGenericClassTypeName: null, - InheritedInterfaceTypeName: null, - Constructors: null, - Properties: null, - Methods: methodParameters, - GenerateToStringMethod: false); - } - - private static string GenerateContentExecuteMethod( - bool hasParameters, - string operationName) - { - var sb = new StringBuilder(); - if (hasParameters) - { - sb.AppendLine("ArgumentNullException.ThrowIfNull(parameters);"); - sb.AppendLine(); - } - - sb.Append($"throw new NotImplementedException(\"Add logic here for {operationName}{ContentGeneratorConstants.Handler}\");"); - return sb.ToString(); - } - - private static string GenerateContentTestSample() - { - var sb = new StringBuilder(); - sb.AppendLine(4, "{"); - sb.AppendLine(8, "// Arrange"); - sb.AppendLine(); - sb.AppendLine(8, "// Act"); - sb.AppendLine(); - sb.AppendLine(8, "// Assert"); - sb.Append(4, "}"); - return sb.ToString(); - } -} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework/Factories/Parameters/Server/ContentGeneratorServerParameterParametersFactory.cs b/src/Atc.Rest.ApiGenerator.Framework/Factories/Parameters/Server/ContentGeneratorServerParameterParametersFactory.cs index 259c1a65..fcee2e1f 100644 --- a/src/Atc.Rest.ApiGenerator.Framework/Factories/Parameters/Server/ContentGeneratorServerParameterParametersFactory.cs +++ b/src/Atc.Rest.ApiGenerator.Framework/Factories/Parameters/Server/ContentGeneratorServerParameterParametersFactory.cs @@ -5,7 +5,7 @@ namespace Atc.Rest.ApiGenerator.Framework.Factories.Parameters.Server; public static class ContentGeneratorServerParameterParametersFactory { - public static ContentGeneratorServerParameterParameters Create( + public static ContentGeneratorServerParameterParameters CreateForClass( string @namespace, OpenApiOperation openApiOperation, IList globalPathParameters) @@ -29,6 +29,30 @@ public static ContentGeneratorServerParameterParameters Create( parameters); } + public static ContentGeneratorServerParameterParameters CreateForRecord( + string @namespace, + OpenApiOperation openApiOperation, + IList globalPathParameters) + { + ArgumentNullException.ThrowIfNull(openApiOperation); + ArgumentNullException.ThrowIfNull(globalPathParameters); + + var operationName = openApiOperation.GetOperationName(); + + var parameters = new List(); + + AppendParameters(parameters, globalPathParameters); + AppendParameters(parameters, openApiOperation.Parameters); + AppendParametersFromBody(parameters, openApiOperation.RequestBody); + + return new ContentGeneratorServerParameterParameters( + @namespace, + operationName, + openApiOperation.ExtractDocumentationTagsForParameters(), + ParameterName: $"{operationName}{ContentGeneratorConstants.Parameters}", + SortOptionalParametersMustAppearAfterAllRequiredParameters(parameters)); + } + private static void AppendParameters( ICollection parameters, IEnumerable openApiParameters) @@ -55,7 +79,7 @@ private static void AppendParameters( dataType, isSimpleType, useListForDataType, - GetIsNullable(openApiParameter, useListForDataType), + GetIsNullable(openApiParameter), openApiParameter.Required, GetAdditionalValidationAttributes(openApiParameter), openApiParameter.Schema.GetDefaultValueAsString())); @@ -64,14 +88,8 @@ private static void AppendParameters( } private static bool GetIsNullable( - OpenApiParameter openApiParameter, - bool useListForDataType) + OpenApiParameter openApiParameter) { - if (useListForDataType) - { - return false; - } - var isNullable = openApiParameter.Schema.Nullable; if (isNullable) { @@ -161,4 +179,20 @@ private static IList GetAdditionalValidationAttributes( var validationAttributeExtractor = new ValidationAttributeExtractor(); return validationAttributeExtractor.Extract(openApiParameter.Schema); } + + /// + /// CS1737 - Sorts the optional parameters must appear after all required parameters. + /// + /// The parameter base parameters. + private static IList SortOptionalParametersMustAppearAfterAllRequiredParameters( + IReadOnlyCollection parameters) + { + var parametersWithoutDefaultValues = parameters.Where(x => x.DefaultValueInitializer is null).ToList(); + var parametersWitDefaultValues = parameters.Where(x => x.DefaultValueInitializer is not null).ToList(); + + var data = new List(); + data.AddRange(parametersWithoutDefaultValues); + data.AddRange(parametersWitDefaultValues); + return data; + } } \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework/Factories/Parameters/Server/ContentGeneratorServerResultParametersFactory.cs b/src/Atc.Rest.ApiGenerator.Framework/Factories/Parameters/Server/ContentGeneratorServerResultParametersFactory.cs deleted file mode 100644 index e3daea00..00000000 --- a/src/Atc.Rest.ApiGenerator.Framework/Factories/Parameters/Server/ContentGeneratorServerResultParametersFactory.cs +++ /dev/null @@ -1,240 +0,0 @@ -// ReSharper disable ConvertIfStatementToReturnStatement -// ReSharper disable SwitchStatementMissingSomeEnumCasesNoDefault -// ReSharper disable InvertIf -namespace Atc.Rest.ApiGenerator.Framework.Factories.Parameters.Server; - -public static class ContentGeneratorServerResultParametersFactory -{ - public static ContentGeneratorServerResultParameters Create( - string @namespace, - OpenApiOperation openApiOperation, - bool useProblemDetailsAsDefaultBody) - { - ArgumentNullException.ThrowIfNull(openApiOperation); - - var operationName = openApiOperation.GetOperationName(); - var httpStatusCodes = openApiOperation.Responses.GetHttpStatusCodes(); - - var schemaTypeForImplicitOperator = SchemaType.None; - string? modelNameForImplicitOperator = null; - string? simpleDataTypeNameForImplicitOperator = null; - - // Methods - var methodParameters = new List(); - string? genericDataTypeName = null; - - foreach (var httpStatusCode in httpStatusCodes) - { - // TODO: Refactor to method - var useProblemDetails = openApiOperation.Responses.IsSchemaTypeProblemDetailsForStatusCode(httpStatusCode); - if (!useProblemDetails && - useProblemDetailsAsDefaultBody) - { - useProblemDetails = true; - } - - var schemaType = GetSchemaType(openApiOperation, httpStatusCode); - if (httpStatusCode is HttpStatusCode.OK or HttpStatusCode.Created) - { - schemaTypeForImplicitOperator = schemaType; - } - - var simpleDataTypeName = GetSimpleDataTypeName(schemaType, openApiOperation, httpStatusCode); - var modelSchemaForStatusCode = openApiOperation.GetModelSchemaFromResponse(); - var modelNameForStatusCode = openApiOperation.Responses.GetModelNameForStatusCode(httpStatusCode); - if (httpStatusCode is HttpStatusCode.OK or HttpStatusCode.Created) - { - if (!string.IsNullOrEmpty(simpleDataTypeName)) - { - if ("Object".Equals(simpleDataTypeName, StringComparison.Ordinal)) - { - simpleDataTypeName = "object"; - } - - simpleDataTypeNameForImplicitOperator = simpleDataTypeName; - } - else if (!string.IsNullOrEmpty(modelNameForStatusCode)) - { - modelNameForImplicitOperator = modelNameForStatusCode; - } - else - { - if (simpleDataTypeNameForImplicitOperator is null && - schemaType == SchemaType.SimpleTypeCustomPagedList && - modelSchemaForStatusCode is not null) - { - var customPaginationSchema = modelSchemaForStatusCode.GetCustomPaginationSchema(); - var customPaginationItemsSchema = modelSchemaForStatusCode.GetCustomPaginationItemsSchema(); - if (customPaginationSchema is not null && - customPaginationItemsSchema is not null) - { - genericDataTypeName = customPaginationSchema.GetDataType(); - simpleDataTypeNameForImplicitOperator = customPaginationItemsSchema.GetDataType(); - } - } - else if (modelNameForImplicitOperator is null && - schemaType == SchemaType.ComplexTypeCustomPagedList && - modelSchemaForStatusCode is not null) - { - var customPaginationSchema = modelSchemaForStatusCode.GetCustomPaginationSchema(); - var customPaginationItemsSchema = modelSchemaForStatusCode.GetCustomPaginationItemsSchema(); - if (customPaginationSchema is not null && - customPaginationItemsSchema is not null) - { - genericDataTypeName = customPaginationSchema.GetDataType(); - modelNameForImplicitOperator = customPaginationItemsSchema.GetModelName(); - modelNameForStatusCode = modelNameForImplicitOperator; - } - } - } - } - - var documentationTags = new CodeDocumentationTags($"{(int)httpStatusCode} - {httpStatusCode.ToNormalizedString()} response."); - - methodParameters.Add(new ContentGeneratorServerResultMethodParameters( - httpStatusCode, - schemaType, - UsesProblemDetails: useProblemDetails, - ModelName: modelNameForStatusCode, - documentationTags, - UsesBinaryResponse: httpStatusCode == HttpStatusCode.OK - ? openApiOperation.Responses.IsSchemaUsingBinaryFormatForOkResponse() - : null, - SimpleDataTypeName: simpleDataTypeName, - GenericDataTypeName: genericDataTypeName)); - } - - ContentGeneratorServerResultImplicitOperatorParameters? implicitOperatorParameters = null; - - if (ShouldAppendImplicitOperatorContent(httpStatusCodes, modelNameForImplicitOperator, openApiOperation.Responses.IsSchemaUsingBinaryFormatForOkResponse())) - { - // Implicit Operator - implicitOperatorParameters = new ContentGeneratorServerResultImplicitOperatorParameters( - SchemaType: schemaTypeForImplicitOperator, - modelNameForImplicitOperator, - simpleDataTypeNameForImplicitOperator, - GenericDataTypeName: genericDataTypeName); - } - - return new ContentGeneratorServerResultParameters( - @namespace, - operationName, - openApiOperation.ExtractDocumentationTagsForResult(), - $"{operationName}{ContentGeneratorConstants.Result}", - methodParameters, - implicitOperatorParameters); - } - - private static bool ShouldAppendImplicitOperatorContent( - ICollection httpStatusCodes, - string? modelName, - bool isSchemaUsingBinaryFormatForOkResponse) - { - if (!httpStatusCodes.Contains(HttpStatusCode.OK) && - !httpStatusCodes.Contains(HttpStatusCode.Created)) - { - return false; - } - - if (httpStatusCodes.Contains(HttpStatusCode.OK) && - httpStatusCodes.Contains(HttpStatusCode.Created)) - { - return false; - } - - var httpStatusCode = HttpStatusCode.Continue; // Dummy - if (httpStatusCodes.Contains(HttpStatusCode.OK)) - { - httpStatusCode = HttpStatusCode.OK; - } - else if (httpStatusCodes.Contains(HttpStatusCode.Created)) - { - httpStatusCode = HttpStatusCode.Created; - } - - if (string.IsNullOrEmpty(modelName) && - httpStatusCode == HttpStatusCode.Created) - { - return false; - } - - if (isSchemaUsingBinaryFormatForOkResponse) - { - return false; - } - - return true; - } - - private static SchemaType GetSchemaType( - OpenApiOperation openApiOperation, - HttpStatusCode httpStatusCode) - { - var schema = openApiOperation.Responses.GetSchemaForStatusCode(httpStatusCode); - if (schema is null) - { - return SchemaType.None; - } - - var modelName = openApiOperation.Responses.GetModelNameForStatusCode(httpStatusCode); - if (!string.IsNullOrEmpty(modelName)) - { - if (schema.IsTypeArray()) - { - return SchemaType.ComplexTypeList; - } - - if (schema.IsTypePagination()) - { - return SchemaType.ComplexTypePagedList; - } - - return SchemaType.ComplexType; - } - - if (schema.IsTypeArray() && schema.HasItemsWithSimpleDataType()) - { - return SchemaType.SimpleTypeList; - } - - if (schema.IsTypePagination() && schema.HasPaginationItemsWithSimpleDataType()) - { - return SchemaType.SimpleTypePagedList; - } - - if (schema.IsTypeCustomPagination()) - { - var customPaginationItemsSchema = schema.GetCustomPaginationItemsSchema(); - if (customPaginationItemsSchema is not null && - customPaginationItemsSchema.Items.IsSimpleDataType()) - { - return SchemaType.SimpleTypeCustomPagedList; - } - - return SchemaType.ComplexTypeCustomPagedList; - } - - return SchemaType.SimpleType; - } - - private static string? GetSimpleDataTypeName( - SchemaType schemaType, - OpenApiOperation openApiOperation, - HttpStatusCode httpStatusCode) - { - var schema = openApiOperation.Responses.GetSchemaForStatusCode(httpStatusCode); - if (schema is null) - { - return null; - } - - return schemaType switch - { - SchemaType.SimpleType => schema.GetDataType(), - SchemaType.SimpleTypeList => schema.GetSimpleDataTypeFromArray(), - SchemaType.SimpleTypePagedList => schema.GetSimpleDataTypeFromPagination(), - SchemaType.SimpleTypeCustomPagedList => schema.GetSimpleDataTypeFromCustomPagination(), - _ => null, - }; - } -} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework/Factories/Parameters/Server/ContentGeneratorServerTestEndpointHandlerStubParametersFactory.cs b/src/Atc.Rest.ApiGenerator.Framework/Factories/Parameters/Server/ContentGeneratorServerTestEndpointHandlerStubParametersFactory.cs index 150fdc5f..e45d0f1c 100644 --- a/src/Atc.Rest.ApiGenerator.Framework/Factories/Parameters/Server/ContentGeneratorServerTestEndpointHandlerStubParametersFactory.cs +++ b/src/Atc.Rest.ApiGenerator.Framework/Factories/Parameters/Server/ContentGeneratorServerTestEndpointHandlerStubParametersFactory.cs @@ -29,6 +29,7 @@ public static ClassParameters Create( GenericTypeName: null, IsGenericListType: false, TypeName: $"{operationName}{ContentGeneratorConstants.Parameters}", + IsNullableType: false, IsReferenceType: true, Name: "parameters", DefaultValue: null)); @@ -40,6 +41,7 @@ public static ClassParameters Create( GenericTypeName: null, IsGenericListType: false, TypeName: "CancellationToken", + IsNullableType: false, IsReferenceType: true, Name: "cancellationToken", DefaultValue: "default")); @@ -68,7 +70,7 @@ public static ClassParameters Create( @namespace, DocumentationTags: null, new List { codeGeneratorAttribute }, - AccessModifiers.Public, + AccessModifiers.PublicClass, ClassTypeName: $"{operationName}{ContentGeneratorConstants.HandlerStub}", GenericTypeName: null, InheritedClassTypeName: inheritedClassTypeName, diff --git a/src/Atc.Rest.ApiGenerator.Framework/Factories/Parameters/Server/ContentGeneratorServerTestEndpointTestsParametersFactory.cs b/src/Atc.Rest.ApiGenerator.Framework/Factories/Parameters/Server/ContentGeneratorServerTestEndpointTestsParametersFactory.cs index cc440611..7bd0e220 100644 --- a/src/Atc.Rest.ApiGenerator.Framework/Factories/Parameters/Server/ContentGeneratorServerTestEndpointTestsParametersFactory.cs +++ b/src/Atc.Rest.ApiGenerator.Framework/Factories/Parameters/Server/ContentGeneratorServerTestEndpointTestsParametersFactory.cs @@ -22,6 +22,7 @@ public static ClassParameters Create( new( GenericTypeName: null, TypeName: "WebApiStartupFactory", + IsNullableType: false, Name: "fixture", DefaultValue: null, PassToInheritedClass: true, @@ -54,7 +55,7 @@ public static ClassParameters Create( AttributeParametersFactory.Create("Collection", "\"Sequential-Endpoints\""), AttributeParametersFactory.Create("Trait", "Traits.Category, Traits.Categories.Integration"), }, - AccessModifiers.Public, + AccessModifiers.PublicClass, ClassTypeName: $"{operationName}{ContentGeneratorConstants.Tests}", GenericTypeName: null, InheritedClassTypeName: "WebApiControllerBaseTest", diff --git a/src/Atc.Rest.ApiGenerator.Framework/Factories/Parameters/ServerClient/AttributeParametersFactory.cs b/src/Atc.Rest.ApiGenerator.Framework/Factories/Parameters/ServerClient/AttributeParametersFactory.cs new file mode 100644 index 00000000..6c416684 --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Framework/Factories/Parameters/ServerClient/AttributeParametersFactory.cs @@ -0,0 +1,19 @@ +namespace Atc.Rest.ApiGenerator.Framework.Factories.Parameters.ServerClient; + +public static class AttributeParametersFactory +{ + public static AttributeParameters Create( + string name) + => new(name, Content: null); + + public static AttributeParameters Create( + string name, + string content) + => new(name, content); + + public static AttributeParameters CreateGeneratedCode( + Version apiGeneratorVersion) + => new( + "GeneratedCode", + $"\"{ContentWriterConstants.ApiGeneratorName}\", \"{apiGeneratorVersion}\""); +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework/Factories/Parameters/ServerClient/ContentGeneratorServerClientModelParametersFactory.cs b/src/Atc.Rest.ApiGenerator.Framework/Factories/Parameters/ServerClient/ContentGeneratorServerClientModelParametersFactory.cs index 4d762b3b..f1a7f66d 100644 --- a/src/Atc.Rest.ApiGenerator.Framework/Factories/Parameters/ServerClient/ContentGeneratorServerClientModelParametersFactory.cs +++ b/src/Atc.Rest.ApiGenerator.Framework/Factories/Parameters/ServerClient/ContentGeneratorServerClientModelParametersFactory.cs @@ -1,21 +1,24 @@ // ReSharper disable MergeIntoPattern // ReSharper disable ConvertIfStatementToReturnStatement +// ReSharper disable InvertIf namespace Atc.Rest.ApiGenerator.Framework.Factories.Parameters.ServerClient; public static class ContentGeneratorServerClientModelParametersFactory { - public static ClassParameters Create( + public static ClassParameters CreateForClass( string headerContent, string @namespace, AttributeParameters codeGeneratorAttribute, string modelName, - OpenApiSchema apiSchemaModel) + OpenApiSchema apiSchemaModel, + bool includeDeprecated) { ArgumentNullException.ThrowIfNull(apiSchemaModel); + ArgumentNullException.ThrowIfNull(modelName); var documentationTags = apiSchemaModel.ExtractDocumentationTags($"{modelName}."); - var propertiesParameters = ExtractPropertiesParameters(apiSchemaModel); + var propertiesParameters = ExtractPropertiesParameters(apiSchemaModel, modelName, includeDeprecated); string? genericTypeName = null; if (propertiesParameters.Any(x => x.TypeName == "T")) @@ -28,7 +31,7 @@ public static ClassParameters Create( @namespace, documentationTags, new List { codeGeneratorAttribute }, - AccessModifiers.Public, + AccessModifiers.PublicClass, ClassTypeName: modelName, GenericTypeName: genericTypeName, InheritedClassTypeName: null, @@ -40,6 +43,28 @@ public static ClassParameters Create( GenerateToStringMethod: true); } + public static RecordsParameters CreateForRecord( + string headerContent, + string @namespace, + AttributeParameters codeGeneratorAttribute, + string modelName, + OpenApiSchema apiSchemaModel, + bool includeDeprecated) + { + ArgumentNullException.ThrowIfNull(apiSchemaModel); + + var documentationTags = apiSchemaModel.ExtractDocumentationTags($"{modelName}."); + + var recordParameters = ExtractRecordParameters(modelName, apiSchemaModel, includeDeprecated); + + return new RecordsParameters( + headerContent, + @namespace, + documentationTags, + new List { codeGeneratorAttribute }, + Parameters: recordParameters); + } + private static bool GetRequired( ICollection required, string name, @@ -54,13 +79,21 @@ private static bool GetRequired( } private static string? GetDefaultValue( - IOpenApiAny? initializer, + OpenApiSchema schema, string? dataTypeForList) { - if (initializer is not null || + if (schema.Default is not null || string.IsNullOrEmpty(dataTypeForList)) { - return initializer.GetDefaultValueAsString(); + if (schema.IsSchemaEnum()) + { + var value = schema.Default.GetDefaultValueAsString(); + return value is null + ? null + : $"{schema.GetModelName()}.{value.EnsureFirstCharacterToUpper()}"; + } + + return schema.Default.GetDefaultValueAsString(); } if ("List".Equals(dataTypeForList, StringComparison.Ordinal)) @@ -72,15 +105,19 @@ private static bool GetRequired( } private static List ExtractPropertiesParameters( - OpenApiSchema apiSchemaModel) + OpenApiSchema apiSchemaModel, + string modelName, + bool includeDeprecated) { - var hasAnyPropertiesAsArrayWithFormatTypeBinary = apiSchemaModel.HasAnyPropertiesAsArrayWithFormatTypeBinary(); - var propertiesParameters = new List(); + var hasAnyPropertiesAsArrayWithFormatTypeBinary = apiSchemaModel.HasAnyPropertiesAsArrayWithFormatTypeBinary(); + if (apiSchemaModel.Properties.Count == 0) { - var childModelName = apiSchemaModel.Items.GetModelName(); + var childModelName = apiSchemaModel.Items is null + ? apiSchemaModel.GetModelName() + : apiSchemaModel.Items.GetModelName(); var documentationTags = new CodeDocumentationTags($"A list of {childModelName}."); @@ -92,8 +129,10 @@ private static List ExtractPropertiesParameters( GenericTypeName: "List", IsGenericListType: true, TypeName: childModelName, + IsNullableType: false, IsReferenceType: false, Name: childModelName + "List", + JsonName: null, DefaultValue: $"new List<{childModelName}>()", UseAutoProperty: true, UseGet: true, @@ -107,6 +146,11 @@ private static List ExtractPropertiesParameters( { var openApiParameter = apiSchema.Value; + if (openApiParameter.Deprecated && !includeDeprecated) + { + continue; + } + var useListForDataType = openApiParameter.IsTypeArray(); string? dataType = null; @@ -122,9 +166,7 @@ private static List ExtractPropertiesParameters( } else { - dataType = openApiParameter.AnyOf.Count == 1 - ? openApiParameter.AnyOf[0].GetDataType() - : openApiParameter.GetDataType(); + dataType = openApiParameter.GetDataType(); if ("Object".Equals(dataType, StringComparison.Ordinal) && openApiParameter.AdditionalProperties is not null) @@ -173,18 +215,21 @@ openApiParameter.Default is null && dataTypeForList = "List"; } - if (openApiParameter.Nullable) - { - dataType += "?"; - } - - var defaultValue = GetDefaultValue(openApiParameter.Default, dataTypeForList); + var defaultValue = GetDefaultValue(openApiParameter, dataTypeForList); if (dataType.Equals(dataTypeForList, StringComparison.Ordinal)) { dataTypeForList = "List"; } + var name = apiSchema.Key.EnsureFirstCharacterToUpper(); + string? jsonName = null; + if (modelName.Equals(name, StringComparison.OrdinalIgnoreCase)) + { + name = $"{name}Property"; + jsonName = apiSchema.Key; + } + propertiesParameters.Add( new PropertyParameters( documentationTags, @@ -197,8 +242,10 @@ openApiParameter.Default is null && GenericTypeName: dataTypeForList, IsGenericListType: !string.IsNullOrEmpty(dataTypeForList), TypeName: dataType, + IsNullableType: openApiParameter.Nullable, IsReferenceType: !isSimpleType, - Name: apiSchema.Key.EnsureFirstCharacterToUpper(), + Name: name, + JsonName: jsonName, DefaultValue: defaultValue, UseAutoProperty: true, UseGet: true, @@ -230,4 +277,152 @@ private static IList ExtractAttributeParameters( return attributesParameters; } + + private static List ExtractRecordParameters( + string modelName, + OpenApiSchema apiSchemaModel, + bool includeDeprecated) + { + var documentationTags = apiSchemaModel.ExtractDocumentationTags($"{modelName}."); + + return + [ + new( + documentationTags, + AccessModifiers.PublicRecord, + Name: modelName, + Parameters: ExtractRecordParameterBaseParameters(apiSchemaModel, includeDeprecated)) + + ]; + } + + private static List ExtractRecordParameterBaseParameters( + OpenApiSchema apiSchemaModel, + bool includeDeprecated) + { + var parameterBaseParameters = new List(); + + var hasAnyPropertiesAsArrayWithFormatTypeBinary = apiSchemaModel.HasAnyPropertiesAsArrayWithFormatTypeBinary(); + + if (apiSchemaModel.Properties.Count == 0) + { + var childModelName = apiSchemaModel.Items.GetModelName(); + + parameterBaseParameters.Add( + new PropertyParameters( + DocumentationTags: null, + Attributes: null, + AccessModifier: AccessModifiers.Public, + GenericTypeName: "List", + IsGenericListType: true, + TypeName: childModelName, + IsNullableType: false, + IsReferenceType: false, + Name: childModelName + "List", + JsonName: null, + DefaultValue: null, + UseAutoProperty: true, + UseGet: true, + UseSet: true, + UseExpressionBody: false, + Content: null)); + } + else + { + foreach (var apiSchema in apiSchemaModel.Properties) + { + var openApiParameter = apiSchema.Value; + + if (openApiParameter.Deprecated && !includeDeprecated) + { + continue; + } + + var useListForDataType = openApiParameter.IsTypeArray(); + + string? dataType = null; + if (useListForDataType) + { + if (apiSchema.Key.IsNamedAsItemsOrResult() && + string.IsNullOrEmpty(openApiParameter.Items.Type)) + { + dataType = "T"; + } + + dataType ??= openApiParameter.Items.GetDataType(); + } + else + { + dataType = openApiParameter.GetDataType(); + } + + var isSimpleType = useListForDataType + ? openApiParameter.Items.IsSimpleDataType() || openApiParameter.Items.IsSchemaEnumOrPropertyEnum() || openApiParameter.Items.IsFormatTypeBinary() + : openApiParameter.IsSimpleDataType() || openApiParameter.IsSchemaEnumOrPropertyEnum() || openApiParameter.IsFormatTypeBinary(); + + string? dataTypeForList = null; + if (hasAnyPropertiesAsArrayWithFormatTypeBinary) + { + dataTypeForList = dataType; + } + else if (useListForDataType && !string.IsNullOrEmpty(openApiParameter.Items.Title) && + openApiParameter.Default is null && + !GetRequired(apiSchemaModel.Required, apiSchema.Key, hasAnyPropertiesAsArrayWithFormatTypeBinary)) + { + dataTypeForList = dataType; + } + + if (dataTypeForList is null && + openApiParameter.Default is null && + useListForDataType && + !GetRequired(apiSchemaModel.Required, apiSchema.Key, hasAnyPropertiesAsArrayWithFormatTypeBinary)) + { + dataTypeForList = dataType; + } + + string? defaultValue = null; + if (useListForDataType) + { + dataTypeForList = "List"; + } + else + { + defaultValue = GetDefaultValue(openApiParameter, dataTypeForList); + } + + parameterBaseParameters.Add( + new ParameterBaseParameters( + Attributes: ExtractAttributeParameters( + apiSchemaModel.Required, + apiSchema.Key, + hasAnyPropertiesAsArrayWithFormatTypeBinary, + openApiParameter), + GenericTypeName: dataTypeForList, + IsGenericListType: !string.IsNullOrEmpty(dataTypeForList), + TypeName: dataType, + IsNullableType: openApiParameter.Nullable, + IsReferenceType: !isSimpleType, + Name: apiSchema.GetFormattedKey(), + DefaultValue: defaultValue)); + } + } + + return SortOptionalParametersMustAppearAfterAllRequiredParameters(parameterBaseParameters); + } + + /// + /// CS1737 - Sorts the optional parameters must appear after all required parameters. + /// + /// The parameter base parameters. + private static List SortOptionalParametersMustAppearAfterAllRequiredParameters( + IReadOnlyCollection parameters) + { + var parametersWithoutDefaultValues = parameters.Where(x => x.DefaultValue is null).ToList(); + var parametersWitDefaultValues = parameters.Where(x => x.DefaultValue is not null).ToList(); + + var data = new List(); + data.AddRange(parametersWithoutDefaultValues); + data.AddRange(parametersWitDefaultValues); + return data; + } } \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework/Factories/Parameters/ServerClient/GeneratedCodeHeaderGeneratorFactory.cs b/src/Atc.Rest.ApiGenerator.Framework/Factories/Parameters/ServerClient/GeneratedCodeHeaderGeneratorFactory.cs new file mode 100644 index 00000000..ad2e0804 --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Framework/Factories/Parameters/ServerClient/GeneratedCodeHeaderGeneratorFactory.cs @@ -0,0 +1,8 @@ +namespace Atc.Rest.ApiGenerator.Framework.Factories.Parameters.ServerClient; + +public static class GeneratedCodeHeaderGeneratorFactory +{ + public static GeneratedCodeHeaderGenerator Create( + Version apiGeneratorVersion) + => new(new GeneratedCodeGeneratorParameters(apiGeneratorVersion)); +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework/Factories/Server/ContentGeneratorServerEndpointParametersFactory.cs b/src/Atc.Rest.ApiGenerator.Framework/Factories/Server/ContentGeneratorServerEndpointParametersFactory.cs new file mode 100644 index 00000000..e0788200 --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Framework/Factories/Server/ContentGeneratorServerEndpointParametersFactory.cs @@ -0,0 +1,99 @@ +namespace Atc.Rest.ApiGenerator.Framework.Factories.Server; + +public static class ContentGeneratorServerEndpointParametersFactory +{ + public static ContentGeneratorServerEndpointParameters Create( + IList operationSchemaMappings, + string projectName, + string @namespace, + string apiGroupName, + string route, + string endpointSuffixName, + OpenApiDocument openApiDocument) + { + var methodParameters = new List(); + + ApiAuthorizeModel? controllerAuthorization = null; + foreach (var (apiPath, apiPathData) in openApiDocument.GetPathsByBasePathSegmentName(apiGroupName)) + { + controllerAuthorization ??= apiPathData.ExtractApiPathAuthorization(); + + foreach (var apiOperation in apiPathData.Operations) + { + var operationName = apiOperation.Value.GetOperationName(); + var endpointAuthorization = apiOperation.Value.ExtractApiOperationAuthorization(apiPathData); + var responseModels = apiOperation.Value + .ExtractApiOperationResponseModels() + .AdjustNamespacesIfNeeded(operationSchemaMappings); + + methodParameters.Add(new ContentGeneratorServerEndpointMethodParameters( + OperationTypeRepresentation: apiOperation.Key.ToString(), + Name: operationName, + DocumentationTags: apiOperation.Value.ExtractDocumentationTags(), + Description: apiOperation.Value.Description, + RouteSuffix: GetRouteSuffix(apiPath), + InterfaceName: $"I{operationName}{ContentGeneratorConstants.Handler}", + ParameterTypeName: GetParameterTypeName(operationName, apiPathData, apiOperation.Value), + MultipartBodyLengthLimit: GetMultipartBodyLengthLimit(apiOperation.Value), + ResultName: $"{operationName}{ContentGeneratorConstants.Result}", + ResponseModels: responseModels, + Authorization: endpointAuthorization)); + } + } + + var documentationTags = new CodeDocumentationTags("Endpoint definitions."); + + return new ContentGeneratorServerEndpointParameters( + Namespace: @namespace, + ApiGroupName: apiGroupName, + route, + documentationTags, + EndpointName: $"{apiGroupName}{endpointSuffixName}", + controllerAuthorization, + methodParameters); + } + + private static string? GetRouteSuffix( + string apiPath) + { + var apiPathParts = apiPath.Split('/', StringSplitOptions.RemoveEmptyEntries); + if (apiPathParts.Length <= 1) + { + return null; + } + + var sb = new StringBuilder(); + for (var i = 1; i < apiPathParts.Length; i++) + { + if (i != 1) + { + sb.Append('/'); + } + + sb.Append(apiPathParts[i]); + } + + return sb.ToString(); + } + + private static string? GetParameterTypeName( + string operationName, + OpenApiPathItem apiPathData, + OpenApiOperation apiOperation) + => apiPathData.HasParameters() || + apiOperation.HasParametersOrRequestBody() + ? $"{operationName}{ContentGeneratorConstants.Parameters}" + : null; + + private static long? GetMultipartBodyLengthLimit( + OpenApiOperation apiOperation) + { + if (apiOperation.HasRequestBodyWithAnythingAsFormatTypeBinary()) + { + // TODO: Use project settings + return long.MaxValue; + } + + return null; + } +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework/Factories/Server/ContentGeneratorServerHandlerParametersTestFactory.cs b/src/Atc.Rest.ApiGenerator.Framework/Factories/Server/ContentGeneratorServerHandlerParametersTestFactory.cs new file mode 100644 index 00000000..8a1932ab --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Framework/Factories/Server/ContentGeneratorServerHandlerParametersTestFactory.cs @@ -0,0 +1,55 @@ +namespace Atc.Rest.ApiGenerator.Framework.Factories.Server; + +public static class ContentGeneratorServerHandlerParametersTestFactory +{ + public static ClassParameters CreateForCustomTest( + string @namespace, + OpenApiOperation openApiOperation) + { + var operationName = openApiOperation.GetOperationName(); + + var methodParameters = new List + { + new( + DocumentationTags: null, + Attributes: AttributesParametersFactory.Create("Fact", "Skip = \"Change this to a real test\""), + AccessModifier: AccessModifiers.Public, + ReturnTypeName: "void", + ReturnGenericTypeName: null, + Name: "Sample", + Parameters: null, + AlwaysBreakDownParameters: false, + UseExpressionBody: false, + Content: GenerateContentTestSample()), + }; + + return new ClassParameters( + HeaderContent: null, + @namespace, + DocumentationTags: null, + Attributes: null, + AccessModifiers.PublicClass, + ClassTypeName: $"{operationName}{ContentGeneratorConstants.HandlerTests}", + GenericTypeName: null, + InheritedClassTypeName: null, + InheritedGenericClassTypeName: null, + InheritedInterfaceTypeName: null, + Constructors: null, + Properties: null, + Methods: methodParameters, + GenerateToStringMethod: false); + } + + private static string GenerateContentTestSample() + { + var sb = new StringBuilder(); + sb.AppendLine(4, "{"); + sb.AppendLine(8, "// Arrange"); + sb.AppendLine(); + sb.AppendLine(8, "// Act"); + sb.AppendLine(); + sb.AppendLine(8, "// Assert"); + sb.Append(4, "}"); + return sb.ToString(); + } +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework/GlobalUsings.cs b/src/Atc.Rest.ApiGenerator.Framework/GlobalUsings.cs index 9a270e88..18a3a9cd 100644 --- a/src/Atc.Rest.ApiGenerator.Framework/GlobalUsings.cs +++ b/src/Atc.Rest.ApiGenerator.Framework/GlobalUsings.cs @@ -5,6 +5,7 @@ global using System.Globalization; global using System.Net; global using System.Net.Mime; +global using System.Reflection; global using System.Text; global using Atc.CodeDocumentation.CodeComment; @@ -12,16 +13,24 @@ global using Atc.CodeGeneration.CSharp.Content.Factories; global using Atc.CodeGeneration.CSharp.Content.Generators; global using Atc.CodeGeneration.CSharp.Extensions; +global using Atc.DotNet; global using Atc.Helpers; -global using Atc.Rest.ApiGenerator.Framework.Contracts; -global using Atc.Rest.ApiGenerator.Framework.Contracts.ContentGeneratorsParameters; -global using Atc.Rest.ApiGenerator.Framework.Contracts.ContentGeneratorsParameters.Client; -global using Atc.Rest.ApiGenerator.Framework.Contracts.ContentGeneratorsParameters.Server; -global using Atc.Rest.ApiGenerator.Framework.Contracts.Models; -global using Atc.Rest.ApiGenerator.Framework.Contracts.Resolver; +global using Atc.Rest.ApiGenerator.Contracts; +global using Atc.Rest.ApiGenerator.Contracts.ContentGeneratorsParameters; +global using Atc.Rest.ApiGenerator.Contracts.ContentGeneratorsParameters.Client; +global using Atc.Rest.ApiGenerator.Contracts.ContentGeneratorsParameters.Server; +global using Atc.Rest.ApiGenerator.Contracts.Extensions; +global using Atc.Rest.ApiGenerator.Contracts.Models; +global using Atc.Rest.ApiGenerator.Framework.ContentGenerators; +global using Atc.Rest.ApiGenerator.Framework.ContentGeneratorsParameters.Server; +global using Atc.Rest.ApiGenerator.Framework.Factories.Parameters.ServerClient; +global using Atc.Rest.ApiGenerator.Framework.Factories.Server; +global using Atc.Rest.ApiGenerator.Framework.Helpers; +global using Atc.Rest.ApiGenerator.Framework.Providers; global using Atc.Rest.ApiGenerator.Framework.Readers; global using Atc.Rest.ApiGenerator.Framework.ToRefactor; global using Atc.Rest.ApiGenerator.Framework.Writers; +global using Atc.Rest.ApiGenerator.Nuget.Clients; global using Atc.Rest.ApiGenerator.OpenApi.Extensions; global using Atc.Rest.ApiGenerator.OpenApi.Extractors; global using Atc.Rest.ApiGenerator.OpenApi.Models; @@ -30,4 +39,5 @@ global using Microsoft.Extensions.Logging; global using Microsoft.OpenApi.Any; global using Microsoft.OpenApi.Models; -global using Microsoft.OpenApi.Readers; \ No newline at end of file +global using Microsoft.OpenApi.Readers; +global using Microsoft.OpenApi.Writers; \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework/Helpers/GenerateContentForSolutionFileHelper.cs b/src/Atc.Rest.ApiGenerator.Framework/Helpers/GenerateContentForSolutionFileHelper.cs new file mode 100644 index 00000000..262e7974 --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Framework/Helpers/GenerateContentForSolutionFileHelper.cs @@ -0,0 +1,98 @@ +// ReSharper disable ArrangeObjectCreationWhenTypeNotEvident +namespace Atc.Rest.ApiGenerator.Framework.Helpers; + +public static class GenerateContentForSolutionFileHelper +{ + private static readonly Guid ProjectTypeIdForCSharpDotNetCore = new("9A19103F-16F7-4668-BE54-9A1E7A4F7556"); + + public static string Generate( + string projectName, + DirectoryInfo rootPath, + DirectoryInfo srcPath, + DirectoryInfo? testPath) + { + ArgumentNullException.ThrowIfNull(rootPath); + + var hostName = $"{projectName}.Api"; + var hostFile = srcPath.CombineFileInfo(hostName, $"{hostName}.csproj"); + var hostRelativePath = GetProjectReference(rootPath, hostFile); + var hostConfigurationId = Guid.NewGuid(); + + var apiName = $"{projectName}.Api.Generated"; + var apiPath = srcPath.CombineFileInfo(apiName, $"{apiName}.csproj"); + var apiRelativePath = GetProjectReference(rootPath, apiPath); + var apiConfigurationId = Guid.NewGuid(); + + var domainName = $"{projectName}.Domain"; + var domainPath = srcPath.CombineFileInfo(domainName, $"{domainName}.csproj"); + var domainRelativePath = GetProjectReference(rootPath, domainPath); + var domainConfigurationId = Guid.NewGuid(); + + var parameters = new SolutionFileParameters( + Guid.NewGuid(), + [ + new(hostConfigurationId), + new(apiConfigurationId), + new(domainConfigurationId), + ], + [ + new(ProjectTypeIdForCSharpDotNetCore, hostName, hostRelativePath, hostConfigurationId), + new(ProjectTypeIdForCSharpDotNetCore, apiName, apiRelativePath, apiConfigurationId), + new(ProjectTypeIdForCSharpDotNetCore, domainName, domainRelativePath, domainConfigurationId), + ]); + + if (testPath is not null) + { + var hostTestName = $"{projectName}.Api.Tests"; + var hostTestPath = testPath.CombineFileInfo(hostTestName, $"{hostTestName}.csproj"); + var hostTestRelativePath = GetProjectReference(rootPath, hostTestPath); + var hostTestConfigurationId = Guid.NewGuid(); + + parameters.Configurations.Add(new SolutionConfigurationParameters(hostTestConfigurationId)); + parameters.Projects.Add(new SolutionProjectParameters(ProjectTypeIdForCSharpDotNetCore, hostTestName, hostTestRelativePath, hostTestConfigurationId)); + + var domainTestName = $"{projectName}.Domain.Tests"; + var domainTestPath = testPath.CombineFileInfo(domainTestName, $"{domainTestName}.csproj"); + var domainTestRelativePath = GetProjectReference(rootPath, domainTestPath); + var domainTestConfigurationId = Guid.NewGuid(); + + parameters.Configurations.Add(new SolutionConfigurationParameters(domainTestConfigurationId)); + parameters.Projects.Add(new SolutionProjectParameters(ProjectTypeIdForCSharpDotNetCore, domainTestName, domainTestRelativePath, domainTestConfigurationId)); + } + + var contentGenerator = new GenerateContentForSolutionFile( + parameters); + + return contentGenerator.Generate(); + } + + private static string GetProjectReference( + FileSystemInfo source, + FileSystemInfo destination) + { + var sa1 = source.FullName.Split(Path.DirectorySeparatorChar); + var sa2 = destination.FullName.Split(Path.DirectorySeparatorChar); + var diffIndex = sa1.Where((t, i) => i < sa2.Length && t == sa2[i]).Count(); + + var goForward = 0; + for (var i = diffIndex; i < sa2.Length; i++) + { + goForward++; + } + + var sb = new StringBuilder(); + for (var i = 0; i < goForward; i++) + { + if (goForward - 1 == i) + { + sb.Append(@$"{sa2[diffIndex + i]}"); + } + else + { + sb.Append(@$"{sa2[diffIndex + i]}\"); + } + } + + return sb.ToString(); + } +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator/Helpers/GlobalUsingsHelper.cs b/src/Atc.Rest.ApiGenerator.Framework/Helpers/GlobalUsingsHelper.cs similarity index 85% rename from src/Atc.Rest.ApiGenerator/Helpers/GlobalUsingsHelper.cs rename to src/Atc.Rest.ApiGenerator.Framework/Helpers/GlobalUsingsHelper.cs index c89fb9ba..96cc15b1 100644 --- a/src/Atc.Rest.ApiGenerator/Helpers/GlobalUsingsHelper.cs +++ b/src/Atc.Rest.ApiGenerator.Framework/Helpers/GlobalUsingsHelper.cs @@ -1,6 +1,6 @@ // ReSharper disable ForeachCanBeConvertedToQueryUsingAnotherGetEnumerator // ReSharper disable LoopCanBeConvertedToQuery -namespace Atc.Rest.ApiGenerator.Helpers +namespace Atc.Rest.ApiGenerator.Framework.Helpers { public static class GlobalUsingsHelper { @@ -25,7 +25,6 @@ public static void CreateOrUpdate( setSystemFirst: true, addNamespaceSeparator: !removeNamespaceGroupSeparatorInGlobalUsings); - var globalUsingFile = new FileInfo(Path.Combine(directoryInfo.FullName, "GlobalUsings.cs")); if (string.IsNullOrEmpty(content)) { return; @@ -33,8 +32,8 @@ public static void CreateOrUpdate( var contentWriter = new ContentWriter(logger); contentWriter.Write( - globalUsingFile.Directory!, - globalUsingFile, + directoryInfo, + directoryInfo.CombineFileInfo("GlobalUsings.cs"), contentWriterArea, content); } diff --git a/src/Atc.Rest.ApiGenerator.Framework/Helpers/ResourcesHelper.cs b/src/Atc.Rest.ApiGenerator.Framework/Helpers/ResourcesHelper.cs new file mode 100644 index 00000000..c6556c23 --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Framework/Helpers/ResourcesHelper.cs @@ -0,0 +1,125 @@ +namespace Atc.Rest.ApiGenerator.Framework.Helpers; + +public static class ResourcesHelper +{ + private const string NamespaceToRemoveForWwwRoot = "Atc.Rest.ApiGenerator.Framework.Resources.wwwroot."; + + public static void ScaffoldPropertiesLaunchSettingsFile( + string projectName, + DirectoryInfo projectPath, + bool useExtended) + { + var file = projectPath.CombineFileInfo("Properties", "launchSettings.json"); + if (file.Exists) + { + return; + } + + var resourceName = "Atc.Rest.ApiGenerator.Framework.Resources.launchSettings.json"; + if (useExtended) + { + resourceName = "Atc.Rest.ApiGenerator.Framework.Resources.launchSettingsExtended.json"; + } + + var resourceStream = typeof(ResourcesHelper).Assembly.GetManifestResourceStream(resourceName); + var json = resourceStream!.ToStringData(); + json = json.Replace("\"[[PROJECTNAME]]\":", $"\"{projectName}\":", StringComparison.Ordinal); + + if (!file.Directory!.Exists) + { + Directory.CreateDirectory(file.Directory.FullName); + } + + FileHelper.WriteAllText(file, json); + } + + public static void MaintainWwwResources( + DirectoryInfo directoryInfo) + { + ArgumentNullException.ThrowIfNull(directoryInfo); + + var manifestResourceNames = Assembly + .GetAssembly(typeof(ResourcesHelper))! + .GetManifestResourceNames(); + + foreach (var manifestResourceName in manifestResourceNames) + { + if (!manifestResourceName.StartsWith(NamespaceToRemoveForWwwRoot, StringComparison.Ordinal)) + { + continue; + } + + var paths = new List + { + "wwwroot", + }; + + var path = manifestResourceName + .Replace(NamespaceToRemoveForWwwRoot, string.Empty, StringComparison.Ordinal) + .Replace('_', '-') + .Replace('.', '/'); + + var lastIndexOfSlash = path.LastIndexOf('/'); + if (lastIndexOfSlash > 0) + { + paths.AddRange(string + .Concat( + path.AsSpan()[..lastIndexOfSlash], + ".", + path.AsSpan(lastIndexOfSlash + 1, path.Length - lastIndexOfSlash - 1)) + .Split('/')); + } + + var file = directoryInfo.CombineFileInfo([.. paths]); + + var manifestResourceStream = Assembly + .GetAssembly(typeof(ResourcesHelper))! + .GetManifestResourceStream(manifestResourceName); + + if (manifestResourceStream is null) + { + continue; + } + + if (!Directory.Exists(file.Directory!.FullName)) + { + Directory.CreateDirectory(file.Directory.FullName); + } + + using var fileStream = new FileStream(file.FullName, FileMode.Create, FileAccess.Write); + manifestResourceStream.CopyTo(fileStream); + } + } + + public static void CopyApiSpecification( + FileInfo apiSpecificationFile, + OpenApiDocument openApiDocument, + DirectoryInfo directoryInfo) + { + ArgumentNullException.ThrowIfNull(apiSpecificationFile); + ArgumentNullException.ThrowIfNull(openApiDocument); + ArgumentNullException.ThrowIfNull(directoryInfo); + + var resourceFolder = directoryInfo.CombineFileInfo("Resources"); + if (!resourceFolder.Exists) + { + Directory.CreateDirectory(resourceFolder.FullName); + } + + var resourceFile = new FileInfo(Path.Combine(resourceFolder.FullName, "ApiSpecification.yaml")); + if (File.Exists(resourceFile.FullName)) + { + File.Delete(resourceFile.FullName); + } + + if (apiSpecificationFile.Extension.Equals(".json", StringComparison.OrdinalIgnoreCase)) + { + using var writeFile = new StreamWriter(resourceFile.FullName); + openApiDocument.SerializeAsV3(new OpenApiYamlWriter(writeFile)); + } + else + { + File.Copy(apiSpecificationFile.FullName, resourceFile.FullName); + } + } +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework/ProjectGenerator/IServerApiGenerator.cs b/src/Atc.Rest.ApiGenerator.Framework/ProjectGenerator/IServerApiGenerator.cs new file mode 100644 index 00000000..6115dabe --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Framework/ProjectGenerator/IServerApiGenerator.cs @@ -0,0 +1,33 @@ +namespace Atc.Rest.ApiGenerator.Framework.ProjectGenerator; + +/// +/// Interface: IServerApiGenerator +/// +/// +/// Method prefixes: +/// - Generate => Generate file and overwrite file if exists. +/// - Scaffold => Generate file if not exists. +/// - Maintain => Update file. +/// +public interface IServerApiGenerator +{ + Task ScaffoldProjectFile(); + + void GenerateAssemblyMarker(); + + void GenerateModels(); + + void GenerateParameters(); + + void GenerateResults(); + + void GenerateInterfaces(); + + void GenerateEndpoints(); + + void MaintainApiSpecification( + FileInfo apiSpecificationFile); + + void MaintainGlobalUsings( + bool removeNamespaceGroupSeparatorInGlobalUsings); +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework/ProjectGenerator/IServerDomainGenerator.cs b/src/Atc.Rest.ApiGenerator.Framework/ProjectGenerator/IServerDomainGenerator.cs new file mode 100644 index 00000000..deda48fb --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Framework/ProjectGenerator/IServerDomainGenerator.cs @@ -0,0 +1,24 @@ +namespace Atc.Rest.ApiGenerator.Framework.ProjectGenerator; + +/// +/// Interface: IServerDomainGenerator +/// +/// +/// Method prefixes: +/// - Generate => Generate file and overwrite file if exists. +/// - Scaffold => Generate file if not exists. +/// - Maintain => Update file. +/// +public interface IServerDomainGenerator +{ + Task ScaffoldProjectFile(); + + void ScaffoldHandlers(); + + void GenerateAssemblyMarker(); + + void GenerateServiceCollectionExtensions(); + + void MaintainGlobalUsings( + bool removeNamespaceGroupSeparatorInGlobalUsings); +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework/ProjectGenerator/IServerDomainTestGenerator.cs b/src/Atc.Rest.ApiGenerator.Framework/ProjectGenerator/IServerDomainTestGenerator.cs new file mode 100644 index 00000000..eb1d3c88 --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Framework/ProjectGenerator/IServerDomainTestGenerator.cs @@ -0,0 +1,21 @@ +namespace Atc.Rest.ApiGenerator.Framework.ProjectGenerator; + +/// +/// Interface: IServerDomainGenerator +/// +/// +/// Method prefixes: +/// - Generate => Generate file and overwrite file if exists. +/// - Scaffold => Generate file if not exists. +/// - Maintain => Update file. +/// +public interface IServerDomainTestGenerator +{ + Task ScaffoldProjectFile(); + + void ScaffoldHandlers(); + + void MaintainGlobalUsings( + bool usingCodingRules, + bool removeNamespaceGroupSeparatorInGlobalUsings); +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework/ProjectGenerator/IServerGenerator.cs b/src/Atc.Rest.ApiGenerator.Framework/ProjectGenerator/IServerGenerator.cs new file mode 100644 index 00000000..74849a97 --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Framework/ProjectGenerator/IServerGenerator.cs @@ -0,0 +1,17 @@ +namespace Atc.Rest.ApiGenerator.Framework.ProjectGenerator; + +/// +/// Interface: IServerGenerator +/// +/// +/// Method prefixes: +/// - Generate => Generate file and overwrite file if exists. +/// - Scaffold => Generate file if not exists. +/// - Maintain => Update file. +/// +public interface IServerGenerator +{ + void ScaffoldSolutionFile(); + + void ScaffoldSolutionDotSettingsFile(); +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework/ProjectGenerator/IServerHostGenerator.cs b/src/Atc.Rest.ApiGenerator.Framework/ProjectGenerator/IServerHostGenerator.cs new file mode 100644 index 00000000..69f2ce76 --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Framework/ProjectGenerator/IServerHostGenerator.cs @@ -0,0 +1,44 @@ +namespace Atc.Rest.ApiGenerator.Framework.ProjectGenerator; + +/// +/// Interface: IServerHostGenerator +/// +/// +/// Method prefixes: +/// - Generate => Generate file and overwrite file if exists. +/// - Scaffold => Generate file if not exists. +/// - Maintain => Update file. +/// +public interface IServerHostGenerator +{ + bool UseRestExtended { get; set; } + + Task ScaffoldProjectFile(); + + void ScaffoldPropertiesLaunchSettingsFile(); + + void ScaffoldJsonSerializerOptionsExtensions(); + + void ScaffoldServiceCollectionExtensions(); + + void ScaffoldWebApplicationBuilderExtensions(); + + void ScaffoldWebApplicationExtensions( + SwaggerThemeMode swaggerThemeMode); + + void GenerateConfigureSwaggerDocOptions(); + + void ScaffoldConfigureSwaggerOptions(); + + void ScaffoldProgramFile( + SwaggerThemeMode swaggerThemeMode); + + void ScaffoldStartupFile(); + + void ScaffoldWebConfig(); + + void MaintainGlobalUsings( + bool removeNamespaceGroupSeparatorInGlobalUsings); + + void MaintainWwwResources(); +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework/ProjectGenerator/IServerHostTestGenerator.cs b/src/Atc.Rest.ApiGenerator.Framework/ProjectGenerator/IServerHostTestGenerator.cs new file mode 100644 index 00000000..2cbedf16 --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Framework/ProjectGenerator/IServerHostTestGenerator.cs @@ -0,0 +1,29 @@ +namespace Atc.Rest.ApiGenerator.Framework.ProjectGenerator; + +/// +/// Interface: IServerHostGenerator +/// +/// +/// Method prefixes: +/// - Generate => Generate file and overwrite file if exists. +/// - Scaffold => Generate file if not exists. +/// - Maintain => Update file. +/// +public interface IServerHostTestGenerator +{ + Task ScaffoldProjectFile(); + + void ScaffoldAppSettingsIntegrationTestFile(); + + void GenerateWebApiStartupFactoryFile(); + + void GenerateWebApiControllerBaseTestFile(); + + void GenerateEndpointHandlerStubs(); + + void GenerateEndpointTests(); + + void MaintainGlobalUsings( + bool usingCodingRules, + bool removeNamespaceGroupSeparatorInGlobalUsings); +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework/ProjectGenerator/ServerDomainTestGenerator.cs b/src/Atc.Rest.ApiGenerator.Framework/ProjectGenerator/ServerDomainTestGenerator.cs new file mode 100644 index 00000000..9d35bc99 --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Framework/ProjectGenerator/ServerDomainTestGenerator.cs @@ -0,0 +1,145 @@ +// ReSharper disable ArrangeObjectCreationWhenTypeNotEvident +namespace Atc.Rest.ApiGenerator.Framework.ProjectGenerator; + +public class ServerDomainTestGenerator : IServerDomainTestGenerator +{ + private readonly ILogger logger; + private readonly INugetPackageReferenceProvider nugetPackageReferenceProvider; + private readonly string projectName; + private readonly string apiProjectName; + private readonly string domainProjectName; + private readonly DirectoryInfo projectPath; + private readonly OpenApiDocument openApiDocument; + + public ServerDomainTestGenerator( + ILoggerFactory loggerFactory, + INugetPackageReferenceProvider nugetPackageReferenceProvider, + Version apiGeneratorVersion, + string projectName, + string apiProjectName, + string domainProjectName, + DirectoryInfo projectPath, + OpenApiDocument openApiDocument) + { + ArgumentNullException.ThrowIfNull(loggerFactory); + ArgumentNullException.ThrowIfNull(nugetPackageReferenceProvider); + ArgumentNullException.ThrowIfNull(apiGeneratorVersion); + ArgumentNullException.ThrowIfNull(projectName); + ArgumentNullException.ThrowIfNull(apiProjectName); + ArgumentNullException.ThrowIfNull(domainProjectName); + ArgumentNullException.ThrowIfNull(projectPath); + ArgumentNullException.ThrowIfNull(openApiDocument); + + logger = loggerFactory.CreateLogger(); + this.nugetPackageReferenceProvider = nugetPackageReferenceProvider; + this.projectName = projectName; + this.apiProjectName = apiProjectName; + this.domainProjectName = domainProjectName; + this.projectPath = projectPath; + this.openApiDocument = openApiDocument; + } + + public async Task ScaffoldProjectFile() + { + var packageReferences = await nugetPackageReferenceProvider.GetPackageReferencesForTestDomainProjectForMvc(); + + var itemGroupPackageReferences = packageReferences + .Select(packageReference => new ItemGroupParameter( + "PackageReference", + [ + new("Include", packageReference.PackageId), + new("Version", packageReference.PackageVersion), + ], + Value: packageReference.SubElements)) + .ToList(); + + var projectFileParameters = new ProjectFileParameters( + "Microsoft.NET.Sdk", + [ + [ + new("TargetFramework", Attributes: null, "net8.0"), + ], + ], + [ + itemGroupPackageReferences, + [ + new( + "ProjectReference", + [ + new("Include", @$"..\..\src\{apiProjectName}\{apiProjectName}.csproj"), + ], + Value: null), + new( + "ProjectReference", + [ + new("Include", @$"..\..\src\{domainProjectName}\{domainProjectName}.csproj"), + ], + Value: null), + ], + ]); + + var contentGenerator = new GenerateContentForProjectFile( + projectFileParameters); + + var content = contentGenerator.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + projectPath, + projectPath.CombineFileInfo($"{projectName}.csproj"), + ContentWriterArea.Src, + content, + overrideIfExist: false); + } + + public void ScaffoldHandlers() + { + foreach (var urlPath in openApiDocument.Paths) + { + var apiGroupName = urlPath.GetApiGroupName(); + + foreach (var openApiOperation in urlPath.Value.Operations) + { + var fullNamespace = $"{projectName}.{ContentGeneratorConstants.Handlers}.{apiGroupName}"; + + var classParameters = ContentGeneratorServerHandlerParametersTestFactory.CreateForCustomTest( + fullNamespace, + openApiOperation.Value); + + var contentGenerator = new GenerateContentForClass( + new CodeDocumentationTagsGenerator(), + classParameters); + + var content = contentGenerator.Generate(); + + var contentWriter = new ContentWriter(logger); + contentWriter.Write( + projectPath, + projectPath.CombineFileInfo( + ContentGeneratorConstants.Handlers, + apiGroupName, + $"{classParameters.TypeName}.cs"), + ContentWriterArea.Test, + content, + overrideIfExist: false); + } + } + } + + public void MaintainGlobalUsings( + bool usingCodingRules, + bool removeNamespaceGroupSeparatorInGlobalUsings) + { + var requiredUsings = new List + { + "Xunit", + }; + + GlobalUsingsHelper.CreateOrUpdate( + logger, + ContentWriterArea.Test, + projectPath, + requiredUsings, + removeNamespaceGroupSeparatorInGlobalUsings); + } +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework/Providers/INugetPackageReferenceProvider.cs b/src/Atc.Rest.ApiGenerator.Framework/Providers/INugetPackageReferenceProvider.cs new file mode 100644 index 00000000..3bea2a33 --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Framework/Providers/INugetPackageReferenceProvider.cs @@ -0,0 +1,29 @@ +namespace Atc.Rest.ApiGenerator.Framework.Providers; + +public interface INugetPackageReferenceProvider +{ + Task GetAtcApiGeneratorVersion(); + + Task> GetPackageReferencesForHostProjectForMvc( + bool useRestExtended); + + Task> GetPackageReferencesForHostProjectForMinimalApi(); + + Task> GetPackageReferencesForApiProjectForMvc(); + + Task> GetPackageReferencesForApiProjectForMinimalApi(); + + Task?> GetPackageReferencesForDomainProjectForMvc(); + + Task?> GetPackageReferencesForDomainProjectForMinimalApi(); + + Task> GetPackageReferencesForApiClientProject(); + + Task> GetPackageReferencesForTestHostProjectForMvc(); + + Task> GetPackageReferencesForTestHostProjectForMinimalApi(); + + Task> GetPackageReferencesForTestDomainProjectForMvc(); + + Task> GetPackageReferencesForTestDomainProjectForMinimalApi(); +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework/Providers/NugetPackageReferenceProvider.cs b/src/Atc.Rest.ApiGenerator.Framework/Providers/NugetPackageReferenceProvider.cs new file mode 100644 index 00000000..8fa36ded --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Framework/Providers/NugetPackageReferenceProvider.cs @@ -0,0 +1,247 @@ +namespace Atc.Rest.ApiGenerator.Framework.Providers; + +[SuppressMessage("Major Code Smell", "S4144:Methods should not have identical implementations", Justification = "OK - for now")] +public class NugetPackageReferenceProvider( + IAtcApiNugetClient atcApiNugetClient) + : INugetPackageReferenceProvider +{ + private Dictionary PackageDefaultVersions { get; } = new(StringComparer.Ordinal) + { + { "Asp.Versioning.Http", "8.1.0" }, + { "Atc", "2.0.472" }, + { "Atc.Azure.Options", "3.0.31" }, + { "Atc.Rest", "2.0.472" }, + { "Atc.Rest.Client", "1.0.36" }, + { "Atc.Rest.Extended", "2.0.472" }, + { "Atc.Rest.FluentAssertions", "2.0.472" }, + { "Atc.Rest.MinimalApi", "1.0.81" }, + { "Atc.XUnit", "2.0.472" }, + { "AutoFixture", "4.18.1" }, + { "AutoFixture.AutoNSubstitute", "4.18.1" }, + { "AutoFixture.Xunit2", "4.18.1" }, + { "FluentAssertions", "6.12.0" }, + { "FluentValidation.AspNetCore", "11.3.0" }, + { "Microsoft.ApplicationInsights.AspNetCore", "2.22.0" }, + { "Microsoft.AspNetCore.Authentication.JwtBearer", "8.0.4" }, + { "Microsoft.AspNetCore.OpenApi", "8.0.6" }, + { "Microsoft.AspNetCore.Mvc.Testing", "8.0.6" }, + { "Microsoft.NETCore.Platforms", "7.0.4" }, + { "Microsoft.NET.Test.Sdk", "17.10.0" }, + { "NSubstitute", "5.1.0" }, + { "Swashbuckle.AspNetCore", "6.6.2" }, + { "xunit", "2.8.1" }, + { "xunit.runner.visualstudio", "2.8.1" }, + }; + + public async Task GetAtcApiGeneratorVersion() + { + var version = await atcApiNugetClient.RetrieveLatestVersionForPackageId( + "Atc.Rest.ApiGenerator", + CancellationToken.None) ?? new Version(2, 0, 360, 0); + + var assemblyVersion = CliHelper.GetCurrentVersion(); + + return assemblyVersion.GreaterThan(version) + ? assemblyVersion + : new Version(2, 0, 360, 0); + } + + public async Task> GetPackageReferencesForHostProjectForMvc( + bool useRestExtended) + { + var atcVersion = await GetAtcVersionAsString3(); + + if (useRestExtended) + { + var packageReferences = new List<(string, string)> + { + ("Asp.Versioning.Http", PackageDefaultVersions["Asp.Versioning.Http"]), + ("Atc", atcVersion), + ("Atc.Rest.Extended", atcVersion), + ("Atc.Rest.MinimalApi", "1.0.81"), + ("Microsoft.NETCore.Platforms", PackageDefaultVersions["Microsoft.NETCore.Platforms"]), + ("Swashbuckle.AspNetCore", PackageDefaultVersions["Swashbuckle.AspNetCore"]), + }; + + return packageReferences; + } + else + { + var packageReferences = new List<(string, string)> + { + new("Atc", atcVersion), + new("Atc.Rest", atcVersion), + }; + + return packageReferences; + } + } + + public async Task> GetPackageReferencesForHostProjectForMinimalApi() + { + var atcVersion = await GetAtcVersionAsString3(); + + var packageReferences = new List<(string, string)> + { + new("Asp.Versioning.Http", PackageDefaultVersions["Asp.Versioning.Http"]), + new("Atc", atcVersion), + new("Atc.Rest.MinimalApi", PackageDefaultVersions["Atc.Rest.MinimalApi"]), + new("Microsoft.NETCore.Platforms", PackageDefaultVersions["Microsoft.NETCore.Platforms"]), + new("Swashbuckle.AspNetCore", PackageDefaultVersions["Swashbuckle.AspNetCore"]), + }; + + return packageReferences; + } + + public async Task> GetPackageReferencesForApiProjectForMvc() + { + var atcVersion = await GetAtcVersionAsString3(); + + var packageReferences = new List<(string, string)> + { + new("Asp.Versioning.Http", PackageDefaultVersions["Asp.Versioning.Http"]), + new("Atc", atcVersion), + new("Atc.Rest", atcVersion), + new("FluentValidation.AspNetCore", PackageDefaultVersions["FluentValidation.AspNetCore"]), + new("Microsoft.AspNetCore.OpenApi", PackageDefaultVersions["Microsoft.AspNetCore.OpenApi"]), + new("Microsoft.NETCore.Platforms", PackageDefaultVersions["Microsoft.NETCore.Platforms"]), + }; + + return packageReferences; + } + + public async Task> GetPackageReferencesForApiProjectForMinimalApi() + { + var atcVersion = await GetAtcVersionAsString3(); + + var packageReferences = new List<(string, string)> + { + new("Asp.Versioning.Http", PackageDefaultVersions["Asp.Versioning.Http"]), + new("Atc", atcVersion), + new("Atc.Rest", atcVersion), + new("Atc.Rest.MinimalApi", PackageDefaultVersions["Atc.Rest.MinimalApi"]), + new("FluentValidation.AspNetCore", PackageDefaultVersions["FluentValidation.AspNetCore"]), + new("Microsoft.AspNetCore.OpenApi", PackageDefaultVersions["Microsoft.AspNetCore.OpenApi"]), + new("Microsoft.NETCore.Platforms", PackageDefaultVersions["Microsoft.NETCore.Platforms"]), + }; + + return packageReferences; + } + + public async Task?> GetPackageReferencesForDomainProjectForMvc() + { + var packageReferences = new List<(string, string)>(); + + await Task.CompletedTask; + + return packageReferences; + } + + public async Task?> GetPackageReferencesForDomainProjectForMinimalApi() + { + var atcVersion = await GetAtcVersionAsString3(); + + var packageReferences = new List<(string, string)> + { + new("Atc.Azure.Options", PackageDefaultVersions["Atc.Azure.Options"]), + new("Atc.Rest", atcVersion), + }; + + return packageReferences; + } + + public async Task> GetPackageReferencesForApiClientProject() + { + var atcVersion = await GetAtcVersionAsString3(); + + var packageReferences = new List<(string, string, string?)> + { + new("Atc", atcVersion, null), + new("Atc.Rest", atcVersion, null), + new("Atc.Rest.Client", PackageDefaultVersions["Atc.Rest.Client"], null), + }; + + return packageReferences; + } + + public async Task> GetPackageReferencesForTestHostProjectForMvc() + { + var atcVersion = await GetAtcVersionAsString3(); + + var packageReferences = new List<(string, string, string?)> + { + new("Atc.Rest.FluentAssertions", atcVersion, null), + new("Atc.XUnit", atcVersion, null), + new("Microsoft.AspNetCore.Mvc.Testing", PackageDefaultVersions["Microsoft.AspNetCore.Mvc.Testing"], null), + new("Microsoft.NET.Test.Sdk", PackageDefaultVersions["Microsoft.NET.Test.Sdk"], null), + new("xunit", PackageDefaultVersions["xunit"], null), + new("xunit.runner.visualstudio", PackageDefaultVersions["xunit.runner.visualstudio"], "all\nruntime; build; native; contentfiles; analyzers; buildtransitive"), + }; + + return packageReferences; + } + + public async Task> GetPackageReferencesForTestHostProjectForMinimalApi() + { + var atcVersion = await GetAtcVersionAsString3(); + + var packageReferences = new List<(string, string, string?)> + { + new("Atc.Rest.FluentAssertions", atcVersion, null), + new("Atc.XUnit", atcVersion, null), + new("AutoFixture", PackageDefaultVersions["AutoFixture"], null), + new("AutoFixture.AutoNSubstitute", PackageDefaultVersions["AutoFixture.AutoNSubstitute"], null), + new("AutoFixture.Xunit2", PackageDefaultVersions["AutoFixture.Xunit2"], null), + new("FluentAssertions", PackageDefaultVersions["FluentAssertions"], null), + new("Microsoft.NET.Test.Sdk", PackageDefaultVersions["Microsoft.NET.Test.Sdk"], null), + new("xunit", PackageDefaultVersions["xunit"], null), + new("xunit.runner.visualstudio", PackageDefaultVersions["xunit.runner.visualstudio"], "all\nruntime; build; native; contentfiles; analyzers; buildtransitive"), + }; + + return packageReferences; + } + + public async Task> GetPackageReferencesForTestDomainProjectForMvc() + { + var atcVersion = await GetAtcVersionAsString3(); + + var packageReferences = new List<(string, string, string?)> + { + new("Atc.XUnit", atcVersion, null), + new("AutoFixture", PackageDefaultVersions["AutoFixture"], null), + new("AutoFixture.AutoNSubstitute", PackageDefaultVersions["AutoFixture.AutoNSubstitute"], null), + new("AutoFixture.Xunit2", PackageDefaultVersions["AutoFixture.Xunit2"], null), + new("FluentAssertions", PackageDefaultVersions["FluentAssertions"], null), + new("Microsoft.AspNetCore.Mvc.Testing", PackageDefaultVersions["Microsoft.AspNetCore.Mvc.Testing"], null), + new("Microsoft.NET.Test.Sdk", PackageDefaultVersions["Microsoft.NET.Test.Sdk"], null), + new("NSubstitute", PackageDefaultVersions["NSubstitute"], null), + new("xunit", PackageDefaultVersions["xunit"], null), + new("xunit.runner.visualstudio", PackageDefaultVersions["xunit.runner.visualstudio"], "all\nruntime; build; native; contentfiles; analyzers; buildtransitive"), + }; + + return packageReferences; + } + + public async Task> GetPackageReferencesForTestDomainProjectForMinimalApi() + { + var packageReferences = new List<(string, string, string?)>(); + + await Task.CompletedTask; + + return packageReferences; + } + + private async Task GetAtcVersion() + { + var version = await atcApiNugetClient.RetrieveLatestVersionForPackageId( + "Atc", + CancellationToken.None); + return version ?? new Version(PackageDefaultVersions["Atc"]); + } + + private async Task GetAtcVersionAsString3() + { + var atcVersion = await GetAtcVersion(); + return $"{atcVersion.Major}.{atcVersion.Minor}.{atcVersion.Build}"; + } +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Framework/Readers/ApiSpecificationContentReader.cs b/src/Atc.Rest.ApiGenerator.Framework/Readers/ApiSpecificationContentReader.cs index 113f04e2..6af1418f 100644 --- a/src/Atc.Rest.ApiGenerator.Framework/Readers/ApiSpecificationContentReader.cs +++ b/src/Atc.Rest.ApiGenerator.Framework/Readers/ApiSpecificationContentReader.cs @@ -38,27 +38,40 @@ public OpenApiDocumentContainer CombineAndGetApiDocumentContainer( } else { - // Find all yaml files, except files starting with '.' as example '.spectral.yaml' - var docFiles = Directory - .GetFiles(specificationPath, "*.yaml", SearchOption.AllDirectories) - .Where(x => !x.Contains("\\.", StringComparison.Ordinal)) - .ToArray(); + if (specificationPath.StartsWith("http", StringComparison.CurrentCultureIgnoreCase)) + { + apiDocFile = HttpClientHelper.DownloadToTempFile(logger, specificationPath); - if (docFiles.Length == 0) + if (apiDocFile is null || + !apiDocFile.Exists) + { + throw new IOException("Api file don't exist."); + } + } + else { - // No yaml, then try all json files - docFiles = Directory - .GetFiles(specificationPath, "*.json", SearchOption.AllDirectories) + // Find all yaml files, except files starting with '.' as example '.spectral.yaml' + var docFiles = Directory + .GetFiles(specificationPath, "*.yaml", SearchOption.AllDirectories) .Where(x => !x.Contains("\\.", StringComparison.Ordinal)) .ToArray(); - } - apiDocFile = docFiles.Length switch - { - 0 => throw new IOException("Api specification file don't exist in folder."), - 1 => new FileInfo(docFiles.First()), - _ => CreateCombineApiDocumentFile(specificationPath), - }; + if (docFiles.Length == 0) + { + // No yaml, then try all json files + docFiles = Directory + .GetFiles(specificationPath, "*.json", SearchOption.AllDirectories) + .Where(x => !x.Contains("\\.", StringComparison.Ordinal)) + .ToArray(); + } + + apiDocFile = docFiles.Length switch + { + 0 => throw new IOException("Api specification file don't exist in folder."), + 1 => new FileInfo(docFiles[0]), + _ => CreateCombineApiDocumentFile(specificationPath), + }; + } } if (apiDocFile is not { Exists: true }) diff --git a/src/Atc.Rest.ApiGenerator.Framework/Resources/launchSettings.json b/src/Atc.Rest.ApiGenerator.Framework/Resources/launchSettings.json new file mode 100644 index 00000000..ed9645a7 --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Framework/Resources/launchSettings.json @@ -0,0 +1,27 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:2597", + "sslPort": 44312 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "[[PROJECTNAME]]": { + "commandName": "Project", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "applicationUrl": "https://localhost:5001;http://localhost:5000" + } + } +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator/Resources/launchSettingsExtended.json b/src/Atc.Rest.ApiGenerator.Framework/Resources/launchSettingsExtended.json similarity index 96% rename from src/Atc.Rest.ApiGenerator/Resources/launchSettingsExtended.json rename to src/Atc.Rest.ApiGenerator.Framework/Resources/launchSettingsExtended.json index ba6cf4d0..0a3df470 100644 --- a/src/Atc.Rest.ApiGenerator/Resources/launchSettingsExtended.json +++ b/src/Atc.Rest.ApiGenerator.Framework/Resources/launchSettingsExtended.json @@ -16,7 +16,7 @@ "ASPNETCORE_ENVIRONMENT": "Development" } }, - "Demo.Api": { + "[[PROJECTNAME]]": { "commandName": "Project", "launchBrowser": true, "environmentVariables": { diff --git a/sample/src/Demo.Api.Full/wwwroot/favicon.ico b/src/Atc.Rest.ApiGenerator.Framework/Resources/wwwroot/favicon.ico similarity index 100% rename from sample/src/Demo.Api.Full/wwwroot/favicon.ico rename to src/Atc.Rest.ApiGenerator.Framework/Resources/wwwroot/favicon.ico diff --git a/src/Atc.Rest.ApiGenerator.Framework/Resources/wwwroot/swagger-ui/SwaggerDark.css b/src/Atc.Rest.ApiGenerator.Framework/Resources/wwwroot/swagger-ui/SwaggerDark.css new file mode 100644 index 00000000..ca731450 --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Framework/Resources/wwwroot/swagger-ui/SwaggerDark.css @@ -0,0 +1,11256 @@ +/* Inject clean Swagger Image */ +.topbar-wrapper .link { + background: url(swagger.png); + background-size: contain; + height: 22px; + width: 220px; + background-repeat: no-repeat; + flex: none !important; +} + + /* Remove Existing Swagger/SmartBear image */ + .topbar-wrapper .link img, .topbar-wrapper .link span { + display: none; + } + +/* Dark-Mode */ +html { + background: #1f1f1f; +} + +body { + background: #1f1f1f; +} + +button, input, select, textarea { + background-color: #1f1f1f; + color: #bfbfbf; +} + +.swagger-ui { + color: #b5bac9; + font-family: sans-serif; +} + + .swagger-ui html { + -ms-text-size-adjust: 100%; + -webkit-text-size-adjust: 100%; + line-height: 1.15 + } + + .swagger-ui body { + margin: 0 + } + + .swagger-ui article, .swagger-ui aside, .swagger-ui footer, .swagger-ui header, .swagger-ui nav, .swagger-ui section { + display: block + } + + .swagger-ui h1 { + font-size: 2em; + margin: .67em 0 + } + + .swagger-ui figcaption, .swagger-ui figure, .swagger-ui main { + display: block + } + + .swagger-ui figure { + margin: 1em 40px + } + + .swagger-ui hr { + box-sizing: content-box; + height: 0; + overflow: visible + } + + .swagger-ui pre { + font-family: monospace,monospace; + font-size: 1em + } + + .swagger-ui a { + -webkit-text-decoration-skip: objects; + background-color: transparent + } + + .swagger-ui abbr[title] { + border-bottom: none; + text-decoration: underline; + -webkit-text-decoration: underline dotted; + text-decoration: underline dotted + } + + .swagger-ui b, .swagger-ui strong { + font-weight: inherit; + font-weight: bolder + } + + .swagger-ui code, .swagger-ui kbd, .swagger-ui samp { + font-family: monospace,monospace; + font-size: 1em + } + + .swagger-ui dfn { + font-style: italic + } + + .swagger-ui mark { + background-color: #ff0; + color: #000 + } + + .swagger-ui small { + font-size: 80% + } + + .swagger-ui sub, .swagger-ui sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline + } + + .swagger-ui sub { + bottom: -.25em + } + + .swagger-ui sup { + top: -.5em + } + + .swagger-ui audio, .swagger-ui video { + display: inline-block + } + + .swagger-ui audio:not([controls]) { + display: none; + height: 0 + } + + .swagger-ui img { + border-style: none + } + + .swagger-ui svg:not(:root) { + overflow: hidden + } + + .swagger-ui button, .swagger-ui input, .swagger-ui optgroup, .swagger-ui select, .swagger-ui textarea { + font-family: sans-serif; + font-size: 100%; + line-height: 1.15; + margin: 0 + } + + .swagger-ui button, .swagger-ui input { + overflow: visible + } + + .swagger-ui button, .swagger-ui select { + text-transform: none + } + + .swagger-ui [type=reset], .swagger-ui [type=submit], .swagger-ui button, .swagger-ui html [type=button] { + -webkit-appearance: button + } + + .swagger-ui [type=button]::-moz-focus-inner, .swagger-ui [type=reset]::-moz-focus-inner, .swagger-ui [type=submit]::-moz-focus-inner, .swagger-ui button::-moz-focus-inner { + border-style: none; + padding: 0 + } + + .swagger-ui [type=button]:-moz-focusring, .swagger-ui [type=reset]:-moz-focusring, .swagger-ui [type=submit]:-moz-focusring, .swagger-ui button:-moz-focusring { + outline: 1px dotted ButtonText + } + + .swagger-ui fieldset { + padding: .35em .75em .625em + } + + .swagger-ui legend { + box-sizing: border-box; + color: inherit; + display: table; + max-width: 100%; + padding: 0; + white-space: normal + } + + .swagger-ui progress { + display: inline-block; + vertical-align: baseline + } + + .swagger-ui textarea { + overflow: auto + } + + .swagger-ui [type=checkbox], .swagger-ui [type=radio] { + box-sizing: border-box; + padding: 0 + } + + .swagger-ui [type=number]::-webkit-inner-spin-button, .swagger-ui [type=number]::-webkit-outer-spin-button { + height: auto + } + + .swagger-ui [type=search] { + -webkit-appearance: textfield; + outline-offset: -2px + } + + .swagger-ui [type=search]::-webkit-search-cancel-button, .swagger-ui [type=search]::-webkit-search-decoration { + -webkit-appearance: none + } + + .swagger-ui ::-webkit-file-upload-button { + -webkit-appearance: button; + font: inherit + } + + .swagger-ui details, .swagger-ui menu { + display: block + } + + .swagger-ui summary { + display: list-item + } + + .swagger-ui canvas { + display: inline-block + } + + .swagger-ui [hidden], .swagger-ui template { + display: none + } + + .swagger-ui .debug * { + outline: 1px solid gold + } + + .swagger-ui .debug-white * { + outline: 1px solid #1c1c21 + } + + .swagger-ui .debug-black * { + outline: 1px solid #000 + } + + .swagger-ui .debug-grid { + background: transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTExIDc5LjE1ODMyNSwgMjAxNS8wOS8xMC0wMToxMDoyMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MTRDOTY4N0U2N0VFMTFFNjg2MzZDQjkwNkQ4MjgwMEIiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MTRDOTY4N0Q2N0VFMTFFNjg2MzZDQjkwNkQ4MjgwMEIiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUgKE1hY2ludG9zaCkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo3NjcyQkQ3NjY3QzUxMUU2QjJCQ0UyNDA4MTAwMjE3MSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo3NjcyQkQ3NzY3QzUxMUU2QjJCQ0UyNDA4MTAwMjE3MSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PsBS+GMAAAAjSURBVHjaYvz//z8DLsD4gcGXiYEAGBIKGBne//fFpwAgwAB98AaF2pjlUQAAAABJRU5ErkJggg==) repeat 0 0 + } + + .swagger-ui .debug-grid-16 { + background: transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTExIDc5LjE1ODMyNSwgMjAxNS8wOS8xMC0wMToxMDoyMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6ODYyRjhERDU2N0YyMTFFNjg2MzZDQjkwNkQ4MjgwMEIiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6ODYyRjhERDQ2N0YyMTFFNjg2MzZDQjkwNkQ4MjgwMEIiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUgKE1hY2ludG9zaCkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo3NjcyQkQ3QTY3QzUxMUU2QjJCQ0UyNDA4MTAwMjE3MSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo3NjcyQkQ3QjY3QzUxMUU2QjJCQ0UyNDA4MTAwMjE3MSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PvCS01IAAABMSURBVHjaYmR4/5+BFPBfAMFm/MBgx8RAGWCn1AAmSg34Q6kBDKMGMDCwICeMIemF/5QawEipAWwUhwEjMDvbAWlWkvVBwu8vQIABAEwBCph8U6c0AAAAAElFTkSuQmCC) repeat 0 0 + } + + .swagger-ui .debug-grid-8-solid { + background: #1c1c21 url(data:image/jpeg;base64,/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAAAAAAD/4QMxaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjYtYzExMSA3OS4xNTgzMjUsIDIwMTUvMDkvMTAtMDE6MTA6MjAgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bXA6Q3JlYXRvclRvb2w9IkFkb2JlIFBob3Rvc2hvcCBDQyAyMDE1IChNYWNpbnRvc2gpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkIxMjI0OTczNjdCMzExRTZCMkJDRTI0MDgxMDAyMTcxIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkIxMjI0OTc0NjdCMzExRTZCMkJDRTI0MDgxMDAyMTcxIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6QjEyMjQ5NzE2N0IzMTFFNkIyQkNFMjQwODEwMDIxNzEiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6QjEyMjQ5NzI2N0IzMTFFNkIyQkNFMjQwODEwMDIxNzEiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz7/7gAOQWRvYmUAZMAAAAAB/9sAhAAbGhopHSlBJiZBQi8vL0JHPz4+P0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHAR0pKTQmND8oKD9HPzU/R0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0f/wAARCAAIAAgDASIAAhEBAxEB/8QAWQABAQAAAAAAAAAAAAAAAAAAAAYBAQEAAAAAAAAAAAAAAAAAAAIEEAEBAAMBAAAAAAAAAAAAAAABADECA0ERAAEDBQAAAAAAAAAAAAAAAAARITFBUWESIv/aAAwDAQACEQMRAD8AoOnTV1QTD7JJshP3vSM3P//Z) repeat 0 0 + } + + .swagger-ui .debug-grid-16-solid { + background: #1c1c21 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTExIDc5LjE1ODMyNSwgMjAxNS8wOS8xMC0wMToxMDoyMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NzY3MkJEN0U2N0M1MTFFNkIyQkNFMjQwODEwMDIxNzEiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NzY3MkJEN0Y2N0M1MTFFNkIyQkNFMjQwODEwMDIxNzEiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo3NjcyQkQ3QzY3QzUxMUU2QjJCQ0UyNDA4MTAwMjE3MSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo3NjcyQkQ3RDY3QzUxMUU2QjJCQ0UyNDA4MTAwMjE3MSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pve6J3kAAAAzSURBVHjaYvz//z8D0UDsMwMjSRoYP5Gq4SPNbRjVMEQ1fCRDg+in/6+J1AJUxsgAEGAA31BAJMS0GYEAAAAASUVORK5CYII=) repeat 0 0 + } + + .swagger-ui .border-box, .swagger-ui a, .swagger-ui article, .swagger-ui body, .swagger-ui code, .swagger-ui dd, .swagger-ui div, .swagger-ui dl, .swagger-ui dt, .swagger-ui fieldset, .swagger-ui footer, .swagger-ui form, .swagger-ui h1, .swagger-ui h2, .swagger-ui h3, .swagger-ui h4, .swagger-ui h5, .swagger-ui h6, .swagger-ui header, .swagger-ui html, .swagger-ui input[type=email], .swagger-ui input[type=number], .swagger-ui input[type=password], .swagger-ui input[type=tel], .swagger-ui input[type=text], .swagger-ui input[type=url], .swagger-ui legend, .swagger-ui li, .swagger-ui main, .swagger-ui ol, .swagger-ui p, .swagger-ui pre, .swagger-ui section, .swagger-ui table, .swagger-ui td, .swagger-ui textarea, .swagger-ui th, .swagger-ui tr, .swagger-ui ul { + box-sizing: border-box + } + + .swagger-ui .aspect-ratio { + height: 0; + position: relative + } + + .swagger-ui .aspect-ratio--16x9 { + padding-bottom: 56.25% + } + + .swagger-ui .aspect-ratio--9x16 { + padding-bottom: 177.77% + } + + .swagger-ui .aspect-ratio--4x3 { + padding-bottom: 75% + } + + .swagger-ui .aspect-ratio--3x4 { + padding-bottom: 133.33% + } + + .swagger-ui .aspect-ratio--6x4 { + padding-bottom: 66.6% + } + + .swagger-ui .aspect-ratio--4x6 { + padding-bottom: 150% + } + + .swagger-ui .aspect-ratio--8x5 { + padding-bottom: 62.5% + } + + .swagger-ui .aspect-ratio--5x8 { + padding-bottom: 160% + } + + .swagger-ui .aspect-ratio--7x5 { + padding-bottom: 71.42% + } + + .swagger-ui .aspect-ratio--5x7 { + padding-bottom: 140% + } + + .swagger-ui .aspect-ratio--1x1 { + padding-bottom: 100% + } + + .swagger-ui .aspect-ratio--object { + bottom: 0; + height: 100%; + left: 0; + position: absolute; + right: 0; + top: 0; + width: 100%; + z-index: 100 + } + +@media screen and (min-width: 30em) { + .swagger-ui .aspect-ratio-ns { + height: 0; + position: relative + } + + .swagger-ui .aspect-ratio--16x9-ns { + padding-bottom: 56.25% + } + + .swagger-ui .aspect-ratio--9x16-ns { + padding-bottom: 177.77% + } + + .swagger-ui .aspect-ratio--4x3-ns { + padding-bottom: 75% + } + + .swagger-ui .aspect-ratio--3x4-ns { + padding-bottom: 133.33% + } + + .swagger-ui .aspect-ratio--6x4-ns { + padding-bottom: 66.6% + } + + .swagger-ui .aspect-ratio--4x6-ns { + padding-bottom: 150% + } + + .swagger-ui .aspect-ratio--8x5-ns { + padding-bottom: 62.5% + } + + .swagger-ui .aspect-ratio--5x8-ns { + padding-bottom: 160% + } + + .swagger-ui .aspect-ratio--7x5-ns { + padding-bottom: 71.42% + } + + .swagger-ui .aspect-ratio--5x7-ns { + padding-bottom: 140% + } + + .swagger-ui .aspect-ratio--1x1-ns { + padding-bottom: 100% + } + + .swagger-ui .aspect-ratio--object-ns { + bottom: 0; + height: 100%; + left: 0; + position: absolute; + right: 0; + top: 0; + width: 100%; + z-index: 100 + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .aspect-ratio-m { + height: 0; + position: relative + } + + .swagger-ui .aspect-ratio--16x9-m { + padding-bottom: 56.25% + } + + .swagger-ui .aspect-ratio--9x16-m { + padding-bottom: 177.77% + } + + .swagger-ui .aspect-ratio--4x3-m { + padding-bottom: 75% + } + + .swagger-ui .aspect-ratio--3x4-m { + padding-bottom: 133.33% + } + + .swagger-ui .aspect-ratio--6x4-m { + padding-bottom: 66.6% + } + + .swagger-ui .aspect-ratio--4x6-m { + padding-bottom: 150% + } + + .swagger-ui .aspect-ratio--8x5-m { + padding-bottom: 62.5% + } + + .swagger-ui .aspect-ratio--5x8-m { + padding-bottom: 160% + } + + .swagger-ui .aspect-ratio--7x5-m { + padding-bottom: 71.42% + } + + .swagger-ui .aspect-ratio--5x7-m { + padding-bottom: 140% + } + + .swagger-ui .aspect-ratio--1x1-m { + padding-bottom: 100% + } + + .swagger-ui .aspect-ratio--object-m { + bottom: 0; + height: 100%; + left: 0; + position: absolute; + right: 0; + top: 0; + width: 100%; + z-index: 100 + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .aspect-ratio-l { + height: 0; + position: relative + } + + .swagger-ui .aspect-ratio--16x9-l { + padding-bottom: 56.25% + } + + .swagger-ui .aspect-ratio--9x16-l { + padding-bottom: 177.77% + } + + .swagger-ui .aspect-ratio--4x3-l { + padding-bottom: 75% + } + + .swagger-ui .aspect-ratio--3x4-l { + padding-bottom: 133.33% + } + + .swagger-ui .aspect-ratio--6x4-l { + padding-bottom: 66.6% + } + + .swagger-ui .aspect-ratio--4x6-l { + padding-bottom: 150% + } + + .swagger-ui .aspect-ratio--8x5-l { + padding-bottom: 62.5% + } + + .swagger-ui .aspect-ratio--5x8-l { + padding-bottom: 160% + } + + .swagger-ui .aspect-ratio--7x5-l { + padding-bottom: 71.42% + } + + .swagger-ui .aspect-ratio--5x7-l { + padding-bottom: 140% + } + + .swagger-ui .aspect-ratio--1x1-l { + padding-bottom: 100% + } + + .swagger-ui .aspect-ratio--object-l { + bottom: 0; + height: 100%; + left: 0; + position: absolute; + right: 0; + top: 0; + width: 100%; + z-index: 100 + } +} + +.swagger-ui img { + max-width: 100% +} + +.swagger-ui .cover { + background-size: cover !important +} + +.swagger-ui .contain { + background-size: contain !important +} + +@media screen and (min-width: 30em) { + .swagger-ui .cover-ns { + background-size: cover !important + } + + .swagger-ui .contain-ns { + background-size: contain !important + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .cover-m { + background-size: cover !important + } + + .swagger-ui .contain-m { + background-size: contain !important + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .cover-l { + background-size: cover !important + } + + .swagger-ui .contain-l { + background-size: contain !important + } +} + +.swagger-ui .bg-center { + background-position: 50%; + background-repeat: no-repeat +} + +.swagger-ui .bg-top { + background-position: top; + background-repeat: no-repeat +} + +.swagger-ui .bg-right { + background-position: 100%; + background-repeat: no-repeat +} + +.swagger-ui .bg-bottom { + background-position: bottom; + background-repeat: no-repeat +} + +.swagger-ui .bg-left { + background-position: 0; + background-repeat: no-repeat +} + +@media screen and (min-width: 30em) { + .swagger-ui .bg-center-ns { + background-position: 50%; + background-repeat: no-repeat + } + + .swagger-ui .bg-top-ns { + background-position: top; + background-repeat: no-repeat + } + + .swagger-ui .bg-right-ns { + background-position: 100%; + background-repeat: no-repeat + } + + .swagger-ui .bg-bottom-ns { + background-position: bottom; + background-repeat: no-repeat + } + + .swagger-ui .bg-left-ns { + background-position: 0; + background-repeat: no-repeat + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .bg-center-m { + background-position: 50%; + background-repeat: no-repeat + } + + .swagger-ui .bg-top-m { + background-position: top; + background-repeat: no-repeat + } + + .swagger-ui .bg-right-m { + background-position: 100%; + background-repeat: no-repeat + } + + .swagger-ui .bg-bottom-m { + background-position: bottom; + background-repeat: no-repeat + } + + .swagger-ui .bg-left-m { + background-position: 0; + background-repeat: no-repeat + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .bg-center-l { + background-position: 50%; + background-repeat: no-repeat + } + + .swagger-ui .bg-top-l { + background-position: top; + background-repeat: no-repeat + } + + .swagger-ui .bg-right-l { + background-position: 100%; + background-repeat: no-repeat + } + + .swagger-ui .bg-bottom-l { + background-position: bottom; + background-repeat: no-repeat + } + + .swagger-ui .bg-left-l { + background-position: 0; + background-repeat: no-repeat + } +} + +.swagger-ui .outline { + outline: 1px solid +} + +.swagger-ui .outline-transparent { + outline: 1px solid transparent +} + +.swagger-ui .outline-0 { + outline: 0 +} + +@media screen and (min-width: 30em) { + .swagger-ui .outline-ns { + outline: 1px solid + } + + .swagger-ui .outline-transparent-ns { + outline: 1px solid transparent + } + + .swagger-ui .outline-0-ns { + outline: 0 + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .outline-m { + outline: 1px solid + } + + .swagger-ui .outline-transparent-m { + outline: 1px solid transparent + } + + .swagger-ui .outline-0-m { + outline: 0 + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .outline-l { + outline: 1px solid + } + + .swagger-ui .outline-transparent-l { + outline: 1px solid transparent + } + + .swagger-ui .outline-0-l { + outline: 0 + } +} + +.swagger-ui .ba { + border-style: solid; + border-width: 1px +} + +.swagger-ui .bt { + border-top-style: solid; + border-top-width: 1px +} + +.swagger-ui .br { + border-right-style: solid; + border-right-width: 1px +} + +.swagger-ui .bb { + border-bottom-style: solid; + border-bottom-width: 1px +} + +.swagger-ui .bl { + border-left-style: solid; + border-left-width: 1px +} + +.swagger-ui .bn { + border-style: none; + border-width: 0 +} + +@media screen and (min-width: 30em) { + .swagger-ui .ba-ns { + border-style: solid; + border-width: 1px + } + + .swagger-ui .bt-ns { + border-top-style: solid; + border-top-width: 1px + } + + .swagger-ui .br-ns { + border-right-style: solid; + border-right-width: 1px + } + + .swagger-ui .bb-ns { + border-bottom-style: solid; + border-bottom-width: 1px + } + + .swagger-ui .bl-ns { + border-left-style: solid; + border-left-width: 1px + } + + .swagger-ui .bn-ns { + border-style: none; + border-width: 0 + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .ba-m { + border-style: solid; + border-width: 1px + } + + .swagger-ui .bt-m { + border-top-style: solid; + border-top-width: 1px + } + + .swagger-ui .br-m { + border-right-style: solid; + border-right-width: 1px + } + + .swagger-ui .bb-m { + border-bottom-style: solid; + border-bottom-width: 1px + } + + .swagger-ui .bl-m { + border-left-style: solid; + border-left-width: 1px + } + + .swagger-ui .bn-m { + border-style: none; + border-width: 0 + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .ba-l { + border-style: solid; + border-width: 1px + } + + .swagger-ui .bt-l { + border-top-style: solid; + border-top-width: 1px + } + + .swagger-ui .br-l { + border-right-style: solid; + border-right-width: 1px + } + + .swagger-ui .bb-l { + border-bottom-style: solid; + border-bottom-width: 1px + } + + .swagger-ui .bl-l { + border-left-style: solid; + border-left-width: 1px + } + + .swagger-ui .bn-l { + border-style: none; + border-width: 0 + } +} + +.swagger-ui .b--black { + border-color: #000 +} + +.swagger-ui .b--near-black { + border-color: #111 +} + +.swagger-ui .b--dark-gray { + border-color: #333 +} + +.swagger-ui .b--mid-gray { + border-color: #555 +} + +.swagger-ui .b--gray { + border-color: #777 +} + +.swagger-ui .b--silver { + border-color: #999 +} + +.swagger-ui .b--light-silver { + border-color: #aaa +} + +.swagger-ui .b--moon-gray { + border-color: #ccc +} + +.swagger-ui .b--light-gray { + border-color: #eee +} + +.swagger-ui .b--near-white { + border-color: #f4f4f4 +} + +.swagger-ui .b--white { + border-color: #1c1c21 +} + +.swagger-ui .b--white-90 { + border-color: hsla(0,0%,100%,.9) +} + +.swagger-ui .b--white-80 { + border-color: hsla(0,0%,100%,.8) +} + +.swagger-ui .b--white-70 { + border-color: hsla(0,0%,100%,.7) +} + +.swagger-ui .b--white-60 { + border-color: hsla(0,0%,100%,.6) +} + +.swagger-ui .b--white-50 { + border-color: hsla(0,0%,100%,.5) +} + +.swagger-ui .b--white-40 { + border-color: hsla(0,0%,100%,.4) +} + +.swagger-ui .b--white-30 { + border-color: hsla(0,0%,100%,.3) +} + +.swagger-ui .b--white-20 { + border-color: hsla(0,0%,100%,.2) +} + +.swagger-ui .b--white-10 { + border-color: hsla(0,0%,100%,.1) +} + +.swagger-ui .b--white-05 { + border-color: hsla(0,0%,100%,.05) +} + +.swagger-ui .b--white-025 { + border-color: hsla(0,0%,100%,.025) +} + +.swagger-ui .b--white-0125 { + border-color: hsla(0,0%,100%,.013) +} + +.swagger-ui .b--black-90 { + border-color: rgba(0,0,0,.9) +} + +.swagger-ui .b--black-80 { + border-color: rgba(0,0,0,.8) +} + +.swagger-ui .b--black-70 { + border-color: rgba(0,0,0,.7) +} + +.swagger-ui .b--black-60 { + border-color: rgba(0,0,0,.6) +} + +.swagger-ui .b--black-50 { + border-color: rgba(0,0,0,.5) +} + +.swagger-ui .b--black-40 { + border-color: rgba(0,0,0,.4) +} + +.swagger-ui .b--black-30 { + border-color: rgba(0,0,0,.3) +} + +.swagger-ui .b--black-20 { + border-color: rgba(0,0,0,.2) +} + +.swagger-ui .b--black-10 { + border-color: rgba(0,0,0,.1) +} + +.swagger-ui .b--black-05 { + border-color: rgba(0,0,0,.05) +} + +.swagger-ui .b--black-025 { + border-color: rgba(0,0,0,.025) +} + +.swagger-ui .b--black-0125 { + border-color: rgba(0,0,0,.013) +} + +.swagger-ui .b--dark-red { + border-color: #e7040f +} + +.swagger-ui .b--red { + border-color: #ff4136 +} + +.swagger-ui .b--light-red { + border-color: #ff725c +} + +.swagger-ui .b--orange { + border-color: #ff6300 +} + +.swagger-ui .b--gold { + border-color: #ffb700 +} + +.swagger-ui .b--yellow { + border-color: gold +} + +.swagger-ui .b--light-yellow { + border-color: #fbf1a9 +} + +.swagger-ui .b--purple { + border-color: #5e2ca5 +} + +.swagger-ui .b--light-purple { + border-color: #a463f2 +} + +.swagger-ui .b--dark-pink { + border-color: #d5008f +} + +.swagger-ui .b--hot-pink { + border-color: #ff41b4 +} + +.swagger-ui .b--pink { + border-color: #ff80cc +} + +.swagger-ui .b--light-pink { + border-color: #ffa3d7 +} + +.swagger-ui .b--dark-green { + border-color: #137752 +} + +.swagger-ui .b--green { + border-color: #19a974 +} + +.swagger-ui .b--light-green { + border-color: #9eebcf +} + +.swagger-ui .b--navy { + border-color: #001b44 +} + +.swagger-ui .b--dark-blue { + border-color: #00449e +} + +.swagger-ui .b--blue { + border-color: #357edd +} + +.swagger-ui .b--light-blue { + border-color: #96ccff +} + +.swagger-ui .b--lightest-blue { + border-color: #cdecff +} + +.swagger-ui .b--washed-blue { + border-color: #f6fffe +} + +.swagger-ui .b--washed-green { + border-color: #e8fdf5 +} + +.swagger-ui .b--washed-yellow { + border-color: #1c1c21ceb +} + +.swagger-ui .b--washed-red { + border-color: #ffdfdf +} + +.swagger-ui .b--transparent { + border-color: transparent +} + +.swagger-ui .b--inherit { + border-color: inherit +} + +.swagger-ui .br0 { + border-radius: 0 +} + +.swagger-ui .br1 { + border-radius: .125rem +} + +.swagger-ui .br2 { + border-radius: .25rem +} + +.swagger-ui .br3 { + border-radius: .5rem +} + +.swagger-ui .br4 { + border-radius: 1rem +} + +.swagger-ui .br-100 { + border-radius: 100% +} + +.swagger-ui .br-pill { + border-radius: 9999px +} + +.swagger-ui .br--bottom { + border-top-left-radius: 0; + border-top-right-radius: 0 +} + +.swagger-ui .br--top { + border-bottom-left-radius: 0; + border-bottom-right-radius: 0 +} + +.swagger-ui .br--right { + border-bottom-left-radius: 0; + border-top-left-radius: 0 +} + +.swagger-ui .br--left { + border-bottom-right-radius: 0; + border-top-right-radius: 0 +} + +@media screen and (min-width: 30em) { + .swagger-ui .br0-ns { + border-radius: 0 + } + + .swagger-ui .br1-ns { + border-radius: .125rem + } + + .swagger-ui .br2-ns { + border-radius: .25rem + } + + .swagger-ui .br3-ns { + border-radius: .5rem + } + + .swagger-ui .br4-ns { + border-radius: 1rem + } + + .swagger-ui .br-100-ns { + border-radius: 100% + } + + .swagger-ui .br-pill-ns { + border-radius: 9999px + } + + .swagger-ui .br--bottom-ns { + border-top-left-radius: 0; + border-top-right-radius: 0 + } + + .swagger-ui .br--top-ns { + border-bottom-left-radius: 0; + border-bottom-right-radius: 0 + } + + .swagger-ui .br--right-ns { + border-bottom-left-radius: 0; + border-top-left-radius: 0 + } + + .swagger-ui .br--left-ns { + border-bottom-right-radius: 0; + border-top-right-radius: 0 + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .br0-m { + border-radius: 0 + } + + .swagger-ui .br1-m { + border-radius: .125rem + } + + .swagger-ui .br2-m { + border-radius: .25rem + } + + .swagger-ui .br3-m { + border-radius: .5rem + } + + .swagger-ui .br4-m { + border-radius: 1rem + } + + .swagger-ui .br-100-m { + border-radius: 100% + } + + .swagger-ui .br-pill-m { + border-radius: 9999px + } + + .swagger-ui .br--bottom-m { + border-top-left-radius: 0; + border-top-right-radius: 0 + } + + .swagger-ui .br--top-m { + border-bottom-left-radius: 0; + border-bottom-right-radius: 0 + } + + .swagger-ui .br--right-m { + border-bottom-left-radius: 0; + border-top-left-radius: 0 + } + + .swagger-ui .br--left-m { + border-bottom-right-radius: 0; + border-top-right-radius: 0 + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .br0-l { + border-radius: 0 + } + + .swagger-ui .br1-l { + border-radius: .125rem + } + + .swagger-ui .br2-l { + border-radius: .25rem + } + + .swagger-ui .br3-l { + border-radius: .5rem + } + + .swagger-ui .br4-l { + border-radius: 1rem + } + + .swagger-ui .br-100-l { + border-radius: 100% + } + + .swagger-ui .br-pill-l { + border-radius: 9999px + } + + .swagger-ui .br--bottom-l { + border-top-left-radius: 0; + border-top-right-radius: 0 + } + + .swagger-ui .br--top-l { + border-bottom-left-radius: 0; + border-bottom-right-radius: 0 + } + + .swagger-ui .br--right-l { + border-bottom-left-radius: 0; + border-top-left-radius: 0 + } + + .swagger-ui .br--left-l { + border-bottom-right-radius: 0; + border-top-right-radius: 0 + } +} + +.swagger-ui .b--dotted { + border-style: dotted +} + +.swagger-ui .b--dashed { + border-style: dashed +} + +.swagger-ui .b--solid { + border-style: solid +} + +.swagger-ui .b--none { + border-style: none +} + +@media screen and (min-width: 30em) { + .swagger-ui .b--dotted-ns { + border-style: dotted + } + + .swagger-ui .b--dashed-ns { + border-style: dashed + } + + .swagger-ui .b--solid-ns { + border-style: solid + } + + .swagger-ui .b--none-ns { + border-style: none + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .b--dotted-m { + border-style: dotted + } + + .swagger-ui .b--dashed-m { + border-style: dashed + } + + .swagger-ui .b--solid-m { + border-style: solid + } + + .swagger-ui .b--none-m { + border-style: none + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .b--dotted-l { + border-style: dotted + } + + .swagger-ui .b--dashed-l { + border-style: dashed + } + + .swagger-ui .b--solid-l { + border-style: solid + } + + .swagger-ui .b--none-l { + border-style: none + } +} + +.swagger-ui .bw0 { + border-width: 0 +} + +.swagger-ui .bw1 { + border-width: .125rem +} + +.swagger-ui .bw2 { + border-width: .25rem +} + +.swagger-ui .bw3 { + border-width: .5rem +} + +.swagger-ui .bw4 { + border-width: 1rem +} + +.swagger-ui .bw5 { + border-width: 2rem +} + +.swagger-ui .bt-0 { + border-top-width: 0 +} + +.swagger-ui .br-0 { + border-right-width: 0 +} + +.swagger-ui .bb-0 { + border-bottom-width: 0 +} + +.swagger-ui .bl-0 { + border-left-width: 0 +} + +@media screen and (min-width: 30em) { + .swagger-ui .bw0-ns { + border-width: 0 + } + + .swagger-ui .bw1-ns { + border-width: .125rem + } + + .swagger-ui .bw2-ns { + border-width: .25rem + } + + .swagger-ui .bw3-ns { + border-width: .5rem + } + + .swagger-ui .bw4-ns { + border-width: 1rem + } + + .swagger-ui .bw5-ns { + border-width: 2rem + } + + .swagger-ui .bt-0-ns { + border-top-width: 0 + } + + .swagger-ui .br-0-ns { + border-right-width: 0 + } + + .swagger-ui .bb-0-ns { + border-bottom-width: 0 + } + + .swagger-ui .bl-0-ns { + border-left-width: 0 + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .bw0-m { + border-width: 0 + } + + .swagger-ui .bw1-m { + border-width: .125rem + } + + .swagger-ui .bw2-m { + border-width: .25rem + } + + .swagger-ui .bw3-m { + border-width: .5rem + } + + .swagger-ui .bw4-m { + border-width: 1rem + } + + .swagger-ui .bw5-m { + border-width: 2rem + } + + .swagger-ui .bt-0-m { + border-top-width: 0 + } + + .swagger-ui .br-0-m { + border-right-width: 0 + } + + .swagger-ui .bb-0-m { + border-bottom-width: 0 + } + + .swagger-ui .bl-0-m { + border-left-width: 0 + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .bw0-l { + border-width: 0 + } + + .swagger-ui .bw1-l { + border-width: .125rem + } + + .swagger-ui .bw2-l { + border-width: .25rem + } + + .swagger-ui .bw3-l { + border-width: .5rem + } + + .swagger-ui .bw4-l { + border-width: 1rem + } + + .swagger-ui .bw5-l { + border-width: 2rem + } + + .swagger-ui .bt-0-l { + border-top-width: 0 + } + + .swagger-ui .br-0-l { + border-right-width: 0 + } + + .swagger-ui .bb-0-l { + border-bottom-width: 0 + } + + .swagger-ui .bl-0-l { + border-left-width: 0 + } +} + +.swagger-ui .shadow-1 { + box-shadow: 0 0 4px 2px rgba(0,0,0,.2) +} + +.swagger-ui .shadow-2 { + box-shadow: 0 0 8px 2px rgba(0,0,0,.2) +} + +.swagger-ui .shadow-3 { + box-shadow: 2px 2px 4px 2px rgba(0,0,0,.2) +} + +.swagger-ui .shadow-4 { + box-shadow: 2px 2px 8px 0 rgba(0,0,0,.2) +} + +.swagger-ui .shadow-5 { + box-shadow: 4px 4px 8px 0 rgba(0,0,0,.2) +} + +@media screen and (min-width: 30em) { + .swagger-ui .shadow-1-ns { + box-shadow: 0 0 4px 2px rgba(0,0,0,.2) + } + + .swagger-ui .shadow-2-ns { + box-shadow: 0 0 8px 2px rgba(0,0,0,.2) + } + + .swagger-ui .shadow-3-ns { + box-shadow: 2px 2px 4px 2px rgba(0,0,0,.2) + } + + .swagger-ui .shadow-4-ns { + box-shadow: 2px 2px 8px 0 rgba(0,0,0,.2) + } + + .swagger-ui .shadow-5-ns { + box-shadow: 4px 4px 8px 0 rgba(0,0,0,.2) + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .shadow-1-m { + box-shadow: 0 0 4px 2px rgba(0,0,0,.2) + } + + .swagger-ui .shadow-2-m { + box-shadow: 0 0 8px 2px rgba(0,0,0,.2) + } + + .swagger-ui .shadow-3-m { + box-shadow: 2px 2px 4px 2px rgba(0,0,0,.2) + } + + .swagger-ui .shadow-4-m { + box-shadow: 2px 2px 8px 0 rgba(0,0,0,.2) + } + + .swagger-ui .shadow-5-m { + box-shadow: 4px 4px 8px 0 rgba(0,0,0,.2) + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .shadow-1-l { + box-shadow: 0 0 4px 2px rgba(0,0,0,.2) + } + + .swagger-ui .shadow-2-l { + box-shadow: 0 0 8px 2px rgba(0,0,0,.2) + } + + .swagger-ui .shadow-3-l { + box-shadow: 2px 2px 4px 2px rgba(0,0,0,.2) + } + + .swagger-ui .shadow-4-l { + box-shadow: 2px 2px 8px 0 rgba(0,0,0,.2) + } + + .swagger-ui .shadow-5-l { + box-shadow: 4px 4px 8px 0 rgba(0,0,0,.2) + } +} + +.swagger-ui .pre { + overflow-x: auto; + overflow-y: hidden; + overflow: scroll +} + +.swagger-ui .top-0 { + top: 0 +} + +.swagger-ui .right-0 { + right: 0 +} + +.swagger-ui .bottom-0 { + bottom: 0 +} + +.swagger-ui .left-0 { + left: 0 +} + +.swagger-ui .top-1 { + top: 1rem +} + +.swagger-ui .right-1 { + right: 1rem +} + +.swagger-ui .bottom-1 { + bottom: 1rem +} + +.swagger-ui .left-1 { + left: 1rem +} + +.swagger-ui .top-2 { + top: 2rem +} + +.swagger-ui .right-2 { + right: 2rem +} + +.swagger-ui .bottom-2 { + bottom: 2rem +} + +.swagger-ui .left-2 { + left: 2rem +} + +.swagger-ui .top--1 { + top: -1rem +} + +.swagger-ui .right--1 { + right: -1rem +} + +.swagger-ui .bottom--1 { + bottom: -1rem +} + +.swagger-ui .left--1 { + left: -1rem +} + +.swagger-ui .top--2 { + top: -2rem +} + +.swagger-ui .right--2 { + right: -2rem +} + +.swagger-ui .bottom--2 { + bottom: -2rem +} + +.swagger-ui .left--2 { + left: -2rem +} + +.swagger-ui .absolute--fill { + bottom: 0; + left: 0; + right: 0; + top: 0 +} + +@media screen and (min-width: 30em) { + .swagger-ui .top-0-ns { + top: 0 + } + + .swagger-ui .left-0-ns { + left: 0 + } + + .swagger-ui .right-0-ns { + right: 0 + } + + .swagger-ui .bottom-0-ns { + bottom: 0 + } + + .swagger-ui .top-1-ns { + top: 1rem + } + + .swagger-ui .left-1-ns { + left: 1rem + } + + .swagger-ui .right-1-ns { + right: 1rem + } + + .swagger-ui .bottom-1-ns { + bottom: 1rem + } + + .swagger-ui .top-2-ns { + top: 2rem + } + + .swagger-ui .left-2-ns { + left: 2rem + } + + .swagger-ui .right-2-ns { + right: 2rem + } + + .swagger-ui .bottom-2-ns { + bottom: 2rem + } + + .swagger-ui .top--1-ns { + top: -1rem + } + + .swagger-ui .right--1-ns { + right: -1rem + } + + .swagger-ui .bottom--1-ns { + bottom: -1rem + } + + .swagger-ui .left--1-ns { + left: -1rem + } + + .swagger-ui .top--2-ns { + top: -2rem + } + + .swagger-ui .right--2-ns { + right: -2rem + } + + .swagger-ui .bottom--2-ns { + bottom: -2rem + } + + .swagger-ui .left--2-ns { + left: -2rem + } + + .swagger-ui .absolute--fill-ns { + bottom: 0; + left: 0; + right: 0; + top: 0 + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .top-0-m { + top: 0 + } + + .swagger-ui .left-0-m { + left: 0 + } + + .swagger-ui .right-0-m { + right: 0 + } + + .swagger-ui .bottom-0-m { + bottom: 0 + } + + .swagger-ui .top-1-m { + top: 1rem + } + + .swagger-ui .left-1-m { + left: 1rem + } + + .swagger-ui .right-1-m { + right: 1rem + } + + .swagger-ui .bottom-1-m { + bottom: 1rem + } + + .swagger-ui .top-2-m { + top: 2rem + } + + .swagger-ui .left-2-m { + left: 2rem + } + + .swagger-ui .right-2-m { + right: 2rem + } + + .swagger-ui .bottom-2-m { + bottom: 2rem + } + + .swagger-ui .top--1-m { + top: -1rem + } + + .swagger-ui .right--1-m { + right: -1rem + } + + .swagger-ui .bottom--1-m { + bottom: -1rem + } + + .swagger-ui .left--1-m { + left: -1rem + } + + .swagger-ui .top--2-m { + top: -2rem + } + + .swagger-ui .right--2-m { + right: -2rem + } + + .swagger-ui .bottom--2-m { + bottom: -2rem + } + + .swagger-ui .left--2-m { + left: -2rem + } + + .swagger-ui .absolute--fill-m { + bottom: 0; + left: 0; + right: 0; + top: 0 + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .top-0-l { + top: 0 + } + + .swagger-ui .left-0-l { + left: 0 + } + + .swagger-ui .right-0-l { + right: 0 + } + + .swagger-ui .bottom-0-l { + bottom: 0 + } + + .swagger-ui .top-1-l { + top: 1rem + } + + .swagger-ui .left-1-l { + left: 1rem + } + + .swagger-ui .right-1-l { + right: 1rem + } + + .swagger-ui .bottom-1-l { + bottom: 1rem + } + + .swagger-ui .top-2-l { + top: 2rem + } + + .swagger-ui .left-2-l { + left: 2rem + } + + .swagger-ui .right-2-l { + right: 2rem + } + + .swagger-ui .bottom-2-l { + bottom: 2rem + } + + .swagger-ui .top--1-l { + top: -1rem + } + + .swagger-ui .right--1-l { + right: -1rem + } + + .swagger-ui .bottom--1-l { + bottom: -1rem + } + + .swagger-ui .left--1-l { + left: -1rem + } + + .swagger-ui .top--2-l { + top: -2rem + } + + .swagger-ui .right--2-l { + right: -2rem + } + + .swagger-ui .bottom--2-l { + bottom: -2rem + } + + .swagger-ui .left--2-l { + left: -2rem + } + + .swagger-ui .absolute--fill-l { + bottom: 0; + left: 0; + right: 0; + top: 0 + } +} + +.swagger-ui .cf:after, .swagger-ui .cf:before { + content: " "; + display: table +} + +.swagger-ui .cf:after { + clear: both +} + +.swagger-ui .cf { + zoom: 1 +} + +.swagger-ui .cl { + clear: left +} + +.swagger-ui .cr { + clear: right +} + +.swagger-ui .cb { + clear: both +} + +.swagger-ui .cn { + clear: none +} + +@media screen and (min-width: 30em) { + .swagger-ui .cl-ns { + clear: left + } + + .swagger-ui .cr-ns { + clear: right + } + + .swagger-ui .cb-ns { + clear: both + } + + .swagger-ui .cn-ns { + clear: none + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .cl-m { + clear: left + } + + .swagger-ui .cr-m { + clear: right + } + + .swagger-ui .cb-m { + clear: both + } + + .swagger-ui .cn-m { + clear: none + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .cl-l { + clear: left + } + + .swagger-ui .cr-l { + clear: right + } + + .swagger-ui .cb-l { + clear: both + } + + .swagger-ui .cn-l { + clear: none + } +} + +.swagger-ui .flex { + display: flex +} + +.swagger-ui .inline-flex { + display: inline-flex +} + +.swagger-ui .flex-auto { + flex: 1 1 auto; + min-height: 0; + min-width: 0 +} + +.swagger-ui .flex-none { + flex: none +} + +.swagger-ui .flex-column { + flex-direction: column +} + +.swagger-ui .flex-row { + flex-direction: row +} + +.swagger-ui .flex-wrap { + flex-wrap: wrap +} + +.swagger-ui .flex-nowrap { + flex-wrap: nowrap +} + +.swagger-ui .flex-wrap-reverse { + flex-wrap: wrap-reverse +} + +.swagger-ui .flex-column-reverse { + flex-direction: column-reverse +} + +.swagger-ui .flex-row-reverse { + flex-direction: row-reverse +} + +.swagger-ui .items-start { + align-items: flex-start +} + +.swagger-ui .items-end { + align-items: flex-end +} + +.swagger-ui .items-center { + align-items: center +} + +.swagger-ui .items-baseline { + align-items: baseline +} + +.swagger-ui .items-stretch { + align-items: stretch +} + +.swagger-ui .self-start { + align-self: flex-start +} + +.swagger-ui .self-end { + align-self: flex-end +} + +.swagger-ui .self-center { + align-self: center +} + +.swagger-ui .self-baseline { + align-self: baseline +} + +.swagger-ui .self-stretch { + align-self: stretch +} + +.swagger-ui .justify-start { + justify-content: flex-start +} + +.swagger-ui .justify-end { + justify-content: flex-end +} + +.swagger-ui .justify-center { + justify-content: center +} + +.swagger-ui .justify-between { + justify-content: space-between +} + +.swagger-ui .justify-around { + justify-content: space-around +} + +.swagger-ui .content-start { + align-content: flex-start +} + +.swagger-ui .content-end { + align-content: flex-end +} + +.swagger-ui .content-center { + align-content: center +} + +.swagger-ui .content-between { + align-content: space-between +} + +.swagger-ui .content-around { + align-content: space-around +} + +.swagger-ui .content-stretch { + align-content: stretch +} + +.swagger-ui .order-0 { + order: 0 +} + +.swagger-ui .order-1 { + order: 1 +} + +.swagger-ui .order-2 { + order: 2 +} + +.swagger-ui .order-3 { + order: 3 +} + +.swagger-ui .order-4 { + order: 4 +} + +.swagger-ui .order-5 { + order: 5 +} + +.swagger-ui .order-6 { + order: 6 +} + +.swagger-ui .order-7 { + order: 7 +} + +.swagger-ui .order-8 { + order: 8 +} + +.swagger-ui .order-last { + order: 99999 +} + +.swagger-ui .flex-grow-0 { + flex-grow: 0 +} + +.swagger-ui .flex-grow-1 { + flex-grow: 1 +} + +.swagger-ui .flex-shrink-0 { + flex-shrink: 0 +} + +.swagger-ui .flex-shrink-1 { + flex-shrink: 1 +} + +@media screen and (min-width: 30em) { + .swagger-ui .flex-ns { + display: flex + } + + .swagger-ui .inline-flex-ns { + display: inline-flex + } + + .swagger-ui .flex-auto-ns { + flex: 1 1 auto; + min-height: 0; + min-width: 0 + } + + .swagger-ui .flex-none-ns { + flex: none + } + + .swagger-ui .flex-column-ns { + flex-direction: column + } + + .swagger-ui .flex-row-ns { + flex-direction: row + } + + .swagger-ui .flex-wrap-ns { + flex-wrap: wrap + } + + .swagger-ui .flex-nowrap-ns { + flex-wrap: nowrap + } + + .swagger-ui .flex-wrap-reverse-ns { + flex-wrap: wrap-reverse + } + + .swagger-ui .flex-column-reverse-ns { + flex-direction: column-reverse + } + + .swagger-ui .flex-row-reverse-ns { + flex-direction: row-reverse + } + + .swagger-ui .items-start-ns { + align-items: flex-start + } + + .swagger-ui .items-end-ns { + align-items: flex-end + } + + .swagger-ui .items-center-ns { + align-items: center + } + + .swagger-ui .items-baseline-ns { + align-items: baseline + } + + .swagger-ui .items-stretch-ns { + align-items: stretch + } + + .swagger-ui .self-start-ns { + align-self: flex-start + } + + .swagger-ui .self-end-ns { + align-self: flex-end + } + + .swagger-ui .self-center-ns { + align-self: center + } + + .swagger-ui .self-baseline-ns { + align-self: baseline + } + + .swagger-ui .self-stretch-ns { + align-self: stretch + } + + .swagger-ui .justify-start-ns { + justify-content: flex-start + } + + .swagger-ui .justify-end-ns { + justify-content: flex-end + } + + .swagger-ui .justify-center-ns { + justify-content: center + } + + .swagger-ui .justify-between-ns { + justify-content: space-between + } + + .swagger-ui .justify-around-ns { + justify-content: space-around + } + + .swagger-ui .content-start-ns { + align-content: flex-start + } + + .swagger-ui .content-end-ns { + align-content: flex-end + } + + .swagger-ui .content-center-ns { + align-content: center + } + + .swagger-ui .content-between-ns { + align-content: space-between + } + + .swagger-ui .content-around-ns { + align-content: space-around + } + + .swagger-ui .content-stretch-ns { + align-content: stretch + } + + .swagger-ui .order-0-ns { + order: 0 + } + + .swagger-ui .order-1-ns { + order: 1 + } + + .swagger-ui .order-2-ns { + order: 2 + } + + .swagger-ui .order-3-ns { + order: 3 + } + + .swagger-ui .order-4-ns { + order: 4 + } + + .swagger-ui .order-5-ns { + order: 5 + } + + .swagger-ui .order-6-ns { + order: 6 + } + + .swagger-ui .order-7-ns { + order: 7 + } + + .swagger-ui .order-8-ns { + order: 8 + } + + .swagger-ui .order-last-ns { + order: 99999 + } + + .swagger-ui .flex-grow-0-ns { + flex-grow: 0 + } + + .swagger-ui .flex-grow-1-ns { + flex-grow: 1 + } + + .swagger-ui .flex-shrink-0-ns { + flex-shrink: 0 + } + + .swagger-ui .flex-shrink-1-ns { + flex-shrink: 1 + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .flex-m { + display: flex + } + + .swagger-ui .inline-flex-m { + display: inline-flex + } + + .swagger-ui .flex-auto-m { + flex: 1 1 auto; + min-height: 0; + min-width: 0 + } + + .swagger-ui .flex-none-m { + flex: none + } + + .swagger-ui .flex-column-m { + flex-direction: column + } + + .swagger-ui .flex-row-m { + flex-direction: row + } + + .swagger-ui .flex-wrap-m { + flex-wrap: wrap + } + + .swagger-ui .flex-nowrap-m { + flex-wrap: nowrap + } + + .swagger-ui .flex-wrap-reverse-m { + flex-wrap: wrap-reverse + } + + .swagger-ui .flex-column-reverse-m { + flex-direction: column-reverse + } + + .swagger-ui .flex-row-reverse-m { + flex-direction: row-reverse + } + + .swagger-ui .items-start-m { + align-items: flex-start + } + + .swagger-ui .items-end-m { + align-items: flex-end + } + + .swagger-ui .items-center-m { + align-items: center + } + + .swagger-ui .items-baseline-m { + align-items: baseline + } + + .swagger-ui .items-stretch-m { + align-items: stretch + } + + .swagger-ui .self-start-m { + align-self: flex-start + } + + .swagger-ui .self-end-m { + align-self: flex-end + } + + .swagger-ui .self-center-m { + align-self: center + } + + .swagger-ui .self-baseline-m { + align-self: baseline + } + + .swagger-ui .self-stretch-m { + align-self: stretch + } + + .swagger-ui .justify-start-m { + justify-content: flex-start + } + + .swagger-ui .justify-end-m { + justify-content: flex-end + } + + .swagger-ui .justify-center-m { + justify-content: center + } + + .swagger-ui .justify-between-m { + justify-content: space-between + } + + .swagger-ui .justify-around-m { + justify-content: space-around + } + + .swagger-ui .content-start-m { + align-content: flex-start + } + + .swagger-ui .content-end-m { + align-content: flex-end + } + + .swagger-ui .content-center-m { + align-content: center + } + + .swagger-ui .content-between-m { + align-content: space-between + } + + .swagger-ui .content-around-m { + align-content: space-around + } + + .swagger-ui .content-stretch-m { + align-content: stretch + } + + .swagger-ui .order-0-m { + order: 0 + } + + .swagger-ui .order-1-m { + order: 1 + } + + .swagger-ui .order-2-m { + order: 2 + } + + .swagger-ui .order-3-m { + order: 3 + } + + .swagger-ui .order-4-m { + order: 4 + } + + .swagger-ui .order-5-m { + order: 5 + } + + .swagger-ui .order-6-m { + order: 6 + } + + .swagger-ui .order-7-m { + order: 7 + } + + .swagger-ui .order-8-m { + order: 8 + } + + .swagger-ui .order-last-m { + order: 99999 + } + + .swagger-ui .flex-grow-0-m { + flex-grow: 0 + } + + .swagger-ui .flex-grow-1-m { + flex-grow: 1 + } + + .swagger-ui .flex-shrink-0-m { + flex-shrink: 0 + } + + .swagger-ui .flex-shrink-1-m { + flex-shrink: 1 + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .flex-l { + display: flex + } + + .swagger-ui .inline-flex-l { + display: inline-flex + } + + .swagger-ui .flex-auto-l { + flex: 1 1 auto; + min-height: 0; + min-width: 0 + } + + .swagger-ui .flex-none-l { + flex: none + } + + .swagger-ui .flex-column-l { + flex-direction: column + } + + .swagger-ui .flex-row-l { + flex-direction: row + } + + .swagger-ui .flex-wrap-l { + flex-wrap: wrap + } + + .swagger-ui .flex-nowrap-l { + flex-wrap: nowrap + } + + .swagger-ui .flex-wrap-reverse-l { + flex-wrap: wrap-reverse + } + + .swagger-ui .flex-column-reverse-l { + flex-direction: column-reverse + } + + .swagger-ui .flex-row-reverse-l { + flex-direction: row-reverse + } + + .swagger-ui .items-start-l { + align-items: flex-start + } + + .swagger-ui .items-end-l { + align-items: flex-end + } + + .swagger-ui .items-center-l { + align-items: center + } + + .swagger-ui .items-baseline-l { + align-items: baseline + } + + .swagger-ui .items-stretch-l { + align-items: stretch + } + + .swagger-ui .self-start-l { + align-self: flex-start + } + + .swagger-ui .self-end-l { + align-self: flex-end + } + + .swagger-ui .self-center-l { + align-self: center + } + + .swagger-ui .self-baseline-l { + align-self: baseline + } + + .swagger-ui .self-stretch-l { + align-self: stretch + } + + .swagger-ui .justify-start-l { + justify-content: flex-start + } + + .swagger-ui .justify-end-l { + justify-content: flex-end + } + + .swagger-ui .justify-center-l { + justify-content: center + } + + .swagger-ui .justify-between-l { + justify-content: space-between + } + + .swagger-ui .justify-around-l { + justify-content: space-around + } + + .swagger-ui .content-start-l { + align-content: flex-start + } + + .swagger-ui .content-end-l { + align-content: flex-end + } + + .swagger-ui .content-center-l { + align-content: center + } + + .swagger-ui .content-between-l { + align-content: space-between + } + + .swagger-ui .content-around-l { + align-content: space-around + } + + .swagger-ui .content-stretch-l { + align-content: stretch + } + + .swagger-ui .order-0-l { + order: 0 + } + + .swagger-ui .order-1-l { + order: 1 + } + + .swagger-ui .order-2-l { + order: 2 + } + + .swagger-ui .order-3-l { + order: 3 + } + + .swagger-ui .order-4-l { + order: 4 + } + + .swagger-ui .order-5-l { + order: 5 + } + + .swagger-ui .order-6-l { + order: 6 + } + + .swagger-ui .order-7-l { + order: 7 + } + + .swagger-ui .order-8-l { + order: 8 + } + + .swagger-ui .order-last-l { + order: 99999 + } + + .swagger-ui .flex-grow-0-l { + flex-grow: 0 + } + + .swagger-ui .flex-grow-1-l { + flex-grow: 1 + } + + .swagger-ui .flex-shrink-0-l { + flex-shrink: 0 + } + + .swagger-ui .flex-shrink-1-l { + flex-shrink: 1 + } +} + +.swagger-ui .dn { + display: none +} + +.swagger-ui .di { + display: inline +} + +.swagger-ui .db { + display: block +} + +.swagger-ui .dib { + display: inline-block +} + +.swagger-ui .dit { + display: inline-table +} + +.swagger-ui .dt { + display: table +} + +.swagger-ui .dtc { + display: table-cell +} + +.swagger-ui .dt-row { + display: table-row +} + +.swagger-ui .dt-row-group { + display: table-row-group +} + +.swagger-ui .dt-column { + display: table-column +} + +.swagger-ui .dt-column-group { + display: table-column-group +} + +.swagger-ui .dt--fixed { + table-layout: fixed; + width: 100% +} + +@media screen and (min-width: 30em) { + .swagger-ui .dn-ns { + display: none + } + + .swagger-ui .di-ns { + display: inline + } + + .swagger-ui .db-ns { + display: block + } + + .swagger-ui .dib-ns { + display: inline-block + } + + .swagger-ui .dit-ns { + display: inline-table + } + + .swagger-ui .dt-ns { + display: table + } + + .swagger-ui .dtc-ns { + display: table-cell + } + + .swagger-ui .dt-row-ns { + display: table-row + } + + .swagger-ui .dt-row-group-ns { + display: table-row-group + } + + .swagger-ui .dt-column-ns { + display: table-column + } + + .swagger-ui .dt-column-group-ns { + display: table-column-group + } + + .swagger-ui .dt--fixed-ns { + table-layout: fixed; + width: 100% + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .dn-m { + display: none + } + + .swagger-ui .di-m { + display: inline + } + + .swagger-ui .db-m { + display: block + } + + .swagger-ui .dib-m { + display: inline-block + } + + .swagger-ui .dit-m { + display: inline-table + } + + .swagger-ui .dt-m { + display: table + } + + .swagger-ui .dtc-m { + display: table-cell + } + + .swagger-ui .dt-row-m { + display: table-row + } + + .swagger-ui .dt-row-group-m { + display: table-row-group + } + + .swagger-ui .dt-column-m { + display: table-column + } + + .swagger-ui .dt-column-group-m { + display: table-column-group + } + + .swagger-ui .dt--fixed-m { + table-layout: fixed; + width: 100% + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .dn-l { + display: none + } + + .swagger-ui .di-l { + display: inline + } + + .swagger-ui .db-l { + display: block + } + + .swagger-ui .dib-l { + display: inline-block + } + + .swagger-ui .dit-l { + display: inline-table + } + + .swagger-ui .dt-l { + display: table + } + + .swagger-ui .dtc-l { + display: table-cell + } + + .swagger-ui .dt-row-l { + display: table-row + } + + .swagger-ui .dt-row-group-l { + display: table-row-group + } + + .swagger-ui .dt-column-l { + display: table-column + } + + .swagger-ui .dt-column-group-l { + display: table-column-group + } + + .swagger-ui .dt--fixed-l { + table-layout: fixed; + width: 100% + } +} + +.swagger-ui .fl { + _display: inline; + float: left +} + +.swagger-ui .fr { + _display: inline; + float: right +} + +.swagger-ui .fn { + float: none +} + +@media screen and (min-width: 30em) { + .swagger-ui .fl-ns { + _display: inline; + float: left + } + + .swagger-ui .fr-ns { + _display: inline; + float: right + } + + .swagger-ui .fn-ns { + float: none + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .fl-m { + _display: inline; + float: left + } + + .swagger-ui .fr-m { + _display: inline; + float: right + } + + .swagger-ui .fn-m { + float: none + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .fl-l { + _display: inline; + float: left + } + + .swagger-ui .fr-l { + _display: inline; + float: right + } + + .swagger-ui .fn-l { + float: none + } +} + +.swagger-ui .sans-serif { + font-family: -apple-system,BlinkMacSystemFont,avenir next,avenir,helvetica,helvetica neue,ubuntu,roboto,noto,segoe ui,arial,sans-serif +} + +.swagger-ui .serif { + font-family: georgia,serif +} + +.swagger-ui .system-sans-serif { + font-family: sans-serif +} + +.swagger-ui .system-serif { + font-family: serif +} + +.swagger-ui .code, .swagger-ui code { + font-family: Consolas,monaco,monospace +} + +.swagger-ui .courier { + font-family: Courier Next,courier,monospace +} + +.swagger-ui .helvetica { + font-family: helvetica neue,helvetica,sans-serif +} + +.swagger-ui .avenir { + font-family: avenir next,avenir,sans-serif +} + +.swagger-ui .athelas { + font-family: athelas,georgia,serif +} + +.swagger-ui .georgia { + font-family: georgia,serif +} + +.swagger-ui .times { + font-family: times,serif +} + +.swagger-ui .bodoni { + font-family: Bodoni MT,serif +} + +.swagger-ui .calisto { + font-family: Calisto MT,serif +} + +.swagger-ui .garamond { + font-family: garamond,serif +} + +.swagger-ui .baskerville { + font-family: baskerville,serif +} + +.swagger-ui .i { + font-style: italic +} + +.swagger-ui .fs-normal { + font-style: normal +} + +@media screen and (min-width: 30em) { + .swagger-ui .i-ns { + font-style: italic + } + + .swagger-ui .fs-normal-ns { + font-style: normal + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .i-m { + font-style: italic + } + + .swagger-ui .fs-normal-m { + font-style: normal + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .i-l { + font-style: italic + } + + .swagger-ui .fs-normal-l { + font-style: normal + } +} + +.swagger-ui .normal { + font-weight: 400 +} + +.swagger-ui .b { + font-weight: 700 +} + +.swagger-ui .fw1 { + font-weight: 100 +} + +.swagger-ui .fw2 { + font-weight: 200 +} + +.swagger-ui .fw3 { + font-weight: 300 +} + +.swagger-ui .fw4 { + font-weight: 400 +} + +.swagger-ui .fw5 { + font-weight: 500 +} + +.swagger-ui .fw6 { + font-weight: 600 +} + +.swagger-ui .fw7 { + font-weight: 700 +} + +.swagger-ui .fw8 { + font-weight: 800 +} + +.swagger-ui .fw9 { + font-weight: 900 +} + +@media screen and (min-width: 30em) { + .swagger-ui .normal-ns { + font-weight: 400 + } + + .swagger-ui .b-ns { + font-weight: 700 + } + + .swagger-ui .fw1-ns { + font-weight: 100 + } + + .swagger-ui .fw2-ns { + font-weight: 200 + } + + .swagger-ui .fw3-ns { + font-weight: 300 + } + + .swagger-ui .fw4-ns { + font-weight: 400 + } + + .swagger-ui .fw5-ns { + font-weight: 500 + } + + .swagger-ui .fw6-ns { + font-weight: 600 + } + + .swagger-ui .fw7-ns { + font-weight: 700 + } + + .swagger-ui .fw8-ns { + font-weight: 800 + } + + .swagger-ui .fw9-ns { + font-weight: 900 + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .normal-m { + font-weight: 400 + } + + .swagger-ui .b-m { + font-weight: 700 + } + + .swagger-ui .fw1-m { + font-weight: 100 + } + + .swagger-ui .fw2-m { + font-weight: 200 + } + + .swagger-ui .fw3-m { + font-weight: 300 + } + + .swagger-ui .fw4-m { + font-weight: 400 + } + + .swagger-ui .fw5-m { + font-weight: 500 + } + + .swagger-ui .fw6-m { + font-weight: 600 + } + + .swagger-ui .fw7-m { + font-weight: 700 + } + + .swagger-ui .fw8-m { + font-weight: 800 + } + + .swagger-ui .fw9-m { + font-weight: 900 + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .normal-l { + font-weight: 400 + } + + .swagger-ui .b-l { + font-weight: 700 + } + + .swagger-ui .fw1-l { + font-weight: 100 + } + + .swagger-ui .fw2-l { + font-weight: 200 + } + + .swagger-ui .fw3-l { + font-weight: 300 + } + + .swagger-ui .fw4-l { + font-weight: 400 + } + + .swagger-ui .fw5-l { + font-weight: 500 + } + + .swagger-ui .fw6-l { + font-weight: 600 + } + + .swagger-ui .fw7-l { + font-weight: 700 + } + + .swagger-ui .fw8-l { + font-weight: 800 + } + + .swagger-ui .fw9-l { + font-weight: 900 + } +} + +.swagger-ui .input-reset { + -webkit-appearance: none; + -moz-appearance: none +} + + .swagger-ui .button-reset::-moz-focus-inner, .swagger-ui .input-reset::-moz-focus-inner { + border: 0; + padding: 0 + } + +.swagger-ui .h1 { + height: 1rem +} + +.swagger-ui .h2 { + height: 2rem +} + +.swagger-ui .h3 { + height: 4rem +} + +.swagger-ui .h4 { + height: 8rem +} + +.swagger-ui .h5 { + height: 16rem +} + +.swagger-ui .h-25 { + height: 25% +} + +.swagger-ui .h-50 { + height: 50% +} + +.swagger-ui .h-75 { + height: 75% +} + +.swagger-ui .h-100 { + height: 100% +} + +.swagger-ui .min-h-100 { + min-height: 100% +} + +.swagger-ui .vh-25 { + height: 25vh +} + +.swagger-ui .vh-50 { + height: 50vh +} + +.swagger-ui .vh-75 { + height: 75vh +} + +.swagger-ui .vh-100 { + height: 100vh +} + +.swagger-ui .min-vh-100 { + min-height: 100vh +} + +.swagger-ui .h-auto { + height: auto +} + +.swagger-ui .h-inherit { + height: inherit +} + +@media screen and (min-width: 30em) { + .swagger-ui .h1-ns { + height: 1rem + } + + .swagger-ui .h2-ns { + height: 2rem + } + + .swagger-ui .h3-ns { + height: 4rem + } + + .swagger-ui .h4-ns { + height: 8rem + } + + .swagger-ui .h5-ns { + height: 16rem + } + + .swagger-ui .h-25-ns { + height: 25% + } + + .swagger-ui .h-50-ns { + height: 50% + } + + .swagger-ui .h-75-ns { + height: 75% + } + + .swagger-ui .h-100-ns { + height: 100% + } + + .swagger-ui .min-h-100-ns { + min-height: 100% + } + + .swagger-ui .vh-25-ns { + height: 25vh + } + + .swagger-ui .vh-50-ns { + height: 50vh + } + + .swagger-ui .vh-75-ns { + height: 75vh + } + + .swagger-ui .vh-100-ns { + height: 100vh + } + + .swagger-ui .min-vh-100-ns { + min-height: 100vh + } + + .swagger-ui .h-auto-ns { + height: auto + } + + .swagger-ui .h-inherit-ns { + height: inherit + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .h1-m { + height: 1rem + } + + .swagger-ui .h2-m { + height: 2rem + } + + .swagger-ui .h3-m { + height: 4rem + } + + .swagger-ui .h4-m { + height: 8rem + } + + .swagger-ui .h5-m { + height: 16rem + } + + .swagger-ui .h-25-m { + height: 25% + } + + .swagger-ui .h-50-m { + height: 50% + } + + .swagger-ui .h-75-m { + height: 75% + } + + .swagger-ui .h-100-m { + height: 100% + } + + .swagger-ui .min-h-100-m { + min-height: 100% + } + + .swagger-ui .vh-25-m { + height: 25vh + } + + .swagger-ui .vh-50-m { + height: 50vh + } + + .swagger-ui .vh-75-m { + height: 75vh + } + + .swagger-ui .vh-100-m { + height: 100vh + } + + .swagger-ui .min-vh-100-m { + min-height: 100vh + } + + .swagger-ui .h-auto-m { + height: auto + } + + .swagger-ui .h-inherit-m { + height: inherit + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .h1-l { + height: 1rem + } + + .swagger-ui .h2-l { + height: 2rem + } + + .swagger-ui .h3-l { + height: 4rem + } + + .swagger-ui .h4-l { + height: 8rem + } + + .swagger-ui .h5-l { + height: 16rem + } + + .swagger-ui .h-25-l { + height: 25% + } + + .swagger-ui .h-50-l { + height: 50% + } + + .swagger-ui .h-75-l { + height: 75% + } + + .swagger-ui .h-100-l { + height: 100% + } + + .swagger-ui .min-h-100-l { + min-height: 100% + } + + .swagger-ui .vh-25-l { + height: 25vh + } + + .swagger-ui .vh-50-l { + height: 50vh + } + + .swagger-ui .vh-75-l { + height: 75vh + } + + .swagger-ui .vh-100-l { + height: 100vh + } + + .swagger-ui .min-vh-100-l { + min-height: 100vh + } + + .swagger-ui .h-auto-l { + height: auto + } + + .swagger-ui .h-inherit-l { + height: inherit + } +} + +.swagger-ui .tracked { + letter-spacing: .1em +} + +.swagger-ui .tracked-tight { + letter-spacing: -.05em +} + +.swagger-ui .tracked-mega { + letter-spacing: .25em +} + +@media screen and (min-width: 30em) { + .swagger-ui .tracked-ns { + letter-spacing: .1em + } + + .swagger-ui .tracked-tight-ns { + letter-spacing: -.05em + } + + .swagger-ui .tracked-mega-ns { + letter-spacing: .25em + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .tracked-m { + letter-spacing: .1em + } + + .swagger-ui .tracked-tight-m { + letter-spacing: -.05em + } + + .swagger-ui .tracked-mega-m { + letter-spacing: .25em + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .tracked-l { + letter-spacing: .1em + } + + .swagger-ui .tracked-tight-l { + letter-spacing: -.05em + } + + .swagger-ui .tracked-mega-l { + letter-spacing: .25em + } +} + +.swagger-ui .lh-solid { + line-height: 1 +} + +.swagger-ui .lh-title { + line-height: 1.25 +} + +.swagger-ui .lh-copy { + line-height: 1.5 +} + +@media screen and (min-width: 30em) { + .swagger-ui .lh-solid-ns { + line-height: 1 + } + + .swagger-ui .lh-title-ns { + line-height: 1.25 + } + + .swagger-ui .lh-copy-ns { + line-height: 1.5 + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .lh-solid-m { + line-height: 1 + } + + .swagger-ui .lh-title-m { + line-height: 1.25 + } + + .swagger-ui .lh-copy-m { + line-height: 1.5 + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .lh-solid-l { + line-height: 1 + } + + .swagger-ui .lh-title-l { + line-height: 1.25 + } + + .swagger-ui .lh-copy-l { + line-height: 1.5 + } +} + +.swagger-ui .link { + text-decoration: none +} + + .swagger-ui .link, .swagger-ui .link:active, .swagger-ui .link:focus, .swagger-ui .link:hover, .swagger-ui .link:link, .swagger-ui .link:visited { + transition: color .15s ease-in + } + + .swagger-ui .link:focus { + outline: 1px dotted currentColor + } + +.swagger-ui .list { + list-style-type: none +} + +.swagger-ui .mw-100 { + max-width: 100% +} + +.swagger-ui .mw1 { + max-width: 1rem +} + +.swagger-ui .mw2 { + max-width: 2rem +} + +.swagger-ui .mw3 { + max-width: 4rem +} + +.swagger-ui .mw4 { + max-width: 8rem +} + +.swagger-ui .mw5 { + max-width: 16rem +} + +.swagger-ui .mw6 { + max-width: 32rem +} + +.swagger-ui .mw7 { + max-width: 48rem +} + +.swagger-ui .mw8 { + max-width: 64rem +} + +.swagger-ui .mw9 { + max-width: 96rem +} + +.swagger-ui .mw-none { + max-width: none +} + +@media screen and (min-width: 30em) { + .swagger-ui .mw-100-ns { + max-width: 100% + } + + .swagger-ui .mw1-ns { + max-width: 1rem + } + + .swagger-ui .mw2-ns { + max-width: 2rem + } + + .swagger-ui .mw3-ns { + max-width: 4rem + } + + .swagger-ui .mw4-ns { + max-width: 8rem + } + + .swagger-ui .mw5-ns { + max-width: 16rem + } + + .swagger-ui .mw6-ns { + max-width: 32rem + } + + .swagger-ui .mw7-ns { + max-width: 48rem + } + + .swagger-ui .mw8-ns { + max-width: 64rem + } + + .swagger-ui .mw9-ns { + max-width: 96rem + } + + .swagger-ui .mw-none-ns { + max-width: none + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .mw-100-m { + max-width: 100% + } + + .swagger-ui .mw1-m { + max-width: 1rem + } + + .swagger-ui .mw2-m { + max-width: 2rem + } + + .swagger-ui .mw3-m { + max-width: 4rem + } + + .swagger-ui .mw4-m { + max-width: 8rem + } + + .swagger-ui .mw5-m { + max-width: 16rem + } + + .swagger-ui .mw6-m { + max-width: 32rem + } + + .swagger-ui .mw7-m { + max-width: 48rem + } + + .swagger-ui .mw8-m { + max-width: 64rem + } + + .swagger-ui .mw9-m { + max-width: 96rem + } + + .swagger-ui .mw-none-m { + max-width: none + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .mw-100-l { + max-width: 100% + } + + .swagger-ui .mw1-l { + max-width: 1rem + } + + .swagger-ui .mw2-l { + max-width: 2rem + } + + .swagger-ui .mw3-l { + max-width: 4rem + } + + .swagger-ui .mw4-l { + max-width: 8rem + } + + .swagger-ui .mw5-l { + max-width: 16rem + } + + .swagger-ui .mw6-l { + max-width: 32rem + } + + .swagger-ui .mw7-l { + max-width: 48rem + } + + .swagger-ui .mw8-l { + max-width: 64rem + } + + .swagger-ui .mw9-l { + max-width: 96rem + } + + .swagger-ui .mw-none-l { + max-width: none + } +} + +.swagger-ui .w1 { + width: 1rem +} + +.swagger-ui .w2 { + width: 2rem +} + +.swagger-ui .w3 { + width: 4rem +} + +.swagger-ui .w4 { + width: 8rem +} + +.swagger-ui .w5 { + width: 16rem +} + +.swagger-ui .w-10 { + width: 10% +} + +.swagger-ui .w-20 { + width: 20% +} + +.swagger-ui .w-25 { + width: 25% +} + +.swagger-ui .w-30 { + width: 30% +} + +.swagger-ui .w-33 { + width: 33% +} + +.swagger-ui .w-34 { + width: 34% +} + +.swagger-ui .w-40 { + width: 40% +} + +.swagger-ui .w-50 { + width: 50% +} + +.swagger-ui .w-60 { + width: 60% +} + +.swagger-ui .w-70 { + width: 70% +} + +.swagger-ui .w-75 { + width: 75% +} + +.swagger-ui .w-80 { + width: 80% +} + +.swagger-ui .w-90 { + width: 90% +} + +.swagger-ui .w-100 { + width: 100% +} + +.swagger-ui .w-third { + width: 33.3333333333% +} + +.swagger-ui .w-two-thirds { + width: 66.6666666667% +} + +.swagger-ui .w-auto { + width: auto +} + +@media screen and (min-width: 30em) { + .swagger-ui .w1-ns { + width: 1rem + } + + .swagger-ui .w2-ns { + width: 2rem + } + + .swagger-ui .w3-ns { + width: 4rem + } + + .swagger-ui .w4-ns { + width: 8rem + } + + .swagger-ui .w5-ns { + width: 16rem + } + + .swagger-ui .w-10-ns { + width: 10% + } + + .swagger-ui .w-20-ns { + width: 20% + } + + .swagger-ui .w-25-ns { + width: 25% + } + + .swagger-ui .w-30-ns { + width: 30% + } + + .swagger-ui .w-33-ns { + width: 33% + } + + .swagger-ui .w-34-ns { + width: 34% + } + + .swagger-ui .w-40-ns { + width: 40% + } + + .swagger-ui .w-50-ns { + width: 50% + } + + .swagger-ui .w-60-ns { + width: 60% + } + + .swagger-ui .w-70-ns { + width: 70% + } + + .swagger-ui .w-75-ns { + width: 75% + } + + .swagger-ui .w-80-ns { + width: 80% + } + + .swagger-ui .w-90-ns { + width: 90% + } + + .swagger-ui .w-100-ns { + width: 100% + } + + .swagger-ui .w-third-ns { + width: 33.3333333333% + } + + .swagger-ui .w-two-thirds-ns { + width: 66.6666666667% + } + + .swagger-ui .w-auto-ns { + width: auto + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .w1-m { + width: 1rem + } + + .swagger-ui .w2-m { + width: 2rem + } + + .swagger-ui .w3-m { + width: 4rem + } + + .swagger-ui .w4-m { + width: 8rem + } + + .swagger-ui .w5-m { + width: 16rem + } + + .swagger-ui .w-10-m { + width: 10% + } + + .swagger-ui .w-20-m { + width: 20% + } + + .swagger-ui .w-25-m { + width: 25% + } + + .swagger-ui .w-30-m { + width: 30% + } + + .swagger-ui .w-33-m { + width: 33% + } + + .swagger-ui .w-34-m { + width: 34% + } + + .swagger-ui .w-40-m { + width: 40% + } + + .swagger-ui .w-50-m { + width: 50% + } + + .swagger-ui .w-60-m { + width: 60% + } + + .swagger-ui .w-70-m { + width: 70% + } + + .swagger-ui .w-75-m { + width: 75% + } + + .swagger-ui .w-80-m { + width: 80% + } + + .swagger-ui .w-90-m { + width: 90% + } + + .swagger-ui .w-100-m { + width: 100% + } + + .swagger-ui .w-third-m { + width: 33.3333333333% + } + + .swagger-ui .w-two-thirds-m { + width: 66.6666666667% + } + + .swagger-ui .w-auto-m { + width: auto + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .w1-l { + width: 1rem + } + + .swagger-ui .w2-l { + width: 2rem + } + + .swagger-ui .w3-l { + width: 4rem + } + + .swagger-ui .w4-l { + width: 8rem + } + + .swagger-ui .w5-l { + width: 16rem + } + + .swagger-ui .w-10-l { + width: 10% + } + + .swagger-ui .w-20-l { + width: 20% + } + + .swagger-ui .w-25-l { + width: 25% + } + + .swagger-ui .w-30-l { + width: 30% + } + + .swagger-ui .w-33-l { + width: 33% + } + + .swagger-ui .w-34-l { + width: 34% + } + + .swagger-ui .w-40-l { + width: 40% + } + + .swagger-ui .w-50-l { + width: 50% + } + + .swagger-ui .w-60-l { + width: 60% + } + + .swagger-ui .w-70-l { + width: 70% + } + + .swagger-ui .w-75-l { + width: 75% + } + + .swagger-ui .w-80-l { + width: 80% + } + + .swagger-ui .w-90-l { + width: 90% + } + + .swagger-ui .w-100-l { + width: 100% + } + + .swagger-ui .w-third-l { + width: 33.3333333333% + } + + .swagger-ui .w-two-thirds-l { + width: 66.6666666667% + } + + .swagger-ui .w-auto-l { + width: auto + } +} + +.swagger-ui .overflow-visible { + overflow: visible +} + +.swagger-ui .overflow-hidden { + overflow: hidden +} + +.swagger-ui .overflow-scroll { + overflow: scroll +} + +.swagger-ui .overflow-auto { + overflow: auto +} + +.swagger-ui .overflow-x-visible { + overflow-x: visible +} + +.swagger-ui .overflow-x-hidden { + overflow-x: hidden +} + +.swagger-ui .overflow-x-scroll { + overflow-x: scroll +} + +.swagger-ui .overflow-x-auto { + overflow-x: auto +} + +.swagger-ui .overflow-y-visible { + overflow-y: visible +} + +.swagger-ui .overflow-y-hidden { + overflow-y: hidden +} + +.swagger-ui .overflow-y-scroll { + overflow-y: scroll +} + +.swagger-ui .overflow-y-auto { + overflow-y: auto +} + +@media screen and (min-width: 30em) { + .swagger-ui .overflow-visible-ns { + overflow: visible + } + + .swagger-ui .overflow-hidden-ns { + overflow: hidden + } + + .swagger-ui .overflow-scroll-ns { + overflow: scroll + } + + .swagger-ui .overflow-auto-ns { + overflow: auto + } + + .swagger-ui .overflow-x-visible-ns { + overflow-x: visible + } + + .swagger-ui .overflow-x-hidden-ns { + overflow-x: hidden + } + + .swagger-ui .overflow-x-scroll-ns { + overflow-x: scroll + } + + .swagger-ui .overflow-x-auto-ns { + overflow-x: auto + } + + .swagger-ui .overflow-y-visible-ns { + overflow-y: visible + } + + .swagger-ui .overflow-y-hidden-ns { + overflow-y: hidden + } + + .swagger-ui .overflow-y-scroll-ns { + overflow-y: scroll + } + + .swagger-ui .overflow-y-auto-ns { + overflow-y: auto + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .overflow-visible-m { + overflow: visible + } + + .swagger-ui .overflow-hidden-m { + overflow: hidden + } + + .swagger-ui .overflow-scroll-m { + overflow: scroll + } + + .swagger-ui .overflow-auto-m { + overflow: auto + } + + .swagger-ui .overflow-x-visible-m { + overflow-x: visible + } + + .swagger-ui .overflow-x-hidden-m { + overflow-x: hidden + } + + .swagger-ui .overflow-x-scroll-m { + overflow-x: scroll + } + + .swagger-ui .overflow-x-auto-m { + overflow-x: auto + } + + .swagger-ui .overflow-y-visible-m { + overflow-y: visible + } + + .swagger-ui .overflow-y-hidden-m { + overflow-y: hidden + } + + .swagger-ui .overflow-y-scroll-m { + overflow-y: scroll + } + + .swagger-ui .overflow-y-auto-m { + overflow-y: auto + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .overflow-visible-l { + overflow: visible + } + + .swagger-ui .overflow-hidden-l { + overflow: hidden + } + + .swagger-ui .overflow-scroll-l { + overflow: scroll + } + + .swagger-ui .overflow-auto-l { + overflow: auto + } + + .swagger-ui .overflow-x-visible-l { + overflow-x: visible + } + + .swagger-ui .overflow-x-hidden-l { + overflow-x: hidden + } + + .swagger-ui .overflow-x-scroll-l { + overflow-x: scroll + } + + .swagger-ui .overflow-x-auto-l { + overflow-x: auto + } + + .swagger-ui .overflow-y-visible-l { + overflow-y: visible + } + + .swagger-ui .overflow-y-hidden-l { + overflow-y: hidden + } + + .swagger-ui .overflow-y-scroll-l { + overflow-y: scroll + } + + .swagger-ui .overflow-y-auto-l { + overflow-y: auto + } +} + +.swagger-ui .static { + position: static +} + +.swagger-ui .relative { + position: relative +} + +.swagger-ui .absolute { + position: absolute +} + +.swagger-ui .fixed { + position: fixed +} + +@media screen and (min-width: 30em) { + .swagger-ui .static-ns { + position: static + } + + .swagger-ui .relative-ns { + position: relative + } + + .swagger-ui .absolute-ns { + position: absolute + } + + .swagger-ui .fixed-ns { + position: fixed + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .static-m { + position: static + } + + .swagger-ui .relative-m { + position: relative + } + + .swagger-ui .absolute-m { + position: absolute + } + + .swagger-ui .fixed-m { + position: fixed + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .static-l { + position: static + } + + .swagger-ui .relative-l { + position: relative + } + + .swagger-ui .absolute-l { + position: absolute + } + + .swagger-ui .fixed-l { + position: fixed + } +} + +.swagger-ui .o-100 { + opacity: 1 +} + +.swagger-ui .o-90 { + opacity: .9 +} + +.swagger-ui .o-80 { + opacity: .8 +} + +.swagger-ui .o-70 { + opacity: .7 +} + +.swagger-ui .o-60 { + opacity: .6 +} + +.swagger-ui .o-50 { + opacity: .5 +} + +.swagger-ui .o-40 { + opacity: .4 +} + +.swagger-ui .o-30 { + opacity: .3 +} + +.swagger-ui .o-20 { + opacity: .2 +} + +.swagger-ui .o-10 { + opacity: .1 +} + +.swagger-ui .o-05 { + opacity: .05 +} + +.swagger-ui .o-025 { + opacity: .025 +} + +.swagger-ui .o-0 { + opacity: 0 +} + +.swagger-ui .rotate-45 { + transform: rotate(45deg) +} + +.swagger-ui .rotate-90 { + transform: rotate(90deg) +} + +.swagger-ui .rotate-135 { + transform: rotate(135deg) +} + +.swagger-ui .rotate-180 { + transform: rotate(180deg) +} + +.swagger-ui .rotate-225 { + transform: rotate(225deg) +} + +.swagger-ui .rotate-270 { + transform: rotate(270deg) +} + +.swagger-ui .rotate-315 { + transform: rotate(315deg) +} + +@media screen and (min-width: 30em) { + .swagger-ui .rotate-45-ns { + transform: rotate(45deg) + } + + .swagger-ui .rotate-90-ns { + transform: rotate(90deg) + } + + .swagger-ui .rotate-135-ns { + transform: rotate(135deg) + } + + .swagger-ui .rotate-180-ns { + transform: rotate(180deg) + } + + .swagger-ui .rotate-225-ns { + transform: rotate(225deg) + } + + .swagger-ui .rotate-270-ns { + transform: rotate(270deg) + } + + .swagger-ui .rotate-315-ns { + transform: rotate(315deg) + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .rotate-45-m { + transform: rotate(45deg) + } + + .swagger-ui .rotate-90-m { + transform: rotate(90deg) + } + + .swagger-ui .rotate-135-m { + transform: rotate(135deg) + } + + .swagger-ui .rotate-180-m { + transform: rotate(180deg) + } + + .swagger-ui .rotate-225-m { + transform: rotate(225deg) + } + + .swagger-ui .rotate-270-m { + transform: rotate(270deg) + } + + .swagger-ui .rotate-315-m { + transform: rotate(315deg) + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .rotate-45-l { + transform: rotate(45deg) + } + + .swagger-ui .rotate-90-l { + transform: rotate(90deg) + } + + .swagger-ui .rotate-135-l { + transform: rotate(135deg) + } + + .swagger-ui .rotate-180-l { + transform: rotate(180deg) + } + + .swagger-ui .rotate-225-l { + transform: rotate(225deg) + } + + .swagger-ui .rotate-270-l { + transform: rotate(270deg) + } + + .swagger-ui .rotate-315-l { + transform: rotate(315deg) + } +} + +.swagger-ui .black-90 { + color: rgba(0,0,0,.9) +} + +.swagger-ui .black-80 { + color: rgba(0,0,0,.8) +} + +.swagger-ui .black-70 { + color: rgba(0,0,0,.7) +} + +.swagger-ui .black-60 { + color: rgba(0,0,0,.6) +} + +.swagger-ui .black-50 { + color: rgba(0,0,0,.5) +} + +.swagger-ui .black-40 { + color: rgba(0,0,0,.4) +} + +.swagger-ui .black-30 { + color: rgba(0,0,0,.3) +} + +.swagger-ui .black-20 { + color: rgba(0,0,0,.2) +} + +.swagger-ui .black-10 { + color: rgba(0,0,0,.1) +} + +.swagger-ui .black-05 { + color: rgba(0,0,0,.05) +} + +.swagger-ui .white-90 { + color: hsla(0,0%,100%,.9) +} + +.swagger-ui .white-80 { + color: hsla(0,0%,100%,.8) +} + +.swagger-ui .white-70 { + color: hsla(0,0%,100%,.7) +} + +.swagger-ui .white-60 { + color: hsla(0,0%,100%,.6) +} + +.swagger-ui .white-50 { + color: hsla(0,0%,100%,.5) +} + +.swagger-ui .white-40 { + color: hsla(0,0%,100%,.4) +} + +.swagger-ui .white-30 { + color: hsla(0,0%,100%,.3) +} + +.swagger-ui .white-20 { + color: hsla(0,0%,100%,.2) +} + +.swagger-ui .white-10 { + color: hsla(0,0%,100%,.1) +} + +.swagger-ui .black { + color: #000 +} + +.swagger-ui .near-black { + color: #111 +} + +.swagger-ui .dark-gray { + color: #333 +} + +.swagger-ui .mid-gray { + color: #555 +} + +.swagger-ui .gray { + color: #777 +} + +.swagger-ui .silver { + color: #999 +} + +.swagger-ui .light-silver { + color: #aaa +} + +.swagger-ui .moon-gray { + color: #ccc +} + +.swagger-ui .light-gray { + color: #eee +} + +.swagger-ui .near-white { + color: #f4f4f4 +} + +.swagger-ui .white { + color: #1c1c21 +} + +.swagger-ui .dark-red { + color: #e7040f +} + +.swagger-ui .red { + color: #ff4136 +} + +.swagger-ui .light-red { + color: #ff725c +} + +.swagger-ui .orange { + color: #ff6300 +} + +.swagger-ui .gold { + color: #ffb700 +} + +.swagger-ui .yellow { + color: gold +} + +.swagger-ui .light-yellow { + color: #fbf1a9 +} + +.swagger-ui .purple { + color: #5e2ca5 +} + +.swagger-ui .light-purple { + color: #a463f2 +} + +.swagger-ui .dark-pink { + color: #d5008f +} + +.swagger-ui .hot-pink { + color: #ff41b4 +} + +.swagger-ui .pink { + color: #ff80cc +} + +.swagger-ui .light-pink { + color: #ffa3d7 +} + +.swagger-ui .dark-green { + color: #137752 +} + +.swagger-ui .green { + color: #19a974 +} + +.swagger-ui .light-green { + color: #9eebcf +} + +.swagger-ui .navy { + color: #001b44 +} + +.swagger-ui .dark-blue { + color: #00449e +} + +.swagger-ui .blue { + color: #357edd +} + +.swagger-ui .light-blue { + color: #96ccff +} + +.swagger-ui .lightest-blue { + color: #cdecff +} + +.swagger-ui .washed-blue { + color: #f6fffe +} + +.swagger-ui .washed-green { + color: #e8fdf5 +} + +.swagger-ui .washed-yellow { + color: #1c1c21ceb +} + +.swagger-ui .washed-red { + color: #ffdfdf +} + +.swagger-ui .color-inherit { + color: inherit +} + +.swagger-ui .bg-black-90 { + background-color: rgba(0,0,0,.9) +} + +.swagger-ui .bg-black-80 { + background-color: rgba(0,0,0,.8) +} + +.swagger-ui .bg-black-70 { + background-color: rgba(0,0,0,.7) +} + +.swagger-ui .bg-black-60 { + background-color: rgba(0,0,0,.6) +} + +.swagger-ui .bg-black-50 { + background-color: rgba(0,0,0,.5) +} + +.swagger-ui .bg-black-40 { + background-color: rgba(0,0,0,.4) +} + +.swagger-ui .bg-black-30 { + background-color: rgba(0,0,0,.3) +} + +.swagger-ui .bg-black-20 { + background-color: rgba(0,0,0,.2) +} + +.swagger-ui .bg-black-10 { + background-color: rgba(0,0,0,.1) +} + +.swagger-ui .bg-black-05 { + background-color: rgba(0,0,0,.05) +} + +.swagger-ui .bg-white-90 { + background-color: hsla(0,0%,100%,.9) +} + +.swagger-ui .bg-white-80 { + background-color: hsla(0,0%,100%,.8) +} + +.swagger-ui .bg-white-70 { + background-color: hsla(0,0%,100%,.7) +} + +.swagger-ui .bg-white-60 { + background-color: hsla(0,0%,100%,.6) +} + +.swagger-ui .bg-white-50 { + background-color: hsla(0,0%,100%,.5) +} + +.swagger-ui .bg-white-40 { + background-color: hsla(0,0%,100%,.4) +} + +.swagger-ui .bg-white-30 { + background-color: hsla(0,0%,100%,.3) +} + +.swagger-ui .bg-white-20 { + background-color: hsla(0,0%,100%,.2) +} + +.swagger-ui .bg-white-10 { + background-color: hsla(0,0%,100%,.1) +} + +.swagger-ui .bg-black { + background-color: #000 +} + +.swagger-ui .bg-near-black { + background-color: #111 +} + +.swagger-ui .bg-dark-gray { + background-color: #333 +} + +.swagger-ui .bg-mid-gray { + background-color: #555 +} + +.swagger-ui .bg-gray { + background-color: #777 +} + +.swagger-ui .bg-silver { + background-color: #999 +} + +.swagger-ui .bg-light-silver { + background-color: #aaa +} + +.swagger-ui .bg-moon-gray { + background-color: #ccc +} + +.swagger-ui .bg-light-gray { + background-color: #eee +} + +.swagger-ui .bg-near-white { + background-color: #f4f4f4 +} + +.swagger-ui .bg-white { + background-color: #1c1c21 +} + +.swagger-ui .bg-transparent { + background-color: transparent +} + +.swagger-ui .bg-dark-red { + background-color: #e7040f +} + +.swagger-ui .bg-red { + background-color: #ff4136 +} + +.swagger-ui .bg-light-red { + background-color: #ff725c +} + +.swagger-ui .bg-orange { + background-color: #ff6300 +} + +.swagger-ui .bg-gold { + background-color: #ffb700 +} + +.swagger-ui .bg-yellow { + background-color: gold +} + +.swagger-ui .bg-light-yellow { + background-color: #fbf1a9 +} + +.swagger-ui .bg-purple { + background-color: #5e2ca5 +} + +.swagger-ui .bg-light-purple { + background-color: #a463f2 +} + +.swagger-ui .bg-dark-pink { + background-color: #d5008f +} + +.swagger-ui .bg-hot-pink { + background-color: #ff41b4 +} + +.swagger-ui .bg-pink { + background-color: #ff80cc +} + +.swagger-ui .bg-light-pink { + background-color: #ffa3d7 +} + +.swagger-ui .bg-dark-green { + background-color: #137752 +} + +.swagger-ui .bg-green { + background-color: #19a974 +} + +.swagger-ui .bg-light-green { + background-color: #9eebcf +} + +.swagger-ui .bg-navy { + background-color: #001b44 +} + +.swagger-ui .bg-dark-blue { + background-color: #00449e +} + +.swagger-ui .bg-blue { + background-color: #357edd +} + +.swagger-ui .bg-light-blue { + background-color: #96ccff +} + +.swagger-ui .bg-lightest-blue { + background-color: #cdecff +} + +.swagger-ui .bg-washed-blue { + background-color: #f6fffe +} + +.swagger-ui .bg-washed-green { + background-color: #e8fdf5 +} + +.swagger-ui .bg-washed-yellow { + background-color: #1c1c21ceb +} + +.swagger-ui .bg-washed-red { + background-color: #ffdfdf +} + +.swagger-ui .bg-inherit { + background-color: inherit +} + +.swagger-ui .hover-black:focus, .swagger-ui .hover-black:hover { + color: #000 +} + +.swagger-ui .hover-near-black:focus, .swagger-ui .hover-near-black:hover { + color: #111 +} + +.swagger-ui .hover-dark-gray:focus, .swagger-ui .hover-dark-gray:hover { + color: #333 +} + +.swagger-ui .hover-mid-gray:focus, .swagger-ui .hover-mid-gray:hover { + color: #555 +} + +.swagger-ui .hover-gray:focus, .swagger-ui .hover-gray:hover { + color: #777 +} + +.swagger-ui .hover-silver:focus, .swagger-ui .hover-silver:hover { + color: #999 +} + +.swagger-ui .hover-light-silver:focus, .swagger-ui .hover-light-silver:hover { + color: #aaa +} + +.swagger-ui .hover-moon-gray:focus, .swagger-ui .hover-moon-gray:hover { + color: #ccc +} + +.swagger-ui .hover-light-gray:focus, .swagger-ui .hover-light-gray:hover { + color: #eee +} + +.swagger-ui .hover-near-white:focus, .swagger-ui .hover-near-white:hover { + color: #f4f4f4 +} + +.swagger-ui .hover-white:focus, .swagger-ui .hover-white:hover { + color: #1c1c21 +} + +.swagger-ui .hover-black-90:focus, .swagger-ui .hover-black-90:hover { + color: rgba(0,0,0,.9) +} + +.swagger-ui .hover-black-80:focus, .swagger-ui .hover-black-80:hover { + color: rgba(0,0,0,.8) +} + +.swagger-ui .hover-black-70:focus, .swagger-ui .hover-black-70:hover { + color: rgba(0,0,0,.7) +} + +.swagger-ui .hover-black-60:focus, .swagger-ui .hover-black-60:hover { + color: rgba(0,0,0,.6) +} + +.swagger-ui .hover-black-50:focus, .swagger-ui .hover-black-50:hover { + color: rgba(0,0,0,.5) +} + +.swagger-ui .hover-black-40:focus, .swagger-ui .hover-black-40:hover { + color: rgba(0,0,0,.4) +} + +.swagger-ui .hover-black-30:focus, .swagger-ui .hover-black-30:hover { + color: rgba(0,0,0,.3) +} + +.swagger-ui .hover-black-20:focus, .swagger-ui .hover-black-20:hover { + color: rgba(0,0,0,.2) +} + +.swagger-ui .hover-black-10:focus, .swagger-ui .hover-black-10:hover { + color: rgba(0,0,0,.1) +} + +.swagger-ui .hover-white-90:focus, .swagger-ui .hover-white-90:hover { + color: hsla(0,0%,100%,.9) +} + +.swagger-ui .hover-white-80:focus, .swagger-ui .hover-white-80:hover { + color: hsla(0,0%,100%,.8) +} + +.swagger-ui .hover-white-70:focus, .swagger-ui .hover-white-70:hover { + color: hsla(0,0%,100%,.7) +} + +.swagger-ui .hover-white-60:focus, .swagger-ui .hover-white-60:hover { + color: hsla(0,0%,100%,.6) +} + +.swagger-ui .hover-white-50:focus, .swagger-ui .hover-white-50:hover { + color: hsla(0,0%,100%,.5) +} + +.swagger-ui .hover-white-40:focus, .swagger-ui .hover-white-40:hover { + color: hsla(0,0%,100%,.4) +} + +.swagger-ui .hover-white-30:focus, .swagger-ui .hover-white-30:hover { + color: hsla(0,0%,100%,.3) +} + +.swagger-ui .hover-white-20:focus, .swagger-ui .hover-white-20:hover { + color: hsla(0,0%,100%,.2) +} + +.swagger-ui .hover-white-10:focus, .swagger-ui .hover-white-10:hover { + color: hsla(0,0%,100%,.1) +} + +.swagger-ui .hover-inherit:focus, .swagger-ui .hover-inherit:hover { + color: inherit +} + +.swagger-ui .hover-bg-black:focus, .swagger-ui .hover-bg-black:hover { + background-color: #000 +} + +.swagger-ui .hover-bg-near-black:focus, .swagger-ui .hover-bg-near-black:hover { + background-color: #111 +} + +.swagger-ui .hover-bg-dark-gray:focus, .swagger-ui .hover-bg-dark-gray:hover { + background-color: #333 +} + +.swagger-ui .hover-bg-mid-gray:focus, .swagger-ui .hover-bg-mid-gray:hover { + background-color: #555 +} + +.swagger-ui .hover-bg-gray:focus, .swagger-ui .hover-bg-gray:hover { + background-color: #777 +} + +.swagger-ui .hover-bg-silver:focus, .swagger-ui .hover-bg-silver:hover { + background-color: #999 +} + +.swagger-ui .hover-bg-light-silver:focus, .swagger-ui .hover-bg-light-silver:hover { + background-color: #aaa +} + +.swagger-ui .hover-bg-moon-gray:focus, .swagger-ui .hover-bg-moon-gray:hover { + background-color: #ccc +} + +.swagger-ui .hover-bg-light-gray:focus, .swagger-ui .hover-bg-light-gray:hover { + background-color: #eee +} + +.swagger-ui .hover-bg-near-white:focus, .swagger-ui .hover-bg-near-white:hover { + background-color: #f4f4f4 +} + +.swagger-ui .hover-bg-white:focus, .swagger-ui .hover-bg-white:hover { + background-color: #1c1c21 +} + +.swagger-ui .hover-bg-transparent:focus, .swagger-ui .hover-bg-transparent:hover { + background-color: transparent +} + +.swagger-ui .hover-bg-black-90:focus, .swagger-ui .hover-bg-black-90:hover { + background-color: rgba(0,0,0,.9) +} + +.swagger-ui .hover-bg-black-80:focus, .swagger-ui .hover-bg-black-80:hover { + background-color: rgba(0,0,0,.8) +} + +.swagger-ui .hover-bg-black-70:focus, .swagger-ui .hover-bg-black-70:hover { + background-color: rgba(0,0,0,.7) +} + +.swagger-ui .hover-bg-black-60:focus, .swagger-ui .hover-bg-black-60:hover { + background-color: rgba(0,0,0,.6) +} + +.swagger-ui .hover-bg-black-50:focus, .swagger-ui .hover-bg-black-50:hover { + background-color: rgba(0,0,0,.5) +} + +.swagger-ui .hover-bg-black-40:focus, .swagger-ui .hover-bg-black-40:hover { + background-color: rgba(0,0,0,.4) +} + +.swagger-ui .hover-bg-black-30:focus, .swagger-ui .hover-bg-black-30:hover { + background-color: rgba(0,0,0,.3) +} + +.swagger-ui .hover-bg-black-20:focus, .swagger-ui .hover-bg-black-20:hover { + background-color: rgba(0,0,0,.2) +} + +.swagger-ui .hover-bg-black-10:focus, .swagger-ui .hover-bg-black-10:hover { + background-color: rgba(0,0,0,.1) +} + +.swagger-ui .hover-bg-white-90:focus, .swagger-ui .hover-bg-white-90:hover { + background-color: hsla(0,0%,100%,.9) +} + +.swagger-ui .hover-bg-white-80:focus, .swagger-ui .hover-bg-white-80:hover { + background-color: hsla(0,0%,100%,.8) +} + +.swagger-ui .hover-bg-white-70:focus, .swagger-ui .hover-bg-white-70:hover { + background-color: hsla(0,0%,100%,.7) +} + +.swagger-ui .hover-bg-white-60:focus, .swagger-ui .hover-bg-white-60:hover { + background-color: hsla(0,0%,100%,.6) +} + +.swagger-ui .hover-bg-white-50:focus, .swagger-ui .hover-bg-white-50:hover { + background-color: hsla(0,0%,100%,.5) +} + +.swagger-ui .hover-bg-white-40:focus, .swagger-ui .hover-bg-white-40:hover { + background-color: hsla(0,0%,100%,.4) +} + +.swagger-ui .hover-bg-white-30:focus, .swagger-ui .hover-bg-white-30:hover { + background-color: hsla(0,0%,100%,.3) +} + +.swagger-ui .hover-bg-white-20:focus, .swagger-ui .hover-bg-white-20:hover { + background-color: hsla(0,0%,100%,.2) +} + +.swagger-ui .hover-bg-white-10:focus, .swagger-ui .hover-bg-white-10:hover { + background-color: hsla(0,0%,100%,.1) +} + +.swagger-ui .hover-dark-red:focus, .swagger-ui .hover-dark-red:hover { + color: #e7040f +} + +.swagger-ui .hover-red:focus, .swagger-ui .hover-red:hover { + color: #ff4136 +} + +.swagger-ui .hover-light-red:focus, .swagger-ui .hover-light-red:hover { + color: #ff725c +} + +.swagger-ui .hover-orange:focus, .swagger-ui .hover-orange:hover { + color: #ff6300 +} + +.swagger-ui .hover-gold:focus, .swagger-ui .hover-gold:hover { + color: #ffb700 +} + +.swagger-ui .hover-yellow:focus, .swagger-ui .hover-yellow:hover { + color: gold +} + +.swagger-ui .hover-light-yellow:focus, .swagger-ui .hover-light-yellow:hover { + color: #fbf1a9 +} + +.swagger-ui .hover-purple:focus, .swagger-ui .hover-purple:hover { + color: #5e2ca5 +} + +.swagger-ui .hover-light-purple:focus, .swagger-ui .hover-light-purple:hover { + color: #a463f2 +} + +.swagger-ui .hover-dark-pink:focus, .swagger-ui .hover-dark-pink:hover { + color: #d5008f +} + +.swagger-ui .hover-hot-pink:focus, .swagger-ui .hover-hot-pink:hover { + color: #ff41b4 +} + +.swagger-ui .hover-pink:focus, .swagger-ui .hover-pink:hover { + color: #ff80cc +} + +.swagger-ui .hover-light-pink:focus, .swagger-ui .hover-light-pink:hover { + color: #ffa3d7 +} + +.swagger-ui .hover-dark-green:focus, .swagger-ui .hover-dark-green:hover { + color: #137752 +} + +.swagger-ui .hover-green:focus, .swagger-ui .hover-green:hover { + color: #19a974 +} + +.swagger-ui .hover-light-green:focus, .swagger-ui .hover-light-green:hover { + color: #9eebcf +} + +.swagger-ui .hover-navy:focus, .swagger-ui .hover-navy:hover { + color: #001b44 +} + +.swagger-ui .hover-dark-blue:focus, .swagger-ui .hover-dark-blue:hover { + color: #00449e +} + +.swagger-ui .hover-blue:focus, .swagger-ui .hover-blue:hover { + color: #357edd +} + +.swagger-ui .hover-light-blue:focus, .swagger-ui .hover-light-blue:hover { + color: #96ccff +} + +.swagger-ui .hover-lightest-blue:focus, .swagger-ui .hover-lightest-blue:hover { + color: #cdecff +} + +.swagger-ui .hover-washed-blue:focus, .swagger-ui .hover-washed-blue:hover { + color: #f6fffe +} + +.swagger-ui .hover-washed-green:focus, .swagger-ui .hover-washed-green:hover { + color: #e8fdf5 +} + +.swagger-ui .hover-washed-yellow:focus, .swagger-ui .hover-washed-yellow:hover { + color: #1c1c21ceb +} + +.swagger-ui .hover-washed-red:focus, .swagger-ui .hover-washed-red:hover { + color: #ffdfdf +} + +.swagger-ui .hover-bg-dark-red:focus, .swagger-ui .hover-bg-dark-red:hover { + background-color: #e7040f +} + +.swagger-ui .hover-bg-red:focus, .swagger-ui .hover-bg-red:hover { + background-color: #ff4136 +} + +.swagger-ui .hover-bg-light-red:focus, .swagger-ui .hover-bg-light-red:hover { + background-color: #ff725c +} + +.swagger-ui .hover-bg-orange:focus, .swagger-ui .hover-bg-orange:hover { + background-color: #ff6300 +} + +.swagger-ui .hover-bg-gold:focus, .swagger-ui .hover-bg-gold:hover { + background-color: #ffb700 +} + +.swagger-ui .hover-bg-yellow:focus, .swagger-ui .hover-bg-yellow:hover { + background-color: gold +} + +.swagger-ui .hover-bg-light-yellow:focus, .swagger-ui .hover-bg-light-yellow:hover { + background-color: #fbf1a9 +} + +.swagger-ui .hover-bg-purple:focus, .swagger-ui .hover-bg-purple:hover { + background-color: #5e2ca5 +} + +.swagger-ui .hover-bg-light-purple:focus, .swagger-ui .hover-bg-light-purple:hover { + background-color: #a463f2 +} + +.swagger-ui .hover-bg-dark-pink:focus, .swagger-ui .hover-bg-dark-pink:hover { + background-color: #d5008f +} + +.swagger-ui .hover-bg-hot-pink:focus, .swagger-ui .hover-bg-hot-pink:hover { + background-color: #ff41b4 +} + +.swagger-ui .hover-bg-pink:focus, .swagger-ui .hover-bg-pink:hover { + background-color: #ff80cc +} + +.swagger-ui .hover-bg-light-pink:focus, .swagger-ui .hover-bg-light-pink:hover { + background-color: #ffa3d7 +} + +.swagger-ui .hover-bg-dark-green:focus, .swagger-ui .hover-bg-dark-green:hover { + background-color: #137752 +} + +.swagger-ui .hover-bg-green:focus, .swagger-ui .hover-bg-green:hover { + background-color: #19a974 +} + +.swagger-ui .hover-bg-light-green:focus, .swagger-ui .hover-bg-light-green:hover { + background-color: #9eebcf +} + +.swagger-ui .hover-bg-navy:focus, .swagger-ui .hover-bg-navy:hover { + background-color: #001b44 +} + +.swagger-ui .hover-bg-dark-blue:focus, .swagger-ui .hover-bg-dark-blue:hover { + background-color: #00449e +} + +.swagger-ui .hover-bg-blue:focus, .swagger-ui .hover-bg-blue:hover { + background-color: #357edd +} + +.swagger-ui .hover-bg-light-blue:focus, .swagger-ui .hover-bg-light-blue:hover { + background-color: #96ccff +} + +.swagger-ui .hover-bg-lightest-blue:focus, .swagger-ui .hover-bg-lightest-blue:hover { + background-color: #cdecff +} + +.swagger-ui .hover-bg-washed-blue:focus, .swagger-ui .hover-bg-washed-blue:hover { + background-color: #f6fffe +} + +.swagger-ui .hover-bg-washed-green:focus, .swagger-ui .hover-bg-washed-green:hover { + background-color: #e8fdf5 +} + +.swagger-ui .hover-bg-washed-yellow:focus, .swagger-ui .hover-bg-washed-yellow:hover { + background-color: #1c1c21ceb +} + +.swagger-ui .hover-bg-washed-red:focus, .swagger-ui .hover-bg-washed-red:hover { + background-color: #ffdfdf +} + +.swagger-ui .hover-bg-inherit:focus, .swagger-ui .hover-bg-inherit:hover { + background-color: inherit +} + +.swagger-ui .pa0 { + padding: 0 +} + +.swagger-ui .pa1 { + padding: .25rem +} + +.swagger-ui .pa2 { + padding: .5rem +} + +.swagger-ui .pa3 { + padding: 1rem +} + +.swagger-ui .pa4 { + padding: 2rem +} + +.swagger-ui .pa5 { + padding: 4rem +} + +.swagger-ui .pa6 { + padding: 8rem +} + +.swagger-ui .pa7 { + padding: 16rem +} + +.swagger-ui .pl0 { + padding-left: 0 +} + +.swagger-ui .pl1 { + padding-left: .25rem +} + +.swagger-ui .pl2 { + padding-left: .5rem +} + +.swagger-ui .pl3 { + padding-left: 1rem +} + +.swagger-ui .pl4 { + padding-left: 2rem +} + +.swagger-ui .pl5 { + padding-left: 4rem +} + +.swagger-ui .pl6 { + padding-left: 8rem +} + +.swagger-ui .pl7 { + padding-left: 16rem +} + +.swagger-ui .pr0 { + padding-right: 0 +} + +.swagger-ui .pr1 { + padding-right: .25rem +} + +.swagger-ui .pr2 { + padding-right: .5rem +} + +.swagger-ui .pr3 { + padding-right: 1rem +} + +.swagger-ui .pr4 { + padding-right: 2rem +} + +.swagger-ui .pr5 { + padding-right: 4rem +} + +.swagger-ui .pr6 { + padding-right: 8rem +} + +.swagger-ui .pr7 { + padding-right: 16rem +} + +.swagger-ui .pb0 { + padding-bottom: 0 +} + +.swagger-ui .pb1 { + padding-bottom: .25rem +} + +.swagger-ui .pb2 { + padding-bottom: .5rem +} + +.swagger-ui .pb3 { + padding-bottom: 1rem +} + +.swagger-ui .pb4 { + padding-bottom: 2rem +} + +.swagger-ui .pb5 { + padding-bottom: 4rem +} + +.swagger-ui .pb6 { + padding-bottom: 8rem +} + +.swagger-ui .pb7 { + padding-bottom: 16rem +} + +.swagger-ui .pt0 { + padding-top: 0 +} + +.swagger-ui .pt1 { + padding-top: .25rem +} + +.swagger-ui .pt2 { + padding-top: .5rem +} + +.swagger-ui .pt3 { + padding-top: 1rem +} + +.swagger-ui .pt4 { + padding-top: 2rem +} + +.swagger-ui .pt5 { + padding-top: 4rem +} + +.swagger-ui .pt6 { + padding-top: 8rem +} + +.swagger-ui .pt7 { + padding-top: 16rem +} + +.swagger-ui .pv0 { + padding-bottom: 0; + padding-top: 0 +} + +.swagger-ui .pv1 { + padding-bottom: .25rem; + padding-top: .25rem +} + +.swagger-ui .pv2 { + padding-bottom: .5rem; + padding-top: .5rem +} + +.swagger-ui .pv3 { + padding-bottom: 1rem; + padding-top: 1rem +} + +.swagger-ui .pv4 { + padding-bottom: 2rem; + padding-top: 2rem +} + +.swagger-ui .pv5 { + padding-bottom: 4rem; + padding-top: 4rem +} + +.swagger-ui .pv6 { + padding-bottom: 8rem; + padding-top: 8rem +} + +.swagger-ui .pv7 { + padding-bottom: 16rem; + padding-top: 16rem +} + +.swagger-ui .ph0 { + padding-left: 0; + padding-right: 0 +} + +.swagger-ui .ph1 { + padding-left: .25rem; + padding-right: .25rem +} + +.swagger-ui .ph2 { + padding-left: .5rem; + padding-right: .5rem +} + +.swagger-ui .ph3 { + padding-left: 1rem; + padding-right: 1rem +} + +.swagger-ui .ph4 { + padding-left: 2rem; + padding-right: 2rem +} + +.swagger-ui .ph5 { + padding-left: 4rem; + padding-right: 4rem +} + +.swagger-ui .ph6 { + padding-left: 8rem; + padding-right: 8rem +} + +.swagger-ui .ph7 { + padding-left: 16rem; + padding-right: 16rem +} + +.swagger-ui .ma0 { + margin: 0 +} + +.swagger-ui .ma1 { + margin: .25rem +} + +.swagger-ui .ma2 { + margin: .5rem +} + +.swagger-ui .ma3 { + margin: 1rem +} + +.swagger-ui .ma4 { + margin: 2rem +} + +.swagger-ui .ma5 { + margin: 4rem +} + +.swagger-ui .ma6 { + margin: 8rem +} + +.swagger-ui .ma7 { + margin: 16rem +} + +.swagger-ui .ml0 { + margin-left: 0 +} + +.swagger-ui .ml1 { + margin-left: .25rem +} + +.swagger-ui .ml2 { + margin-left: .5rem +} + +.swagger-ui .ml3 { + margin-left: 1rem +} + +.swagger-ui .ml4 { + margin-left: 2rem +} + +.swagger-ui .ml5 { + margin-left: 4rem +} + +.swagger-ui .ml6 { + margin-left: 8rem +} + +.swagger-ui .ml7 { + margin-left: 16rem +} + +.swagger-ui .mr0 { + margin-right: 0 +} + +.swagger-ui .mr1 { + margin-right: .25rem +} + +.swagger-ui .mr2 { + margin-right: .5rem +} + +.swagger-ui .mr3 { + margin-right: 1rem +} + +.swagger-ui .mr4 { + margin-right: 2rem +} + +.swagger-ui .mr5 { + margin-right: 4rem +} + +.swagger-ui .mr6 { + margin-right: 8rem +} + +.swagger-ui .mr7 { + margin-right: 16rem +} + +.swagger-ui .mb0 { + margin-bottom: 0 +} + +.swagger-ui .mb1 { + margin-bottom: .25rem +} + +.swagger-ui .mb2 { + margin-bottom: .5rem +} + +.swagger-ui .mb3 { + margin-bottom: 1rem +} + +.swagger-ui .mb4 { + margin-bottom: 2rem +} + +.swagger-ui .mb5 { + margin-bottom: 4rem +} + +.swagger-ui .mb6 { + margin-bottom: 8rem +} + +.swagger-ui .mb7 { + margin-bottom: 16rem +} + +.swagger-ui .mt0 { + margin-top: 0 +} + +.swagger-ui .mt1 { + margin-top: .25rem +} + +.swagger-ui .mt2 { + margin-top: .5rem +} + +.swagger-ui .mt3 { + margin-top: 1rem +} + +.swagger-ui .mt4 { + margin-top: 2rem +} + +.swagger-ui .mt5 { + margin-top: 4rem +} + +.swagger-ui .mt6 { + margin-top: 8rem +} + +.swagger-ui .mt7 { + margin-top: 16rem +} + +.swagger-ui .mv0 { + margin-bottom: 0; + margin-top: 0 +} + +.swagger-ui .mv1 { + margin-bottom: .25rem; + margin-top: .25rem +} + +.swagger-ui .mv2 { + margin-bottom: .5rem; + margin-top: .5rem +} + +.swagger-ui .mv3 { + margin-bottom: 1rem; + margin-top: 1rem +} + +.swagger-ui .mv4 { + margin-bottom: 2rem; + margin-top: 2rem +} + +.swagger-ui .mv5 { + margin-bottom: 4rem; + margin-top: 4rem +} + +.swagger-ui .mv6 { + margin-bottom: 8rem; + margin-top: 8rem +} + +.swagger-ui .mv7 { + margin-bottom: 16rem; + margin-top: 16rem +} + +.swagger-ui .mh0 { + margin-left: 0; + margin-right: 0 +} + +.swagger-ui .mh1 { + margin-left: .25rem; + margin-right: .25rem +} + +.swagger-ui .mh2 { + margin-left: .5rem; + margin-right: .5rem +} + +.swagger-ui .mh3 { + margin-left: 1rem; + margin-right: 1rem +} + +.swagger-ui .mh4 { + margin-left: 2rem; + margin-right: 2rem +} + +.swagger-ui .mh5 { + margin-left: 4rem; + margin-right: 4rem +} + +.swagger-ui .mh6 { + margin-left: 8rem; + margin-right: 8rem +} + +.swagger-ui .mh7 { + margin-left: 16rem; + margin-right: 16rem +} + +@media screen and (min-width: 30em) { + .swagger-ui .pa0-ns { + padding: 0 + } + + .swagger-ui .pa1-ns { + padding: .25rem + } + + .swagger-ui .pa2-ns { + padding: .5rem + } + + .swagger-ui .pa3-ns { + padding: 1rem + } + + .swagger-ui .pa4-ns { + padding: 2rem + } + + .swagger-ui .pa5-ns { + padding: 4rem + } + + .swagger-ui .pa6-ns { + padding: 8rem + } + + .swagger-ui .pa7-ns { + padding: 16rem + } + + .swagger-ui .pl0-ns { + padding-left: 0 + } + + .swagger-ui .pl1-ns { + padding-left: .25rem + } + + .swagger-ui .pl2-ns { + padding-left: .5rem + } + + .swagger-ui .pl3-ns { + padding-left: 1rem + } + + .swagger-ui .pl4-ns { + padding-left: 2rem + } + + .swagger-ui .pl5-ns { + padding-left: 4rem + } + + .swagger-ui .pl6-ns { + padding-left: 8rem + } + + .swagger-ui .pl7-ns { + padding-left: 16rem + } + + .swagger-ui .pr0-ns { + padding-right: 0 + } + + .swagger-ui .pr1-ns { + padding-right: .25rem + } + + .swagger-ui .pr2-ns { + padding-right: .5rem + } + + .swagger-ui .pr3-ns { + padding-right: 1rem + } + + .swagger-ui .pr4-ns { + padding-right: 2rem + } + + .swagger-ui .pr5-ns { + padding-right: 4rem + } + + .swagger-ui .pr6-ns { + padding-right: 8rem + } + + .swagger-ui .pr7-ns { + padding-right: 16rem + } + + .swagger-ui .pb0-ns { + padding-bottom: 0 + } + + .swagger-ui .pb1-ns { + padding-bottom: .25rem + } + + .swagger-ui .pb2-ns { + padding-bottom: .5rem + } + + .swagger-ui .pb3-ns { + padding-bottom: 1rem + } + + .swagger-ui .pb4-ns { + padding-bottom: 2rem + } + + .swagger-ui .pb5-ns { + padding-bottom: 4rem + } + + .swagger-ui .pb6-ns { + padding-bottom: 8rem + } + + .swagger-ui .pb7-ns { + padding-bottom: 16rem + } + + .swagger-ui .pt0-ns { + padding-top: 0 + } + + .swagger-ui .pt1-ns { + padding-top: .25rem + } + + .swagger-ui .pt2-ns { + padding-top: .5rem + } + + .swagger-ui .pt3-ns { + padding-top: 1rem + } + + .swagger-ui .pt4-ns { + padding-top: 2rem + } + + .swagger-ui .pt5-ns { + padding-top: 4rem + } + + .swagger-ui .pt6-ns { + padding-top: 8rem + } + + .swagger-ui .pt7-ns { + padding-top: 16rem + } + + .swagger-ui .pv0-ns { + padding-bottom: 0; + padding-top: 0 + } + + .swagger-ui .pv1-ns { + padding-bottom: .25rem; + padding-top: .25rem + } + + .swagger-ui .pv2-ns { + padding-bottom: .5rem; + padding-top: .5rem + } + + .swagger-ui .pv3-ns { + padding-bottom: 1rem; + padding-top: 1rem + } + + .swagger-ui .pv4-ns { + padding-bottom: 2rem; + padding-top: 2rem + } + + .swagger-ui .pv5-ns { + padding-bottom: 4rem; + padding-top: 4rem + } + + .swagger-ui .pv6-ns { + padding-bottom: 8rem; + padding-top: 8rem + } + + .swagger-ui .pv7-ns { + padding-bottom: 16rem; + padding-top: 16rem + } + + .swagger-ui .ph0-ns { + padding-left: 0; + padding-right: 0 + } + + .swagger-ui .ph1-ns { + padding-left: .25rem; + padding-right: .25rem + } + + .swagger-ui .ph2-ns { + padding-left: .5rem; + padding-right: .5rem + } + + .swagger-ui .ph3-ns { + padding-left: 1rem; + padding-right: 1rem + } + + .swagger-ui .ph4-ns { + padding-left: 2rem; + padding-right: 2rem + } + + .swagger-ui .ph5-ns { + padding-left: 4rem; + padding-right: 4rem + } + + .swagger-ui .ph6-ns { + padding-left: 8rem; + padding-right: 8rem + } + + .swagger-ui .ph7-ns { + padding-left: 16rem; + padding-right: 16rem + } + + .swagger-ui .ma0-ns { + margin: 0 + } + + .swagger-ui .ma1-ns { + margin: .25rem + } + + .swagger-ui .ma2-ns { + margin: .5rem + } + + .swagger-ui .ma3-ns { + margin: 1rem + } + + .swagger-ui .ma4-ns { + margin: 2rem + } + + .swagger-ui .ma5-ns { + margin: 4rem + } + + .swagger-ui .ma6-ns { + margin: 8rem + } + + .swagger-ui .ma7-ns { + margin: 16rem + } + + .swagger-ui .ml0-ns { + margin-left: 0 + } + + .swagger-ui .ml1-ns { + margin-left: .25rem + } + + .swagger-ui .ml2-ns { + margin-left: .5rem + } + + .swagger-ui .ml3-ns { + margin-left: 1rem + } + + .swagger-ui .ml4-ns { + margin-left: 2rem + } + + .swagger-ui .ml5-ns { + margin-left: 4rem + } + + .swagger-ui .ml6-ns { + margin-left: 8rem + } + + .swagger-ui .ml7-ns { + margin-left: 16rem + } + + .swagger-ui .mr0-ns { + margin-right: 0 + } + + .swagger-ui .mr1-ns { + margin-right: .25rem + } + + .swagger-ui .mr2-ns { + margin-right: .5rem + } + + .swagger-ui .mr3-ns { + margin-right: 1rem + } + + .swagger-ui .mr4-ns { + margin-right: 2rem + } + + .swagger-ui .mr5-ns { + margin-right: 4rem + } + + .swagger-ui .mr6-ns { + margin-right: 8rem + } + + .swagger-ui .mr7-ns { + margin-right: 16rem + } + + .swagger-ui .mb0-ns { + margin-bottom: 0 + } + + .swagger-ui .mb1-ns { + margin-bottom: .25rem + } + + .swagger-ui .mb2-ns { + margin-bottom: .5rem + } + + .swagger-ui .mb3-ns { + margin-bottom: 1rem + } + + .swagger-ui .mb4-ns { + margin-bottom: 2rem + } + + .swagger-ui .mb5-ns { + margin-bottom: 4rem + } + + .swagger-ui .mb6-ns { + margin-bottom: 8rem + } + + .swagger-ui .mb7-ns { + margin-bottom: 16rem + } + + .swagger-ui .mt0-ns { + margin-top: 0 + } + + .swagger-ui .mt1-ns { + margin-top: .25rem + } + + .swagger-ui .mt2-ns { + margin-top: .5rem + } + + .swagger-ui .mt3-ns { + margin-top: 1rem + } + + .swagger-ui .mt4-ns { + margin-top: 2rem + } + + .swagger-ui .mt5-ns { + margin-top: 4rem + } + + .swagger-ui .mt6-ns { + margin-top: 8rem + } + + .swagger-ui .mt7-ns { + margin-top: 16rem + } + + .swagger-ui .mv0-ns { + margin-bottom: 0; + margin-top: 0 + } + + .swagger-ui .mv1-ns { + margin-bottom: .25rem; + margin-top: .25rem + } + + .swagger-ui .mv2-ns { + margin-bottom: .5rem; + margin-top: .5rem + } + + .swagger-ui .mv3-ns { + margin-bottom: 1rem; + margin-top: 1rem + } + + .swagger-ui .mv4-ns { + margin-bottom: 2rem; + margin-top: 2rem + } + + .swagger-ui .mv5-ns { + margin-bottom: 4rem; + margin-top: 4rem + } + + .swagger-ui .mv6-ns { + margin-bottom: 8rem; + margin-top: 8rem + } + + .swagger-ui .mv7-ns { + margin-bottom: 16rem; + margin-top: 16rem + } + + .swagger-ui .mh0-ns { + margin-left: 0; + margin-right: 0 + } + + .swagger-ui .mh1-ns { + margin-left: .25rem; + margin-right: .25rem + } + + .swagger-ui .mh2-ns { + margin-left: .5rem; + margin-right: .5rem + } + + .swagger-ui .mh3-ns { + margin-left: 1rem; + margin-right: 1rem + } + + .swagger-ui .mh4-ns { + margin-left: 2rem; + margin-right: 2rem + } + + .swagger-ui .mh5-ns { + margin-left: 4rem; + margin-right: 4rem + } + + .swagger-ui .mh6-ns { + margin-left: 8rem; + margin-right: 8rem + } + + .swagger-ui .mh7-ns { + margin-left: 16rem; + margin-right: 16rem + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .pa0-m { + padding: 0 + } + + .swagger-ui .pa1-m { + padding: .25rem + } + + .swagger-ui .pa2-m { + padding: .5rem + } + + .swagger-ui .pa3-m { + padding: 1rem + } + + .swagger-ui .pa4-m { + padding: 2rem + } + + .swagger-ui .pa5-m { + padding: 4rem + } + + .swagger-ui .pa6-m { + padding: 8rem + } + + .swagger-ui .pa7-m { + padding: 16rem + } + + .swagger-ui .pl0-m { + padding-left: 0 + } + + .swagger-ui .pl1-m { + padding-left: .25rem + } + + .swagger-ui .pl2-m { + padding-left: .5rem + } + + .swagger-ui .pl3-m { + padding-left: 1rem + } + + .swagger-ui .pl4-m { + padding-left: 2rem + } + + .swagger-ui .pl5-m { + padding-left: 4rem + } + + .swagger-ui .pl6-m { + padding-left: 8rem + } + + .swagger-ui .pl7-m { + padding-left: 16rem + } + + .swagger-ui .pr0-m { + padding-right: 0 + } + + .swagger-ui .pr1-m { + padding-right: .25rem + } + + .swagger-ui .pr2-m { + padding-right: .5rem + } + + .swagger-ui .pr3-m { + padding-right: 1rem + } + + .swagger-ui .pr4-m { + padding-right: 2rem + } + + .swagger-ui .pr5-m { + padding-right: 4rem + } + + .swagger-ui .pr6-m { + padding-right: 8rem + } + + .swagger-ui .pr7-m { + padding-right: 16rem + } + + .swagger-ui .pb0-m { + padding-bottom: 0 + } + + .swagger-ui .pb1-m { + padding-bottom: .25rem + } + + .swagger-ui .pb2-m { + padding-bottom: .5rem + } + + .swagger-ui .pb3-m { + padding-bottom: 1rem + } + + .swagger-ui .pb4-m { + padding-bottom: 2rem + } + + .swagger-ui .pb5-m { + padding-bottom: 4rem + } + + .swagger-ui .pb6-m { + padding-bottom: 8rem + } + + .swagger-ui .pb7-m { + padding-bottom: 16rem + } + + .swagger-ui .pt0-m { + padding-top: 0 + } + + .swagger-ui .pt1-m { + padding-top: .25rem + } + + .swagger-ui .pt2-m { + padding-top: .5rem + } + + .swagger-ui .pt3-m { + padding-top: 1rem + } + + .swagger-ui .pt4-m { + padding-top: 2rem + } + + .swagger-ui .pt5-m { + padding-top: 4rem + } + + .swagger-ui .pt6-m { + padding-top: 8rem + } + + .swagger-ui .pt7-m { + padding-top: 16rem + } + + .swagger-ui .pv0-m { + padding-bottom: 0; + padding-top: 0 + } + + .swagger-ui .pv1-m { + padding-bottom: .25rem; + padding-top: .25rem + } + + .swagger-ui .pv2-m { + padding-bottom: .5rem; + padding-top: .5rem + } + + .swagger-ui .pv3-m { + padding-bottom: 1rem; + padding-top: 1rem + } + + .swagger-ui .pv4-m { + padding-bottom: 2rem; + padding-top: 2rem + } + + .swagger-ui .pv5-m { + padding-bottom: 4rem; + padding-top: 4rem + } + + .swagger-ui .pv6-m { + padding-bottom: 8rem; + padding-top: 8rem + } + + .swagger-ui .pv7-m { + padding-bottom: 16rem; + padding-top: 16rem + } + + .swagger-ui .ph0-m { + padding-left: 0; + padding-right: 0 + } + + .swagger-ui .ph1-m { + padding-left: .25rem; + padding-right: .25rem + } + + .swagger-ui .ph2-m { + padding-left: .5rem; + padding-right: .5rem + } + + .swagger-ui .ph3-m { + padding-left: 1rem; + padding-right: 1rem + } + + .swagger-ui .ph4-m { + padding-left: 2rem; + padding-right: 2rem + } + + .swagger-ui .ph5-m { + padding-left: 4rem; + padding-right: 4rem + } + + .swagger-ui .ph6-m { + padding-left: 8rem; + padding-right: 8rem + } + + .swagger-ui .ph7-m { + padding-left: 16rem; + padding-right: 16rem + } + + .swagger-ui .ma0-m { + margin: 0 + } + + .swagger-ui .ma1-m { + margin: .25rem + } + + .swagger-ui .ma2-m { + margin: .5rem + } + + .swagger-ui .ma3-m { + margin: 1rem + } + + .swagger-ui .ma4-m { + margin: 2rem + } + + .swagger-ui .ma5-m { + margin: 4rem + } + + .swagger-ui .ma6-m { + margin: 8rem + } + + .swagger-ui .ma7-m { + margin: 16rem + } + + .swagger-ui .ml0-m { + margin-left: 0 + } + + .swagger-ui .ml1-m { + margin-left: .25rem + } + + .swagger-ui .ml2-m { + margin-left: .5rem + } + + .swagger-ui .ml3-m { + margin-left: 1rem + } + + .swagger-ui .ml4-m { + margin-left: 2rem + } + + .swagger-ui .ml5-m { + margin-left: 4rem + } + + .swagger-ui .ml6-m { + margin-left: 8rem + } + + .swagger-ui .ml7-m { + margin-left: 16rem + } + + .swagger-ui .mr0-m { + margin-right: 0 + } + + .swagger-ui .mr1-m { + margin-right: .25rem + } + + .swagger-ui .mr2-m { + margin-right: .5rem + } + + .swagger-ui .mr3-m { + margin-right: 1rem + } + + .swagger-ui .mr4-m { + margin-right: 2rem + } + + .swagger-ui .mr5-m { + margin-right: 4rem + } + + .swagger-ui .mr6-m { + margin-right: 8rem + } + + .swagger-ui .mr7-m { + margin-right: 16rem + } + + .swagger-ui .mb0-m { + margin-bottom: 0 + } + + .swagger-ui .mb1-m { + margin-bottom: .25rem + } + + .swagger-ui .mb2-m { + margin-bottom: .5rem + } + + .swagger-ui .mb3-m { + margin-bottom: 1rem + } + + .swagger-ui .mb4-m { + margin-bottom: 2rem + } + + .swagger-ui .mb5-m { + margin-bottom: 4rem + } + + .swagger-ui .mb6-m { + margin-bottom: 8rem + } + + .swagger-ui .mb7-m { + margin-bottom: 16rem + } + + .swagger-ui .mt0-m { + margin-top: 0 + } + + .swagger-ui .mt1-m { + margin-top: .25rem + } + + .swagger-ui .mt2-m { + margin-top: .5rem + } + + .swagger-ui .mt3-m { + margin-top: 1rem + } + + .swagger-ui .mt4-m { + margin-top: 2rem + } + + .swagger-ui .mt5-m { + margin-top: 4rem + } + + .swagger-ui .mt6-m { + margin-top: 8rem + } + + .swagger-ui .mt7-m { + margin-top: 16rem + } + + .swagger-ui .mv0-m { + margin-bottom: 0; + margin-top: 0 + } + + .swagger-ui .mv1-m { + margin-bottom: .25rem; + margin-top: .25rem + } + + .swagger-ui .mv2-m { + margin-bottom: .5rem; + margin-top: .5rem + } + + .swagger-ui .mv3-m { + margin-bottom: 1rem; + margin-top: 1rem + } + + .swagger-ui .mv4-m { + margin-bottom: 2rem; + margin-top: 2rem + } + + .swagger-ui .mv5-m { + margin-bottom: 4rem; + margin-top: 4rem + } + + .swagger-ui .mv6-m { + margin-bottom: 8rem; + margin-top: 8rem + } + + .swagger-ui .mv7-m { + margin-bottom: 16rem; + margin-top: 16rem + } + + .swagger-ui .mh0-m { + margin-left: 0; + margin-right: 0 + } + + .swagger-ui .mh1-m { + margin-left: .25rem; + margin-right: .25rem + } + + .swagger-ui .mh2-m { + margin-left: .5rem; + margin-right: .5rem + } + + .swagger-ui .mh3-m { + margin-left: 1rem; + margin-right: 1rem + } + + .swagger-ui .mh4-m { + margin-left: 2rem; + margin-right: 2rem + } + + .swagger-ui .mh5-m { + margin-left: 4rem; + margin-right: 4rem + } + + .swagger-ui .mh6-m { + margin-left: 8rem; + margin-right: 8rem + } + + .swagger-ui .mh7-m { + margin-left: 16rem; + margin-right: 16rem + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .pa0-l { + padding: 0 + } + + .swagger-ui .pa1-l { + padding: .25rem + } + + .swagger-ui .pa2-l { + padding: .5rem + } + + .swagger-ui .pa3-l { + padding: 1rem + } + + .swagger-ui .pa4-l { + padding: 2rem + } + + .swagger-ui .pa5-l { + padding: 4rem + } + + .swagger-ui .pa6-l { + padding: 8rem + } + + .swagger-ui .pa7-l { + padding: 16rem + } + + .swagger-ui .pl0-l { + padding-left: 0 + } + + .swagger-ui .pl1-l { + padding-left: .25rem + } + + .swagger-ui .pl2-l { + padding-left: .5rem + } + + .swagger-ui .pl3-l { + padding-left: 1rem + } + + .swagger-ui .pl4-l { + padding-left: 2rem + } + + .swagger-ui .pl5-l { + padding-left: 4rem + } + + .swagger-ui .pl6-l { + padding-left: 8rem + } + + .swagger-ui .pl7-l { + padding-left: 16rem + } + + .swagger-ui .pr0-l { + padding-right: 0 + } + + .swagger-ui .pr1-l { + padding-right: .25rem + } + + .swagger-ui .pr2-l { + padding-right: .5rem + } + + .swagger-ui .pr3-l { + padding-right: 1rem + } + + .swagger-ui .pr4-l { + padding-right: 2rem + } + + .swagger-ui .pr5-l { + padding-right: 4rem + } + + .swagger-ui .pr6-l { + padding-right: 8rem + } + + .swagger-ui .pr7-l { + padding-right: 16rem + } + + .swagger-ui .pb0-l { + padding-bottom: 0 + } + + .swagger-ui .pb1-l { + padding-bottom: .25rem + } + + .swagger-ui .pb2-l { + padding-bottom: .5rem + } + + .swagger-ui .pb3-l { + padding-bottom: 1rem + } + + .swagger-ui .pb4-l { + padding-bottom: 2rem + } + + .swagger-ui .pb5-l { + padding-bottom: 4rem + } + + .swagger-ui .pb6-l { + padding-bottom: 8rem + } + + .swagger-ui .pb7-l { + padding-bottom: 16rem + } + + .swagger-ui .pt0-l { + padding-top: 0 + } + + .swagger-ui .pt1-l { + padding-top: .25rem + } + + .swagger-ui .pt2-l { + padding-top: .5rem + } + + .swagger-ui .pt3-l { + padding-top: 1rem + } + + .swagger-ui .pt4-l { + padding-top: 2rem + } + + .swagger-ui .pt5-l { + padding-top: 4rem + } + + .swagger-ui .pt6-l { + padding-top: 8rem + } + + .swagger-ui .pt7-l { + padding-top: 16rem + } + + .swagger-ui .pv0-l { + padding-bottom: 0; + padding-top: 0 + } + + .swagger-ui .pv1-l { + padding-bottom: .25rem; + padding-top: .25rem + } + + .swagger-ui .pv2-l { + padding-bottom: .5rem; + padding-top: .5rem + } + + .swagger-ui .pv3-l { + padding-bottom: 1rem; + padding-top: 1rem + } + + .swagger-ui .pv4-l { + padding-bottom: 2rem; + padding-top: 2rem + } + + .swagger-ui .pv5-l { + padding-bottom: 4rem; + padding-top: 4rem + } + + .swagger-ui .pv6-l { + padding-bottom: 8rem; + padding-top: 8rem + } + + .swagger-ui .pv7-l { + padding-bottom: 16rem; + padding-top: 16rem + } + + .swagger-ui .ph0-l { + padding-left: 0; + padding-right: 0 + } + + .swagger-ui .ph1-l { + padding-left: .25rem; + padding-right: .25rem + } + + .swagger-ui .ph2-l { + padding-left: .5rem; + padding-right: .5rem + } + + .swagger-ui .ph3-l { + padding-left: 1rem; + padding-right: 1rem + } + + .swagger-ui .ph4-l { + padding-left: 2rem; + padding-right: 2rem + } + + .swagger-ui .ph5-l { + padding-left: 4rem; + padding-right: 4rem + } + + .swagger-ui .ph6-l { + padding-left: 8rem; + padding-right: 8rem + } + + .swagger-ui .ph7-l { + padding-left: 16rem; + padding-right: 16rem + } + + .swagger-ui .ma0-l { + margin: 0 + } + + .swagger-ui .ma1-l { + margin: .25rem + } + + .swagger-ui .ma2-l { + margin: .5rem + } + + .swagger-ui .ma3-l { + margin: 1rem + } + + .swagger-ui .ma4-l { + margin: 2rem + } + + .swagger-ui .ma5-l { + margin: 4rem + } + + .swagger-ui .ma6-l { + margin: 8rem + } + + .swagger-ui .ma7-l { + margin: 16rem + } + + .swagger-ui .ml0-l { + margin-left: 0 + } + + .swagger-ui .ml1-l { + margin-left: .25rem + } + + .swagger-ui .ml2-l { + margin-left: .5rem + } + + .swagger-ui .ml3-l { + margin-left: 1rem + } + + .swagger-ui .ml4-l { + margin-left: 2rem + } + + .swagger-ui .ml5-l { + margin-left: 4rem + } + + .swagger-ui .ml6-l { + margin-left: 8rem + } + + .swagger-ui .ml7-l { + margin-left: 16rem + } + + .swagger-ui .mr0-l { + margin-right: 0 + } + + .swagger-ui .mr1-l { + margin-right: .25rem + } + + .swagger-ui .mr2-l { + margin-right: .5rem + } + + .swagger-ui .mr3-l { + margin-right: 1rem + } + + .swagger-ui .mr4-l { + margin-right: 2rem + } + + .swagger-ui .mr5-l { + margin-right: 4rem + } + + .swagger-ui .mr6-l { + margin-right: 8rem + } + + .swagger-ui .mr7-l { + margin-right: 16rem + } + + .swagger-ui .mb0-l { + margin-bottom: 0 + } + + .swagger-ui .mb1-l { + margin-bottom: .25rem + } + + .swagger-ui .mb2-l { + margin-bottom: .5rem + } + + .swagger-ui .mb3-l { + margin-bottom: 1rem + } + + .swagger-ui .mb4-l { + margin-bottom: 2rem + } + + .swagger-ui .mb5-l { + margin-bottom: 4rem + } + + .swagger-ui .mb6-l { + margin-bottom: 8rem + } + + .swagger-ui .mb7-l { + margin-bottom: 16rem + } + + .swagger-ui .mt0-l { + margin-top: 0 + } + + .swagger-ui .mt1-l { + margin-top: .25rem + } + + .swagger-ui .mt2-l { + margin-top: .5rem + } + + .swagger-ui .mt3-l { + margin-top: 1rem + } + + .swagger-ui .mt4-l { + margin-top: 2rem + } + + .swagger-ui .mt5-l { + margin-top: 4rem + } + + .swagger-ui .mt6-l { + margin-top: 8rem + } + + .swagger-ui .mt7-l { + margin-top: 16rem + } + + .swagger-ui .mv0-l { + margin-bottom: 0; + margin-top: 0 + } + + .swagger-ui .mv1-l { + margin-bottom: .25rem; + margin-top: .25rem + } + + .swagger-ui .mv2-l { + margin-bottom: .5rem; + margin-top: .5rem + } + + .swagger-ui .mv3-l { + margin-bottom: 1rem; + margin-top: 1rem + } + + .swagger-ui .mv4-l { + margin-bottom: 2rem; + margin-top: 2rem + } + + .swagger-ui .mv5-l { + margin-bottom: 4rem; + margin-top: 4rem + } + + .swagger-ui .mv6-l { + margin-bottom: 8rem; + margin-top: 8rem + } + + .swagger-ui .mv7-l { + margin-bottom: 16rem; + margin-top: 16rem + } + + .swagger-ui .mh0-l { + margin-left: 0; + margin-right: 0 + } + + .swagger-ui .mh1-l { + margin-left: .25rem; + margin-right: .25rem + } + + .swagger-ui .mh2-l { + margin-left: .5rem; + margin-right: .5rem + } + + .swagger-ui .mh3-l { + margin-left: 1rem; + margin-right: 1rem + } + + .swagger-ui .mh4-l { + margin-left: 2rem; + margin-right: 2rem + } + + .swagger-ui .mh5-l { + margin-left: 4rem; + margin-right: 4rem + } + + .swagger-ui .mh6-l { + margin-left: 8rem; + margin-right: 8rem + } + + .swagger-ui .mh7-l { + margin-left: 16rem; + margin-right: 16rem + } +} + +.swagger-ui .na1 { + margin: -.25rem +} + +.swagger-ui .na2 { + margin: -.5rem +} + +.swagger-ui .na3 { + margin: -1rem +} + +.swagger-ui .na4 { + margin: -2rem +} + +.swagger-ui .na5 { + margin: -4rem +} + +.swagger-ui .na6 { + margin: -8rem +} + +.swagger-ui .na7 { + margin: -16rem +} + +.swagger-ui .nl1 { + margin-left: -.25rem +} + +.swagger-ui .nl2 { + margin-left: -.5rem +} + +.swagger-ui .nl3 { + margin-left: -1rem +} + +.swagger-ui .nl4 { + margin-left: -2rem +} + +.swagger-ui .nl5 { + margin-left: -4rem +} + +.swagger-ui .nl6 { + margin-left: -8rem +} + +.swagger-ui .nl7 { + margin-left: -16rem +} + +.swagger-ui .nr1 { + margin-right: -.25rem +} + +.swagger-ui .nr2 { + margin-right: -.5rem +} + +.swagger-ui .nr3 { + margin-right: -1rem +} + +.swagger-ui .nr4 { + margin-right: -2rem +} + +.swagger-ui .nr5 { + margin-right: -4rem +} + +.swagger-ui .nr6 { + margin-right: -8rem +} + +.swagger-ui .nr7 { + margin-right: -16rem +} + +.swagger-ui .nb1 { + margin-bottom: -.25rem +} + +.swagger-ui .nb2 { + margin-bottom: -.5rem +} + +.swagger-ui .nb3 { + margin-bottom: -1rem +} + +.swagger-ui .nb4 { + margin-bottom: -2rem +} + +.swagger-ui .nb5 { + margin-bottom: -4rem +} + +.swagger-ui .nb6 { + margin-bottom: -8rem +} + +.swagger-ui .nb7 { + margin-bottom: -16rem +} + +.swagger-ui .nt1 { + margin-top: -.25rem +} + +.swagger-ui .nt2 { + margin-top: -.5rem +} + +.swagger-ui .nt3 { + margin-top: -1rem +} + +.swagger-ui .nt4 { + margin-top: -2rem +} + +.swagger-ui .nt5 { + margin-top: -4rem +} + +.swagger-ui .nt6 { + margin-top: -8rem +} + +.swagger-ui .nt7 { + margin-top: -16rem +} + +@media screen and (min-width: 30em) { + .swagger-ui .na1-ns { + margin: -.25rem + } + + .swagger-ui .na2-ns { + margin: -.5rem + } + + .swagger-ui .na3-ns { + margin: -1rem + } + + .swagger-ui .na4-ns { + margin: -2rem + } + + .swagger-ui .na5-ns { + margin: -4rem + } + + .swagger-ui .na6-ns { + margin: -8rem + } + + .swagger-ui .na7-ns { + margin: -16rem + } + + .swagger-ui .nl1-ns { + margin-left: -.25rem + } + + .swagger-ui .nl2-ns { + margin-left: -.5rem + } + + .swagger-ui .nl3-ns { + margin-left: -1rem + } + + .swagger-ui .nl4-ns { + margin-left: -2rem + } + + .swagger-ui .nl5-ns { + margin-left: -4rem + } + + .swagger-ui .nl6-ns { + margin-left: -8rem + } + + .swagger-ui .nl7-ns { + margin-left: -16rem + } + + .swagger-ui .nr1-ns { + margin-right: -.25rem + } + + .swagger-ui .nr2-ns { + margin-right: -.5rem + } + + .swagger-ui .nr3-ns { + margin-right: -1rem + } + + .swagger-ui .nr4-ns { + margin-right: -2rem + } + + .swagger-ui .nr5-ns { + margin-right: -4rem + } + + .swagger-ui .nr6-ns { + margin-right: -8rem + } + + .swagger-ui .nr7-ns { + margin-right: -16rem + } + + .swagger-ui .nb1-ns { + margin-bottom: -.25rem + } + + .swagger-ui .nb2-ns { + margin-bottom: -.5rem + } + + .swagger-ui .nb3-ns { + margin-bottom: -1rem + } + + .swagger-ui .nb4-ns { + margin-bottom: -2rem + } + + .swagger-ui .nb5-ns { + margin-bottom: -4rem + } + + .swagger-ui .nb6-ns { + margin-bottom: -8rem + } + + .swagger-ui .nb7-ns { + margin-bottom: -16rem + } + + .swagger-ui .nt1-ns { + margin-top: -.25rem + } + + .swagger-ui .nt2-ns { + margin-top: -.5rem + } + + .swagger-ui .nt3-ns { + margin-top: -1rem + } + + .swagger-ui .nt4-ns { + margin-top: -2rem + } + + .swagger-ui .nt5-ns { + margin-top: -4rem + } + + .swagger-ui .nt6-ns { + margin-top: -8rem + } + + .swagger-ui .nt7-ns { + margin-top: -16rem + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .na1-m { + margin: -.25rem + } + + .swagger-ui .na2-m { + margin: -.5rem + } + + .swagger-ui .na3-m { + margin: -1rem + } + + .swagger-ui .na4-m { + margin: -2rem + } + + .swagger-ui .na5-m { + margin: -4rem + } + + .swagger-ui .na6-m { + margin: -8rem + } + + .swagger-ui .na7-m { + margin: -16rem + } + + .swagger-ui .nl1-m { + margin-left: -.25rem + } + + .swagger-ui .nl2-m { + margin-left: -.5rem + } + + .swagger-ui .nl3-m { + margin-left: -1rem + } + + .swagger-ui .nl4-m { + margin-left: -2rem + } + + .swagger-ui .nl5-m { + margin-left: -4rem + } + + .swagger-ui .nl6-m { + margin-left: -8rem + } + + .swagger-ui .nl7-m { + margin-left: -16rem + } + + .swagger-ui .nr1-m { + margin-right: -.25rem + } + + .swagger-ui .nr2-m { + margin-right: -.5rem + } + + .swagger-ui .nr3-m { + margin-right: -1rem + } + + .swagger-ui .nr4-m { + margin-right: -2rem + } + + .swagger-ui .nr5-m { + margin-right: -4rem + } + + .swagger-ui .nr6-m { + margin-right: -8rem + } + + .swagger-ui .nr7-m { + margin-right: -16rem + } + + .swagger-ui .nb1-m { + margin-bottom: -.25rem + } + + .swagger-ui .nb2-m { + margin-bottom: -.5rem + } + + .swagger-ui .nb3-m { + margin-bottom: -1rem + } + + .swagger-ui .nb4-m { + margin-bottom: -2rem + } + + .swagger-ui .nb5-m { + margin-bottom: -4rem + } + + .swagger-ui .nb6-m { + margin-bottom: -8rem + } + + .swagger-ui .nb7-m { + margin-bottom: -16rem + } + + .swagger-ui .nt1-m { + margin-top: -.25rem + } + + .swagger-ui .nt2-m { + margin-top: -.5rem + } + + .swagger-ui .nt3-m { + margin-top: -1rem + } + + .swagger-ui .nt4-m { + margin-top: -2rem + } + + .swagger-ui .nt5-m { + margin-top: -4rem + } + + .swagger-ui .nt6-m { + margin-top: -8rem + } + + .swagger-ui .nt7-m { + margin-top: -16rem + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .na1-l { + margin: -.25rem + } + + .swagger-ui .na2-l { + margin: -.5rem + } + + .swagger-ui .na3-l { + margin: -1rem + } + + .swagger-ui .na4-l { + margin: -2rem + } + + .swagger-ui .na5-l { + margin: -4rem + } + + .swagger-ui .na6-l { + margin: -8rem + } + + .swagger-ui .na7-l { + margin: -16rem + } + + .swagger-ui .nl1-l { + margin-left: -.25rem + } + + .swagger-ui .nl2-l { + margin-left: -.5rem + } + + .swagger-ui .nl3-l { + margin-left: -1rem + } + + .swagger-ui .nl4-l { + margin-left: -2rem + } + + .swagger-ui .nl5-l { + margin-left: -4rem + } + + .swagger-ui .nl6-l { + margin-left: -8rem + } + + .swagger-ui .nl7-l { + margin-left: -16rem + } + + .swagger-ui .nr1-l { + margin-right: -.25rem + } + + .swagger-ui .nr2-l { + margin-right: -.5rem + } + + .swagger-ui .nr3-l { + margin-right: -1rem + } + + .swagger-ui .nr4-l { + margin-right: -2rem + } + + .swagger-ui .nr5-l { + margin-right: -4rem + } + + .swagger-ui .nr6-l { + margin-right: -8rem + } + + .swagger-ui .nr7-l { + margin-right: -16rem + } + + .swagger-ui .nb1-l { + margin-bottom: -.25rem + } + + .swagger-ui .nb2-l { + margin-bottom: -.5rem + } + + .swagger-ui .nb3-l { + margin-bottom: -1rem + } + + .swagger-ui .nb4-l { + margin-bottom: -2rem + } + + .swagger-ui .nb5-l { + margin-bottom: -4rem + } + + .swagger-ui .nb6-l { + margin-bottom: -8rem + } + + .swagger-ui .nb7-l { + margin-bottom: -16rem + } + + .swagger-ui .nt1-l { + margin-top: -.25rem + } + + .swagger-ui .nt2-l { + margin-top: -.5rem + } + + .swagger-ui .nt3-l { + margin-top: -1rem + } + + .swagger-ui .nt4-l { + margin-top: -2rem + } + + .swagger-ui .nt5-l { + margin-top: -4rem + } + + .swagger-ui .nt6-l { + margin-top: -8rem + } + + .swagger-ui .nt7-l { + margin-top: -16rem + } +} + +.swagger-ui .collapse { + border-collapse: collapse; + border-spacing: 0 +} + +.swagger-ui .striped--light-silver:nth-child(odd) { + background-color: #aaa +} + +.swagger-ui .striped--moon-gray:nth-child(odd) { + background-color: #ccc +} + +.swagger-ui .striped--light-gray:nth-child(odd) { + background-color: #eee +} + +.swagger-ui .striped--near-white:nth-child(odd) { + background-color: #f4f4f4 +} + +.swagger-ui .stripe-light:nth-child(odd) { + background-color: hsla(0,0%,100%,.1) +} + +.swagger-ui .stripe-dark:nth-child(odd) { + background-color: rgba(0,0,0,.1) +} + +.swagger-ui .strike { + text-decoration: line-through +} + +.swagger-ui .underline { + text-decoration: underline +} + +.swagger-ui .no-underline { + text-decoration: none +} + +@media screen and (min-width: 30em) { + .swagger-ui .strike-ns { + text-decoration: line-through + } + + .swagger-ui .underline-ns { + text-decoration: underline + } + + .swagger-ui .no-underline-ns { + text-decoration: none + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .strike-m { + text-decoration: line-through + } + + .swagger-ui .underline-m { + text-decoration: underline + } + + .swagger-ui .no-underline-m { + text-decoration: none + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .strike-l { + text-decoration: line-through + } + + .swagger-ui .underline-l { + text-decoration: underline + } + + .swagger-ui .no-underline-l { + text-decoration: none + } +} + +.swagger-ui .tl { + text-align: left +} + +.swagger-ui .tr { + text-align: right +} + +.swagger-ui .tc { + text-align: center +} + +.swagger-ui .tj { + text-align: justify +} + +@media screen and (min-width: 30em) { + .swagger-ui .tl-ns { + text-align: left + } + + .swagger-ui .tr-ns { + text-align: right + } + + .swagger-ui .tc-ns { + text-align: center + } + + .swagger-ui .tj-ns { + text-align: justify + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .tl-m { + text-align: left + } + + .swagger-ui .tr-m { + text-align: right + } + + .swagger-ui .tc-m { + text-align: center + } + + .swagger-ui .tj-m { + text-align: justify + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .tl-l { + text-align: left + } + + .swagger-ui .tr-l { + text-align: right + } + + .swagger-ui .tc-l { + text-align: center + } + + .swagger-ui .tj-l { + text-align: justify + } +} + +.swagger-ui .ttc { + text-transform: capitalize +} + +.swagger-ui .ttl { + text-transform: lowercase +} + +.swagger-ui .ttu { + text-transform: uppercase +} + +.swagger-ui .ttn { + text-transform: none +} + +@media screen and (min-width: 30em) { + .swagger-ui .ttc-ns { + text-transform: capitalize + } + + .swagger-ui .ttl-ns { + text-transform: lowercase + } + + .swagger-ui .ttu-ns { + text-transform: uppercase + } + + .swagger-ui .ttn-ns { + text-transform: none + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .ttc-m { + text-transform: capitalize + } + + .swagger-ui .ttl-m { + text-transform: lowercase + } + + .swagger-ui .ttu-m { + text-transform: uppercase + } + + .swagger-ui .ttn-m { + text-transform: none + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .ttc-l { + text-transform: capitalize + } + + .swagger-ui .ttl-l { + text-transform: lowercase + } + + .swagger-ui .ttu-l { + text-transform: uppercase + } + + .swagger-ui .ttn-l { + text-transform: none + } +} + +.swagger-ui .f-6, .swagger-ui .f-headline { + font-size: 6rem +} + +.swagger-ui .f-5, .swagger-ui .f-subheadline { + font-size: 5rem +} + +.swagger-ui .f1 { + font-size: 3rem +} + +.swagger-ui .f2 { + font-size: 2.25rem +} + +.swagger-ui .f3 { + font-size: 1.5rem +} + +.swagger-ui .f4 { + font-size: 1.25rem +} + +.swagger-ui .f5 { + font-size: 1rem +} + +.swagger-ui .f6 { + font-size: .875rem +} + +.swagger-ui .f7 { + font-size: .75rem +} + +@media screen and (min-width: 30em) { + .swagger-ui .f-6-ns, .swagger-ui .f-headline-ns { + font-size: 6rem + } + + .swagger-ui .f-5-ns, .swagger-ui .f-subheadline-ns { + font-size: 5rem + } + + .swagger-ui .f1-ns { + font-size: 3rem + } + + .swagger-ui .f2-ns { + font-size: 2.25rem + } + + .swagger-ui .f3-ns { + font-size: 1.5rem + } + + .swagger-ui .f4-ns { + font-size: 1.25rem + } + + .swagger-ui .f5-ns { + font-size: 1rem + } + + .swagger-ui .f6-ns { + font-size: .875rem + } + + .swagger-ui .f7-ns { + font-size: .75rem + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .f-6-m, .swagger-ui .f-headline-m { + font-size: 6rem + } + + .swagger-ui .f-5-m, .swagger-ui .f-subheadline-m { + font-size: 5rem + } + + .swagger-ui .f1-m { + font-size: 3rem + } + + .swagger-ui .f2-m { + font-size: 2.25rem + } + + .swagger-ui .f3-m { + font-size: 1.5rem + } + + .swagger-ui .f4-m { + font-size: 1.25rem + } + + .swagger-ui .f5-m { + font-size: 1rem + } + + .swagger-ui .f6-m { + font-size: .875rem + } + + .swagger-ui .f7-m { + font-size: .75rem + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .f-6-l, .swagger-ui .f-headline-l { + font-size: 6rem + } + + .swagger-ui .f-5-l, .swagger-ui .f-subheadline-l { + font-size: 5rem + } + + .swagger-ui .f1-l { + font-size: 3rem + } + + .swagger-ui .f2-l { + font-size: 2.25rem + } + + .swagger-ui .f3-l { + font-size: 1.5rem + } + + .swagger-ui .f4-l { + font-size: 1.25rem + } + + .swagger-ui .f5-l { + font-size: 1rem + } + + .swagger-ui .f6-l { + font-size: .875rem + } + + .swagger-ui .f7-l { + font-size: .75rem + } +} + +.swagger-ui .measure { + max-width: 30em +} + +.swagger-ui .measure-wide { + max-width: 34em +} + +.swagger-ui .measure-narrow { + max-width: 20em +} + +.swagger-ui .indent { + margin-bottom: 0; + margin-top: 0; + text-indent: 1em +} + +.swagger-ui .small-caps { + font-feature-settings: "smcp"; + font-variant: small-caps +} + +.swagger-ui .truncate { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap +} + +@media screen and (min-width: 30em) { + .swagger-ui .measure-ns { + max-width: 30em + } + + .swagger-ui .measure-wide-ns { + max-width: 34em + } + + .swagger-ui .measure-narrow-ns { + max-width: 20em + } + + .swagger-ui .indent-ns { + margin-bottom: 0; + margin-top: 0; + text-indent: 1em + } + + .swagger-ui .small-caps-ns { + font-feature-settings: "smcp"; + font-variant: small-caps + } + + .swagger-ui .truncate-ns { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .measure-m { + max-width: 30em + } + + .swagger-ui .measure-wide-m { + max-width: 34em + } + + .swagger-ui .measure-narrow-m { + max-width: 20em + } + + .swagger-ui .indent-m { + margin-bottom: 0; + margin-top: 0; + text-indent: 1em + } + + .swagger-ui .small-caps-m { + font-feature-settings: "smcp"; + font-variant: small-caps + } + + .swagger-ui .truncate-m { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .measure-l { + max-width: 30em + } + + .swagger-ui .measure-wide-l { + max-width: 34em + } + + .swagger-ui .measure-narrow-l { + max-width: 20em + } + + .swagger-ui .indent-l { + margin-bottom: 0; + margin-top: 0; + text-indent: 1em + } + + .swagger-ui .small-caps-l { + font-feature-settings: "smcp"; + font-variant: small-caps + } + + .swagger-ui .truncate-l { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap + } +} + +.swagger-ui .overflow-container { + overflow-y: scroll +} + +.swagger-ui .center { + margin-left: auto; + margin-right: auto +} + +.swagger-ui .mr-auto { + margin-right: auto +} + +.swagger-ui .ml-auto { + margin-left: auto +} + +@media screen and (min-width: 30em) { + .swagger-ui .center-ns { + margin-left: auto; + margin-right: auto + } + + .swagger-ui .mr-auto-ns { + margin-right: auto + } + + .swagger-ui .ml-auto-ns { + margin-left: auto + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .center-m { + margin-left: auto; + margin-right: auto + } + + .swagger-ui .mr-auto-m { + margin-right: auto + } + + .swagger-ui .ml-auto-m { + margin-left: auto + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .center-l { + margin-left: auto; + margin-right: auto + } + + .swagger-ui .mr-auto-l { + margin-right: auto + } + + .swagger-ui .ml-auto-l { + margin-left: auto + } +} + +.swagger-ui .clip { + clip: rect(1px 1px 1px 1px); + clip: rect(1px,1px,1px,1px); + position: fixed !important; + _position: absolute !important +} + +@media screen and (min-width: 30em) { + .swagger-ui .clip-ns { + clip: rect(1px 1px 1px 1px); + clip: rect(1px,1px,1px,1px); + position: fixed !important; + _position: absolute !important + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .clip-m { + clip: rect(1px 1px 1px 1px); + clip: rect(1px,1px,1px,1px); + position: fixed !important; + _position: absolute !important + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .clip-l { + clip: rect(1px 1px 1px 1px); + clip: rect(1px,1px,1px,1px); + position: fixed !important; + _position: absolute !important + } +} + +.swagger-ui .ws-normal { + white-space: normal +} + +.swagger-ui .nowrap { + white-space: nowrap +} + +.swagger-ui .pre { + white-space: pre +} + +@media screen and (min-width: 30em) { + .swagger-ui .ws-normal-ns { + white-space: normal + } + + .swagger-ui .nowrap-ns { + white-space: nowrap + } + + .swagger-ui .pre-ns { + white-space: pre + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .ws-normal-m { + white-space: normal + } + + .swagger-ui .nowrap-m { + white-space: nowrap + } + + .swagger-ui .pre-m { + white-space: pre + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .ws-normal-l { + white-space: normal + } + + .swagger-ui .nowrap-l { + white-space: nowrap + } + + .swagger-ui .pre-l { + white-space: pre + } +} + +.swagger-ui .v-base { + vertical-align: baseline +} + +.swagger-ui .v-mid { + vertical-align: middle +} + +.swagger-ui .v-top { + vertical-align: top +} + +.swagger-ui .v-btm { + vertical-align: bottom +} + +@media screen and (min-width: 30em) { + .swagger-ui .v-base-ns { + vertical-align: baseline + } + + .swagger-ui .v-mid-ns { + vertical-align: middle + } + + .swagger-ui .v-top-ns { + vertical-align: top + } + + .swagger-ui .v-btm-ns { + vertical-align: bottom + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .v-base-m { + vertical-align: baseline + } + + .swagger-ui .v-mid-m { + vertical-align: middle + } + + .swagger-ui .v-top-m { + vertical-align: top + } + + .swagger-ui .v-btm-m { + vertical-align: bottom + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .v-base-l { + vertical-align: baseline + } + + .swagger-ui .v-mid-l { + vertical-align: middle + } + + .swagger-ui .v-top-l { + vertical-align: top + } + + .swagger-ui .v-btm-l { + vertical-align: bottom + } +} + +.swagger-ui .dim { + opacity: 1; + transition: opacity .15s ease-in +} + + .swagger-ui .dim:focus, .swagger-ui .dim:hover { + opacity: .5; + transition: opacity .15s ease-in + } + + .swagger-ui .dim:active { + opacity: .8; + transition: opacity .15s ease-out + } + +.swagger-ui .glow { + transition: opacity .15s ease-in +} + + .swagger-ui .glow:focus, .swagger-ui .glow:hover { + opacity: 1; + transition: opacity .15s ease-in + } + +.swagger-ui .hide-child .child { + opacity: 0; + transition: opacity .15s ease-in +} + +.swagger-ui .hide-child:active .child, .swagger-ui .hide-child:focus .child, .swagger-ui .hide-child:hover .child { + opacity: 1; + transition: opacity .15s ease-in +} + +.swagger-ui .underline-hover:focus, .swagger-ui .underline-hover:hover { + text-decoration: underline +} + +.swagger-ui .grow { + -moz-osx-font-smoothing: grayscale; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; + transform: translateZ(0); + transition: transform .25s ease-out +} + + .swagger-ui .grow:focus, .swagger-ui .grow:hover { + transform: scale(1.05) + } + + .swagger-ui .grow:active { + transform: scale(.9) + } + +.swagger-ui .grow-large { + -moz-osx-font-smoothing: grayscale; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; + transform: translateZ(0); + transition: transform .25s ease-in-out +} + + .swagger-ui .grow-large:focus, .swagger-ui .grow-large:hover { + transform: scale(1.2) + } + + .swagger-ui .grow-large:active { + transform: scale(.95) + } + +.swagger-ui .pointer:hover { + cursor: pointer +} + +.swagger-ui .shadow-hover { + cursor: pointer; + position: relative; + transition: all .5s cubic-bezier(.165,.84,.44,1) +} + + .swagger-ui .shadow-hover:after { + border-radius: inherit; + box-shadow: 0 0 16px 2px rgba(0,0,0,.2); + content: ""; + height: 100%; + left: 0; + opacity: 0; + position: absolute; + top: 0; + transition: opacity .5s cubic-bezier(.165,.84,.44,1); + width: 100%; + z-index: -1 + } + + .swagger-ui .shadow-hover:focus:after, .swagger-ui .shadow-hover:hover:after { + opacity: 1 + } + +.swagger-ui .bg-animate, .swagger-ui .bg-animate:focus, .swagger-ui .bg-animate:hover { + transition: background-color .15s ease-in-out +} + +.swagger-ui .z-0 { + z-index: 0 +} + +.swagger-ui .z-1 { + z-index: 1 +} + +.swagger-ui .z-2 { + z-index: 2 +} + +.swagger-ui .z-3 { + z-index: 3 +} + +.swagger-ui .z-4 { + z-index: 4 +} + +.swagger-ui .z-5 { + z-index: 5 +} + +.swagger-ui .z-999 { + z-index: 999 +} + +.swagger-ui .z-9999 { + z-index: 9999 +} + +.swagger-ui .z-max { + z-index: 2147483647 +} + +.swagger-ui .z-inherit { + z-index: inherit +} + +.swagger-ui .z-initial { + z-index: auto +} + +.swagger-ui .z-unset { + z-index: unset +} + +.swagger-ui .nested-copy-line-height ol, .swagger-ui .nested-copy-line-height p, .swagger-ui .nested-copy-line-height ul { + line-height: 1.5 +} + +.swagger-ui .nested-headline-line-height h1, .swagger-ui .nested-headline-line-height h2, .swagger-ui .nested-headline-line-height h3, .swagger-ui .nested-headline-line-height h4, .swagger-ui .nested-headline-line-height h5, .swagger-ui .nested-headline-line-height h6 { + line-height: 1.25 +} + +.swagger-ui .nested-list-reset ol, .swagger-ui .nested-list-reset ul { + list-style-type: none; + margin-left: 0; + padding-left: 0 +} + +.swagger-ui .nested-copy-indent p + p { + margin-bottom: 0; + margin-top: 0; + text-indent: .1em +} + +.swagger-ui .nested-copy-seperator p + p { + margin-top: 1.5em +} + +.swagger-ui .nested-img img { + display: block; + max-width: 100%; + width: 100% +} + +.swagger-ui .nested-links a { + color: #357edd; + transition: color .15s ease-in +} + + .swagger-ui .nested-links a:focus, .swagger-ui .nested-links a:hover { + color: #96ccff; + transition: color .15s ease-in + } + +.swagger-ui .wrapper { + box-sizing: border-box; + margin: 0 auto; + max-width: 1460px; + padding: 0 20px; + width: 100% +} + +.swagger-ui .opblock-tag-section { + display: flex; + flex-direction: column +} + +.swagger-ui .try-out.btn-group { + display: flex; + flex: .1 2 auto; + padding: 0 +} + +.swagger-ui .try-out__btn { + margin-left: 1.25rem +} + +.swagger-ui .opblock-tag { + align-items: center; + border-bottom: 1px solid rgba(59,65,81,.3); + cursor: pointer; + display: flex; + padding: 10px 20px 10px 10px; + transition: all .2s +} + + .swagger-ui .opblock-tag:hover { + background: rgba(0,0,0,.02) + } + +.swagger-ui .opblock-tag { + color: #b5bac9; + font-family: sans-serif; + font-size: 24px; + margin: 0 0 5px +} + + .swagger-ui .opblock-tag.no-desc span { + flex: 1 + } + + .swagger-ui .opblock-tag svg { + transition: all .4s + } + + .swagger-ui .opblock-tag small { + color: #b5bac9; + flex: 2; + font-family: sans-serif; + font-size: 14px; + font-weight: 400; + padding: 0 10px + } + + .swagger-ui .opblock-tag > div { + flex: 1 1 150px; + font-weight: 400; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap + } + +@media(max-width: 640px) { + .swagger-ui .opblock-tag small, .swagger-ui .opblock-tag > div { + flex: 1 + } +} + +.swagger-ui .opblock-tag .info__externaldocs { + text-align: right +} + +.swagger-ui .parameter__type { + color: #b5bac9; + font-family: monospace; + font-size: 12px; + font-weight: 600; + padding: 5px 0 +} + +.swagger-ui .parameter-controls { + margin-top: .75em +} + +.swagger-ui .examples__title { + display: block; + font-size: 1.1em; + font-weight: 700; + margin-bottom: .75em +} + +.swagger-ui .examples__section { + margin-top: 1.5em +} + +.swagger-ui .examples__section-header { + font-size: .9rem; + font-weight: 700; + margin-bottom: .5rem +} + +.swagger-ui .examples-select { + display: inline-block; + margin-bottom: .75em +} + + .swagger-ui .examples-select .examples-select-element { + width: 100% + } + +.swagger-ui .examples-select__section-label { + font-size: .9rem; + font-weight: 700; + margin-right: .5rem +} + +.swagger-ui .example__section { + margin-top: 1.5em +} + +.swagger-ui .example__section-header { + font-size: .9rem; + font-weight: 700; + margin-bottom: .5rem +} + +.swagger-ui .view-line-link { + cursor: pointer; + margin: 0 5px; + position: relative; + top: 3px; + transition: all .5s; + width: 20px +} + +.swagger-ui .opblock { + border: 1px solid #000; + border-radius: 4px; + box-shadow: 0 0 3px rgba(0,0,0,.19); + margin: 0 0 15px +} + + .swagger-ui .opblock .tab-header { + display: flex; + flex: 1 + } + + .swagger-ui .opblock .tab-header .tab-item { + cursor: pointer; + padding: 0 40px + } + + .swagger-ui .opblock .tab-header .tab-item:first-of-type { + padding: 0 40px 0 0 + } + + .swagger-ui .opblock .tab-header .tab-item.active h4 span { + position: relative + } + + .swagger-ui .opblock .tab-header .tab-item.active h4 span:after { + background: gray; + bottom: -15px; + content: ""; + height: 4px; + left: 50%; + position: absolute; + transform: translateX(-50%); + width: 120% + } + + .swagger-ui .opblock.is-open .opblock-summary { + border-bottom: 1px solid #000 + } + + .swagger-ui .opblock .opblock-section-header { + align-items: center; + background: rgba(28, 28, 33, .8); + ; + box-shadow: 0 1px 2px rgba(0,0,0,.1); + display: flex; + min-height: 50px; + padding: 8px 20px + } + + .swagger-ui .opblock .opblock-section-header > label { + align-items: center; + color: #b5bac9; + display: flex; + font-family: sans-serif; + font-size: 12px; + font-weight: 700; + margin: 0 0 0 auto + } + + .swagger-ui .opblock .opblock-section-header > label > span { + padding: 0 10px 0 0 + } + + .swagger-ui .opblock .opblock-section-header h4 { + color: #b5bac9; + flex: 1; + font-family: sans-serif; + font-size: 14px; + margin: 0 + } + + .swagger-ui .opblock .opblock-summary-method { + background: #000; + border-radius: 3px; + color: #1c1c21; + font-family: sans-serif; + font-size: 14px; + font-weight: 700; + min-width: 80px; + padding: 6px 0; + text-align: center; + text-shadow: 0 1px 0 rgba(0,0,0,.1) + } + + .swagger-ui .opblock .opblock-summary-operation-id, .swagger-ui .opblock .opblock-summary-path, .swagger-ui .opblock .opblock-summary-path__deprecated { + align-items: center; + color: #b5bac9; + display: flex; + font-family: monospace; + font-size: 16px; + font-weight: 600; + padding: 0 10px; + word-break: break-word + } + +@media(max-width: 768px) { + .swagger-ui .opblock .opblock-summary-operation-id, .swagger-ui .opblock .opblock-summary-path, .swagger-ui .opblock .opblock-summary-path__deprecated { + font-size: 12px + } +} + +.swagger-ui .opblock .opblock-summary-path { + flex-shrink: 0; + max-width: calc(100% - 110px - 15rem) +} + +@media(max-width: 640px) { + .swagger-ui .opblock .opblock-summary-path { + flex-shrink: 1; + max-width: 100% + } +} + +.swagger-ui .opblock .opblock-summary-path__deprecated { + text-decoration: line-through +} + +.swagger-ui .opblock .opblock-summary-operation-id { + font-size: 14px +} + +.swagger-ui .opblock .opblock-summary-description { + color: #b5bac9; + flex: 1 1 auto; + font-family: sans-serif; + font-size: 13px; + word-break: break-word +} + +.swagger-ui .opblock .opblock-summary { + align-items: center; + cursor: pointer; + display: flex; + padding: 5px +} + + .swagger-ui .opblock .opblock-summary .view-line-link { + cursor: pointer; + margin: 0; + position: relative; + top: 2px; + transition: all .5s; + width: 0 + } + + .swagger-ui .opblock .opblock-summary:hover .view-line-link { + margin: 0 5px; + width: 18px + } + + .swagger-ui .opblock .opblock-summary:hover .view-line-link.copy-to-clipboard { + width: 24px + } + +.swagger-ui .opblock.opblock-post { + background: rgba(73,204,144,.1); + border-color: #49cc90 +} + + .swagger-ui .opblock.opblock-post .opblock-summary-method { + background: #49cc90 + } + + .swagger-ui .opblock.opblock-post .opblock-summary { + border-color: #49cc90 + } + + .swagger-ui .opblock.opblock-post .tab-header .tab-item.active h4 span:after { + background: #49cc90 + } + +.swagger-ui .opblock.opblock-put { + background: rgba(252,161,48,.1); + border-color: #fca130 +} + + .swagger-ui .opblock.opblock-put .opblock-summary-method { + background: #fca130 + } + + .swagger-ui .opblock.opblock-put .opblock-summary { + border-color: #fca130 + } + + .swagger-ui .opblock.opblock-put .tab-header .tab-item.active h4 span:after { + background: #fca130 + } + +.swagger-ui .opblock.opblock-delete { + background: rgba(249,62,62,.1); + border-color: #f93e3e +} + + .swagger-ui .opblock.opblock-delete .opblock-summary-method { + background: #f93e3e + } + + .swagger-ui .opblock.opblock-delete .opblock-summary { + border-color: #f93e3e + } + + .swagger-ui .opblock.opblock-delete .tab-header .tab-item.active h4 span:after { + background: #f93e3e + } + +.swagger-ui .opblock.opblock-get { + background: rgba(97,175,254,.1); + border-color: #61affe +} + + .swagger-ui .opblock.opblock-get .opblock-summary-method { + background: #61affe + } + + .swagger-ui .opblock.opblock-get .opblock-summary { + border-color: #61affe + } + + .swagger-ui .opblock.opblock-get .tab-header .tab-item.active h4 span:after { + background: #61affe + } + +.swagger-ui .opblock.opblock-patch { + background: rgba(80,227,194,.1); + border-color: #50e3c2 +} + + .swagger-ui .opblock.opblock-patch .opblock-summary-method { + background: #50e3c2 + } + + .swagger-ui .opblock.opblock-patch .opblock-summary { + border-color: #50e3c2 + } + + .swagger-ui .opblock.opblock-patch .tab-header .tab-item.active h4 span:after { + background: #50e3c2 + } + +.swagger-ui .opblock.opblock-head { + background: rgba(144,18,254,.1); + border-color: #9012fe +} + + .swagger-ui .opblock.opblock-head .opblock-summary-method { + background: #9012fe + } + + .swagger-ui .opblock.opblock-head .opblock-summary { + border-color: #9012fe + } + + .swagger-ui .opblock.opblock-head .tab-header .tab-item.active h4 span:after { + background: #9012fe + } + +.swagger-ui .opblock.opblock-options { + background: rgba(13,90,167,.1); + border-color: #0d5aa7 +} + + .swagger-ui .opblock.opblock-options .opblock-summary-method { + background: #0d5aa7 + } + + .swagger-ui .opblock.opblock-options .opblock-summary { + border-color: #0d5aa7 + } + + .swagger-ui .opblock.opblock-options .tab-header .tab-item.active h4 span:after { + background: #0d5aa7 + } + +.swagger-ui .opblock.opblock-deprecated { + background: hsla(0,0%,92%,.1); + border-color: #ebebeb; + opacity: .6 +} + + .swagger-ui .opblock.opblock-deprecated .opblock-summary-method { + background: #ebebeb + } + + .swagger-ui .opblock.opblock-deprecated .opblock-summary { + border-color: #ebebeb + } + + .swagger-ui .opblock.opblock-deprecated .tab-header .tab-item.active h4 span:after { + background: #ebebeb + } + +.swagger-ui .opblock .opblock-schemes { + padding: 8px 20px +} + + .swagger-ui .opblock .opblock-schemes .schemes-title { + padding: 0 10px 0 0 + } + +.swagger-ui .filter .operation-filter-input { + border: 2px solid #d8dde7; + margin: 20px 0; + padding: 10px; + width: 100% +} + +.swagger-ui .download-url-wrapper .failed, .swagger-ui .filter .failed { + color: red +} + +.swagger-ui .download-url-wrapper .loading, .swagger-ui .filter .loading { + color: #aaa +} + +.swagger-ui .model-example { + margin-top: 1em +} + +.swagger-ui .tab { + display: flex; + list-style: none; + padding: 0 +} + + .swagger-ui .tab li { + color: #b5bac9; + cursor: pointer; + font-family: sans-serif; + font-size: 12px; + min-width: 60px; + padding: 0 + } + + .swagger-ui .tab li:first-of-type { + padding-left: 0; + padding-right: 12px; + position: relative + } + + .swagger-ui .tab li:first-of-type:after { + background: rgba(0,0,0,.2); + content: ""; + height: 100%; + position: absolute; + right: 6px; + top: 0; + width: 1px + } + + .swagger-ui .tab li.active { + font-weight: 700 + } + + .swagger-ui .tab li button.tablinks { + background: none; + border: 0; + color: inherit; + font-family: inherit; + font-weight: inherit; + padding: 0 + } + +.swagger-ui .opblock-description-wrapper, .swagger-ui .opblock-external-docs-wrapper, .swagger-ui .opblock-title_normal { + color: #b5bac9; + font-family: sans-serif; + font-size: 12px; + margin: 0 0 5px; + padding: 15px 20px +} + + .swagger-ui .opblock-description-wrapper h4, .swagger-ui .opblock-external-docs-wrapper h4, .swagger-ui .opblock-title_normal h4 { + color: #b5bac9; + font-family: sans-serif; + font-size: 12px; + margin: 0 0 5px + } + + .swagger-ui .opblock-description-wrapper p, .swagger-ui .opblock-external-docs-wrapper p, .swagger-ui .opblock-title_normal p { + color: #b5bac9; + font-family: sans-serif; + font-size: 14px; + margin: 0 + } + + .swagger-ui .opblock-external-docs-wrapper h4 { + padding-left: 0 + } + +.swagger-ui .execute-wrapper { + padding: 20px; + text-align: right +} + + .swagger-ui .execute-wrapper .btn { + padding: 8px 40px; + width: 100% + } + +.swagger-ui .body-param-options { + display: flex; + flex-direction: column +} + + .swagger-ui .body-param-options .body-param-edit { + padding: 10px 0 + } + + .swagger-ui .body-param-options label { + padding: 8px 0 + } + + .swagger-ui .body-param-options label select { + margin: 3px 0 0 + } + +.swagger-ui .responses-inner { + padding: 20px +} + + .swagger-ui .responses-inner h4, .swagger-ui .responses-inner h5 { + color: #b5bac9; + font-family: sans-serif; + font-size: 12px; + margin: 10px 0 5px + } + + .swagger-ui .responses-inner .curl { + white-space: normal + } + +.swagger-ui .response-col_status { + color: #b5bac9; + font-family: sans-serif; + font-size: 14px +} + + .swagger-ui .response-col_status .response-undocumented { + color: #909090; + font-family: monospace; + font-size: 11px; + font-weight: 600 + } + +.swagger-ui .response-col_links { + color: #b5bac9; + font-family: sans-serif; + font-size: 14px; + max-width: 40em; + padding-left: 2em +} + + .swagger-ui .response-col_links .response-undocumented { + color: #909090; + font-family: monospace; + font-size: 11px; + font-weight: 600 + } + + .swagger-ui .response-col_links .operation-link { + margin-bottom: 1.5em + } + + .swagger-ui .response-col_links .operation-link .description { + margin-bottom: .5em + } + +.swagger-ui .opblock-body .opblock-loading-animation { + display: block; + margin: 3em auto +} + +.swagger-ui .opblock-body pre.microlight { + word-wrap: break-word; + background: #333; + border-radius: 4px; + color: #1c1c21; + font-family: monospace; + font-size: 12px; + font-weight: 600; + -webkit-hyphens: auto; + hyphens: auto; + margin: 0; + padding: 10px; + white-space: pre-wrap; + word-break: break-all; + word-break: break-word +} + + .swagger-ui .opblock-body pre.microlight .headerline { + display: block + } + +.swagger-ui .highlight-code { + position: relative +} + + .swagger-ui .highlight-code > .microlight { + max-height: 400px; + min-height: 6em; + overflow-y: auto + } + + .swagger-ui .highlight-code > .microlight code { + white-space: pre-wrap !important; + word-break: break-all + } + +.swagger-ui .curl-command { + position: relative +} + +.swagger-ui .download-contents { + align-items: center; + background: #7d8293; + border-radius: 4px; + bottom: 10px; + color: #1c1c21; + cursor: pointer; + display: flex; + font-family: sans-serif; + font-size: 14px; + font-weight: 600; + height: 30px; + justify-content: center; + padding: 5px; + position: absolute; + right: 10px; + text-align: center +} + +.swagger-ui .scheme-container { + background: #1c1c21; + box-shadow: 0 1px 2px 0 rgba(0,0,0,.15); + margin: 0 0 20px; + padding: 30px 0 +} + + .swagger-ui .scheme-container .schemes { + align-items: flex-end; + display: flex + } + + .swagger-ui .scheme-container .schemes > label { + color: #b5bac9; + display: flex; + flex-direction: column; + font-family: sans-serif; + font-size: 12px; + font-weight: 700; + margin: -20px 15px 0 0 + } + + .swagger-ui .scheme-container .schemes > label select { + min-width: 130px; + text-transform: uppercase + } + +.swagger-ui .loading-container { + align-items: center; + display: flex; + flex-direction: column; + justify-content: center; + margin-top: 1em; + min-height: 1px; + padding: 40px 0 60px +} + + .swagger-ui .loading-container .loading { + position: relative + } + + .swagger-ui .loading-container .loading:after { + color: #b5bac9; + content: "loading"; + font-family: sans-serif; + font-size: 10px; + font-weight: 700; + left: 50%; + position: absolute; + text-transform: uppercase; + top: 50%; + transform: translate(-50%,-50%) + } + + .swagger-ui .loading-container .loading:before { + -webkit-animation: rotation 1s linear infinite,opacity .5s; + animation: rotation 1s linear infinite,opacity .5s; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; + border: 2px solid rgba(85,85,85,.1); + border-radius: 100%; + border-top-color: rgba(0,0,0,.6); + content: ""; + display: block; + height: 60px; + left: 50%; + margin: -30px; + opacity: 1; + position: absolute; + top: 50%; + width: 60px + } + +@-webkit-keyframes rotation { + to { + transform: rotate(1turn) + } +} + +@keyframes rotation { + to { + transform: rotate(1turn) + } +} + +.swagger-ui .response-controls { + display: flex; + padding-top: 1em +} + +.swagger-ui .response-control-media-type { + margin-right: 1em +} + +.swagger-ui .response-control-media-type--accept-controller select { + border-color: #196619 +} + +.swagger-ui .response-control-media-type__accept-message { + color: #99e699; + font-size: .7em +} + +.swagger-ui .response-control-examples__title, .swagger-ui .response-control-media-type__title { + display: block; + font-size: .7em; + margin-bottom: .2em +} + +@-webkit-keyframes blinker { + 50% { + opacity: 0 + } +} + +@keyframes blinker { + 50% { + opacity: 0 + } +} + +.swagger-ui .hidden { + display: none +} + +.swagger-ui .no-margin { + border: none; + height: auto; + margin: 0; + padding: 0 +} + +.swagger-ui .float-right { + float: right +} + +.swagger-ui .svg-assets { + height: 0; + position: absolute; + width: 0 +} + +.swagger-ui section h3 { + color: #b5bac9; + font-family: sans-serif +} + +.swagger-ui a.nostyle { + display: inline +} + + .swagger-ui a.nostyle, .swagger-ui a.nostyle:visited { + color: inherit; + cursor: pointer; + text-decoration: inherit + } + +.swagger-ui .fallback { + color: #aaa; + padding: 1em +} + +.swagger-ui .version-pragma { + height: 100%; + padding: 5em 0 +} + +.swagger-ui .version-pragma__message { + display: flex; + font-size: 1.2em; + height: 100%; + justify-content: center; + line-height: 1.5em; + padding: 0 .6em; + text-align: center +} + + .swagger-ui .version-pragma__message > div { + flex: 1; + max-width: 55ch + } + + .swagger-ui .version-pragma__message code { + background-color: #dedede; + padding: 4px 4px 2px; + white-space: pre + } + +.swagger-ui .opblock-link { + font-weight: 400 +} + + .swagger-ui .opblock-link.shown { + font-weight: 700 + } + +.swagger-ui span.token-string { + color: #555 +} + +.swagger-ui span.token-not-formatted { + color: #555; + font-weight: 700 +} + +.swagger-ui .btn { + background: transparent; + border: 2px solid gray; + border-radius: 4px; + box-shadow: 0 1px 2px rgba(0,0,0,.1); + color: #b5bac9; + font-family: sans-serif; + font-size: 14px; + font-weight: 700; + padding: 5px 23px; + transition: all .3s +} + + .swagger-ui .btn.btn-sm { + font-size: 12px; + padding: 4px 23px + } + + .swagger-ui .btn[disabled] { + cursor: not-allowed; + opacity: .3 + } + + .swagger-ui .btn:hover { + box-shadow: 0 0 5px rgba(0,0,0,.3) + } + + .swagger-ui .btn.cancel { + background-color: transparent; + border-color: #ff6060; + color: #ff6060; + font-family: sans-serif + } + + .swagger-ui .btn.authorize { + background-color: transparent; + border-color: #49cc90; + color: #49cc90; + display: inline; + line-height: 1 + } + + .swagger-ui .btn.authorize span { + float: left; + padding: 4px 20px 0 0 + } + + .swagger-ui .btn.authorize svg { + fill: #49cc90 + } + + .swagger-ui .btn.execute { + background-color: #4990e2; + border-color: #4990e2; + color: #ffffff + } + +.swagger-ui .btn-group { + display: flex; + padding: 30px +} + + .swagger-ui .btn-group .btn { + flex: 1 + } + + .swagger-ui .btn-group .btn:first-child { + border-radius: 4px 0 0 4px + } + + .swagger-ui .btn-group .btn:last-child { + border-radius: 0 4px 4px 0 + } + +.swagger-ui .authorization__btn { + background: none; + border: none; + padding: 0 0 0 10px +} + + .swagger-ui .authorization__btn.locked { + opacity: 1 + } + + .swagger-ui .authorization__btn.unlocked { + opacity: .4 + } + +.swagger-ui .model-box-control, .swagger-ui .models-control, .swagger-ui .opblock-summary-control { + all: inherit; + border-bottom: 0; + cursor: pointer; + flex: 1; + padding: 0; + fill: #fff; +} + + .swagger-ui .model-box-control:focus, .swagger-ui .models-control:focus, .swagger-ui .opblock-summary-control:focus { + outline-color: #62a03f; + outline-style: solid; + outline-width: 1px; + outline-offset: 2px; + } + +.swagger-ui .expand-methods, .swagger-ui .expand-operation { + background: none; + border: none +} + + .swagger-ui .expand-methods svg, .swagger-ui .expand-operation svg { + fill: #fff; + height: 20px; + width: 20px + } + +.swagger-ui .expand-methods { + padding: 0 10px +} + + .swagger-ui .expand-methods:hover svg { + fill: #404040 + } + + .swagger-ui .expand-methods svg { + fill: #707070; + transition: all .3s + } + +.swagger-ui button { + cursor: pointer +} + + .swagger-ui button.invalid { + -webkit-animation: shake .4s 1; + animation: shake .4s 1; + background: #feebeb; + border-color: #f93e3e + } + +.swagger-ui .copy-to-clipboard { + align-items: center; + background: #7d8293; + border: none; + border-radius: 4px; + bottom: 10px; + display: flex; + height: 30px; + justify-content: center; + position: absolute; + right: 100px; + width: 30px +} + + .swagger-ui .copy-to-clipboard button { + background: url("data:image/svg+xml;charset=utf-8,") 50% no-repeat; + border: none; + flex-grow: 1; + flex-shrink: 1; + height: 25px + } + +.swagger-ui .curl-command .copy-to-clipboard { + bottom: 5px; + height: 20px; + right: 10px; + width: 20px +} + + .swagger-ui .curl-command .copy-to-clipboard button { + height: 18px + } + +.swagger-ui .opblock .opblock-summary .view-line-link.copy-to-clipboard { + height: 26px; + position: unset +} + +.swagger-ui select { + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + background: url("data:image/svg+xml;charset=utf-8,") right 10px center/20px no-repeat #212121; + background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgeG1sbnM6c29kaXBvZGk9Imh0dHA6Ly9zb2RpcG9kaS5zb3VyY2Vmb3JnZS5uZXQvRFREL3NvZGlwb2RpLTAuZHRkIgogICB4bWxuczppbmtzY2FwZT0iaHR0cDovL3d3dy5pbmtzY2FwZS5vcmcvbmFtZXNwYWNlcy9pbmtzY2FwZSIKICAgaW5rc2NhcGU6dmVyc2lvbj0iMS4wICg0MDM1YTRmYjQ5LCAyMDIwLTA1LTAxKSIKICAgc29kaXBvZGk6ZG9jbmFtZT0iZG93bmxvYWQuc3ZnIgogICBpZD0ic3ZnNCIKICAgdmVyc2lvbj0iMS4xIgogICB2aWV3Qm94PSIwIDAgMjAgMjAiPgogIDxtZXRhZGF0YQogICAgIGlkPSJtZXRhZGF0YTEwIj4KICAgIDxyZGY6UkRGPgogICAgICA8Y2M6V29yawogICAgICAgICByZGY6YWJvdXQ9IiI+CiAgICAgICAgPGRjOmZvcm1hdD5pbWFnZS9zdmcreG1sPC9kYzpmb3JtYXQ+CiAgICAgICAgPGRjOnR5cGUKICAgICAgICAgICByZGY6cmVzb3VyY2U9Imh0dHA6Ly9wdXJsLm9yZy9kYy9kY21pdHlwZS9TdGlsbEltYWdlIiAvPgogICAgICA8L2NjOldvcms+CiAgICA8L3JkZjpSREY+CiAgPC9tZXRhZGF0YT4KICA8ZGVmcwogICAgIGlkPSJkZWZzOCIgLz4KICA8c29kaXBvZGk6bmFtZWR2aWV3CiAgICAgaW5rc2NhcGU6Y3VycmVudC1sYXllcj0ic3ZnNCIKICAgICBpbmtzY2FwZTp3aW5kb3ctbWF4aW1pemVkPSIxIgogICAgIGlua3NjYXBlOndpbmRvdy15PSItOSIKICAgICBpbmtzY2FwZTp3aW5kb3cteD0iLTkiCiAgICAgaW5rc2NhcGU6Y3k9IjEwIgogICAgIGlua3NjYXBlOmN4PSIxMCIKICAgICBpbmtzY2FwZTp6b29tPSI0MS41IgogICAgIHNob3dncmlkPSJmYWxzZSIKICAgICBpZD0ibmFtZWR2aWV3NiIKICAgICBpbmtzY2FwZTp3aW5kb3ctaGVpZ2h0PSIxMDAxIgogICAgIGlua3NjYXBlOndpbmRvdy13aWR0aD0iMTkyMCIKICAgICBpbmtzY2FwZTpwYWdlc2hhZG93PSIyIgogICAgIGlua3NjYXBlOnBhZ2VvcGFjaXR5PSIwIgogICAgIGd1aWRldG9sZXJhbmNlPSIxMCIKICAgICBncmlkdG9sZXJhbmNlPSIxMCIKICAgICBvYmplY3R0b2xlcmFuY2U9IjEwIgogICAgIGJvcmRlcm9wYWNpdHk9IjEiCiAgICAgYm9yZGVyY29sb3I9IiM2NjY2NjYiCiAgICAgcGFnZWNvbG9yPSIjZmZmZmZmIiAvPgogIDxwYXRoCiAgICAgc3R5bGU9ImZpbGw6I2ZmZmZmZiIKICAgICBpZD0icGF0aDIiCiAgICAgZD0iTTEzLjQxOCA3Ljg1OWEuNjk1LjY5NSAwIDAxLjk3OCAwIC42OC42OCAwIDAxMCAuOTY5bC0zLjkwOCAzLjgzYS42OTcuNjk3IDAgMDEtLjk3OSAwbC0zLjkwOC0zLjgzYS42OC42OCAwIDAxMC0uOTY5LjY5NS42OTUgMCAwMS45NzggMEwxMCAxMWwzLjQxOC0zLjE0MXoiIC8+Cjwvc3ZnPgo=) right 10px center/20px no-repeat #1c1c21; + background-size: 20px; + border: 2px solid #41444e; + border-radius: 4px; + box-shadow: 0 1px 2px 0 rgba(0,0,0,.25); + color: #b5bac9; + font-family: sans-serif; + font-size: 14px; + font-weight: 700; + padding: 5px 40px 5px 10px +} + + .swagger-ui select[multiple] { + background: #1c1c21; + margin: 5px 0; + padding: 5px + } + + .swagger-ui select.invalid { + -webkit-animation: shake .4s 1; + animation: shake .4s 1; + background: #feebeb; + border-color: #f93e3e + } + +.swagger-ui .opblock-body select { + min-width: 230px +} + +@media(max-width: 768px) { + .swagger-ui .opblock-body select { + min-width: 180px + } +} + +@media(max-width: 640px) { + .swagger-ui .opblock-body select { + min-width: 100%; + width: 100% + } +} + +.swagger-ui label { + color: #b5bac9; + font-family: sans-serif; + font-size: 12px; + font-weight: 700; + margin: 0 0 5px +} + +.swagger-ui input[type=email], .swagger-ui input[type=file], .swagger-ui input[type=password], .swagger-ui input[type=search], .swagger-ui input[type=text] { + line-height: 1 +} + +@media(max-width: 768px) { + .swagger-ui input[type=email], .swagger-ui input[type=file], .swagger-ui input[type=password], .swagger-ui input[type=search], .swagger-ui input[type=text] { + max-width: 175px + } +} + +.swagger-ui input[type=email], .swagger-ui input[type=file], .swagger-ui input[type=password], .swagger-ui input[type=search], .swagger-ui input[type=text], .swagger-ui textarea { + background: #1c1c21; + border: 1px solid #d9d9d9; + border-radius: 4px; + margin: 5px 0; + min-width: 100px; + padding: 8px 10px +} + + .swagger-ui input[type=email].invalid, .swagger-ui input[type=file].invalid, .swagger-ui input[type=password].invalid, .swagger-ui input[type=search].invalid, .swagger-ui input[type=text].invalid, .swagger-ui textarea.invalid { + -webkit-animation: shake .4s 1; + animation: shake .4s 1; + background: #feebeb; + border-color: #f93e3e + } + + .swagger-ui input[disabled], .swagger-ui select[disabled], .swagger-ui textarea[disabled] { + background-color: #fafafa; + color: #888; + cursor: not-allowed + } + +.swagger-ui select[disabled] { + border-color: #888 +} + +.swagger-ui textarea[disabled] { + background-color: #41444e; + color: #1c1c21 +} + +@-webkit-keyframes shake { + 10%,90% { + transform: translate3d(-1px,0,0) + } + + 20%,80% { + transform: translate3d(2px,0,0) + } + + 30%,50%,70% { + transform: translate3d(-4px,0,0) + } + + 40%,60% { + transform: translate3d(4px,0,0) + } +} + +@keyframes shake { + 10%,90% { + transform: translate3d(-1px,0,0) + } + + 20%,80% { + transform: translate3d(2px,0,0) + } + + 30%,50%,70% { + transform: translate3d(-4px,0,0) + } + + 40%,60% { + transform: translate3d(4px,0,0) + } +} + +.swagger-ui textarea { + background: hsla(0,0%,100%,.8); + border: none; + border-radius: 4px; + color: #b5bac9; + font-family: monospace; + font-size: 12px; + font-weight: 600; + min-height: 280px; + outline: none; + padding: 10px; + width: 100% +} + + .swagger-ui textarea:focus { + border: 2px solid #61affe + } + + .swagger-ui textarea.curl { + background: #41444e; + border-radius: 4px; + color: #1c1c21; + font-family: monospace; + font-size: 12px; + font-weight: 600; + margin: 0; + min-height: 100px; + padding: 10px; + resize: none + } + +.swagger-ui .checkbox { + color: #303030; + padding: 5px 0 10px; + transition: opacity .5s +} + + .swagger-ui .checkbox label { + display: flex + } + + .swagger-ui .checkbox p { + color: #b5bac9; + font-family: monospace; + font-style: italic; + font-weight: 400 !important; + font-weight: 600; + margin: 0 !important + } + + .swagger-ui .checkbox input[type=checkbox] { + display: none + } + + .swagger-ui .checkbox input[type=checkbox] + label > .item { + background: #e8e8e8; + border-radius: 1px; + box-shadow: 0 0 0 2px #e8e8e8; + cursor: pointer; + display: inline-block; + flex: none; + height: 16px; + margin: 0 8px 0 0; + padding: 5px; + position: relative; + top: 3px; + width: 16px + } + + .swagger-ui .checkbox input[type=checkbox] + label > .item:active { + transform: scale(.9) + } + + .swagger-ui .checkbox input[type=checkbox]:checked + label > .item { + background: #e8e8e8 url("data:image/svg+xml;charset=utf-8,") 50% no-repeat + } + +.swagger-ui .dialog-ux { + bottom: 0; + left: 0; + position: fixed; + right: 0; + top: 0; + z-index: 9999 +} + + .swagger-ui .dialog-ux .backdrop-ux { + background: rgba(0,0,0,.8); + bottom: 0; + left: 0; + position: fixed; + right: 0; + top: 0 + } + + .swagger-ui .dialog-ux .modal-ux { + background: #1c1c21; + border: 1px solid #ebebeb; + border-radius: 4px; + box-shadow: 0 10px 30px 0 rgba(0,0,0,.2); + left: 50%; + max-width: 650px; + min-width: 300px; + position: absolute; + top: 50%; + transform: translate(-50%,-50%); + width: 100%; + z-index: 9999 + } + + .swagger-ui .dialog-ux .modal-ux-content { + max-height: 540px; + overflow-y: auto; + padding: 20px + } + + .swagger-ui .dialog-ux .modal-ux-content p { + color: #41444e; + color: #b5bac9; + font-family: sans-serif; + font-size: 12px; + margin: 0 0 5px + } + + .swagger-ui .dialog-ux .modal-ux-content h4 { + color: #b5bac9; + font-family: sans-serif; + font-size: 18px; + font-weight: 600; + margin: 15px 0 0 + } + + .swagger-ui .dialog-ux .modal-ux-header { + align-items: center; + border-bottom: 1px solid #ebebeb; + display: flex; + padding: 12px 0 + } + + .swagger-ui .dialog-ux .modal-ux-header .close-modal { + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + background: none; + border: none; + padding: 0 10px + } + + .swagger-ui .dialog-ux .modal-ux-header h3 { + color: #b5bac9; + flex: 1; + font-family: sans-serif; + font-size: 20px; + font-weight: 600; + margin: 0; + padding: 0 20px + } + +.swagger-ui .model { + color: #b5bac9; + font-family: monospace; + font-size: 12px; + font-weight: 300; + font-weight: 600 +} + + .swagger-ui .model .deprecated span, .swagger-ui .model .deprecated td { + color: #a0a0a0 !important + } + + .swagger-ui .model .deprecated > td:first-of-type { + text-decoration: line-through + } + +.swagger-ui .model-toggle { + cursor: pointer; + display: inline-block; + font-size: 10px; + margin: auto .3em; + position: relative; + top: 6px; + transform: rotate(90deg); + transform-origin: 50% 50%; + transition: transform .15s ease-in +} + + .swagger-ui .model-toggle.collapsed { + transform: rotate(0deg) + } + + .swagger-ui .model-toggle:after { + background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgeG1sbnM6c29kaXBvZGk9Imh0dHA6Ly9zb2RpcG9kaS5zb3VyY2Vmb3JnZS5uZXQvRFREL3NvZGlwb2RpLTAuZHRkIgogICB4bWxuczppbmtzY2FwZT0iaHR0cDovL3d3dy5pbmtzY2FwZS5vcmcvbmFtZXNwYWNlcy9pbmtzY2FwZSIKICAgaW5rc2NhcGU6dmVyc2lvbj0iMS4wICg0MDM1YTRmYjQ5LCAyMDIwLTA1LTAxKSIKICAgc29kaXBvZGk6ZG9jbmFtZT0iZG93bmxvYWQyLnN2ZyIKICAgaWQ9InN2ZzQiCiAgIHZlcnNpb249IjEuMSIKICAgaGVpZ2h0PSIyNCIKICAgd2lkdGg9IjI0Ij4KICA8bWV0YWRhdGEKICAgICBpZD0ibWV0YWRhdGExMCI+CiAgICA8cmRmOlJERj4KICAgICAgPGNjOldvcmsKICAgICAgICAgcmRmOmFib3V0PSIiPgogICAgICAgIDxkYzpmb3JtYXQ+aW1hZ2Uvc3ZnK3htbDwvZGM6Zm9ybWF0PgogICAgICAgIDxkYzp0eXBlCiAgICAgICAgICAgcmRmOnJlc291cmNlPSJodHRwOi8vcHVybC5vcmcvZGMvZGNtaXR5cGUvU3RpbGxJbWFnZSIgLz4KICAgICAgPC9jYzpXb3JrPgogICAgPC9yZGY6UkRGPgogIDwvbWV0YWRhdGE+CiAgPGRlZnMKICAgICBpZD0iZGVmczgiIC8+CiAgPHNvZGlwb2RpOm5hbWVkdmlldwogICAgIGlua3NjYXBlOmN1cnJlbnQtbGF5ZXI9InN2ZzQiCiAgICAgaW5rc2NhcGU6d2luZG93LW1heGltaXplZD0iMSIKICAgICBpbmtzY2FwZTp3aW5kb3cteT0iLTkiCiAgICAgaW5rc2NhcGU6d2luZG93LXg9Ii05IgogICAgIGlua3NjYXBlOmN5PSIxMiIKICAgICBpbmtzY2FwZTpjeD0iMTIiCiAgICAgaW5rc2NhcGU6em9vbT0iMzQuNTgzMzMzIgogICAgIHNob3dncmlkPSJmYWxzZSIKICAgICBpZD0ibmFtZWR2aWV3NiIKICAgICBpbmtzY2FwZTp3aW5kb3ctaGVpZ2h0PSIxMDAxIgogICAgIGlua3NjYXBlOndpbmRvdy13aWR0aD0iMTkyMCIKICAgICBpbmtzY2FwZTpwYWdlc2hhZG93PSIyIgogICAgIGlua3NjYXBlOnBhZ2VvcGFjaXR5PSIwIgogICAgIGd1aWRldG9sZXJhbmNlPSIxMCIKICAgICBncmlkdG9sZXJhbmNlPSIxMCIKICAgICBvYmplY3R0b2xlcmFuY2U9IjEwIgogICAgIGJvcmRlcm9wYWNpdHk9IjEiCiAgICAgYm9yZGVyY29sb3I9IiM2NjY2NjYiCiAgICAgcGFnZWNvbG9yPSIjZmZmZmZmIiAvPgogIDxwYXRoCiAgICAgc3R5bGU9ImZpbGw6I2ZmZmZmZiIKICAgICBpZD0icGF0aDIiCiAgICAgZD0iTTEwIDZMOC41OSA3LjQxIDEzLjE3IDEybC00LjU4IDQuNTlMMTAgMThsNi02eiIgLz4KPC9zdmc+Cg==) 50% no-repeat; + background-size: 100%; + content: ""; + display: block; + height: 20px; + width: 20px + } + +.swagger-ui .model-jump-to-path { + cursor: pointer; + position: relative +} + + .swagger-ui .model-jump-to-path .view-line-link { + cursor: pointer; + position: absolute; + top: -.4em + } + +.swagger-ui .model-title { + position: relative +} + + .swagger-ui .model-title:hover .model-hint { + visibility: visible + } + +.swagger-ui .model-hint { + background: rgba(0,0,0,.7); + border-radius: 4px; + color: #ebebeb; + padding: .1em .5em; + position: absolute; + top: -1.8em; + visibility: hidden; + white-space: nowrap +} + +.swagger-ui .model p { + margin: 0 0 1em +} + +.swagger-ui .model .property { + color: #999; + font-style: italic +} + + .swagger-ui .model .property.primitive { + color: #6b6b6b + } + +.swagger-ui .model .external-docs, .swagger-ui table.model tr.description { + color: #666; + font-weight: 400 +} + + .swagger-ui table.model tr.description td:first-child, .swagger-ui table.model tr.property-row.required td:first-child { + font-weight: 700 + } + +.swagger-ui table.model tr.property-row td { + vertical-align: top +} + + .swagger-ui table.model tr.property-row td:first-child { + padding-right: .2em + } + +.swagger-ui table.model tr.property-row .star { + color: red +} + +.swagger-ui table.model tr.extension { + color: #777 +} + + .swagger-ui table.model tr.extension td:last-child { + vertical-align: top + } + +.swagger-ui table.model tr.external-docs td:first-child { + font-weight: 700 +} + +.swagger-ui table.model tr .renderedMarkdown p:first-child { + margin-top: 0 +} + +.swagger-ui section.models { + border: 1px solid rgba(59,65,81,.3); + border-radius: 4px; + margin: 30px 0 +} + + .swagger-ui section.models .pointer { + cursor: pointer + } + + .swagger-ui section.models.is-open { + padding: 0 0 20px + } + + .swagger-ui section.models.is-open h4 { + border-bottom: 1px solid rgba(59,65,81,.3); + margin: 0 0 5px + } + + .swagger-ui section.models h4 { + align-items: center; + color: #bfbfbf; + cursor: pointer; + display: flex; + font-family: sans-serif; + font-size: 16px; + margin: 0; + padding: 10px 20px 10px 10px; + transition: all .2s + } + + .swagger-ui section.models h4 svg { + fill: #fff; + transition: all .4s + } + + .swagger-ui section.models h4 span { + flex: 1 + } + + .swagger-ui section.models h4:hover { + background: rgba(0,0,0,.02) + } + + .swagger-ui section.models h5 { + color: #707070; + font-family: sans-serif; + font-size: 16px; + margin: 0 0 10px + } + + .swagger-ui section.models .model-jump-to-path { + position: relative; + top: 5px + } + + .swagger-ui section.models .model-container { + background: rgba(0,0,0,.05); + border-radius: 4px; + margin: 0 20px 15px; + position: relative; + transition: all .5s + } + + .swagger-ui section.models .model-container:hover { + background: rgba(0,0,0,.07) + } + + .swagger-ui section.models .model-container:first-of-type { + margin: 20px + } + + .swagger-ui section.models .model-container:last-of-type { + margin: 0 20px + } + + .swagger-ui section.models .model-container .models-jump-to-path { + opacity: .65; + position: absolute; + right: 5px; + top: 8px + } + + .swagger-ui section.models .model-box { + background: none + } + +.swagger-ui .model-box { + background: rgba(0,0,0,.1); + border-radius: 4px; + display: inline-block; + padding: 10px +} + + .swagger-ui .model-box .model-jump-to-path { + position: relative; + top: 4px + } + + .swagger-ui .model-box.deprecated { + opacity: .5 + } + +.swagger-ui .model-title { + color: #b5bac9; + font-family: sans-serif; + font-size: 16px +} + + .swagger-ui .model-title img { + bottom: 0; + margin-left: 1em; + position: relative + } + +.swagger-ui .model-deprecated-warning { + color: #f93e3e; + font-family: sans-serif; + font-size: 16px; + font-weight: 600; + margin-right: 1em +} + +.swagger-ui span > span.model .brace-close { + padding: 0 0 0 10px +} + +.swagger-ui .prop-name { + display: inline-block; + margin-right: 1em +} + +.swagger-ui .prop-type { + color: #aaaad4 +} + +.swagger-ui .prop-enum { + display: block +} + +.swagger-ui .prop-format { + color: #bfbfbf +} + +.swagger-ui .servers > label { + color: #b5bac9; + font-family: sans-serif; + font-size: 12px; + margin: -20px 15px 0 0 +} + + .swagger-ui .servers > label select { + max-width: 100%; + min-width: 130px; + width: 100% + } + +.swagger-ui .servers h4.message { + padding-bottom: 2em +} + +.swagger-ui .servers table tr { + width: 30em +} + +.swagger-ui .servers table td { + display: inline-block; + max-width: 15em; + padding-bottom: 10px; + padding-top: 10px; + vertical-align: middle +} + + .swagger-ui .servers table td:first-of-type { + padding-right: 1em + } + + .swagger-ui .servers table td input { + height: 100%; + width: 100% + } + +.swagger-ui .servers .computed-url { + margin: 2em 0 +} + + .swagger-ui .servers .computed-url code { + display: inline-block; + font-size: 16px; + margin: 0 1em; + padding: 4px + } + +.swagger-ui .servers-title { + font-size: 12px; + font-weight: 700 +} + +.swagger-ui .operation-servers h4.message { + margin-bottom: 2em +} + +.swagger-ui table { + border-collapse: collapse; + padding: 0 10px; + width: 100% +} + + .swagger-ui table.model tbody tr td { + padding: 0; + vertical-align: top + } + + .swagger-ui table.model tbody tr td:first-of-type { + padding: 0 0 0 2em; + width: 174px + } + + .swagger-ui table.headers td { + color: #b5bac9; + font-family: monospace; + font-size: 12px; + font-weight: 300; + font-weight: 600; + vertical-align: middle + } + + .swagger-ui table.headers .header-example { + color: #999; + font-style: italic + } + + .swagger-ui table tbody tr td { + padding: 10px 0 0; + vertical-align: top + } + + .swagger-ui table tbody tr td:first-of-type { + min-width: 6em; + padding: 10px 0 + } + + .swagger-ui table thead tr td, .swagger-ui table thead tr th { + border-bottom: 1px solid rgba(59,65,81,.2); + color: #b5bac9; + font-family: sans-serif; + font-size: 12px; + font-weight: 700; + padding: 12px 0; + text-align: left + } + +.swagger-ui .parameters-col_description { + margin-bottom: 2em; + width: 99% +} + + .swagger-ui .parameters-col_description input { + max-width: 340px; + width: 100% + } + + .swagger-ui .parameters-col_description select { + border-width: 1px + } + + .swagger-ui .parameters-col_description .markdown p { + margin: 0 + } + +.swagger-ui .parameter__name { + color: #b5bac9; + font-family: sans-serif; + font-size: 16px; + font-weight: 400; + margin-right: .75em +} + + .swagger-ui .parameter__name.required { + font-weight: 700 + } + + .swagger-ui .parameter__name.required span { + color: red + } + + .swagger-ui .parameter__name.required:after { + color: rgba(255,0,0,.6); + content: "required"; + font-size: 10px; + padding: 5px; + position: relative; + top: -6px + } + +.swagger-ui .parameter__extension, .swagger-ui .parameter__in { + color: gray; + font-family: monospace; + font-size: 12px; + font-style: italic; + font-weight: 600 +} + +.swagger-ui .parameter__deprecated { + color: red; + font-family: monospace; + font-size: 12px; + font-style: italic; + font-weight: 600 +} + +.swagger-ui .parameter__empty_value_toggle { + display: block; + font-size: 13px; + padding-bottom: 12px; + padding-top: 5px +} + + .swagger-ui .parameter__empty_value_toggle input { + margin-right: 7px + } + + .swagger-ui .parameter__empty_value_toggle.disabled { + opacity: .7 + } + +.swagger-ui .table-container { + padding: 20px +} + +.swagger-ui .response-col_description { + width: 99% +} + + .swagger-ui .response-col_description .markdown p { + margin: 0 + } + +.swagger-ui .response-col_links { + min-width: 6em +} + +.swagger-ui .response__extension { + color: gray; + font-family: monospace; + font-size: 12px; + font-style: italic; + font-weight: 600 +} + +.swagger-ui .topbar { + background-color: #1b1b1b; + padding: 10px 0 +} + + .swagger-ui .topbar .topbar-wrapper, .swagger-ui .topbar a { + align-items: center; + display: flex + } + + .swagger-ui .topbar a { + color: #1c1c21; + flex: 1; + font-family: sans-serif; + font-size: 1.5em; + font-weight: 700; + max-width: 300px; + text-decoration: none + } + + .swagger-ui .topbar a span { + margin: 0; + padding: 0 10px + } + + .swagger-ui .topbar .download-url-wrapper { + display: flex; + flex: 3; + justify-content: flex-end + } + + .swagger-ui .topbar .download-url-wrapper input[type=text] { + border: 2px solid #62a03f; + border-radius: 4px 0 0 4px; + margin: 0; + outline: none; + width: 100% + } + + .swagger-ui .topbar .download-url-wrapper .select-label { + align-items: center; + color: #f0f0f0; + display: flex; + margin: 0; + max-width: 600px; + width: 100% + } + + .swagger-ui .topbar .download-url-wrapper .select-label span { + flex: 1; + font-size: 16px; + padding: 0 10px 0 0; + text-align: right + } + + .swagger-ui .topbar .download-url-wrapper .select-label select { + border: 2px solid #62a03f; + box-shadow: none; + flex: 2; + outline: none; + width: 100% + } + + .swagger-ui .topbar .download-url-wrapper .download-url-button { + background: #62a03f; + border: none; + border-radius: 0 4px 4px 0; + color: #1c1c21; + font-family: sans-serif; + font-size: 16px; + font-weight: 700; + padding: 4px 30px + } + +.swagger-ui .info { + margin: 50px 0 +} + + .swagger-ui .info.failed-config { + margin-left: auto; + margin-right: auto; + max-width: 880px; + text-align: center + } + + .swagger-ui .info hgroup.main { + margin: 0 0 20px + } + + .swagger-ui .info hgroup.main a { + font-size: 12px + } + + .swagger-ui .info pre { + font-size: 14px + } + + .swagger-ui .info li, .swagger-ui .info p, .swagger-ui .info table { + color: #b5bac9; + font-family: sans-serif; + font-size: 14px + } + + .swagger-ui .info h1, .swagger-ui .info h2, .swagger-ui .info h3, .swagger-ui .info h4, .swagger-ui .info h5 { + color: #b5bac9; + font-family: sans-serif + } + + .swagger-ui .info a { + color: #4990e2; + font-family: sans-serif; + font-size: 14px; + transition: all .4s + } + + .swagger-ui .info a:hover { + color: #1f69c0 + } + + .swagger-ui .info > div { + margin: 0 0 5px + } + + .swagger-ui .info .base-url { + color: #b5bac9; + font-family: monospace; + font-size: 12px; + font-weight: 300 !important; + font-weight: 600; + margin: 0 + } + + .swagger-ui .info .title { + color: #62a03f; + font-family: sans-serif; + font-size: 36px; + margin: 0 + } + + .swagger-ui .info .title small { + background: #7d8492; + border-radius: 57px; + display: inline-block; + font-size: 10px; + margin: 0 0 0 5px; + padding: 2px 4px; + position: relative; + top: -5px; + vertical-align: super + } + + .swagger-ui .info .title small.version-stamp { + background-color: #89bf04 + } + + .swagger-ui .info .title small pre { + color: #1c1c21; + font-family: sans-serif; + margin: 0; + padding: 0 + } + +.swagger-ui .auth-btn-wrapper { + display: flex; + justify-content: center; + padding: 10px 0 +} + + .swagger-ui .auth-btn-wrapper .btn-done { + margin-right: 1em + } + +.swagger-ui .auth-wrapper { + display: flex; + flex: 1; + justify-content: flex-end +} + + .swagger-ui .auth-wrapper .authorize { + margin-left: 10px; + margin-right: 10px; + padding-right: 20px + } + +.swagger-ui .auth-container { + border-bottom: 1px solid #ebebeb; + margin: 0 0 10px; + padding: 10px 20px +} + + .swagger-ui .auth-container:last-of-type { + border: 0; + margin: 0; + padding: 10px 20px + } + + .swagger-ui .auth-container h4 { + margin: 5px 0 15px !important + } + + .swagger-ui .auth-container .wrapper { + margin: 0; + padding: 0 + } + + .swagger-ui .auth-container input[type=password], .swagger-ui .auth-container input[type=text] { + min-width: 230px + } + + .swagger-ui .auth-container .errors { + background-color: #fee; + border-radius: 4px; + color: red; + color: #b5bac9; + font-family: monospace; + font-size: 12px; + font-weight: 600; + margin: 1em; + padding: 10px + } + + .swagger-ui .auth-container .errors b { + margin-right: 1em; + text-transform: capitalize + } + +.swagger-ui .scopes h2 { + color: #b5bac9; + font-family: sans-serif; + font-size: 14px +} + + .swagger-ui .scopes h2 a { + color: #4990e2; + cursor: pointer; + font-size: 12px; + padding-left: 10px; + text-decoration: underline + } + +.swagger-ui .scope-def { + padding: 0 0 20px +} + +.swagger-ui .errors-wrapper { + -webkit-animation: scaleUp .5s; + animation: scaleUp .5s; + background: rgba(249,62,62,.1); + border: 2px solid #f93e3e; + border-radius: 4px; + margin: 20px; + padding: 10px 20px +} + + .swagger-ui .errors-wrapper .error-wrapper { + margin: 0 0 10px + } + + .swagger-ui .errors-wrapper .errors h4 { + color: #b5bac9; + font-family: monospace; + font-size: 14px; + font-weight: 600; + margin: 0 + } + + .swagger-ui .errors-wrapper .errors small { + color: #bfbfbf + } + + .swagger-ui .errors-wrapper .errors .message { + white-space: pre-line + } + + .swagger-ui .errors-wrapper .errors .message.thrown { + max-width: 100% + } + + .swagger-ui .errors-wrapper .errors .error-line { + cursor: pointer; + text-decoration: underline + } + + .swagger-ui .errors-wrapper hgroup { + align-items: center; + display: flex + } + + .swagger-ui .errors-wrapper hgroup h4 { + color: #b5bac9; + flex: 1; + font-family: sans-serif; + font-size: 20px; + margin: 0 + } + +@-webkit-keyframes scaleUp { + 0% { + opacity: 0; + transform: scale(.8) + } + + to { + opacity: 1; + transform: scale(1) + } +} + +@keyframes scaleUp { + 0% { + opacity: 0; + transform: scale(.8) + } + + to { + opacity: 1; + transform: scale(1) + } +} + +.swagger-ui .Resizer.vertical.disabled { + display: none +} + +.swagger-ui .markdown p, .swagger-ui .markdown pre, .swagger-ui .renderedMarkdown p, .swagger-ui .renderedMarkdown pre { + margin: 1em auto; + word-break: break-all; + word-break: break-word +} + +.swagger-ui .markdown pre, .swagger-ui .renderedMarkdown pre { + background: none; + color: #000; + font-weight: 400; + padding: 0; + white-space: pre-wrap +} + +.swagger-ui .markdown code, .swagger-ui .renderedMarkdown code { + background: rgba(0,0,0,.05); + border-radius: 4px; + color: #9012fe; + font-family: monospace; + font-size: 14px; + font-weight: 600; + padding: 5px 7px +} + +.swagger-ui .markdown pre > code, .swagger-ui .renderedMarkdown pre > code { + display: block +} + +::-webkit-scrollbar-track-piece { + background-color: rgba(255, 255, 255, .2) !important; +} + +::-webkit-scrollbar-track { + background-color: rgba(255, 255, 255, .3) !important; +} + +::-webkit-scrollbar-thumb { + background-color: rgba(255, 255, 255, .5) !important; +} + +::-webkit-scrollbar-track { + background-color: #646464 !important; +} + +::-webkit-scrollbar-thumb { + background-color: #242424 !important; + border: 2px solid #3e4346 !important; +} + +::-webkit-scrollbar-button:vertical:start:decrement { + background: linear-gradient(130deg, #696969 40%, rgba(255, 0, 0, 0) 41%), linear-gradient(230deg, #696969 40%, transparent 41%), linear-gradient(0deg, #696969 40%, transparent 31%); + background-color: #b6b6b6; +} + +::-webkit-scrollbar-button:vertical:end:increment { + background: linear-gradient(310deg, #696969 40%, transparent 41%), linear-gradient(50deg, #696969 40%, transparent 41%), linear-gradient(180deg, #696969 40%, transparent 31%); + background-color: #b6b6b6; +} + +::-webkit-scrollbar-button:horizontal:end:increment { + background: linear-gradient(210deg, #696969 40%, transparent 41%), linear-gradient(330deg, #696969 40%, transparent 41%), linear-gradient(90deg, #696969 30%, transparent 31%); + background-color: #b6b6b6; +} + +::-webkit-scrollbar-button:horizontal:start:decrement { + background: linear-gradient(30deg, #696969 40%, transparent 41%), linear-gradient(150deg, #696969 40%, transparent 41%), linear-gradient(270deg, #696969 30%, transparent 31%); + background-color: #b6b6b6; +} + +::-webkit-scrollbar-button, ::-webkit-scrollbar-track-piece { + background-color: #3e4346 !important; +} + +::-webkit-scrollbar { + width: 16px; + height: 16px; +} + +::-webkit-scrollbar-button { + background-color: #3e4346 !important; +} + +::-webkit-scrollbar-track { + background-color: #646464 !important; +} + +::-webkit-scrollbar-track-piece { + background-color: #3e4346 !important; +} + +::-webkit-scrollbar-thumb { + height: 50px; + background-color: #242424 !important; + border: 2px solid #3e4346 !important; +} diff --git a/src/Atc.Rest.ApiGenerator.Framework/Resources/wwwroot/swagger-ui/SwaggerLight.css b/src/Atc.Rest.ApiGenerator.Framework/Resources/wwwroot/swagger-ui/SwaggerLight.css new file mode 100644 index 00000000..6779f1b0 --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Framework/Resources/wwwroot/swagger-ui/SwaggerLight.css @@ -0,0 +1,11170 @@ +/* Inject clean Swagger Image */ +.topbar-wrapper .link { + background: url(swagger.png); + background-size: contain; + height: 22px; + width: 220px; + background-repeat: no-repeat; + flex: none !important; +} + + /* Remove Existing Swagger/SmartBear image */ + .topbar-wrapper .link img, .topbar-wrapper .link span { + display: none; + } + +/* Light-Mode */ +.swagger-ui { + color: #3b4151; + font-family: sans-serif; +} + + .swagger-ui html { + -ms-text-size-adjust: 100%; + -webkit-text-size-adjust: 100%; + line-height: 1.15 + } + + .swagger-ui body { + margin: 0 + } + + .swagger-ui article, .swagger-ui aside, .swagger-ui footer, .swagger-ui header, .swagger-ui nav, .swagger-ui section { + display: block + } + + .swagger-ui h1 { + font-size: 2em; + margin: .67em 0 + } + + .swagger-ui figcaption, .swagger-ui figure, .swagger-ui main { + display: block + } + + .swagger-ui figure { + margin: 1em 40px + } + + .swagger-ui hr { + box-sizing: content-box; + height: 0; + overflow: visible + } + + .swagger-ui pre { + font-family: monospace,monospace; + font-size: 1em + } + + .swagger-ui a { + -webkit-text-decoration-skip: objects; + background-color: transparent + } + + .swagger-ui abbr[title] { + border-bottom: none; + text-decoration: underline; + -webkit-text-decoration: underline dotted; + text-decoration: underline dotted + } + + .swagger-ui b, .swagger-ui strong { + font-weight: inherit; + font-weight: bolder + } + + .swagger-ui code, .swagger-ui kbd, .swagger-ui samp { + font-family: monospace,monospace; + font-size: 1em + } + + .swagger-ui dfn { + font-style: italic + } + + .swagger-ui mark { + background-color: #ff0; + color: #000 + } + + .swagger-ui small { + font-size: 80% + } + + .swagger-ui sub, .swagger-ui sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline + } + + .swagger-ui sub { + bottom: -.25em + } + + .swagger-ui sup { + top: -.5em + } + + .swagger-ui audio, .swagger-ui video { + display: inline-block + } + + .swagger-ui audio:not([controls]) { + display: none; + height: 0 + } + + .swagger-ui img { + border-style: none + } + + .swagger-ui svg:not(:root) { + overflow: hidden + } + + .swagger-ui button, .swagger-ui input, .swagger-ui optgroup, .swagger-ui select, .swagger-ui textarea { + font-family: sans-serif; + font-size: 100%; + line-height: 1.15; + margin: 0 + } + + .swagger-ui button, .swagger-ui input { + overflow: visible + } + + .swagger-ui button, .swagger-ui select { + text-transform: none + } + + .swagger-ui [type=reset], .swagger-ui [type=submit], .swagger-ui button, .swagger-ui html [type=button] { + -webkit-appearance: button + } + + .swagger-ui [type=button]::-moz-focus-inner, .swagger-ui [type=reset]::-moz-focus-inner, .swagger-ui [type=submit]::-moz-focus-inner, .swagger-ui button::-moz-focus-inner { + border-style: none; + padding: 0 + } + + .swagger-ui [type=button]:-moz-focusring, .swagger-ui [type=reset]:-moz-focusring, .swagger-ui [type=submit]:-moz-focusring, .swagger-ui button:-moz-focusring { + outline: 1px dotted ButtonText + } + + .swagger-ui fieldset { + padding: .35em .75em .625em + } + + .swagger-ui legend { + box-sizing: border-box; + color: inherit; + display: table; + max-width: 100%; + padding: 0; + white-space: normal + } + + .swagger-ui progress { + display: inline-block; + vertical-align: baseline + } + + .swagger-ui textarea { + overflow: auto + } + + .swagger-ui [type=checkbox], .swagger-ui [type=radio] { + box-sizing: border-box; + padding: 0 + } + + .swagger-ui [type=number]::-webkit-inner-spin-button, .swagger-ui [type=number]::-webkit-outer-spin-button { + height: auto + } + + .swagger-ui [type=search] { + -webkit-appearance: textfield; + outline-offset: -2px + } + + .swagger-ui [type=search]::-webkit-search-cancel-button, .swagger-ui [type=search]::-webkit-search-decoration { + -webkit-appearance: none + } + + .swagger-ui ::-webkit-file-upload-button { + -webkit-appearance: button; + font: inherit + } + + .swagger-ui details, .swagger-ui menu { + display: block + } + + .swagger-ui summary { + display: list-item + } + + .swagger-ui canvas { + display: inline-block + } + + .swagger-ui [hidden], .swagger-ui template { + display: none + } + + .swagger-ui .debug * { + outline: 1px solid gold + } + + .swagger-ui .debug-white * { + outline: 1px solid #fff + } + + .swagger-ui .debug-black * { + outline: 1px solid #000 + } + + .swagger-ui .debug-grid { + background: transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTExIDc5LjE1ODMyNSwgMjAxNS8wOS8xMC0wMToxMDoyMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MTRDOTY4N0U2N0VFMTFFNjg2MzZDQjkwNkQ4MjgwMEIiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MTRDOTY4N0Q2N0VFMTFFNjg2MzZDQjkwNkQ4MjgwMEIiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUgKE1hY2ludG9zaCkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo3NjcyQkQ3NjY3QzUxMUU2QjJCQ0UyNDA4MTAwMjE3MSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo3NjcyQkQ3NzY3QzUxMUU2QjJCQ0UyNDA4MTAwMjE3MSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PsBS+GMAAAAjSURBVHjaYvz//z8DLsD4gcGXiYEAGBIKGBne//fFpwAgwAB98AaF2pjlUQAAAABJRU5ErkJggg==) repeat 0 0 + } + + .swagger-ui .debug-grid-16 { + background: transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTExIDc5LjE1ODMyNSwgMjAxNS8wOS8xMC0wMToxMDoyMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6ODYyRjhERDU2N0YyMTFFNjg2MzZDQjkwNkQ4MjgwMEIiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6ODYyRjhERDQ2N0YyMTFFNjg2MzZDQjkwNkQ4MjgwMEIiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUgKE1hY2ludG9zaCkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo3NjcyQkQ3QTY3QzUxMUU2QjJCQ0UyNDA4MTAwMjE3MSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo3NjcyQkQ3QjY3QzUxMUU2QjJCQ0UyNDA4MTAwMjE3MSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PvCS01IAAABMSURBVHjaYmR4/5+BFPBfAMFm/MBgx8RAGWCn1AAmSg34Q6kBDKMGMDCwICeMIemF/5QawEipAWwUhwEjMDvbAWlWkvVBwu8vQIABAEwBCph8U6c0AAAAAElFTkSuQmCC) repeat 0 0 + } + + .swagger-ui .debug-grid-8-solid { + background: #fff url(data:image/jpeg;base64,/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAAAAAAD/4QMxaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjYtYzExMSA3OS4xNTgzMjUsIDIwMTUvMDkvMTAtMDE6MTA6MjAgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bXA6Q3JlYXRvclRvb2w9IkFkb2JlIFBob3Rvc2hvcCBDQyAyMDE1IChNYWNpbnRvc2gpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkIxMjI0OTczNjdCMzExRTZCMkJDRTI0MDgxMDAyMTcxIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkIxMjI0OTc0NjdCMzExRTZCMkJDRTI0MDgxMDAyMTcxIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6QjEyMjQ5NzE2N0IzMTFFNkIyQkNFMjQwODEwMDIxNzEiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6QjEyMjQ5NzI2N0IzMTFFNkIyQkNFMjQwODEwMDIxNzEiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz7/7gAOQWRvYmUAZMAAAAAB/9sAhAAbGhopHSlBJiZBQi8vL0JHPz4+P0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHAR0pKTQmND8oKD9HPzU/R0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0f/wAARCAAIAAgDASIAAhEBAxEB/8QAWQABAQAAAAAAAAAAAAAAAAAAAAYBAQEAAAAAAAAAAAAAAAAAAAIEEAEBAAMBAAAAAAAAAAAAAAABADECA0ERAAEDBQAAAAAAAAAAAAAAAAARITFBUWESIv/aAAwDAQACEQMRAD8AoOnTV1QTD7JJshP3vSM3P//Z) repeat 0 0 + } + + .swagger-ui .debug-grid-16-solid { + background: #fff url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTExIDc5LjE1ODMyNSwgMjAxNS8wOS8xMC0wMToxMDoyMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NzY3MkJEN0U2N0M1MTFFNkIyQkNFMjQwODEwMDIxNzEiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NzY3MkJEN0Y2N0M1MTFFNkIyQkNFMjQwODEwMDIxNzEiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo3NjcyQkQ3QzY3QzUxMUU2QjJCQ0UyNDA4MTAwMjE3MSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo3NjcyQkQ3RDY3QzUxMUU2QjJCQ0UyNDA4MTAwMjE3MSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pve6J3kAAAAzSURBVHjaYvz//z8D0UDsMwMjSRoYP5Gq4SPNbRjVMEQ1fCRDg+in/6+J1AJUxsgAEGAA31BAJMS0GYEAAAAASUVORK5CYII=) repeat 0 0 + } + + .swagger-ui .border-box, .swagger-ui a, .swagger-ui article, .swagger-ui body, .swagger-ui code, .swagger-ui dd, .swagger-ui div, .swagger-ui dl, .swagger-ui dt, .swagger-ui fieldset, .swagger-ui footer, .swagger-ui form, .swagger-ui h1, .swagger-ui h2, .swagger-ui h3, .swagger-ui h4, .swagger-ui h5, .swagger-ui h6, .swagger-ui header, .swagger-ui html, .swagger-ui input[type=email], .swagger-ui input[type=number], .swagger-ui input[type=password], .swagger-ui input[type=tel], .swagger-ui input[type=text], .swagger-ui input[type=url], .swagger-ui legend, .swagger-ui li, .swagger-ui main, .swagger-ui ol, .swagger-ui p, .swagger-ui pre, .swagger-ui section, .swagger-ui table, .swagger-ui td, .swagger-ui textarea, .swagger-ui th, .swagger-ui tr, .swagger-ui ul { + box-sizing: border-box + } + + .swagger-ui .aspect-ratio { + height: 0; + position: relative + } + + .swagger-ui .aspect-ratio--16x9 { + padding-bottom: 56.25% + } + + .swagger-ui .aspect-ratio--9x16 { + padding-bottom: 177.77% + } + + .swagger-ui .aspect-ratio--4x3 { + padding-bottom: 75% + } + + .swagger-ui .aspect-ratio--3x4 { + padding-bottom: 133.33% + } + + .swagger-ui .aspect-ratio--6x4 { + padding-bottom: 66.6% + } + + .swagger-ui .aspect-ratio--4x6 { + padding-bottom: 150% + } + + .swagger-ui .aspect-ratio--8x5 { + padding-bottom: 62.5% + } + + .swagger-ui .aspect-ratio--5x8 { + padding-bottom: 160% + } + + .swagger-ui .aspect-ratio--7x5 { + padding-bottom: 71.42% + } + + .swagger-ui .aspect-ratio--5x7 { + padding-bottom: 140% + } + + .swagger-ui .aspect-ratio--1x1 { + padding-bottom: 100% + } + + .swagger-ui .aspect-ratio--object { + bottom: 0; + height: 100%; + left: 0; + position: absolute; + right: 0; + top: 0; + width: 100%; + z-index: 100 + } + +@media screen and (min-width: 30em) { + .swagger-ui .aspect-ratio-ns { + height: 0; + position: relative + } + + .swagger-ui .aspect-ratio--16x9-ns { + padding-bottom: 56.25% + } + + .swagger-ui .aspect-ratio--9x16-ns { + padding-bottom: 177.77% + } + + .swagger-ui .aspect-ratio--4x3-ns { + padding-bottom: 75% + } + + .swagger-ui .aspect-ratio--3x4-ns { + padding-bottom: 133.33% + } + + .swagger-ui .aspect-ratio--6x4-ns { + padding-bottom: 66.6% + } + + .swagger-ui .aspect-ratio--4x6-ns { + padding-bottom: 150% + } + + .swagger-ui .aspect-ratio--8x5-ns { + padding-bottom: 62.5% + } + + .swagger-ui .aspect-ratio--5x8-ns { + padding-bottom: 160% + } + + .swagger-ui .aspect-ratio--7x5-ns { + padding-bottom: 71.42% + } + + .swagger-ui .aspect-ratio--5x7-ns { + padding-bottom: 140% + } + + .swagger-ui .aspect-ratio--1x1-ns { + padding-bottom: 100% + } + + .swagger-ui .aspect-ratio--object-ns { + bottom: 0; + height: 100%; + left: 0; + position: absolute; + right: 0; + top: 0; + width: 100%; + z-index: 100 + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .aspect-ratio-m { + height: 0; + position: relative + } + + .swagger-ui .aspect-ratio--16x9-m { + padding-bottom: 56.25% + } + + .swagger-ui .aspect-ratio--9x16-m { + padding-bottom: 177.77% + } + + .swagger-ui .aspect-ratio--4x3-m { + padding-bottom: 75% + } + + .swagger-ui .aspect-ratio--3x4-m { + padding-bottom: 133.33% + } + + .swagger-ui .aspect-ratio--6x4-m { + padding-bottom: 66.6% + } + + .swagger-ui .aspect-ratio--4x6-m { + padding-bottom: 150% + } + + .swagger-ui .aspect-ratio--8x5-m { + padding-bottom: 62.5% + } + + .swagger-ui .aspect-ratio--5x8-m { + padding-bottom: 160% + } + + .swagger-ui .aspect-ratio--7x5-m { + padding-bottom: 71.42% + } + + .swagger-ui .aspect-ratio--5x7-m { + padding-bottom: 140% + } + + .swagger-ui .aspect-ratio--1x1-m { + padding-bottom: 100% + } + + .swagger-ui .aspect-ratio--object-m { + bottom: 0; + height: 100%; + left: 0; + position: absolute; + right: 0; + top: 0; + width: 100%; + z-index: 100 + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .aspect-ratio-l { + height: 0; + position: relative + } + + .swagger-ui .aspect-ratio--16x9-l { + padding-bottom: 56.25% + } + + .swagger-ui .aspect-ratio--9x16-l { + padding-bottom: 177.77% + } + + .swagger-ui .aspect-ratio--4x3-l { + padding-bottom: 75% + } + + .swagger-ui .aspect-ratio--3x4-l { + padding-bottom: 133.33% + } + + .swagger-ui .aspect-ratio--6x4-l { + padding-bottom: 66.6% + } + + .swagger-ui .aspect-ratio--4x6-l { + padding-bottom: 150% + } + + .swagger-ui .aspect-ratio--8x5-l { + padding-bottom: 62.5% + } + + .swagger-ui .aspect-ratio--5x8-l { + padding-bottom: 160% + } + + .swagger-ui .aspect-ratio--7x5-l { + padding-bottom: 71.42% + } + + .swagger-ui .aspect-ratio--5x7-l { + padding-bottom: 140% + } + + .swagger-ui .aspect-ratio--1x1-l { + padding-bottom: 100% + } + + .swagger-ui .aspect-ratio--object-l { + bottom: 0; + height: 100%; + left: 0; + position: absolute; + right: 0; + top: 0; + width: 100%; + z-index: 100 + } +} + +.swagger-ui img { + max-width: 100% +} + +.swagger-ui .cover { + background-size: cover !important +} + +.swagger-ui .contain { + background-size: contain !important +} + +@media screen and (min-width: 30em) { + .swagger-ui .cover-ns { + background-size: cover !important + } + + .swagger-ui .contain-ns { + background-size: contain !important + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .cover-m { + background-size: cover !important + } + + .swagger-ui .contain-m { + background-size: contain !important + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .cover-l { + background-size: cover !important + } + + .swagger-ui .contain-l { + background-size: contain !important + } +} + +.swagger-ui .bg-center { + background-position: 50%; + background-repeat: no-repeat +} + +.swagger-ui .bg-top { + background-position: top; + background-repeat: no-repeat +} + +.swagger-ui .bg-right { + background-position: 100%; + background-repeat: no-repeat +} + +.swagger-ui .bg-bottom { + background-position: bottom; + background-repeat: no-repeat +} + +.swagger-ui .bg-left { + background-position: 0; + background-repeat: no-repeat +} + +@media screen and (min-width: 30em) { + .swagger-ui .bg-center-ns { + background-position: 50%; + background-repeat: no-repeat + } + + .swagger-ui .bg-top-ns { + background-position: top; + background-repeat: no-repeat + } + + .swagger-ui .bg-right-ns { + background-position: 100%; + background-repeat: no-repeat + } + + .swagger-ui .bg-bottom-ns { + background-position: bottom; + background-repeat: no-repeat + } + + .swagger-ui .bg-left-ns { + background-position: 0; + background-repeat: no-repeat + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .bg-center-m { + background-position: 50%; + background-repeat: no-repeat + } + + .swagger-ui .bg-top-m { + background-position: top; + background-repeat: no-repeat + } + + .swagger-ui .bg-right-m { + background-position: 100%; + background-repeat: no-repeat + } + + .swagger-ui .bg-bottom-m { + background-position: bottom; + background-repeat: no-repeat + } + + .swagger-ui .bg-left-m { + background-position: 0; + background-repeat: no-repeat + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .bg-center-l { + background-position: 50%; + background-repeat: no-repeat + } + + .swagger-ui .bg-top-l { + background-position: top; + background-repeat: no-repeat + } + + .swagger-ui .bg-right-l { + background-position: 100%; + background-repeat: no-repeat + } + + .swagger-ui .bg-bottom-l { + background-position: bottom; + background-repeat: no-repeat + } + + .swagger-ui .bg-left-l { + background-position: 0; + background-repeat: no-repeat + } +} + +.swagger-ui .outline { + outline: 1px solid +} + +.swagger-ui .outline-transparent { + outline: 1px solid transparent +} + +.swagger-ui .outline-0 { + outline: 0 +} + +@media screen and (min-width: 30em) { + .swagger-ui .outline-ns { + outline: 1px solid + } + + .swagger-ui .outline-transparent-ns { + outline: 1px solid transparent + } + + .swagger-ui .outline-0-ns { + outline: 0 + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .outline-m { + outline: 1px solid + } + + .swagger-ui .outline-transparent-m { + outline: 1px solid transparent + } + + .swagger-ui .outline-0-m { + outline: 0 + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .outline-l { + outline: 1px solid + } + + .swagger-ui .outline-transparent-l { + outline: 1px solid transparent + } + + .swagger-ui .outline-0-l { + outline: 0 + } +} + +.swagger-ui .ba { + border-style: solid; + border-width: 1px +} + +.swagger-ui .bt { + border-top-style: solid; + border-top-width: 1px +} + +.swagger-ui .br { + border-right-style: solid; + border-right-width: 1px +} + +.swagger-ui .bb { + border-bottom-style: solid; + border-bottom-width: 1px +} + +.swagger-ui .bl { + border-left-style: solid; + border-left-width: 1px +} + +.swagger-ui .bn { + border-style: none; + border-width: 0 +} + +@media screen and (min-width: 30em) { + .swagger-ui .ba-ns { + border-style: solid; + border-width: 1px + } + + .swagger-ui .bt-ns { + border-top-style: solid; + border-top-width: 1px + } + + .swagger-ui .br-ns { + border-right-style: solid; + border-right-width: 1px + } + + .swagger-ui .bb-ns { + border-bottom-style: solid; + border-bottom-width: 1px + } + + .swagger-ui .bl-ns { + border-left-style: solid; + border-left-width: 1px + } + + .swagger-ui .bn-ns { + border-style: none; + border-width: 0 + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .ba-m { + border-style: solid; + border-width: 1px + } + + .swagger-ui .bt-m { + border-top-style: solid; + border-top-width: 1px + } + + .swagger-ui .br-m { + border-right-style: solid; + border-right-width: 1px + } + + .swagger-ui .bb-m { + border-bottom-style: solid; + border-bottom-width: 1px + } + + .swagger-ui .bl-m { + border-left-style: solid; + border-left-width: 1px + } + + .swagger-ui .bn-m { + border-style: none; + border-width: 0 + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .ba-l { + border-style: solid; + border-width: 1px + } + + .swagger-ui .bt-l { + border-top-style: solid; + border-top-width: 1px + } + + .swagger-ui .br-l { + border-right-style: solid; + border-right-width: 1px + } + + .swagger-ui .bb-l { + border-bottom-style: solid; + border-bottom-width: 1px + } + + .swagger-ui .bl-l { + border-left-style: solid; + border-left-width: 1px + } + + .swagger-ui .bn-l { + border-style: none; + border-width: 0 + } +} + +.swagger-ui .b--black { + border-color: #000 +} + +.swagger-ui .b--near-black { + border-color: #111 +} + +.swagger-ui .b--dark-gray { + border-color: #333 +} + +.swagger-ui .b--mid-gray { + border-color: #555 +} + +.swagger-ui .b--gray { + border-color: #777 +} + +.swagger-ui .b--silver { + border-color: #999 +} + +.swagger-ui .b--light-silver { + border-color: #aaa +} + +.swagger-ui .b--moon-gray { + border-color: #ccc +} + +.swagger-ui .b--light-gray { + border-color: #eee +} + +.swagger-ui .b--near-white { + border-color: #f4f4f4 +} + +.swagger-ui .b--white { + border-color: #fff +} + +.swagger-ui .b--white-90 { + border-color: hsla(0,0%,100%,.9) +} + +.swagger-ui .b--white-80 { + border-color: hsla(0,0%,100%,.8) +} + +.swagger-ui .b--white-70 { + border-color: hsla(0,0%,100%,.7) +} + +.swagger-ui .b--white-60 { + border-color: hsla(0,0%,100%,.6) +} + +.swagger-ui .b--white-50 { + border-color: hsla(0,0%,100%,.5) +} + +.swagger-ui .b--white-40 { + border-color: hsla(0,0%,100%,.4) +} + +.swagger-ui .b--white-30 { + border-color: hsla(0,0%,100%,.3) +} + +.swagger-ui .b--white-20 { + border-color: hsla(0,0%,100%,.2) +} + +.swagger-ui .b--white-10 { + border-color: hsla(0,0%,100%,.1) +} + +.swagger-ui .b--white-05 { + border-color: hsla(0,0%,100%,.05) +} + +.swagger-ui .b--white-025 { + border-color: hsla(0,0%,100%,.025) +} + +.swagger-ui .b--white-0125 { + border-color: hsla(0,0%,100%,.013) +} + +.swagger-ui .b--black-90 { + border-color: rgba(0,0,0,.9) +} + +.swagger-ui .b--black-80 { + border-color: rgba(0,0,0,.8) +} + +.swagger-ui .b--black-70 { + border-color: rgba(0,0,0,.7) +} + +.swagger-ui .b--black-60 { + border-color: rgba(0,0,0,.6) +} + +.swagger-ui .b--black-50 { + border-color: rgba(0,0,0,.5) +} + +.swagger-ui .b--black-40 { + border-color: rgba(0,0,0,.4) +} + +.swagger-ui .b--black-30 { + border-color: rgba(0,0,0,.3) +} + +.swagger-ui .b--black-20 { + border-color: rgba(0,0,0,.2) +} + +.swagger-ui .b--black-10 { + border-color: rgba(0,0,0,.1) +} + +.swagger-ui .b--black-05 { + border-color: rgba(0,0,0,.05) +} + +.swagger-ui .b--black-025 { + border-color: rgba(0,0,0,.025) +} + +.swagger-ui .b--black-0125 { + border-color: rgba(0,0,0,.013) +} + +.swagger-ui .b--dark-red { + border-color: #e7040f +} + +.swagger-ui .b--red { + border-color: #ff4136 +} + +.swagger-ui .b--light-red { + border-color: #ff725c +} + +.swagger-ui .b--orange { + border-color: #ff6300 +} + +.swagger-ui .b--gold { + border-color: #ffb700 +} + +.swagger-ui .b--yellow { + border-color: gold +} + +.swagger-ui .b--light-yellow { + border-color: #fbf1a9 +} + +.swagger-ui .b--purple { + border-color: #5e2ca5 +} + +.swagger-ui .b--light-purple { + border-color: #a463f2 +} + +.swagger-ui .b--dark-pink { + border-color: #d5008f +} + +.swagger-ui .b--hot-pink { + border-color: #ff41b4 +} + +.swagger-ui .b--pink { + border-color: #ff80cc +} + +.swagger-ui .b--light-pink { + border-color: #ffa3d7 +} + +.swagger-ui .b--dark-green { + border-color: #137752 +} + +.swagger-ui .b--green { + border-color: #19a974 +} + +.swagger-ui .b--light-green { + border-color: #9eebcf +} + +.swagger-ui .b--navy { + border-color: #001b44 +} + +.swagger-ui .b--dark-blue { + border-color: #00449e +} + +.swagger-ui .b--blue { + border-color: #357edd +} + +.swagger-ui .b--light-blue { + border-color: #96ccff +} + +.swagger-ui .b--lightest-blue { + border-color: #cdecff +} + +.swagger-ui .b--washed-blue { + border-color: #f6fffe +} + +.swagger-ui .b--washed-green { + border-color: #e8fdf5 +} + +.swagger-ui .b--washed-yellow { + border-color: #fffceb +} + +.swagger-ui .b--washed-red { + border-color: #ffdfdf +} + +.swagger-ui .b--transparent { + border-color: transparent +} + +.swagger-ui .b--inherit { + border-color: inherit +} + +.swagger-ui .br0 { + border-radius: 0 +} + +.swagger-ui .br1 { + border-radius: .125rem +} + +.swagger-ui .br2 { + border-radius: .25rem +} + +.swagger-ui .br3 { + border-radius: .5rem +} + +.swagger-ui .br4 { + border-radius: 1rem +} + +.swagger-ui .br-100 { + border-radius: 100% +} + +.swagger-ui .br-pill { + border-radius: 9999px +} + +.swagger-ui .br--bottom { + border-top-left-radius: 0; + border-top-right-radius: 0 +} + +.swagger-ui .br--top { + border-bottom-left-radius: 0; + border-bottom-right-radius: 0 +} + +.swagger-ui .br--right { + border-bottom-left-radius: 0; + border-top-left-radius: 0 +} + +.swagger-ui .br--left { + border-bottom-right-radius: 0; + border-top-right-radius: 0 +} + +@media screen and (min-width: 30em) { + .swagger-ui .br0-ns { + border-radius: 0 + } + + .swagger-ui .br1-ns { + border-radius: .125rem + } + + .swagger-ui .br2-ns { + border-radius: .25rem + } + + .swagger-ui .br3-ns { + border-radius: .5rem + } + + .swagger-ui .br4-ns { + border-radius: 1rem + } + + .swagger-ui .br-100-ns { + border-radius: 100% + } + + .swagger-ui .br-pill-ns { + border-radius: 9999px + } + + .swagger-ui .br--bottom-ns { + border-top-left-radius: 0; + border-top-right-radius: 0 + } + + .swagger-ui .br--top-ns { + border-bottom-left-radius: 0; + border-bottom-right-radius: 0 + } + + .swagger-ui .br--right-ns { + border-bottom-left-radius: 0; + border-top-left-radius: 0 + } + + .swagger-ui .br--left-ns { + border-bottom-right-radius: 0; + border-top-right-radius: 0 + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .br0-m { + border-radius: 0 + } + + .swagger-ui .br1-m { + border-radius: .125rem + } + + .swagger-ui .br2-m { + border-radius: .25rem + } + + .swagger-ui .br3-m { + border-radius: .5rem + } + + .swagger-ui .br4-m { + border-radius: 1rem + } + + .swagger-ui .br-100-m { + border-radius: 100% + } + + .swagger-ui .br-pill-m { + border-radius: 9999px + } + + .swagger-ui .br--bottom-m { + border-top-left-radius: 0; + border-top-right-radius: 0 + } + + .swagger-ui .br--top-m { + border-bottom-left-radius: 0; + border-bottom-right-radius: 0 + } + + .swagger-ui .br--right-m { + border-bottom-left-radius: 0; + border-top-left-radius: 0 + } + + .swagger-ui .br--left-m { + border-bottom-right-radius: 0; + border-top-right-radius: 0 + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .br0-l { + border-radius: 0 + } + + .swagger-ui .br1-l { + border-radius: .125rem + } + + .swagger-ui .br2-l { + border-radius: .25rem + } + + .swagger-ui .br3-l { + border-radius: .5rem + } + + .swagger-ui .br4-l { + border-radius: 1rem + } + + .swagger-ui .br-100-l { + border-radius: 100% + } + + .swagger-ui .br-pill-l { + border-radius: 9999px + } + + .swagger-ui .br--bottom-l { + border-top-left-radius: 0; + border-top-right-radius: 0 + } + + .swagger-ui .br--top-l { + border-bottom-left-radius: 0; + border-bottom-right-radius: 0 + } + + .swagger-ui .br--right-l { + border-bottom-left-radius: 0; + border-top-left-radius: 0 + } + + .swagger-ui .br--left-l { + border-bottom-right-radius: 0; + border-top-right-radius: 0 + } +} + +.swagger-ui .b--dotted { + border-style: dotted +} + +.swagger-ui .b--dashed { + border-style: dashed +} + +.swagger-ui .b--solid { + border-style: solid +} + +.swagger-ui .b--none { + border-style: none +} + +@media screen and (min-width: 30em) { + .swagger-ui .b--dotted-ns { + border-style: dotted + } + + .swagger-ui .b--dashed-ns { + border-style: dashed + } + + .swagger-ui .b--solid-ns { + border-style: solid + } + + .swagger-ui .b--none-ns { + border-style: none + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .b--dotted-m { + border-style: dotted + } + + .swagger-ui .b--dashed-m { + border-style: dashed + } + + .swagger-ui .b--solid-m { + border-style: solid + } + + .swagger-ui .b--none-m { + border-style: none + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .b--dotted-l { + border-style: dotted + } + + .swagger-ui .b--dashed-l { + border-style: dashed + } + + .swagger-ui .b--solid-l { + border-style: solid + } + + .swagger-ui .b--none-l { + border-style: none + } +} + +.swagger-ui .bw0 { + border-width: 0 +} + +.swagger-ui .bw1 { + border-width: .125rem +} + +.swagger-ui .bw2 { + border-width: .25rem +} + +.swagger-ui .bw3 { + border-width: .5rem +} + +.swagger-ui .bw4 { + border-width: 1rem +} + +.swagger-ui .bw5 { + border-width: 2rem +} + +.swagger-ui .bt-0 { + border-top-width: 0 +} + +.swagger-ui .br-0 { + border-right-width: 0 +} + +.swagger-ui .bb-0 { + border-bottom-width: 0 +} + +.swagger-ui .bl-0 { + border-left-width: 0 +} + +@media screen and (min-width: 30em) { + .swagger-ui .bw0-ns { + border-width: 0 + } + + .swagger-ui .bw1-ns { + border-width: .125rem + } + + .swagger-ui .bw2-ns { + border-width: .25rem + } + + .swagger-ui .bw3-ns { + border-width: .5rem + } + + .swagger-ui .bw4-ns { + border-width: 1rem + } + + .swagger-ui .bw5-ns { + border-width: 2rem + } + + .swagger-ui .bt-0-ns { + border-top-width: 0 + } + + .swagger-ui .br-0-ns { + border-right-width: 0 + } + + .swagger-ui .bb-0-ns { + border-bottom-width: 0 + } + + .swagger-ui .bl-0-ns { + border-left-width: 0 + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .bw0-m { + border-width: 0 + } + + .swagger-ui .bw1-m { + border-width: .125rem + } + + .swagger-ui .bw2-m { + border-width: .25rem + } + + .swagger-ui .bw3-m { + border-width: .5rem + } + + .swagger-ui .bw4-m { + border-width: 1rem + } + + .swagger-ui .bw5-m { + border-width: 2rem + } + + .swagger-ui .bt-0-m { + border-top-width: 0 + } + + .swagger-ui .br-0-m { + border-right-width: 0 + } + + .swagger-ui .bb-0-m { + border-bottom-width: 0 + } + + .swagger-ui .bl-0-m { + border-left-width: 0 + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .bw0-l { + border-width: 0 + } + + .swagger-ui .bw1-l { + border-width: .125rem + } + + .swagger-ui .bw2-l { + border-width: .25rem + } + + .swagger-ui .bw3-l { + border-width: .5rem + } + + .swagger-ui .bw4-l { + border-width: 1rem + } + + .swagger-ui .bw5-l { + border-width: 2rem + } + + .swagger-ui .bt-0-l { + border-top-width: 0 + } + + .swagger-ui .br-0-l { + border-right-width: 0 + } + + .swagger-ui .bb-0-l { + border-bottom-width: 0 + } + + .swagger-ui .bl-0-l { + border-left-width: 0 + } +} + +.swagger-ui .shadow-1 { + box-shadow: 0 0 4px 2px rgba(0,0,0,.2) +} + +.swagger-ui .shadow-2 { + box-shadow: 0 0 8px 2px rgba(0,0,0,.2) +} + +.swagger-ui .shadow-3 { + box-shadow: 2px 2px 4px 2px rgba(0,0,0,.2) +} + +.swagger-ui .shadow-4 { + box-shadow: 2px 2px 8px 0 rgba(0,0,0,.2) +} + +.swagger-ui .shadow-5 { + box-shadow: 4px 4px 8px 0 rgba(0,0,0,.2) +} + +@media screen and (min-width: 30em) { + .swagger-ui .shadow-1-ns { + box-shadow: 0 0 4px 2px rgba(0,0,0,.2) + } + + .swagger-ui .shadow-2-ns { + box-shadow: 0 0 8px 2px rgba(0,0,0,.2) + } + + .swagger-ui .shadow-3-ns { + box-shadow: 2px 2px 4px 2px rgba(0,0,0,.2) + } + + .swagger-ui .shadow-4-ns { + box-shadow: 2px 2px 8px 0 rgba(0,0,0,.2) + } + + .swagger-ui .shadow-5-ns { + box-shadow: 4px 4px 8px 0 rgba(0,0,0,.2) + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .shadow-1-m { + box-shadow: 0 0 4px 2px rgba(0,0,0,.2) + } + + .swagger-ui .shadow-2-m { + box-shadow: 0 0 8px 2px rgba(0,0,0,.2) + } + + .swagger-ui .shadow-3-m { + box-shadow: 2px 2px 4px 2px rgba(0,0,0,.2) + } + + .swagger-ui .shadow-4-m { + box-shadow: 2px 2px 8px 0 rgba(0,0,0,.2) + } + + .swagger-ui .shadow-5-m { + box-shadow: 4px 4px 8px 0 rgba(0,0,0,.2) + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .shadow-1-l { + box-shadow: 0 0 4px 2px rgba(0,0,0,.2) + } + + .swagger-ui .shadow-2-l { + box-shadow: 0 0 8px 2px rgba(0,0,0,.2) + } + + .swagger-ui .shadow-3-l { + box-shadow: 2px 2px 4px 2px rgba(0,0,0,.2) + } + + .swagger-ui .shadow-4-l { + box-shadow: 2px 2px 8px 0 rgba(0,0,0,.2) + } + + .swagger-ui .shadow-5-l { + box-shadow: 4px 4px 8px 0 rgba(0,0,0,.2) + } +} + +.swagger-ui .pre { + overflow-x: auto; + overflow-y: hidden; + overflow: scroll +} + +.swagger-ui .top-0 { + top: 0 +} + +.swagger-ui .right-0 { + right: 0 +} + +.swagger-ui .bottom-0 { + bottom: 0 +} + +.swagger-ui .left-0 { + left: 0 +} + +.swagger-ui .top-1 { + top: 1rem +} + +.swagger-ui .right-1 { + right: 1rem +} + +.swagger-ui .bottom-1 { + bottom: 1rem +} + +.swagger-ui .left-1 { + left: 1rem +} + +.swagger-ui .top-2 { + top: 2rem +} + +.swagger-ui .right-2 { + right: 2rem +} + +.swagger-ui .bottom-2 { + bottom: 2rem +} + +.swagger-ui .left-2 { + left: 2rem +} + +.swagger-ui .top--1 { + top: -1rem +} + +.swagger-ui .right--1 { + right: -1rem +} + +.swagger-ui .bottom--1 { + bottom: -1rem +} + +.swagger-ui .left--1 { + left: -1rem +} + +.swagger-ui .top--2 { + top: -2rem +} + +.swagger-ui .right--2 { + right: -2rem +} + +.swagger-ui .bottom--2 { + bottom: -2rem +} + +.swagger-ui .left--2 { + left: -2rem +} + +.swagger-ui .absolute--fill { + bottom: 0; + left: 0; + right: 0; + top: 0 +} + +@media screen and (min-width: 30em) { + .swagger-ui .top-0-ns { + top: 0 + } + + .swagger-ui .left-0-ns { + left: 0 + } + + .swagger-ui .right-0-ns { + right: 0 + } + + .swagger-ui .bottom-0-ns { + bottom: 0 + } + + .swagger-ui .top-1-ns { + top: 1rem + } + + .swagger-ui .left-1-ns { + left: 1rem + } + + .swagger-ui .right-1-ns { + right: 1rem + } + + .swagger-ui .bottom-1-ns { + bottom: 1rem + } + + .swagger-ui .top-2-ns { + top: 2rem + } + + .swagger-ui .left-2-ns { + left: 2rem + } + + .swagger-ui .right-2-ns { + right: 2rem + } + + .swagger-ui .bottom-2-ns { + bottom: 2rem + } + + .swagger-ui .top--1-ns { + top: -1rem + } + + .swagger-ui .right--1-ns { + right: -1rem + } + + .swagger-ui .bottom--1-ns { + bottom: -1rem + } + + .swagger-ui .left--1-ns { + left: -1rem + } + + .swagger-ui .top--2-ns { + top: -2rem + } + + .swagger-ui .right--2-ns { + right: -2rem + } + + .swagger-ui .bottom--2-ns { + bottom: -2rem + } + + .swagger-ui .left--2-ns { + left: -2rem + } + + .swagger-ui .absolute--fill-ns { + bottom: 0; + left: 0; + right: 0; + top: 0 + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .top-0-m { + top: 0 + } + + .swagger-ui .left-0-m { + left: 0 + } + + .swagger-ui .right-0-m { + right: 0 + } + + .swagger-ui .bottom-0-m { + bottom: 0 + } + + .swagger-ui .top-1-m { + top: 1rem + } + + .swagger-ui .left-1-m { + left: 1rem + } + + .swagger-ui .right-1-m { + right: 1rem + } + + .swagger-ui .bottom-1-m { + bottom: 1rem + } + + .swagger-ui .top-2-m { + top: 2rem + } + + .swagger-ui .left-2-m { + left: 2rem + } + + .swagger-ui .right-2-m { + right: 2rem + } + + .swagger-ui .bottom-2-m { + bottom: 2rem + } + + .swagger-ui .top--1-m { + top: -1rem + } + + .swagger-ui .right--1-m { + right: -1rem + } + + .swagger-ui .bottom--1-m { + bottom: -1rem + } + + .swagger-ui .left--1-m { + left: -1rem + } + + .swagger-ui .top--2-m { + top: -2rem + } + + .swagger-ui .right--2-m { + right: -2rem + } + + .swagger-ui .bottom--2-m { + bottom: -2rem + } + + .swagger-ui .left--2-m { + left: -2rem + } + + .swagger-ui .absolute--fill-m { + bottom: 0; + left: 0; + right: 0; + top: 0 + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .top-0-l { + top: 0 + } + + .swagger-ui .left-0-l { + left: 0 + } + + .swagger-ui .right-0-l { + right: 0 + } + + .swagger-ui .bottom-0-l { + bottom: 0 + } + + .swagger-ui .top-1-l { + top: 1rem + } + + .swagger-ui .left-1-l { + left: 1rem + } + + .swagger-ui .right-1-l { + right: 1rem + } + + .swagger-ui .bottom-1-l { + bottom: 1rem + } + + .swagger-ui .top-2-l { + top: 2rem + } + + .swagger-ui .left-2-l { + left: 2rem + } + + .swagger-ui .right-2-l { + right: 2rem + } + + .swagger-ui .bottom-2-l { + bottom: 2rem + } + + .swagger-ui .top--1-l { + top: -1rem + } + + .swagger-ui .right--1-l { + right: -1rem + } + + .swagger-ui .bottom--1-l { + bottom: -1rem + } + + .swagger-ui .left--1-l { + left: -1rem + } + + .swagger-ui .top--2-l { + top: -2rem + } + + .swagger-ui .right--2-l { + right: -2rem + } + + .swagger-ui .bottom--2-l { + bottom: -2rem + } + + .swagger-ui .left--2-l { + left: -2rem + } + + .swagger-ui .absolute--fill-l { + bottom: 0; + left: 0; + right: 0; + top: 0 + } +} + +.swagger-ui .cf:after, .swagger-ui .cf:before { + content: " "; + display: table +} + +.swagger-ui .cf:after { + clear: both +} + +.swagger-ui .cf { + zoom: 1 +} + +.swagger-ui .cl { + clear: left +} + +.swagger-ui .cr { + clear: right +} + +.swagger-ui .cb { + clear: both +} + +.swagger-ui .cn { + clear: none +} + +@media screen and (min-width: 30em) { + .swagger-ui .cl-ns { + clear: left + } + + .swagger-ui .cr-ns { + clear: right + } + + .swagger-ui .cb-ns { + clear: both + } + + .swagger-ui .cn-ns { + clear: none + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .cl-m { + clear: left + } + + .swagger-ui .cr-m { + clear: right + } + + .swagger-ui .cb-m { + clear: both + } + + .swagger-ui .cn-m { + clear: none + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .cl-l { + clear: left + } + + .swagger-ui .cr-l { + clear: right + } + + .swagger-ui .cb-l { + clear: both + } + + .swagger-ui .cn-l { + clear: none + } +} + +.swagger-ui .flex { + display: flex +} + +.swagger-ui .inline-flex { + display: inline-flex +} + +.swagger-ui .flex-auto { + flex: 1 1 auto; + min-height: 0; + min-width: 0 +} + +.swagger-ui .flex-none { + flex: none +} + +.swagger-ui .flex-column { + flex-direction: column +} + +.swagger-ui .flex-row { + flex-direction: row +} + +.swagger-ui .flex-wrap { + flex-wrap: wrap +} + +.swagger-ui .flex-nowrap { + flex-wrap: nowrap +} + +.swagger-ui .flex-wrap-reverse { + flex-wrap: wrap-reverse +} + +.swagger-ui .flex-column-reverse { + flex-direction: column-reverse +} + +.swagger-ui .flex-row-reverse { + flex-direction: row-reverse +} + +.swagger-ui .items-start { + align-items: flex-start +} + +.swagger-ui .items-end { + align-items: flex-end +} + +.swagger-ui .items-center { + align-items: center +} + +.swagger-ui .items-baseline { + align-items: baseline +} + +.swagger-ui .items-stretch { + align-items: stretch +} + +.swagger-ui .self-start { + align-self: flex-start +} + +.swagger-ui .self-end { + align-self: flex-end +} + +.swagger-ui .self-center { + align-self: center +} + +.swagger-ui .self-baseline { + align-self: baseline +} + +.swagger-ui .self-stretch { + align-self: stretch +} + +.swagger-ui .justify-start { + justify-content: flex-start +} + +.swagger-ui .justify-end { + justify-content: flex-end +} + +.swagger-ui .justify-center { + justify-content: center +} + +.swagger-ui .justify-between { + justify-content: space-between +} + +.swagger-ui .justify-around { + justify-content: space-around +} + +.swagger-ui .content-start { + align-content: flex-start +} + +.swagger-ui .content-end { + align-content: flex-end +} + +.swagger-ui .content-center { + align-content: center +} + +.swagger-ui .content-between { + align-content: space-between +} + +.swagger-ui .content-around { + align-content: space-around +} + +.swagger-ui .content-stretch { + align-content: stretch +} + +.swagger-ui .order-0 { + order: 0 +} + +.swagger-ui .order-1 { + order: 1 +} + +.swagger-ui .order-2 { + order: 2 +} + +.swagger-ui .order-3 { + order: 3 +} + +.swagger-ui .order-4 { + order: 4 +} + +.swagger-ui .order-5 { + order: 5 +} + +.swagger-ui .order-6 { + order: 6 +} + +.swagger-ui .order-7 { + order: 7 +} + +.swagger-ui .order-8 { + order: 8 +} + +.swagger-ui .order-last { + order: 99999 +} + +.swagger-ui .flex-grow-0 { + flex-grow: 0 +} + +.swagger-ui .flex-grow-1 { + flex-grow: 1 +} + +.swagger-ui .flex-shrink-0 { + flex-shrink: 0 +} + +.swagger-ui .flex-shrink-1 { + flex-shrink: 1 +} + +@media screen and (min-width: 30em) { + .swagger-ui .flex-ns { + display: flex + } + + .swagger-ui .inline-flex-ns { + display: inline-flex + } + + .swagger-ui .flex-auto-ns { + flex: 1 1 auto; + min-height: 0; + min-width: 0 + } + + .swagger-ui .flex-none-ns { + flex: none + } + + .swagger-ui .flex-column-ns { + flex-direction: column + } + + .swagger-ui .flex-row-ns { + flex-direction: row + } + + .swagger-ui .flex-wrap-ns { + flex-wrap: wrap + } + + .swagger-ui .flex-nowrap-ns { + flex-wrap: nowrap + } + + .swagger-ui .flex-wrap-reverse-ns { + flex-wrap: wrap-reverse + } + + .swagger-ui .flex-column-reverse-ns { + flex-direction: column-reverse + } + + .swagger-ui .flex-row-reverse-ns { + flex-direction: row-reverse + } + + .swagger-ui .items-start-ns { + align-items: flex-start + } + + .swagger-ui .items-end-ns { + align-items: flex-end + } + + .swagger-ui .items-center-ns { + align-items: center + } + + .swagger-ui .items-baseline-ns { + align-items: baseline + } + + .swagger-ui .items-stretch-ns { + align-items: stretch + } + + .swagger-ui .self-start-ns { + align-self: flex-start + } + + .swagger-ui .self-end-ns { + align-self: flex-end + } + + .swagger-ui .self-center-ns { + align-self: center + } + + .swagger-ui .self-baseline-ns { + align-self: baseline + } + + .swagger-ui .self-stretch-ns { + align-self: stretch + } + + .swagger-ui .justify-start-ns { + justify-content: flex-start + } + + .swagger-ui .justify-end-ns { + justify-content: flex-end + } + + .swagger-ui .justify-center-ns { + justify-content: center + } + + .swagger-ui .justify-between-ns { + justify-content: space-between + } + + .swagger-ui .justify-around-ns { + justify-content: space-around + } + + .swagger-ui .content-start-ns { + align-content: flex-start + } + + .swagger-ui .content-end-ns { + align-content: flex-end + } + + .swagger-ui .content-center-ns { + align-content: center + } + + .swagger-ui .content-between-ns { + align-content: space-between + } + + .swagger-ui .content-around-ns { + align-content: space-around + } + + .swagger-ui .content-stretch-ns { + align-content: stretch + } + + .swagger-ui .order-0-ns { + order: 0 + } + + .swagger-ui .order-1-ns { + order: 1 + } + + .swagger-ui .order-2-ns { + order: 2 + } + + .swagger-ui .order-3-ns { + order: 3 + } + + .swagger-ui .order-4-ns { + order: 4 + } + + .swagger-ui .order-5-ns { + order: 5 + } + + .swagger-ui .order-6-ns { + order: 6 + } + + .swagger-ui .order-7-ns { + order: 7 + } + + .swagger-ui .order-8-ns { + order: 8 + } + + .swagger-ui .order-last-ns { + order: 99999 + } + + .swagger-ui .flex-grow-0-ns { + flex-grow: 0 + } + + .swagger-ui .flex-grow-1-ns { + flex-grow: 1 + } + + .swagger-ui .flex-shrink-0-ns { + flex-shrink: 0 + } + + .swagger-ui .flex-shrink-1-ns { + flex-shrink: 1 + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .flex-m { + display: flex + } + + .swagger-ui .inline-flex-m { + display: inline-flex + } + + .swagger-ui .flex-auto-m { + flex: 1 1 auto; + min-height: 0; + min-width: 0 + } + + .swagger-ui .flex-none-m { + flex: none + } + + .swagger-ui .flex-column-m { + flex-direction: column + } + + .swagger-ui .flex-row-m { + flex-direction: row + } + + .swagger-ui .flex-wrap-m { + flex-wrap: wrap + } + + .swagger-ui .flex-nowrap-m { + flex-wrap: nowrap + } + + .swagger-ui .flex-wrap-reverse-m { + flex-wrap: wrap-reverse + } + + .swagger-ui .flex-column-reverse-m { + flex-direction: column-reverse + } + + .swagger-ui .flex-row-reverse-m { + flex-direction: row-reverse + } + + .swagger-ui .items-start-m { + align-items: flex-start + } + + .swagger-ui .items-end-m { + align-items: flex-end + } + + .swagger-ui .items-center-m { + align-items: center + } + + .swagger-ui .items-baseline-m { + align-items: baseline + } + + .swagger-ui .items-stretch-m { + align-items: stretch + } + + .swagger-ui .self-start-m { + align-self: flex-start + } + + .swagger-ui .self-end-m { + align-self: flex-end + } + + .swagger-ui .self-center-m { + align-self: center + } + + .swagger-ui .self-baseline-m { + align-self: baseline + } + + .swagger-ui .self-stretch-m { + align-self: stretch + } + + .swagger-ui .justify-start-m { + justify-content: flex-start + } + + .swagger-ui .justify-end-m { + justify-content: flex-end + } + + .swagger-ui .justify-center-m { + justify-content: center + } + + .swagger-ui .justify-between-m { + justify-content: space-between + } + + .swagger-ui .justify-around-m { + justify-content: space-around + } + + .swagger-ui .content-start-m { + align-content: flex-start + } + + .swagger-ui .content-end-m { + align-content: flex-end + } + + .swagger-ui .content-center-m { + align-content: center + } + + .swagger-ui .content-between-m { + align-content: space-between + } + + .swagger-ui .content-around-m { + align-content: space-around + } + + .swagger-ui .content-stretch-m { + align-content: stretch + } + + .swagger-ui .order-0-m { + order: 0 + } + + .swagger-ui .order-1-m { + order: 1 + } + + .swagger-ui .order-2-m { + order: 2 + } + + .swagger-ui .order-3-m { + order: 3 + } + + .swagger-ui .order-4-m { + order: 4 + } + + .swagger-ui .order-5-m { + order: 5 + } + + .swagger-ui .order-6-m { + order: 6 + } + + .swagger-ui .order-7-m { + order: 7 + } + + .swagger-ui .order-8-m { + order: 8 + } + + .swagger-ui .order-last-m { + order: 99999 + } + + .swagger-ui .flex-grow-0-m { + flex-grow: 0 + } + + .swagger-ui .flex-grow-1-m { + flex-grow: 1 + } + + .swagger-ui .flex-shrink-0-m { + flex-shrink: 0 + } + + .swagger-ui .flex-shrink-1-m { + flex-shrink: 1 + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .flex-l { + display: flex + } + + .swagger-ui .inline-flex-l { + display: inline-flex + } + + .swagger-ui .flex-auto-l { + flex: 1 1 auto; + min-height: 0; + min-width: 0 + } + + .swagger-ui .flex-none-l { + flex: none + } + + .swagger-ui .flex-column-l { + flex-direction: column + } + + .swagger-ui .flex-row-l { + flex-direction: row + } + + .swagger-ui .flex-wrap-l { + flex-wrap: wrap + } + + .swagger-ui .flex-nowrap-l { + flex-wrap: nowrap + } + + .swagger-ui .flex-wrap-reverse-l { + flex-wrap: wrap-reverse + } + + .swagger-ui .flex-column-reverse-l { + flex-direction: column-reverse + } + + .swagger-ui .flex-row-reverse-l { + flex-direction: row-reverse + } + + .swagger-ui .items-start-l { + align-items: flex-start + } + + .swagger-ui .items-end-l { + align-items: flex-end + } + + .swagger-ui .items-center-l { + align-items: center + } + + .swagger-ui .items-baseline-l { + align-items: baseline + } + + .swagger-ui .items-stretch-l { + align-items: stretch + } + + .swagger-ui .self-start-l { + align-self: flex-start + } + + .swagger-ui .self-end-l { + align-self: flex-end + } + + .swagger-ui .self-center-l { + align-self: center + } + + .swagger-ui .self-baseline-l { + align-self: baseline + } + + .swagger-ui .self-stretch-l { + align-self: stretch + } + + .swagger-ui .justify-start-l { + justify-content: flex-start + } + + .swagger-ui .justify-end-l { + justify-content: flex-end + } + + .swagger-ui .justify-center-l { + justify-content: center + } + + .swagger-ui .justify-between-l { + justify-content: space-between + } + + .swagger-ui .justify-around-l { + justify-content: space-around + } + + .swagger-ui .content-start-l { + align-content: flex-start + } + + .swagger-ui .content-end-l { + align-content: flex-end + } + + .swagger-ui .content-center-l { + align-content: center + } + + .swagger-ui .content-between-l { + align-content: space-between + } + + .swagger-ui .content-around-l { + align-content: space-around + } + + .swagger-ui .content-stretch-l { + align-content: stretch + } + + .swagger-ui .order-0-l { + order: 0 + } + + .swagger-ui .order-1-l { + order: 1 + } + + .swagger-ui .order-2-l { + order: 2 + } + + .swagger-ui .order-3-l { + order: 3 + } + + .swagger-ui .order-4-l { + order: 4 + } + + .swagger-ui .order-5-l { + order: 5 + } + + .swagger-ui .order-6-l { + order: 6 + } + + .swagger-ui .order-7-l { + order: 7 + } + + .swagger-ui .order-8-l { + order: 8 + } + + .swagger-ui .order-last-l { + order: 99999 + } + + .swagger-ui .flex-grow-0-l { + flex-grow: 0 + } + + .swagger-ui .flex-grow-1-l { + flex-grow: 1 + } + + .swagger-ui .flex-shrink-0-l { + flex-shrink: 0 + } + + .swagger-ui .flex-shrink-1-l { + flex-shrink: 1 + } +} + +.swagger-ui .dn { + display: none +} + +.swagger-ui .di { + display: inline +} + +.swagger-ui .db { + display: block +} + +.swagger-ui .dib { + display: inline-block +} + +.swagger-ui .dit { + display: inline-table +} + +.swagger-ui .dt { + display: table +} + +.swagger-ui .dtc { + display: table-cell +} + +.swagger-ui .dt-row { + display: table-row +} + +.swagger-ui .dt-row-group { + display: table-row-group +} + +.swagger-ui .dt-column { + display: table-column +} + +.swagger-ui .dt-column-group { + display: table-column-group +} + +.swagger-ui .dt--fixed { + table-layout: fixed; + width: 100% +} + +@media screen and (min-width: 30em) { + .swagger-ui .dn-ns { + display: none + } + + .swagger-ui .di-ns { + display: inline + } + + .swagger-ui .db-ns { + display: block + } + + .swagger-ui .dib-ns { + display: inline-block + } + + .swagger-ui .dit-ns { + display: inline-table + } + + .swagger-ui .dt-ns { + display: table + } + + .swagger-ui .dtc-ns { + display: table-cell + } + + .swagger-ui .dt-row-ns { + display: table-row + } + + .swagger-ui .dt-row-group-ns { + display: table-row-group + } + + .swagger-ui .dt-column-ns { + display: table-column + } + + .swagger-ui .dt-column-group-ns { + display: table-column-group + } + + .swagger-ui .dt--fixed-ns { + table-layout: fixed; + width: 100% + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .dn-m { + display: none + } + + .swagger-ui .di-m { + display: inline + } + + .swagger-ui .db-m { + display: block + } + + .swagger-ui .dib-m { + display: inline-block + } + + .swagger-ui .dit-m { + display: inline-table + } + + .swagger-ui .dt-m { + display: table + } + + .swagger-ui .dtc-m { + display: table-cell + } + + .swagger-ui .dt-row-m { + display: table-row + } + + .swagger-ui .dt-row-group-m { + display: table-row-group + } + + .swagger-ui .dt-column-m { + display: table-column + } + + .swagger-ui .dt-column-group-m { + display: table-column-group + } + + .swagger-ui .dt--fixed-m { + table-layout: fixed; + width: 100% + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .dn-l { + display: none + } + + .swagger-ui .di-l { + display: inline + } + + .swagger-ui .db-l { + display: block + } + + .swagger-ui .dib-l { + display: inline-block + } + + .swagger-ui .dit-l { + display: inline-table + } + + .swagger-ui .dt-l { + display: table + } + + .swagger-ui .dtc-l { + display: table-cell + } + + .swagger-ui .dt-row-l { + display: table-row + } + + .swagger-ui .dt-row-group-l { + display: table-row-group + } + + .swagger-ui .dt-column-l { + display: table-column + } + + .swagger-ui .dt-column-group-l { + display: table-column-group + } + + .swagger-ui .dt--fixed-l { + table-layout: fixed; + width: 100% + } +} + +.swagger-ui .fl { + _display: inline; + float: left +} + +.swagger-ui .fr { + _display: inline; + float: right +} + +.swagger-ui .fn { + float: none +} + +@media screen and (min-width: 30em) { + .swagger-ui .fl-ns { + _display: inline; + float: left + } + + .swagger-ui .fr-ns { + _display: inline; + float: right + } + + .swagger-ui .fn-ns { + float: none + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .fl-m { + _display: inline; + float: left + } + + .swagger-ui .fr-m { + _display: inline; + float: right + } + + .swagger-ui .fn-m { + float: none + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .fl-l { + _display: inline; + float: left + } + + .swagger-ui .fr-l { + _display: inline; + float: right + } + + .swagger-ui .fn-l { + float: none + } +} + +.swagger-ui .sans-serif { + font-family: -apple-system,BlinkMacSystemFont,avenir next,avenir,helvetica,helvetica neue,ubuntu,roboto,noto,segoe ui,arial,sans-serif +} + +.swagger-ui .serif { + font-family: georgia,serif +} + +.swagger-ui .system-sans-serif { + font-family: sans-serif +} + +.swagger-ui .system-serif { + font-family: serif +} + +.swagger-ui .code, .swagger-ui code { + font-family: Consolas,monaco,monospace +} + +.swagger-ui .courier { + font-family: Courier Next,courier,monospace +} + +.swagger-ui .helvetica { + font-family: helvetica neue,helvetica,sans-serif +} + +.swagger-ui .avenir { + font-family: avenir next,avenir,sans-serif +} + +.swagger-ui .athelas { + font-family: athelas,georgia,serif +} + +.swagger-ui .georgia { + font-family: georgia,serif +} + +.swagger-ui .times { + font-family: times,serif +} + +.swagger-ui .bodoni { + font-family: Bodoni MT,serif +} + +.swagger-ui .calisto { + font-family: Calisto MT,serif +} + +.swagger-ui .garamond { + font-family: garamond,serif +} + +.swagger-ui .baskerville { + font-family: baskerville,serif +} + +.swagger-ui .i { + font-style: italic +} + +.swagger-ui .fs-normal { + font-style: normal +} + +@media screen and (min-width: 30em) { + .swagger-ui .i-ns { + font-style: italic + } + + .swagger-ui .fs-normal-ns { + font-style: normal + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .i-m { + font-style: italic + } + + .swagger-ui .fs-normal-m { + font-style: normal + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .i-l { + font-style: italic + } + + .swagger-ui .fs-normal-l { + font-style: normal + } +} + +.swagger-ui .normal { + font-weight: 400 +} + +.swagger-ui .b { + font-weight: 700 +} + +.swagger-ui .fw1 { + font-weight: 100 +} + +.swagger-ui .fw2 { + font-weight: 200 +} + +.swagger-ui .fw3 { + font-weight: 300 +} + +.swagger-ui .fw4 { + font-weight: 400 +} + +.swagger-ui .fw5 { + font-weight: 500 +} + +.swagger-ui .fw6 { + font-weight: 600 +} + +.swagger-ui .fw7 { + font-weight: 700 +} + +.swagger-ui .fw8 { + font-weight: 800 +} + +.swagger-ui .fw9 { + font-weight: 900 +} + +@media screen and (min-width: 30em) { + .swagger-ui .normal-ns { + font-weight: 400 + } + + .swagger-ui .b-ns { + font-weight: 700 + } + + .swagger-ui .fw1-ns { + font-weight: 100 + } + + .swagger-ui .fw2-ns { + font-weight: 200 + } + + .swagger-ui .fw3-ns { + font-weight: 300 + } + + .swagger-ui .fw4-ns { + font-weight: 400 + } + + .swagger-ui .fw5-ns { + font-weight: 500 + } + + .swagger-ui .fw6-ns { + font-weight: 600 + } + + .swagger-ui .fw7-ns { + font-weight: 700 + } + + .swagger-ui .fw8-ns { + font-weight: 800 + } + + .swagger-ui .fw9-ns { + font-weight: 900 + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .normal-m { + font-weight: 400 + } + + .swagger-ui .b-m { + font-weight: 700 + } + + .swagger-ui .fw1-m { + font-weight: 100 + } + + .swagger-ui .fw2-m { + font-weight: 200 + } + + .swagger-ui .fw3-m { + font-weight: 300 + } + + .swagger-ui .fw4-m { + font-weight: 400 + } + + .swagger-ui .fw5-m { + font-weight: 500 + } + + .swagger-ui .fw6-m { + font-weight: 600 + } + + .swagger-ui .fw7-m { + font-weight: 700 + } + + .swagger-ui .fw8-m { + font-weight: 800 + } + + .swagger-ui .fw9-m { + font-weight: 900 + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .normal-l { + font-weight: 400 + } + + .swagger-ui .b-l { + font-weight: 700 + } + + .swagger-ui .fw1-l { + font-weight: 100 + } + + .swagger-ui .fw2-l { + font-weight: 200 + } + + .swagger-ui .fw3-l { + font-weight: 300 + } + + .swagger-ui .fw4-l { + font-weight: 400 + } + + .swagger-ui .fw5-l { + font-weight: 500 + } + + .swagger-ui .fw6-l { + font-weight: 600 + } + + .swagger-ui .fw7-l { + font-weight: 700 + } + + .swagger-ui .fw8-l { + font-weight: 800 + } + + .swagger-ui .fw9-l { + font-weight: 900 + } +} + +.swagger-ui .input-reset { + -webkit-appearance: none; + -moz-appearance: none +} + + .swagger-ui .button-reset::-moz-focus-inner, .swagger-ui .input-reset::-moz-focus-inner { + border: 0; + padding: 0 + } + +.swagger-ui .h1 { + height: 1rem +} + +.swagger-ui .h2 { + height: 2rem +} + +.swagger-ui .h3 { + height: 4rem +} + +.swagger-ui .h4 { + height: 8rem +} + +.swagger-ui .h5 { + height: 16rem +} + +.swagger-ui .h-25 { + height: 25% +} + +.swagger-ui .h-50 { + height: 50% +} + +.swagger-ui .h-75 { + height: 75% +} + +.swagger-ui .h-100 { + height: 100% +} + +.swagger-ui .min-h-100 { + min-height: 100% +} + +.swagger-ui .vh-25 { + height: 25vh +} + +.swagger-ui .vh-50 { + height: 50vh +} + +.swagger-ui .vh-75 { + height: 75vh +} + +.swagger-ui .vh-100 { + height: 100vh +} + +.swagger-ui .min-vh-100 { + min-height: 100vh +} + +.swagger-ui .h-auto { + height: auto +} + +.swagger-ui .h-inherit { + height: inherit +} + +@media screen and (min-width: 30em) { + .swagger-ui .h1-ns { + height: 1rem + } + + .swagger-ui .h2-ns { + height: 2rem + } + + .swagger-ui .h3-ns { + height: 4rem + } + + .swagger-ui .h4-ns { + height: 8rem + } + + .swagger-ui .h5-ns { + height: 16rem + } + + .swagger-ui .h-25-ns { + height: 25% + } + + .swagger-ui .h-50-ns { + height: 50% + } + + .swagger-ui .h-75-ns { + height: 75% + } + + .swagger-ui .h-100-ns { + height: 100% + } + + .swagger-ui .min-h-100-ns { + min-height: 100% + } + + .swagger-ui .vh-25-ns { + height: 25vh + } + + .swagger-ui .vh-50-ns { + height: 50vh + } + + .swagger-ui .vh-75-ns { + height: 75vh + } + + .swagger-ui .vh-100-ns { + height: 100vh + } + + .swagger-ui .min-vh-100-ns { + min-height: 100vh + } + + .swagger-ui .h-auto-ns { + height: auto + } + + .swagger-ui .h-inherit-ns { + height: inherit + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .h1-m { + height: 1rem + } + + .swagger-ui .h2-m { + height: 2rem + } + + .swagger-ui .h3-m { + height: 4rem + } + + .swagger-ui .h4-m { + height: 8rem + } + + .swagger-ui .h5-m { + height: 16rem + } + + .swagger-ui .h-25-m { + height: 25% + } + + .swagger-ui .h-50-m { + height: 50% + } + + .swagger-ui .h-75-m { + height: 75% + } + + .swagger-ui .h-100-m { + height: 100% + } + + .swagger-ui .min-h-100-m { + min-height: 100% + } + + .swagger-ui .vh-25-m { + height: 25vh + } + + .swagger-ui .vh-50-m { + height: 50vh + } + + .swagger-ui .vh-75-m { + height: 75vh + } + + .swagger-ui .vh-100-m { + height: 100vh + } + + .swagger-ui .min-vh-100-m { + min-height: 100vh + } + + .swagger-ui .h-auto-m { + height: auto + } + + .swagger-ui .h-inherit-m { + height: inherit + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .h1-l { + height: 1rem + } + + .swagger-ui .h2-l { + height: 2rem + } + + .swagger-ui .h3-l { + height: 4rem + } + + .swagger-ui .h4-l { + height: 8rem + } + + .swagger-ui .h5-l { + height: 16rem + } + + .swagger-ui .h-25-l { + height: 25% + } + + .swagger-ui .h-50-l { + height: 50% + } + + .swagger-ui .h-75-l { + height: 75% + } + + .swagger-ui .h-100-l { + height: 100% + } + + .swagger-ui .min-h-100-l { + min-height: 100% + } + + .swagger-ui .vh-25-l { + height: 25vh + } + + .swagger-ui .vh-50-l { + height: 50vh + } + + .swagger-ui .vh-75-l { + height: 75vh + } + + .swagger-ui .vh-100-l { + height: 100vh + } + + .swagger-ui .min-vh-100-l { + min-height: 100vh + } + + .swagger-ui .h-auto-l { + height: auto + } + + .swagger-ui .h-inherit-l { + height: inherit + } +} + +.swagger-ui .tracked { + letter-spacing: .1em +} + +.swagger-ui .tracked-tight { + letter-spacing: -.05em +} + +.swagger-ui .tracked-mega { + letter-spacing: .25em +} + +@media screen and (min-width: 30em) { + .swagger-ui .tracked-ns { + letter-spacing: .1em + } + + .swagger-ui .tracked-tight-ns { + letter-spacing: -.05em + } + + .swagger-ui .tracked-mega-ns { + letter-spacing: .25em + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .tracked-m { + letter-spacing: .1em + } + + .swagger-ui .tracked-tight-m { + letter-spacing: -.05em + } + + .swagger-ui .tracked-mega-m { + letter-spacing: .25em + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .tracked-l { + letter-spacing: .1em + } + + .swagger-ui .tracked-tight-l { + letter-spacing: -.05em + } + + .swagger-ui .tracked-mega-l { + letter-spacing: .25em + } +} + +.swagger-ui .lh-solid { + line-height: 1 +} + +.swagger-ui .lh-title { + line-height: 1.25 +} + +.swagger-ui .lh-copy { + line-height: 1.5 +} + +@media screen and (min-width: 30em) { + .swagger-ui .lh-solid-ns { + line-height: 1 + } + + .swagger-ui .lh-title-ns { + line-height: 1.25 + } + + .swagger-ui .lh-copy-ns { + line-height: 1.5 + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .lh-solid-m { + line-height: 1 + } + + .swagger-ui .lh-title-m { + line-height: 1.25 + } + + .swagger-ui .lh-copy-m { + line-height: 1.5 + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .lh-solid-l { + line-height: 1 + } + + .swagger-ui .lh-title-l { + line-height: 1.25 + } + + .swagger-ui .lh-copy-l { + line-height: 1.5 + } +} + +.swagger-ui .link { + text-decoration: none +} + + .swagger-ui .link, .swagger-ui .link:active, .swagger-ui .link:focus, .swagger-ui .link:hover, .swagger-ui .link:link, .swagger-ui .link:visited { + transition: color .15s ease-in + } + + .swagger-ui .link:focus { + outline: 1px dotted currentColor + } + +.swagger-ui .list { + list-style-type: none +} + +.swagger-ui .mw-100 { + max-width: 100% +} + +.swagger-ui .mw1 { + max-width: 1rem +} + +.swagger-ui .mw2 { + max-width: 2rem +} + +.swagger-ui .mw3 { + max-width: 4rem +} + +.swagger-ui .mw4 { + max-width: 8rem +} + +.swagger-ui .mw5 { + max-width: 16rem +} + +.swagger-ui .mw6 { + max-width: 32rem +} + +.swagger-ui .mw7 { + max-width: 48rem +} + +.swagger-ui .mw8 { + max-width: 64rem +} + +.swagger-ui .mw9 { + max-width: 96rem +} + +.swagger-ui .mw-none { + max-width: none +} + +@media screen and (min-width: 30em) { + .swagger-ui .mw-100-ns { + max-width: 100% + } + + .swagger-ui .mw1-ns { + max-width: 1rem + } + + .swagger-ui .mw2-ns { + max-width: 2rem + } + + .swagger-ui .mw3-ns { + max-width: 4rem + } + + .swagger-ui .mw4-ns { + max-width: 8rem + } + + .swagger-ui .mw5-ns { + max-width: 16rem + } + + .swagger-ui .mw6-ns { + max-width: 32rem + } + + .swagger-ui .mw7-ns { + max-width: 48rem + } + + .swagger-ui .mw8-ns { + max-width: 64rem + } + + .swagger-ui .mw9-ns { + max-width: 96rem + } + + .swagger-ui .mw-none-ns { + max-width: none + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .mw-100-m { + max-width: 100% + } + + .swagger-ui .mw1-m { + max-width: 1rem + } + + .swagger-ui .mw2-m { + max-width: 2rem + } + + .swagger-ui .mw3-m { + max-width: 4rem + } + + .swagger-ui .mw4-m { + max-width: 8rem + } + + .swagger-ui .mw5-m { + max-width: 16rem + } + + .swagger-ui .mw6-m { + max-width: 32rem + } + + .swagger-ui .mw7-m { + max-width: 48rem + } + + .swagger-ui .mw8-m { + max-width: 64rem + } + + .swagger-ui .mw9-m { + max-width: 96rem + } + + .swagger-ui .mw-none-m { + max-width: none + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .mw-100-l { + max-width: 100% + } + + .swagger-ui .mw1-l { + max-width: 1rem + } + + .swagger-ui .mw2-l { + max-width: 2rem + } + + .swagger-ui .mw3-l { + max-width: 4rem + } + + .swagger-ui .mw4-l { + max-width: 8rem + } + + .swagger-ui .mw5-l { + max-width: 16rem + } + + .swagger-ui .mw6-l { + max-width: 32rem + } + + .swagger-ui .mw7-l { + max-width: 48rem + } + + .swagger-ui .mw8-l { + max-width: 64rem + } + + .swagger-ui .mw9-l { + max-width: 96rem + } + + .swagger-ui .mw-none-l { + max-width: none + } +} + +.swagger-ui .w1 { + width: 1rem +} + +.swagger-ui .w2 { + width: 2rem +} + +.swagger-ui .w3 { + width: 4rem +} + +.swagger-ui .w4 { + width: 8rem +} + +.swagger-ui .w5 { + width: 16rem +} + +.swagger-ui .w-10 { + width: 10% +} + +.swagger-ui .w-20 { + width: 20% +} + +.swagger-ui .w-25 { + width: 25% +} + +.swagger-ui .w-30 { + width: 30% +} + +.swagger-ui .w-33 { + width: 33% +} + +.swagger-ui .w-34 { + width: 34% +} + +.swagger-ui .w-40 { + width: 40% +} + +.swagger-ui .w-50 { + width: 50% +} + +.swagger-ui .w-60 { + width: 60% +} + +.swagger-ui .w-70 { + width: 70% +} + +.swagger-ui .w-75 { + width: 75% +} + +.swagger-ui .w-80 { + width: 80% +} + +.swagger-ui .w-90 { + width: 90% +} + +.swagger-ui .w-100 { + width: 100% +} + +.swagger-ui .w-third { + width: 33.3333333333% +} + +.swagger-ui .w-two-thirds { + width: 66.6666666667% +} + +.swagger-ui .w-auto { + width: auto +} + +@media screen and (min-width: 30em) { + .swagger-ui .w1-ns { + width: 1rem + } + + .swagger-ui .w2-ns { + width: 2rem + } + + .swagger-ui .w3-ns { + width: 4rem + } + + .swagger-ui .w4-ns { + width: 8rem + } + + .swagger-ui .w5-ns { + width: 16rem + } + + .swagger-ui .w-10-ns { + width: 10% + } + + .swagger-ui .w-20-ns { + width: 20% + } + + .swagger-ui .w-25-ns { + width: 25% + } + + .swagger-ui .w-30-ns { + width: 30% + } + + .swagger-ui .w-33-ns { + width: 33% + } + + .swagger-ui .w-34-ns { + width: 34% + } + + .swagger-ui .w-40-ns { + width: 40% + } + + .swagger-ui .w-50-ns { + width: 50% + } + + .swagger-ui .w-60-ns { + width: 60% + } + + .swagger-ui .w-70-ns { + width: 70% + } + + .swagger-ui .w-75-ns { + width: 75% + } + + .swagger-ui .w-80-ns { + width: 80% + } + + .swagger-ui .w-90-ns { + width: 90% + } + + .swagger-ui .w-100-ns { + width: 100% + } + + .swagger-ui .w-third-ns { + width: 33.3333333333% + } + + .swagger-ui .w-two-thirds-ns { + width: 66.6666666667% + } + + .swagger-ui .w-auto-ns { + width: auto + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .w1-m { + width: 1rem + } + + .swagger-ui .w2-m { + width: 2rem + } + + .swagger-ui .w3-m { + width: 4rem + } + + .swagger-ui .w4-m { + width: 8rem + } + + .swagger-ui .w5-m { + width: 16rem + } + + .swagger-ui .w-10-m { + width: 10% + } + + .swagger-ui .w-20-m { + width: 20% + } + + .swagger-ui .w-25-m { + width: 25% + } + + .swagger-ui .w-30-m { + width: 30% + } + + .swagger-ui .w-33-m { + width: 33% + } + + .swagger-ui .w-34-m { + width: 34% + } + + .swagger-ui .w-40-m { + width: 40% + } + + .swagger-ui .w-50-m { + width: 50% + } + + .swagger-ui .w-60-m { + width: 60% + } + + .swagger-ui .w-70-m { + width: 70% + } + + .swagger-ui .w-75-m { + width: 75% + } + + .swagger-ui .w-80-m { + width: 80% + } + + .swagger-ui .w-90-m { + width: 90% + } + + .swagger-ui .w-100-m { + width: 100% + } + + .swagger-ui .w-third-m { + width: 33.3333333333% + } + + .swagger-ui .w-two-thirds-m { + width: 66.6666666667% + } + + .swagger-ui .w-auto-m { + width: auto + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .w1-l { + width: 1rem + } + + .swagger-ui .w2-l { + width: 2rem + } + + .swagger-ui .w3-l { + width: 4rem + } + + .swagger-ui .w4-l { + width: 8rem + } + + .swagger-ui .w5-l { + width: 16rem + } + + .swagger-ui .w-10-l { + width: 10% + } + + .swagger-ui .w-20-l { + width: 20% + } + + .swagger-ui .w-25-l { + width: 25% + } + + .swagger-ui .w-30-l { + width: 30% + } + + .swagger-ui .w-33-l { + width: 33% + } + + .swagger-ui .w-34-l { + width: 34% + } + + .swagger-ui .w-40-l { + width: 40% + } + + .swagger-ui .w-50-l { + width: 50% + } + + .swagger-ui .w-60-l { + width: 60% + } + + .swagger-ui .w-70-l { + width: 70% + } + + .swagger-ui .w-75-l { + width: 75% + } + + .swagger-ui .w-80-l { + width: 80% + } + + .swagger-ui .w-90-l { + width: 90% + } + + .swagger-ui .w-100-l { + width: 100% + } + + .swagger-ui .w-third-l { + width: 33.3333333333% + } + + .swagger-ui .w-two-thirds-l { + width: 66.6666666667% + } + + .swagger-ui .w-auto-l { + width: auto + } +} + +.swagger-ui .overflow-visible { + overflow: visible +} + +.swagger-ui .overflow-hidden { + overflow: hidden +} + +.swagger-ui .overflow-scroll { + overflow: scroll +} + +.swagger-ui .overflow-auto { + overflow: auto +} + +.swagger-ui .overflow-x-visible { + overflow-x: visible +} + +.swagger-ui .overflow-x-hidden { + overflow-x: hidden +} + +.swagger-ui .overflow-x-scroll { + overflow-x: scroll +} + +.swagger-ui .overflow-x-auto { + overflow-x: auto +} + +.swagger-ui .overflow-y-visible { + overflow-y: visible +} + +.swagger-ui .overflow-y-hidden { + overflow-y: hidden +} + +.swagger-ui .overflow-y-scroll { + overflow-y: scroll +} + +.swagger-ui .overflow-y-auto { + overflow-y: auto +} + +@media screen and (min-width: 30em) { + .swagger-ui .overflow-visible-ns { + overflow: visible + } + + .swagger-ui .overflow-hidden-ns { + overflow: hidden + } + + .swagger-ui .overflow-scroll-ns { + overflow: scroll + } + + .swagger-ui .overflow-auto-ns { + overflow: auto + } + + .swagger-ui .overflow-x-visible-ns { + overflow-x: visible + } + + .swagger-ui .overflow-x-hidden-ns { + overflow-x: hidden + } + + .swagger-ui .overflow-x-scroll-ns { + overflow-x: scroll + } + + .swagger-ui .overflow-x-auto-ns { + overflow-x: auto + } + + .swagger-ui .overflow-y-visible-ns { + overflow-y: visible + } + + .swagger-ui .overflow-y-hidden-ns { + overflow-y: hidden + } + + .swagger-ui .overflow-y-scroll-ns { + overflow-y: scroll + } + + .swagger-ui .overflow-y-auto-ns { + overflow-y: auto + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .overflow-visible-m { + overflow: visible + } + + .swagger-ui .overflow-hidden-m { + overflow: hidden + } + + .swagger-ui .overflow-scroll-m { + overflow: scroll + } + + .swagger-ui .overflow-auto-m { + overflow: auto + } + + .swagger-ui .overflow-x-visible-m { + overflow-x: visible + } + + .swagger-ui .overflow-x-hidden-m { + overflow-x: hidden + } + + .swagger-ui .overflow-x-scroll-m { + overflow-x: scroll + } + + .swagger-ui .overflow-x-auto-m { + overflow-x: auto + } + + .swagger-ui .overflow-y-visible-m { + overflow-y: visible + } + + .swagger-ui .overflow-y-hidden-m { + overflow-y: hidden + } + + .swagger-ui .overflow-y-scroll-m { + overflow-y: scroll + } + + .swagger-ui .overflow-y-auto-m { + overflow-y: auto + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .overflow-visible-l { + overflow: visible + } + + .swagger-ui .overflow-hidden-l { + overflow: hidden + } + + .swagger-ui .overflow-scroll-l { + overflow: scroll + } + + .swagger-ui .overflow-auto-l { + overflow: auto + } + + .swagger-ui .overflow-x-visible-l { + overflow-x: visible + } + + .swagger-ui .overflow-x-hidden-l { + overflow-x: hidden + } + + .swagger-ui .overflow-x-scroll-l { + overflow-x: scroll + } + + .swagger-ui .overflow-x-auto-l { + overflow-x: auto + } + + .swagger-ui .overflow-y-visible-l { + overflow-y: visible + } + + .swagger-ui .overflow-y-hidden-l { + overflow-y: hidden + } + + .swagger-ui .overflow-y-scroll-l { + overflow-y: scroll + } + + .swagger-ui .overflow-y-auto-l { + overflow-y: auto + } +} + +.swagger-ui .static { + position: static +} + +.swagger-ui .relative { + position: relative +} + +.swagger-ui .absolute { + position: absolute +} + +.swagger-ui .fixed { + position: fixed +} + +@media screen and (min-width: 30em) { + .swagger-ui .static-ns { + position: static + } + + .swagger-ui .relative-ns { + position: relative + } + + .swagger-ui .absolute-ns { + position: absolute + } + + .swagger-ui .fixed-ns { + position: fixed + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .static-m { + position: static + } + + .swagger-ui .relative-m { + position: relative + } + + .swagger-ui .absolute-m { + position: absolute + } + + .swagger-ui .fixed-m { + position: fixed + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .static-l { + position: static + } + + .swagger-ui .relative-l { + position: relative + } + + .swagger-ui .absolute-l { + position: absolute + } + + .swagger-ui .fixed-l { + position: fixed + } +} + +.swagger-ui .o-100 { + opacity: 1 +} + +.swagger-ui .o-90 { + opacity: .9 +} + +.swagger-ui .o-80 { + opacity: .8 +} + +.swagger-ui .o-70 { + opacity: .7 +} + +.swagger-ui .o-60 { + opacity: .6 +} + +.swagger-ui .o-50 { + opacity: .5 +} + +.swagger-ui .o-40 { + opacity: .4 +} + +.swagger-ui .o-30 { + opacity: .3 +} + +.swagger-ui .o-20 { + opacity: .2 +} + +.swagger-ui .o-10 { + opacity: .1 +} + +.swagger-ui .o-05 { + opacity: .05 +} + +.swagger-ui .o-025 { + opacity: .025 +} + +.swagger-ui .o-0 { + opacity: 0 +} + +.swagger-ui .rotate-45 { + transform: rotate(45deg) +} + +.swagger-ui .rotate-90 { + transform: rotate(90deg) +} + +.swagger-ui .rotate-135 { + transform: rotate(135deg) +} + +.swagger-ui .rotate-180 { + transform: rotate(180deg) +} + +.swagger-ui .rotate-225 { + transform: rotate(225deg) +} + +.swagger-ui .rotate-270 { + transform: rotate(270deg) +} + +.swagger-ui .rotate-315 { + transform: rotate(315deg) +} + +@media screen and (min-width: 30em) { + .swagger-ui .rotate-45-ns { + transform: rotate(45deg) + } + + .swagger-ui .rotate-90-ns { + transform: rotate(90deg) + } + + .swagger-ui .rotate-135-ns { + transform: rotate(135deg) + } + + .swagger-ui .rotate-180-ns { + transform: rotate(180deg) + } + + .swagger-ui .rotate-225-ns { + transform: rotate(225deg) + } + + .swagger-ui .rotate-270-ns { + transform: rotate(270deg) + } + + .swagger-ui .rotate-315-ns { + transform: rotate(315deg) + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .rotate-45-m { + transform: rotate(45deg) + } + + .swagger-ui .rotate-90-m { + transform: rotate(90deg) + } + + .swagger-ui .rotate-135-m { + transform: rotate(135deg) + } + + .swagger-ui .rotate-180-m { + transform: rotate(180deg) + } + + .swagger-ui .rotate-225-m { + transform: rotate(225deg) + } + + .swagger-ui .rotate-270-m { + transform: rotate(270deg) + } + + .swagger-ui .rotate-315-m { + transform: rotate(315deg) + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .rotate-45-l { + transform: rotate(45deg) + } + + .swagger-ui .rotate-90-l { + transform: rotate(90deg) + } + + .swagger-ui .rotate-135-l { + transform: rotate(135deg) + } + + .swagger-ui .rotate-180-l { + transform: rotate(180deg) + } + + .swagger-ui .rotate-225-l { + transform: rotate(225deg) + } + + .swagger-ui .rotate-270-l { + transform: rotate(270deg) + } + + .swagger-ui .rotate-315-l { + transform: rotate(315deg) + } +} + +.swagger-ui .black-90 { + color: rgba(0,0,0,.9) +} + +.swagger-ui .black-80 { + color: rgba(0,0,0,.8) +} + +.swagger-ui .black-70 { + color: rgba(0,0,0,.7) +} + +.swagger-ui .black-60 { + color: rgba(0,0,0,.6) +} + +.swagger-ui .black-50 { + color: rgba(0,0,0,.5) +} + +.swagger-ui .black-40 { + color: rgba(0,0,0,.4) +} + +.swagger-ui .black-30 { + color: rgba(0,0,0,.3) +} + +.swagger-ui .black-20 { + color: rgba(0,0,0,.2) +} + +.swagger-ui .black-10 { + color: rgba(0,0,0,.1) +} + +.swagger-ui .black-05 { + color: rgba(0,0,0,.05) +} + +.swagger-ui .white-90 { + color: hsla(0,0%,100%,.9) +} + +.swagger-ui .white-80 { + color: hsla(0,0%,100%,.8) +} + +.swagger-ui .white-70 { + color: hsla(0,0%,100%,.7) +} + +.swagger-ui .white-60 { + color: hsla(0,0%,100%,.6) +} + +.swagger-ui .white-50 { + color: hsla(0,0%,100%,.5) +} + +.swagger-ui .white-40 { + color: hsla(0,0%,100%,.4) +} + +.swagger-ui .white-30 { + color: hsla(0,0%,100%,.3) +} + +.swagger-ui .white-20 { + color: hsla(0,0%,100%,.2) +} + +.swagger-ui .white-10 { + color: hsla(0,0%,100%,.1) +} + +.swagger-ui .black { + color: #000 +} + +.swagger-ui .near-black { + color: #111 +} + +.swagger-ui .dark-gray { + color: #333 +} + +.swagger-ui .mid-gray { + color: #555 +} + +.swagger-ui .gray { + color: #777 +} + +.swagger-ui .silver { + color: #999 +} + +.swagger-ui .light-silver { + color: #aaa +} + +.swagger-ui .moon-gray { + color: #ccc +} + +.swagger-ui .light-gray { + color: #eee +} + +.swagger-ui .near-white { + color: #f4f4f4 +} + +.swagger-ui .white { + color: #fff +} + +.swagger-ui .dark-red { + color: #e7040f +} + +.swagger-ui .red { + color: #ff4136 +} + +.swagger-ui .light-red { + color: #ff725c +} + +.swagger-ui .orange { + color: #ff6300 +} + +.swagger-ui .gold { + color: #ffb700 +} + +.swagger-ui .yellow { + color: gold +} + +.swagger-ui .light-yellow { + color: #fbf1a9 +} + +.swagger-ui .purple { + color: #5e2ca5 +} + +.swagger-ui .light-purple { + color: #a463f2 +} + +.swagger-ui .dark-pink { + color: #d5008f +} + +.swagger-ui .hot-pink { + color: #ff41b4 +} + +.swagger-ui .pink { + color: #ff80cc +} + +.swagger-ui .light-pink { + color: #ffa3d7 +} + +.swagger-ui .dark-green { + color: #137752 +} + +.swagger-ui .green { + color: #19a974 +} + +.swagger-ui .light-green { + color: #9eebcf +} + +.swagger-ui .navy { + color: #001b44 +} + +.swagger-ui .dark-blue { + color: #00449e +} + +.swagger-ui .blue { + color: #357edd +} + +.swagger-ui .light-blue { + color: #96ccff +} + +.swagger-ui .lightest-blue { + color: #cdecff +} + +.swagger-ui .washed-blue { + color: #f6fffe +} + +.swagger-ui .washed-green { + color: #e8fdf5 +} + +.swagger-ui .washed-yellow { + color: #fffceb +} + +.swagger-ui .washed-red { + color: #ffdfdf +} + +.swagger-ui .color-inherit { + color: inherit +} + +.swagger-ui .bg-black-90 { + background-color: rgba(0,0,0,.9) +} + +.swagger-ui .bg-black-80 { + background-color: rgba(0,0,0,.8) +} + +.swagger-ui .bg-black-70 { + background-color: rgba(0,0,0,.7) +} + +.swagger-ui .bg-black-60 { + background-color: rgba(0,0,0,.6) +} + +.swagger-ui .bg-black-50 { + background-color: rgba(0,0,0,.5) +} + +.swagger-ui .bg-black-40 { + background-color: rgba(0,0,0,.4) +} + +.swagger-ui .bg-black-30 { + background-color: rgba(0,0,0,.3) +} + +.swagger-ui .bg-black-20 { + background-color: rgba(0,0,0,.2) +} + +.swagger-ui .bg-black-10 { + background-color: rgba(0,0,0,.1) +} + +.swagger-ui .bg-black-05 { + background-color: rgba(0,0,0,.05) +} + +.swagger-ui .bg-white-90 { + background-color: hsla(0,0%,100%,.9) +} + +.swagger-ui .bg-white-80 { + background-color: hsla(0,0%,100%,.8) +} + +.swagger-ui .bg-white-70 { + background-color: hsla(0,0%,100%,.7) +} + +.swagger-ui .bg-white-60 { + background-color: hsla(0,0%,100%,.6) +} + +.swagger-ui .bg-white-50 { + background-color: hsla(0,0%,100%,.5) +} + +.swagger-ui .bg-white-40 { + background-color: hsla(0,0%,100%,.4) +} + +.swagger-ui .bg-white-30 { + background-color: hsla(0,0%,100%,.3) +} + +.swagger-ui .bg-white-20 { + background-color: hsla(0,0%,100%,.2) +} + +.swagger-ui .bg-white-10 { + background-color: hsla(0,0%,100%,.1) +} + +.swagger-ui .bg-black { + background-color: #000 +} + +.swagger-ui .bg-near-black { + background-color: #111 +} + +.swagger-ui .bg-dark-gray { + background-color: #333 +} + +.swagger-ui .bg-mid-gray { + background-color: #555 +} + +.swagger-ui .bg-gray { + background-color: #777 +} + +.swagger-ui .bg-silver { + background-color: #999 +} + +.swagger-ui .bg-light-silver { + background-color: #aaa +} + +.swagger-ui .bg-moon-gray { + background-color: #ccc +} + +.swagger-ui .bg-light-gray { + background-color: #eee +} + +.swagger-ui .bg-near-white { + background-color: #f4f4f4 +} + +.swagger-ui .bg-white { + background-color: #fff +} + +.swagger-ui .bg-transparent { + background-color: transparent +} + +.swagger-ui .bg-dark-red { + background-color: #e7040f +} + +.swagger-ui .bg-red { + background-color: #ff4136 +} + +.swagger-ui .bg-light-red { + background-color: #ff725c +} + +.swagger-ui .bg-orange { + background-color: #ff6300 +} + +.swagger-ui .bg-gold { + background-color: #ffb700 +} + +.swagger-ui .bg-yellow { + background-color: gold +} + +.swagger-ui .bg-light-yellow { + background-color: #fbf1a9 +} + +.swagger-ui .bg-purple { + background-color: #5e2ca5 +} + +.swagger-ui .bg-light-purple { + background-color: #a463f2 +} + +.swagger-ui .bg-dark-pink { + background-color: #d5008f +} + +.swagger-ui .bg-hot-pink { + background-color: #ff41b4 +} + +.swagger-ui .bg-pink { + background-color: #ff80cc +} + +.swagger-ui .bg-light-pink { + background-color: #ffa3d7 +} + +.swagger-ui .bg-dark-green { + background-color: #137752 +} + +.swagger-ui .bg-green { + background-color: #19a974 +} + +.swagger-ui .bg-light-green { + background-color: #9eebcf +} + +.swagger-ui .bg-navy { + background-color: #001b44 +} + +.swagger-ui .bg-dark-blue { + background-color: #00449e +} + +.swagger-ui .bg-blue { + background-color: #357edd +} + +.swagger-ui .bg-light-blue { + background-color: #96ccff +} + +.swagger-ui .bg-lightest-blue { + background-color: #cdecff +} + +.swagger-ui .bg-washed-blue { + background-color: #f6fffe +} + +.swagger-ui .bg-washed-green { + background-color: #e8fdf5 +} + +.swagger-ui .bg-washed-yellow { + background-color: #fffceb +} + +.swagger-ui .bg-washed-red { + background-color: #ffdfdf +} + +.swagger-ui .bg-inherit { + background-color: inherit +} + +.swagger-ui .hover-black:focus, .swagger-ui .hover-black:hover { + color: #000 +} + +.swagger-ui .hover-near-black:focus, .swagger-ui .hover-near-black:hover { + color: #111 +} + +.swagger-ui .hover-dark-gray:focus, .swagger-ui .hover-dark-gray:hover { + color: #333 +} + +.swagger-ui .hover-mid-gray:focus, .swagger-ui .hover-mid-gray:hover { + color: #555 +} + +.swagger-ui .hover-gray:focus, .swagger-ui .hover-gray:hover { + color: #777 +} + +.swagger-ui .hover-silver:focus, .swagger-ui .hover-silver:hover { + color: #999 +} + +.swagger-ui .hover-light-silver:focus, .swagger-ui .hover-light-silver:hover { + color: #aaa +} + +.swagger-ui .hover-moon-gray:focus, .swagger-ui .hover-moon-gray:hover { + color: #ccc +} + +.swagger-ui .hover-light-gray:focus, .swagger-ui .hover-light-gray:hover { + color: #eee +} + +.swagger-ui .hover-near-white:focus, .swagger-ui .hover-near-white:hover { + color: #f4f4f4 +} + +.swagger-ui .hover-white:focus, .swagger-ui .hover-white:hover { + color: #fff +} + +.swagger-ui .hover-black-90:focus, .swagger-ui .hover-black-90:hover { + color: rgba(0,0,0,.9) +} + +.swagger-ui .hover-black-80:focus, .swagger-ui .hover-black-80:hover { + color: rgba(0,0,0,.8) +} + +.swagger-ui .hover-black-70:focus, .swagger-ui .hover-black-70:hover { + color: rgba(0,0,0,.7) +} + +.swagger-ui .hover-black-60:focus, .swagger-ui .hover-black-60:hover { + color: rgba(0,0,0,.6) +} + +.swagger-ui .hover-black-50:focus, .swagger-ui .hover-black-50:hover { + color: rgba(0,0,0,.5) +} + +.swagger-ui .hover-black-40:focus, .swagger-ui .hover-black-40:hover { + color: rgba(0,0,0,.4) +} + +.swagger-ui .hover-black-30:focus, .swagger-ui .hover-black-30:hover { + color: rgba(0,0,0,.3) +} + +.swagger-ui .hover-black-20:focus, .swagger-ui .hover-black-20:hover { + color: rgba(0,0,0,.2) +} + +.swagger-ui .hover-black-10:focus, .swagger-ui .hover-black-10:hover { + color: rgba(0,0,0,.1) +} + +.swagger-ui .hover-white-90:focus, .swagger-ui .hover-white-90:hover { + color: hsla(0,0%,100%,.9) +} + +.swagger-ui .hover-white-80:focus, .swagger-ui .hover-white-80:hover { + color: hsla(0,0%,100%,.8) +} + +.swagger-ui .hover-white-70:focus, .swagger-ui .hover-white-70:hover { + color: hsla(0,0%,100%,.7) +} + +.swagger-ui .hover-white-60:focus, .swagger-ui .hover-white-60:hover { + color: hsla(0,0%,100%,.6) +} + +.swagger-ui .hover-white-50:focus, .swagger-ui .hover-white-50:hover { + color: hsla(0,0%,100%,.5) +} + +.swagger-ui .hover-white-40:focus, .swagger-ui .hover-white-40:hover { + color: hsla(0,0%,100%,.4) +} + +.swagger-ui .hover-white-30:focus, .swagger-ui .hover-white-30:hover { + color: hsla(0,0%,100%,.3) +} + +.swagger-ui .hover-white-20:focus, .swagger-ui .hover-white-20:hover { + color: hsla(0,0%,100%,.2) +} + +.swagger-ui .hover-white-10:focus, .swagger-ui .hover-white-10:hover { + color: hsla(0,0%,100%,.1) +} + +.swagger-ui .hover-inherit:focus, .swagger-ui .hover-inherit:hover { + color: inherit +} + +.swagger-ui .hover-bg-black:focus, .swagger-ui .hover-bg-black:hover { + background-color: #000 +} + +.swagger-ui .hover-bg-near-black:focus, .swagger-ui .hover-bg-near-black:hover { + background-color: #111 +} + +.swagger-ui .hover-bg-dark-gray:focus, .swagger-ui .hover-bg-dark-gray:hover { + background-color: #333 +} + +.swagger-ui .hover-bg-mid-gray:focus, .swagger-ui .hover-bg-mid-gray:hover { + background-color: #555 +} + +.swagger-ui .hover-bg-gray:focus, .swagger-ui .hover-bg-gray:hover { + background-color: #777 +} + +.swagger-ui .hover-bg-silver:focus, .swagger-ui .hover-bg-silver:hover { + background-color: #999 +} + +.swagger-ui .hover-bg-light-silver:focus, .swagger-ui .hover-bg-light-silver:hover { + background-color: #aaa +} + +.swagger-ui .hover-bg-moon-gray:focus, .swagger-ui .hover-bg-moon-gray:hover { + background-color: #ccc +} + +.swagger-ui .hover-bg-light-gray:focus, .swagger-ui .hover-bg-light-gray:hover { + background-color: #eee +} + +.swagger-ui .hover-bg-near-white:focus, .swagger-ui .hover-bg-near-white:hover { + background-color: #f4f4f4 +} + +.swagger-ui .hover-bg-white:focus, .swagger-ui .hover-bg-white:hover { + background-color: #fff +} + +.swagger-ui .hover-bg-transparent:focus, .swagger-ui .hover-bg-transparent:hover { + background-color: transparent +} + +.swagger-ui .hover-bg-black-90:focus, .swagger-ui .hover-bg-black-90:hover { + background-color: rgba(0,0,0,.9) +} + +.swagger-ui .hover-bg-black-80:focus, .swagger-ui .hover-bg-black-80:hover { + background-color: rgba(0,0,0,.8) +} + +.swagger-ui .hover-bg-black-70:focus, .swagger-ui .hover-bg-black-70:hover { + background-color: rgba(0,0,0,.7) +} + +.swagger-ui .hover-bg-black-60:focus, .swagger-ui .hover-bg-black-60:hover { + background-color: rgba(0,0,0,.6) +} + +.swagger-ui .hover-bg-black-50:focus, .swagger-ui .hover-bg-black-50:hover { + background-color: rgba(0,0,0,.5) +} + +.swagger-ui .hover-bg-black-40:focus, .swagger-ui .hover-bg-black-40:hover { + background-color: rgba(0,0,0,.4) +} + +.swagger-ui .hover-bg-black-30:focus, .swagger-ui .hover-bg-black-30:hover { + background-color: rgba(0,0,0,.3) +} + +.swagger-ui .hover-bg-black-20:focus, .swagger-ui .hover-bg-black-20:hover { + background-color: rgba(0,0,0,.2) +} + +.swagger-ui .hover-bg-black-10:focus, .swagger-ui .hover-bg-black-10:hover { + background-color: rgba(0,0,0,.1) +} + +.swagger-ui .hover-bg-white-90:focus, .swagger-ui .hover-bg-white-90:hover { + background-color: hsla(0,0%,100%,.9) +} + +.swagger-ui .hover-bg-white-80:focus, .swagger-ui .hover-bg-white-80:hover { + background-color: hsla(0,0%,100%,.8) +} + +.swagger-ui .hover-bg-white-70:focus, .swagger-ui .hover-bg-white-70:hover { + background-color: hsla(0,0%,100%,.7) +} + +.swagger-ui .hover-bg-white-60:focus, .swagger-ui .hover-bg-white-60:hover { + background-color: hsla(0,0%,100%,.6) +} + +.swagger-ui .hover-bg-white-50:focus, .swagger-ui .hover-bg-white-50:hover { + background-color: hsla(0,0%,100%,.5) +} + +.swagger-ui .hover-bg-white-40:focus, .swagger-ui .hover-bg-white-40:hover { + background-color: hsla(0,0%,100%,.4) +} + +.swagger-ui .hover-bg-white-30:focus, .swagger-ui .hover-bg-white-30:hover { + background-color: hsla(0,0%,100%,.3) +} + +.swagger-ui .hover-bg-white-20:focus, .swagger-ui .hover-bg-white-20:hover { + background-color: hsla(0,0%,100%,.2) +} + +.swagger-ui .hover-bg-white-10:focus, .swagger-ui .hover-bg-white-10:hover { + background-color: hsla(0,0%,100%,.1) +} + +.swagger-ui .hover-dark-red:focus, .swagger-ui .hover-dark-red:hover { + color: #e7040f +} + +.swagger-ui .hover-red:focus, .swagger-ui .hover-red:hover { + color: #ff4136 +} + +.swagger-ui .hover-light-red:focus, .swagger-ui .hover-light-red:hover { + color: #ff725c +} + +.swagger-ui .hover-orange:focus, .swagger-ui .hover-orange:hover { + color: #ff6300 +} + +.swagger-ui .hover-gold:focus, .swagger-ui .hover-gold:hover { + color: #ffb700 +} + +.swagger-ui .hover-yellow:focus, .swagger-ui .hover-yellow:hover { + color: gold +} + +.swagger-ui .hover-light-yellow:focus, .swagger-ui .hover-light-yellow:hover { + color: #fbf1a9 +} + +.swagger-ui .hover-purple:focus, .swagger-ui .hover-purple:hover { + color: #5e2ca5 +} + +.swagger-ui .hover-light-purple:focus, .swagger-ui .hover-light-purple:hover { + color: #a463f2 +} + +.swagger-ui .hover-dark-pink:focus, .swagger-ui .hover-dark-pink:hover { + color: #d5008f +} + +.swagger-ui .hover-hot-pink:focus, .swagger-ui .hover-hot-pink:hover { + color: #ff41b4 +} + +.swagger-ui .hover-pink:focus, .swagger-ui .hover-pink:hover { + color: #ff80cc +} + +.swagger-ui .hover-light-pink:focus, .swagger-ui .hover-light-pink:hover { + color: #ffa3d7 +} + +.swagger-ui .hover-dark-green:focus, .swagger-ui .hover-dark-green:hover { + color: #137752 +} + +.swagger-ui .hover-green:focus, .swagger-ui .hover-green:hover { + color: #19a974 +} + +.swagger-ui .hover-light-green:focus, .swagger-ui .hover-light-green:hover { + color: #9eebcf +} + +.swagger-ui .hover-navy:focus, .swagger-ui .hover-navy:hover { + color: #001b44 +} + +.swagger-ui .hover-dark-blue:focus, .swagger-ui .hover-dark-blue:hover { + color: #00449e +} + +.swagger-ui .hover-blue:focus, .swagger-ui .hover-blue:hover { + color: #357edd +} + +.swagger-ui .hover-light-blue:focus, .swagger-ui .hover-light-blue:hover { + color: #96ccff +} + +.swagger-ui .hover-lightest-blue:focus, .swagger-ui .hover-lightest-blue:hover { + color: #cdecff +} + +.swagger-ui .hover-washed-blue:focus, .swagger-ui .hover-washed-blue:hover { + color: #f6fffe +} + +.swagger-ui .hover-washed-green:focus, .swagger-ui .hover-washed-green:hover { + color: #e8fdf5 +} + +.swagger-ui .hover-washed-yellow:focus, .swagger-ui .hover-washed-yellow:hover { + color: #fffceb +} + +.swagger-ui .hover-washed-red:focus, .swagger-ui .hover-washed-red:hover { + color: #ffdfdf +} + +.swagger-ui .hover-bg-dark-red:focus, .swagger-ui .hover-bg-dark-red:hover { + background-color: #e7040f +} + +.swagger-ui .hover-bg-red:focus, .swagger-ui .hover-bg-red:hover { + background-color: #ff4136 +} + +.swagger-ui .hover-bg-light-red:focus, .swagger-ui .hover-bg-light-red:hover { + background-color: #ff725c +} + +.swagger-ui .hover-bg-orange:focus, .swagger-ui .hover-bg-orange:hover { + background-color: #ff6300 +} + +.swagger-ui .hover-bg-gold:focus, .swagger-ui .hover-bg-gold:hover { + background-color: #ffb700 +} + +.swagger-ui .hover-bg-yellow:focus, .swagger-ui .hover-bg-yellow:hover { + background-color: gold +} + +.swagger-ui .hover-bg-light-yellow:focus, .swagger-ui .hover-bg-light-yellow:hover { + background-color: #fbf1a9 +} + +.swagger-ui .hover-bg-purple:focus, .swagger-ui .hover-bg-purple:hover { + background-color: #5e2ca5 +} + +.swagger-ui .hover-bg-light-purple:focus, .swagger-ui .hover-bg-light-purple:hover { + background-color: #a463f2 +} + +.swagger-ui .hover-bg-dark-pink:focus, .swagger-ui .hover-bg-dark-pink:hover { + background-color: #d5008f +} + +.swagger-ui .hover-bg-hot-pink:focus, .swagger-ui .hover-bg-hot-pink:hover { + background-color: #ff41b4 +} + +.swagger-ui .hover-bg-pink:focus, .swagger-ui .hover-bg-pink:hover { + background-color: #ff80cc +} + +.swagger-ui .hover-bg-light-pink:focus, .swagger-ui .hover-bg-light-pink:hover { + background-color: #ffa3d7 +} + +.swagger-ui .hover-bg-dark-green:focus, .swagger-ui .hover-bg-dark-green:hover { + background-color: #137752 +} + +.swagger-ui .hover-bg-green:focus, .swagger-ui .hover-bg-green:hover { + background-color: #19a974 +} + +.swagger-ui .hover-bg-light-green:focus, .swagger-ui .hover-bg-light-green:hover { + background-color: #9eebcf +} + +.swagger-ui .hover-bg-navy:focus, .swagger-ui .hover-bg-navy:hover { + background-color: #001b44 +} + +.swagger-ui .hover-bg-dark-blue:focus, .swagger-ui .hover-bg-dark-blue:hover { + background-color: #00449e +} + +.swagger-ui .hover-bg-blue:focus, .swagger-ui .hover-bg-blue:hover { + background-color: #357edd +} + +.swagger-ui .hover-bg-light-blue:focus, .swagger-ui .hover-bg-light-blue:hover { + background-color: #96ccff +} + +.swagger-ui .hover-bg-lightest-blue:focus, .swagger-ui .hover-bg-lightest-blue:hover { + background-color: #cdecff +} + +.swagger-ui .hover-bg-washed-blue:focus, .swagger-ui .hover-bg-washed-blue:hover { + background-color: #f6fffe +} + +.swagger-ui .hover-bg-washed-green:focus, .swagger-ui .hover-bg-washed-green:hover { + background-color: #e8fdf5 +} + +.swagger-ui .hover-bg-washed-yellow:focus, .swagger-ui .hover-bg-washed-yellow:hover { + background-color: #fffceb +} + +.swagger-ui .hover-bg-washed-red:focus, .swagger-ui .hover-bg-washed-red:hover { + background-color: #ffdfdf +} + +.swagger-ui .hover-bg-inherit:focus, .swagger-ui .hover-bg-inherit:hover { + background-color: inherit +} + +.swagger-ui .pa0 { + padding: 0 +} + +.swagger-ui .pa1 { + padding: .25rem +} + +.swagger-ui .pa2 { + padding: .5rem +} + +.swagger-ui .pa3 { + padding: 1rem +} + +.swagger-ui .pa4 { + padding: 2rem +} + +.swagger-ui .pa5 { + padding: 4rem +} + +.swagger-ui .pa6 { + padding: 8rem +} + +.swagger-ui .pa7 { + padding: 16rem +} + +.swagger-ui .pl0 { + padding-left: 0 +} + +.swagger-ui .pl1 { + padding-left: .25rem +} + +.swagger-ui .pl2 { + padding-left: .5rem +} + +.swagger-ui .pl3 { + padding-left: 1rem +} + +.swagger-ui .pl4 { + padding-left: 2rem +} + +.swagger-ui .pl5 { + padding-left: 4rem +} + +.swagger-ui .pl6 { + padding-left: 8rem +} + +.swagger-ui .pl7 { + padding-left: 16rem +} + +.swagger-ui .pr0 { + padding-right: 0 +} + +.swagger-ui .pr1 { + padding-right: .25rem +} + +.swagger-ui .pr2 { + padding-right: .5rem +} + +.swagger-ui .pr3 { + padding-right: 1rem +} + +.swagger-ui .pr4 { + padding-right: 2rem +} + +.swagger-ui .pr5 { + padding-right: 4rem +} + +.swagger-ui .pr6 { + padding-right: 8rem +} + +.swagger-ui .pr7 { + padding-right: 16rem +} + +.swagger-ui .pb0 { + padding-bottom: 0 +} + +.swagger-ui .pb1 { + padding-bottom: .25rem +} + +.swagger-ui .pb2 { + padding-bottom: .5rem +} + +.swagger-ui .pb3 { + padding-bottom: 1rem +} + +.swagger-ui .pb4 { + padding-bottom: 2rem +} + +.swagger-ui .pb5 { + padding-bottom: 4rem +} + +.swagger-ui .pb6 { + padding-bottom: 8rem +} + +.swagger-ui .pb7 { + padding-bottom: 16rem +} + +.swagger-ui .pt0 { + padding-top: 0 +} + +.swagger-ui .pt1 { + padding-top: .25rem +} + +.swagger-ui .pt2 { + padding-top: .5rem +} + +.swagger-ui .pt3 { + padding-top: 1rem +} + +.swagger-ui .pt4 { + padding-top: 2rem +} + +.swagger-ui .pt5 { + padding-top: 4rem +} + +.swagger-ui .pt6 { + padding-top: 8rem +} + +.swagger-ui .pt7 { + padding-top: 16rem +} + +.swagger-ui .pv0 { + padding-bottom: 0; + padding-top: 0 +} + +.swagger-ui .pv1 { + padding-bottom: .25rem; + padding-top: .25rem +} + +.swagger-ui .pv2 { + padding-bottom: .5rem; + padding-top: .5rem +} + +.swagger-ui .pv3 { + padding-bottom: 1rem; + padding-top: 1rem +} + +.swagger-ui .pv4 { + padding-bottom: 2rem; + padding-top: 2rem +} + +.swagger-ui .pv5 { + padding-bottom: 4rem; + padding-top: 4rem +} + +.swagger-ui .pv6 { + padding-bottom: 8rem; + padding-top: 8rem +} + +.swagger-ui .pv7 { + padding-bottom: 16rem; + padding-top: 16rem +} + +.swagger-ui .ph0 { + padding-left: 0; + padding-right: 0 +} + +.swagger-ui .ph1 { + padding-left: .25rem; + padding-right: .25rem +} + +.swagger-ui .ph2 { + padding-left: .5rem; + padding-right: .5rem +} + +.swagger-ui .ph3 { + padding-left: 1rem; + padding-right: 1rem +} + +.swagger-ui .ph4 { + padding-left: 2rem; + padding-right: 2rem +} + +.swagger-ui .ph5 { + padding-left: 4rem; + padding-right: 4rem +} + +.swagger-ui .ph6 { + padding-left: 8rem; + padding-right: 8rem +} + +.swagger-ui .ph7 { + padding-left: 16rem; + padding-right: 16rem +} + +.swagger-ui .ma0 { + margin: 0 +} + +.swagger-ui .ma1 { + margin: .25rem +} + +.swagger-ui .ma2 { + margin: .5rem +} + +.swagger-ui .ma3 { + margin: 1rem +} + +.swagger-ui .ma4 { + margin: 2rem +} + +.swagger-ui .ma5 { + margin: 4rem +} + +.swagger-ui .ma6 { + margin: 8rem +} + +.swagger-ui .ma7 { + margin: 16rem +} + +.swagger-ui .ml0 { + margin-left: 0 +} + +.swagger-ui .ml1 { + margin-left: .25rem +} + +.swagger-ui .ml2 { + margin-left: .5rem +} + +.swagger-ui .ml3 { + margin-left: 1rem +} + +.swagger-ui .ml4 { + margin-left: 2rem +} + +.swagger-ui .ml5 { + margin-left: 4rem +} + +.swagger-ui .ml6 { + margin-left: 8rem +} + +.swagger-ui .ml7 { + margin-left: 16rem +} + +.swagger-ui .mr0 { + margin-right: 0 +} + +.swagger-ui .mr1 { + margin-right: .25rem +} + +.swagger-ui .mr2 { + margin-right: .5rem +} + +.swagger-ui .mr3 { + margin-right: 1rem +} + +.swagger-ui .mr4 { + margin-right: 2rem +} + +.swagger-ui .mr5 { + margin-right: 4rem +} + +.swagger-ui .mr6 { + margin-right: 8rem +} + +.swagger-ui .mr7 { + margin-right: 16rem +} + +.swagger-ui .mb0 { + margin-bottom: 0 +} + +.swagger-ui .mb1 { + margin-bottom: .25rem +} + +.swagger-ui .mb2 { + margin-bottom: .5rem +} + +.swagger-ui .mb3 { + margin-bottom: 1rem +} + +.swagger-ui .mb4 { + margin-bottom: 2rem +} + +.swagger-ui .mb5 { + margin-bottom: 4rem +} + +.swagger-ui .mb6 { + margin-bottom: 8rem +} + +.swagger-ui .mb7 { + margin-bottom: 16rem +} + +.swagger-ui .mt0 { + margin-top: 0 +} + +.swagger-ui .mt1 { + margin-top: .25rem +} + +.swagger-ui .mt2 { + margin-top: .5rem +} + +.swagger-ui .mt3 { + margin-top: 1rem +} + +.swagger-ui .mt4 { + margin-top: 2rem +} + +.swagger-ui .mt5 { + margin-top: 4rem +} + +.swagger-ui .mt6 { + margin-top: 8rem +} + +.swagger-ui .mt7 { + margin-top: 16rem +} + +.swagger-ui .mv0 { + margin-bottom: 0; + margin-top: 0 +} + +.swagger-ui .mv1 { + margin-bottom: .25rem; + margin-top: .25rem +} + +.swagger-ui .mv2 { + margin-bottom: .5rem; + margin-top: .5rem +} + +.swagger-ui .mv3 { + margin-bottom: 1rem; + margin-top: 1rem +} + +.swagger-ui .mv4 { + margin-bottom: 2rem; + margin-top: 2rem +} + +.swagger-ui .mv5 { + margin-bottom: 4rem; + margin-top: 4rem +} + +.swagger-ui .mv6 { + margin-bottom: 8rem; + margin-top: 8rem +} + +.swagger-ui .mv7 { + margin-bottom: 16rem; + margin-top: 16rem +} + +.swagger-ui .mh0 { + margin-left: 0; + margin-right: 0 +} + +.swagger-ui .mh1 { + margin-left: .25rem; + margin-right: .25rem +} + +.swagger-ui .mh2 { + margin-left: .5rem; + margin-right: .5rem +} + +.swagger-ui .mh3 { + margin-left: 1rem; + margin-right: 1rem +} + +.swagger-ui .mh4 { + margin-left: 2rem; + margin-right: 2rem +} + +.swagger-ui .mh5 { + margin-left: 4rem; + margin-right: 4rem +} + +.swagger-ui .mh6 { + margin-left: 8rem; + margin-right: 8rem +} + +.swagger-ui .mh7 { + margin-left: 16rem; + margin-right: 16rem +} + +@media screen and (min-width: 30em) { + .swagger-ui .pa0-ns { + padding: 0 + } + + .swagger-ui .pa1-ns { + padding: .25rem + } + + .swagger-ui .pa2-ns { + padding: .5rem + } + + .swagger-ui .pa3-ns { + padding: 1rem + } + + .swagger-ui .pa4-ns { + padding: 2rem + } + + .swagger-ui .pa5-ns { + padding: 4rem + } + + .swagger-ui .pa6-ns { + padding: 8rem + } + + .swagger-ui .pa7-ns { + padding: 16rem + } + + .swagger-ui .pl0-ns { + padding-left: 0 + } + + .swagger-ui .pl1-ns { + padding-left: .25rem + } + + .swagger-ui .pl2-ns { + padding-left: .5rem + } + + .swagger-ui .pl3-ns { + padding-left: 1rem + } + + .swagger-ui .pl4-ns { + padding-left: 2rem + } + + .swagger-ui .pl5-ns { + padding-left: 4rem + } + + .swagger-ui .pl6-ns { + padding-left: 8rem + } + + .swagger-ui .pl7-ns { + padding-left: 16rem + } + + .swagger-ui .pr0-ns { + padding-right: 0 + } + + .swagger-ui .pr1-ns { + padding-right: .25rem + } + + .swagger-ui .pr2-ns { + padding-right: .5rem + } + + .swagger-ui .pr3-ns { + padding-right: 1rem + } + + .swagger-ui .pr4-ns { + padding-right: 2rem + } + + .swagger-ui .pr5-ns { + padding-right: 4rem + } + + .swagger-ui .pr6-ns { + padding-right: 8rem + } + + .swagger-ui .pr7-ns { + padding-right: 16rem + } + + .swagger-ui .pb0-ns { + padding-bottom: 0 + } + + .swagger-ui .pb1-ns { + padding-bottom: .25rem + } + + .swagger-ui .pb2-ns { + padding-bottom: .5rem + } + + .swagger-ui .pb3-ns { + padding-bottom: 1rem + } + + .swagger-ui .pb4-ns { + padding-bottom: 2rem + } + + .swagger-ui .pb5-ns { + padding-bottom: 4rem + } + + .swagger-ui .pb6-ns { + padding-bottom: 8rem + } + + .swagger-ui .pb7-ns { + padding-bottom: 16rem + } + + .swagger-ui .pt0-ns { + padding-top: 0 + } + + .swagger-ui .pt1-ns { + padding-top: .25rem + } + + .swagger-ui .pt2-ns { + padding-top: .5rem + } + + .swagger-ui .pt3-ns { + padding-top: 1rem + } + + .swagger-ui .pt4-ns { + padding-top: 2rem + } + + .swagger-ui .pt5-ns { + padding-top: 4rem + } + + .swagger-ui .pt6-ns { + padding-top: 8rem + } + + .swagger-ui .pt7-ns { + padding-top: 16rem + } + + .swagger-ui .pv0-ns { + padding-bottom: 0; + padding-top: 0 + } + + .swagger-ui .pv1-ns { + padding-bottom: .25rem; + padding-top: .25rem + } + + .swagger-ui .pv2-ns { + padding-bottom: .5rem; + padding-top: .5rem + } + + .swagger-ui .pv3-ns { + padding-bottom: 1rem; + padding-top: 1rem + } + + .swagger-ui .pv4-ns { + padding-bottom: 2rem; + padding-top: 2rem + } + + .swagger-ui .pv5-ns { + padding-bottom: 4rem; + padding-top: 4rem + } + + .swagger-ui .pv6-ns { + padding-bottom: 8rem; + padding-top: 8rem + } + + .swagger-ui .pv7-ns { + padding-bottom: 16rem; + padding-top: 16rem + } + + .swagger-ui .ph0-ns { + padding-left: 0; + padding-right: 0 + } + + .swagger-ui .ph1-ns { + padding-left: .25rem; + padding-right: .25rem + } + + .swagger-ui .ph2-ns { + padding-left: .5rem; + padding-right: .5rem + } + + .swagger-ui .ph3-ns { + padding-left: 1rem; + padding-right: 1rem + } + + .swagger-ui .ph4-ns { + padding-left: 2rem; + padding-right: 2rem + } + + .swagger-ui .ph5-ns { + padding-left: 4rem; + padding-right: 4rem + } + + .swagger-ui .ph6-ns { + padding-left: 8rem; + padding-right: 8rem + } + + .swagger-ui .ph7-ns { + padding-left: 16rem; + padding-right: 16rem + } + + .swagger-ui .ma0-ns { + margin: 0 + } + + .swagger-ui .ma1-ns { + margin: .25rem + } + + .swagger-ui .ma2-ns { + margin: .5rem + } + + .swagger-ui .ma3-ns { + margin: 1rem + } + + .swagger-ui .ma4-ns { + margin: 2rem + } + + .swagger-ui .ma5-ns { + margin: 4rem + } + + .swagger-ui .ma6-ns { + margin: 8rem + } + + .swagger-ui .ma7-ns { + margin: 16rem + } + + .swagger-ui .ml0-ns { + margin-left: 0 + } + + .swagger-ui .ml1-ns { + margin-left: .25rem + } + + .swagger-ui .ml2-ns { + margin-left: .5rem + } + + .swagger-ui .ml3-ns { + margin-left: 1rem + } + + .swagger-ui .ml4-ns { + margin-left: 2rem + } + + .swagger-ui .ml5-ns { + margin-left: 4rem + } + + .swagger-ui .ml6-ns { + margin-left: 8rem + } + + .swagger-ui .ml7-ns { + margin-left: 16rem + } + + .swagger-ui .mr0-ns { + margin-right: 0 + } + + .swagger-ui .mr1-ns { + margin-right: .25rem + } + + .swagger-ui .mr2-ns { + margin-right: .5rem + } + + .swagger-ui .mr3-ns { + margin-right: 1rem + } + + .swagger-ui .mr4-ns { + margin-right: 2rem + } + + .swagger-ui .mr5-ns { + margin-right: 4rem + } + + .swagger-ui .mr6-ns { + margin-right: 8rem + } + + .swagger-ui .mr7-ns { + margin-right: 16rem + } + + .swagger-ui .mb0-ns { + margin-bottom: 0 + } + + .swagger-ui .mb1-ns { + margin-bottom: .25rem + } + + .swagger-ui .mb2-ns { + margin-bottom: .5rem + } + + .swagger-ui .mb3-ns { + margin-bottom: 1rem + } + + .swagger-ui .mb4-ns { + margin-bottom: 2rem + } + + .swagger-ui .mb5-ns { + margin-bottom: 4rem + } + + .swagger-ui .mb6-ns { + margin-bottom: 8rem + } + + .swagger-ui .mb7-ns { + margin-bottom: 16rem + } + + .swagger-ui .mt0-ns { + margin-top: 0 + } + + .swagger-ui .mt1-ns { + margin-top: .25rem + } + + .swagger-ui .mt2-ns { + margin-top: .5rem + } + + .swagger-ui .mt3-ns { + margin-top: 1rem + } + + .swagger-ui .mt4-ns { + margin-top: 2rem + } + + .swagger-ui .mt5-ns { + margin-top: 4rem + } + + .swagger-ui .mt6-ns { + margin-top: 8rem + } + + .swagger-ui .mt7-ns { + margin-top: 16rem + } + + .swagger-ui .mv0-ns { + margin-bottom: 0; + margin-top: 0 + } + + .swagger-ui .mv1-ns { + margin-bottom: .25rem; + margin-top: .25rem + } + + .swagger-ui .mv2-ns { + margin-bottom: .5rem; + margin-top: .5rem + } + + .swagger-ui .mv3-ns { + margin-bottom: 1rem; + margin-top: 1rem + } + + .swagger-ui .mv4-ns { + margin-bottom: 2rem; + margin-top: 2rem + } + + .swagger-ui .mv5-ns { + margin-bottom: 4rem; + margin-top: 4rem + } + + .swagger-ui .mv6-ns { + margin-bottom: 8rem; + margin-top: 8rem + } + + .swagger-ui .mv7-ns { + margin-bottom: 16rem; + margin-top: 16rem + } + + .swagger-ui .mh0-ns { + margin-left: 0; + margin-right: 0 + } + + .swagger-ui .mh1-ns { + margin-left: .25rem; + margin-right: .25rem + } + + .swagger-ui .mh2-ns { + margin-left: .5rem; + margin-right: .5rem + } + + .swagger-ui .mh3-ns { + margin-left: 1rem; + margin-right: 1rem + } + + .swagger-ui .mh4-ns { + margin-left: 2rem; + margin-right: 2rem + } + + .swagger-ui .mh5-ns { + margin-left: 4rem; + margin-right: 4rem + } + + .swagger-ui .mh6-ns { + margin-left: 8rem; + margin-right: 8rem + } + + .swagger-ui .mh7-ns { + margin-left: 16rem; + margin-right: 16rem + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .pa0-m { + padding: 0 + } + + .swagger-ui .pa1-m { + padding: .25rem + } + + .swagger-ui .pa2-m { + padding: .5rem + } + + .swagger-ui .pa3-m { + padding: 1rem + } + + .swagger-ui .pa4-m { + padding: 2rem + } + + .swagger-ui .pa5-m { + padding: 4rem + } + + .swagger-ui .pa6-m { + padding: 8rem + } + + .swagger-ui .pa7-m { + padding: 16rem + } + + .swagger-ui .pl0-m { + padding-left: 0 + } + + .swagger-ui .pl1-m { + padding-left: .25rem + } + + .swagger-ui .pl2-m { + padding-left: .5rem + } + + .swagger-ui .pl3-m { + padding-left: 1rem + } + + .swagger-ui .pl4-m { + padding-left: 2rem + } + + .swagger-ui .pl5-m { + padding-left: 4rem + } + + .swagger-ui .pl6-m { + padding-left: 8rem + } + + .swagger-ui .pl7-m { + padding-left: 16rem + } + + .swagger-ui .pr0-m { + padding-right: 0 + } + + .swagger-ui .pr1-m { + padding-right: .25rem + } + + .swagger-ui .pr2-m { + padding-right: .5rem + } + + .swagger-ui .pr3-m { + padding-right: 1rem + } + + .swagger-ui .pr4-m { + padding-right: 2rem + } + + .swagger-ui .pr5-m { + padding-right: 4rem + } + + .swagger-ui .pr6-m { + padding-right: 8rem + } + + .swagger-ui .pr7-m { + padding-right: 16rem + } + + .swagger-ui .pb0-m { + padding-bottom: 0 + } + + .swagger-ui .pb1-m { + padding-bottom: .25rem + } + + .swagger-ui .pb2-m { + padding-bottom: .5rem + } + + .swagger-ui .pb3-m { + padding-bottom: 1rem + } + + .swagger-ui .pb4-m { + padding-bottom: 2rem + } + + .swagger-ui .pb5-m { + padding-bottom: 4rem + } + + .swagger-ui .pb6-m { + padding-bottom: 8rem + } + + .swagger-ui .pb7-m { + padding-bottom: 16rem + } + + .swagger-ui .pt0-m { + padding-top: 0 + } + + .swagger-ui .pt1-m { + padding-top: .25rem + } + + .swagger-ui .pt2-m { + padding-top: .5rem + } + + .swagger-ui .pt3-m { + padding-top: 1rem + } + + .swagger-ui .pt4-m { + padding-top: 2rem + } + + .swagger-ui .pt5-m { + padding-top: 4rem + } + + .swagger-ui .pt6-m { + padding-top: 8rem + } + + .swagger-ui .pt7-m { + padding-top: 16rem + } + + .swagger-ui .pv0-m { + padding-bottom: 0; + padding-top: 0 + } + + .swagger-ui .pv1-m { + padding-bottom: .25rem; + padding-top: .25rem + } + + .swagger-ui .pv2-m { + padding-bottom: .5rem; + padding-top: .5rem + } + + .swagger-ui .pv3-m { + padding-bottom: 1rem; + padding-top: 1rem + } + + .swagger-ui .pv4-m { + padding-bottom: 2rem; + padding-top: 2rem + } + + .swagger-ui .pv5-m { + padding-bottom: 4rem; + padding-top: 4rem + } + + .swagger-ui .pv6-m { + padding-bottom: 8rem; + padding-top: 8rem + } + + .swagger-ui .pv7-m { + padding-bottom: 16rem; + padding-top: 16rem + } + + .swagger-ui .ph0-m { + padding-left: 0; + padding-right: 0 + } + + .swagger-ui .ph1-m { + padding-left: .25rem; + padding-right: .25rem + } + + .swagger-ui .ph2-m { + padding-left: .5rem; + padding-right: .5rem + } + + .swagger-ui .ph3-m { + padding-left: 1rem; + padding-right: 1rem + } + + .swagger-ui .ph4-m { + padding-left: 2rem; + padding-right: 2rem + } + + .swagger-ui .ph5-m { + padding-left: 4rem; + padding-right: 4rem + } + + .swagger-ui .ph6-m { + padding-left: 8rem; + padding-right: 8rem + } + + .swagger-ui .ph7-m { + padding-left: 16rem; + padding-right: 16rem + } + + .swagger-ui .ma0-m { + margin: 0 + } + + .swagger-ui .ma1-m { + margin: .25rem + } + + .swagger-ui .ma2-m { + margin: .5rem + } + + .swagger-ui .ma3-m { + margin: 1rem + } + + .swagger-ui .ma4-m { + margin: 2rem + } + + .swagger-ui .ma5-m { + margin: 4rem + } + + .swagger-ui .ma6-m { + margin: 8rem + } + + .swagger-ui .ma7-m { + margin: 16rem + } + + .swagger-ui .ml0-m { + margin-left: 0 + } + + .swagger-ui .ml1-m { + margin-left: .25rem + } + + .swagger-ui .ml2-m { + margin-left: .5rem + } + + .swagger-ui .ml3-m { + margin-left: 1rem + } + + .swagger-ui .ml4-m { + margin-left: 2rem + } + + .swagger-ui .ml5-m { + margin-left: 4rem + } + + .swagger-ui .ml6-m { + margin-left: 8rem + } + + .swagger-ui .ml7-m { + margin-left: 16rem + } + + .swagger-ui .mr0-m { + margin-right: 0 + } + + .swagger-ui .mr1-m { + margin-right: .25rem + } + + .swagger-ui .mr2-m { + margin-right: .5rem + } + + .swagger-ui .mr3-m { + margin-right: 1rem + } + + .swagger-ui .mr4-m { + margin-right: 2rem + } + + .swagger-ui .mr5-m { + margin-right: 4rem + } + + .swagger-ui .mr6-m { + margin-right: 8rem + } + + .swagger-ui .mr7-m { + margin-right: 16rem + } + + .swagger-ui .mb0-m { + margin-bottom: 0 + } + + .swagger-ui .mb1-m { + margin-bottom: .25rem + } + + .swagger-ui .mb2-m { + margin-bottom: .5rem + } + + .swagger-ui .mb3-m { + margin-bottom: 1rem + } + + .swagger-ui .mb4-m { + margin-bottom: 2rem + } + + .swagger-ui .mb5-m { + margin-bottom: 4rem + } + + .swagger-ui .mb6-m { + margin-bottom: 8rem + } + + .swagger-ui .mb7-m { + margin-bottom: 16rem + } + + .swagger-ui .mt0-m { + margin-top: 0 + } + + .swagger-ui .mt1-m { + margin-top: .25rem + } + + .swagger-ui .mt2-m { + margin-top: .5rem + } + + .swagger-ui .mt3-m { + margin-top: 1rem + } + + .swagger-ui .mt4-m { + margin-top: 2rem + } + + .swagger-ui .mt5-m { + margin-top: 4rem + } + + .swagger-ui .mt6-m { + margin-top: 8rem + } + + .swagger-ui .mt7-m { + margin-top: 16rem + } + + .swagger-ui .mv0-m { + margin-bottom: 0; + margin-top: 0 + } + + .swagger-ui .mv1-m { + margin-bottom: .25rem; + margin-top: .25rem + } + + .swagger-ui .mv2-m { + margin-bottom: .5rem; + margin-top: .5rem + } + + .swagger-ui .mv3-m { + margin-bottom: 1rem; + margin-top: 1rem + } + + .swagger-ui .mv4-m { + margin-bottom: 2rem; + margin-top: 2rem + } + + .swagger-ui .mv5-m { + margin-bottom: 4rem; + margin-top: 4rem + } + + .swagger-ui .mv6-m { + margin-bottom: 8rem; + margin-top: 8rem + } + + .swagger-ui .mv7-m { + margin-bottom: 16rem; + margin-top: 16rem + } + + .swagger-ui .mh0-m { + margin-left: 0; + margin-right: 0 + } + + .swagger-ui .mh1-m { + margin-left: .25rem; + margin-right: .25rem + } + + .swagger-ui .mh2-m { + margin-left: .5rem; + margin-right: .5rem + } + + .swagger-ui .mh3-m { + margin-left: 1rem; + margin-right: 1rem + } + + .swagger-ui .mh4-m { + margin-left: 2rem; + margin-right: 2rem + } + + .swagger-ui .mh5-m { + margin-left: 4rem; + margin-right: 4rem + } + + .swagger-ui .mh6-m { + margin-left: 8rem; + margin-right: 8rem + } + + .swagger-ui .mh7-m { + margin-left: 16rem; + margin-right: 16rem + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .pa0-l { + padding: 0 + } + + .swagger-ui .pa1-l { + padding: .25rem + } + + .swagger-ui .pa2-l { + padding: .5rem + } + + .swagger-ui .pa3-l { + padding: 1rem + } + + .swagger-ui .pa4-l { + padding: 2rem + } + + .swagger-ui .pa5-l { + padding: 4rem + } + + .swagger-ui .pa6-l { + padding: 8rem + } + + .swagger-ui .pa7-l { + padding: 16rem + } + + .swagger-ui .pl0-l { + padding-left: 0 + } + + .swagger-ui .pl1-l { + padding-left: .25rem + } + + .swagger-ui .pl2-l { + padding-left: .5rem + } + + .swagger-ui .pl3-l { + padding-left: 1rem + } + + .swagger-ui .pl4-l { + padding-left: 2rem + } + + .swagger-ui .pl5-l { + padding-left: 4rem + } + + .swagger-ui .pl6-l { + padding-left: 8rem + } + + .swagger-ui .pl7-l { + padding-left: 16rem + } + + .swagger-ui .pr0-l { + padding-right: 0 + } + + .swagger-ui .pr1-l { + padding-right: .25rem + } + + .swagger-ui .pr2-l { + padding-right: .5rem + } + + .swagger-ui .pr3-l { + padding-right: 1rem + } + + .swagger-ui .pr4-l { + padding-right: 2rem + } + + .swagger-ui .pr5-l { + padding-right: 4rem + } + + .swagger-ui .pr6-l { + padding-right: 8rem + } + + .swagger-ui .pr7-l { + padding-right: 16rem + } + + .swagger-ui .pb0-l { + padding-bottom: 0 + } + + .swagger-ui .pb1-l { + padding-bottom: .25rem + } + + .swagger-ui .pb2-l { + padding-bottom: .5rem + } + + .swagger-ui .pb3-l { + padding-bottom: 1rem + } + + .swagger-ui .pb4-l { + padding-bottom: 2rem + } + + .swagger-ui .pb5-l { + padding-bottom: 4rem + } + + .swagger-ui .pb6-l { + padding-bottom: 8rem + } + + .swagger-ui .pb7-l { + padding-bottom: 16rem + } + + .swagger-ui .pt0-l { + padding-top: 0 + } + + .swagger-ui .pt1-l { + padding-top: .25rem + } + + .swagger-ui .pt2-l { + padding-top: .5rem + } + + .swagger-ui .pt3-l { + padding-top: 1rem + } + + .swagger-ui .pt4-l { + padding-top: 2rem + } + + .swagger-ui .pt5-l { + padding-top: 4rem + } + + .swagger-ui .pt6-l { + padding-top: 8rem + } + + .swagger-ui .pt7-l { + padding-top: 16rem + } + + .swagger-ui .pv0-l { + padding-bottom: 0; + padding-top: 0 + } + + .swagger-ui .pv1-l { + padding-bottom: .25rem; + padding-top: .25rem + } + + .swagger-ui .pv2-l { + padding-bottom: .5rem; + padding-top: .5rem + } + + .swagger-ui .pv3-l { + padding-bottom: 1rem; + padding-top: 1rem + } + + .swagger-ui .pv4-l { + padding-bottom: 2rem; + padding-top: 2rem + } + + .swagger-ui .pv5-l { + padding-bottom: 4rem; + padding-top: 4rem + } + + .swagger-ui .pv6-l { + padding-bottom: 8rem; + padding-top: 8rem + } + + .swagger-ui .pv7-l { + padding-bottom: 16rem; + padding-top: 16rem + } + + .swagger-ui .ph0-l { + padding-left: 0; + padding-right: 0 + } + + .swagger-ui .ph1-l { + padding-left: .25rem; + padding-right: .25rem + } + + .swagger-ui .ph2-l { + padding-left: .5rem; + padding-right: .5rem + } + + .swagger-ui .ph3-l { + padding-left: 1rem; + padding-right: 1rem + } + + .swagger-ui .ph4-l { + padding-left: 2rem; + padding-right: 2rem + } + + .swagger-ui .ph5-l { + padding-left: 4rem; + padding-right: 4rem + } + + .swagger-ui .ph6-l { + padding-left: 8rem; + padding-right: 8rem + } + + .swagger-ui .ph7-l { + padding-left: 16rem; + padding-right: 16rem + } + + .swagger-ui .ma0-l { + margin: 0 + } + + .swagger-ui .ma1-l { + margin: .25rem + } + + .swagger-ui .ma2-l { + margin: .5rem + } + + .swagger-ui .ma3-l { + margin: 1rem + } + + .swagger-ui .ma4-l { + margin: 2rem + } + + .swagger-ui .ma5-l { + margin: 4rem + } + + .swagger-ui .ma6-l { + margin: 8rem + } + + .swagger-ui .ma7-l { + margin: 16rem + } + + .swagger-ui .ml0-l { + margin-left: 0 + } + + .swagger-ui .ml1-l { + margin-left: .25rem + } + + .swagger-ui .ml2-l { + margin-left: .5rem + } + + .swagger-ui .ml3-l { + margin-left: 1rem + } + + .swagger-ui .ml4-l { + margin-left: 2rem + } + + .swagger-ui .ml5-l { + margin-left: 4rem + } + + .swagger-ui .ml6-l { + margin-left: 8rem + } + + .swagger-ui .ml7-l { + margin-left: 16rem + } + + .swagger-ui .mr0-l { + margin-right: 0 + } + + .swagger-ui .mr1-l { + margin-right: .25rem + } + + .swagger-ui .mr2-l { + margin-right: .5rem + } + + .swagger-ui .mr3-l { + margin-right: 1rem + } + + .swagger-ui .mr4-l { + margin-right: 2rem + } + + .swagger-ui .mr5-l { + margin-right: 4rem + } + + .swagger-ui .mr6-l { + margin-right: 8rem + } + + .swagger-ui .mr7-l { + margin-right: 16rem + } + + .swagger-ui .mb0-l { + margin-bottom: 0 + } + + .swagger-ui .mb1-l { + margin-bottom: .25rem + } + + .swagger-ui .mb2-l { + margin-bottom: .5rem + } + + .swagger-ui .mb3-l { + margin-bottom: 1rem + } + + .swagger-ui .mb4-l { + margin-bottom: 2rem + } + + .swagger-ui .mb5-l { + margin-bottom: 4rem + } + + .swagger-ui .mb6-l { + margin-bottom: 8rem + } + + .swagger-ui .mb7-l { + margin-bottom: 16rem + } + + .swagger-ui .mt0-l { + margin-top: 0 + } + + .swagger-ui .mt1-l { + margin-top: .25rem + } + + .swagger-ui .mt2-l { + margin-top: .5rem + } + + .swagger-ui .mt3-l { + margin-top: 1rem + } + + .swagger-ui .mt4-l { + margin-top: 2rem + } + + .swagger-ui .mt5-l { + margin-top: 4rem + } + + .swagger-ui .mt6-l { + margin-top: 8rem + } + + .swagger-ui .mt7-l { + margin-top: 16rem + } + + .swagger-ui .mv0-l { + margin-bottom: 0; + margin-top: 0 + } + + .swagger-ui .mv1-l { + margin-bottom: .25rem; + margin-top: .25rem + } + + .swagger-ui .mv2-l { + margin-bottom: .5rem; + margin-top: .5rem + } + + .swagger-ui .mv3-l { + margin-bottom: 1rem; + margin-top: 1rem + } + + .swagger-ui .mv4-l { + margin-bottom: 2rem; + margin-top: 2rem + } + + .swagger-ui .mv5-l { + margin-bottom: 4rem; + margin-top: 4rem + } + + .swagger-ui .mv6-l { + margin-bottom: 8rem; + margin-top: 8rem + } + + .swagger-ui .mv7-l { + margin-bottom: 16rem; + margin-top: 16rem + } + + .swagger-ui .mh0-l { + margin-left: 0; + margin-right: 0 + } + + .swagger-ui .mh1-l { + margin-left: .25rem; + margin-right: .25rem + } + + .swagger-ui .mh2-l { + margin-left: .5rem; + margin-right: .5rem + } + + .swagger-ui .mh3-l { + margin-left: 1rem; + margin-right: 1rem + } + + .swagger-ui .mh4-l { + margin-left: 2rem; + margin-right: 2rem + } + + .swagger-ui .mh5-l { + margin-left: 4rem; + margin-right: 4rem + } + + .swagger-ui .mh6-l { + margin-left: 8rem; + margin-right: 8rem + } + + .swagger-ui .mh7-l { + margin-left: 16rem; + margin-right: 16rem + } +} + +.swagger-ui .na1 { + margin: -.25rem +} + +.swagger-ui .na2 { + margin: -.5rem +} + +.swagger-ui .na3 { + margin: -1rem +} + +.swagger-ui .na4 { + margin: -2rem +} + +.swagger-ui .na5 { + margin: -4rem +} + +.swagger-ui .na6 { + margin: -8rem +} + +.swagger-ui .na7 { + margin: -16rem +} + +.swagger-ui .nl1 { + margin-left: -.25rem +} + +.swagger-ui .nl2 { + margin-left: -.5rem +} + +.swagger-ui .nl3 { + margin-left: -1rem +} + +.swagger-ui .nl4 { + margin-left: -2rem +} + +.swagger-ui .nl5 { + margin-left: -4rem +} + +.swagger-ui .nl6 { + margin-left: -8rem +} + +.swagger-ui .nl7 { + margin-left: -16rem +} + +.swagger-ui .nr1 { + margin-right: -.25rem +} + +.swagger-ui .nr2 { + margin-right: -.5rem +} + +.swagger-ui .nr3 { + margin-right: -1rem +} + +.swagger-ui .nr4 { + margin-right: -2rem +} + +.swagger-ui .nr5 { + margin-right: -4rem +} + +.swagger-ui .nr6 { + margin-right: -8rem +} + +.swagger-ui .nr7 { + margin-right: -16rem +} + +.swagger-ui .nb1 { + margin-bottom: -.25rem +} + +.swagger-ui .nb2 { + margin-bottom: -.5rem +} + +.swagger-ui .nb3 { + margin-bottom: -1rem +} + +.swagger-ui .nb4 { + margin-bottom: -2rem +} + +.swagger-ui .nb5 { + margin-bottom: -4rem +} + +.swagger-ui .nb6 { + margin-bottom: -8rem +} + +.swagger-ui .nb7 { + margin-bottom: -16rem +} + +.swagger-ui .nt1 { + margin-top: -.25rem +} + +.swagger-ui .nt2 { + margin-top: -.5rem +} + +.swagger-ui .nt3 { + margin-top: -1rem +} + +.swagger-ui .nt4 { + margin-top: -2rem +} + +.swagger-ui .nt5 { + margin-top: -4rem +} + +.swagger-ui .nt6 { + margin-top: -8rem +} + +.swagger-ui .nt7 { + margin-top: -16rem +} + +@media screen and (min-width: 30em) { + .swagger-ui .na1-ns { + margin: -.25rem + } + + .swagger-ui .na2-ns { + margin: -.5rem + } + + .swagger-ui .na3-ns { + margin: -1rem + } + + .swagger-ui .na4-ns { + margin: -2rem + } + + .swagger-ui .na5-ns { + margin: -4rem + } + + .swagger-ui .na6-ns { + margin: -8rem + } + + .swagger-ui .na7-ns { + margin: -16rem + } + + .swagger-ui .nl1-ns { + margin-left: -.25rem + } + + .swagger-ui .nl2-ns { + margin-left: -.5rem + } + + .swagger-ui .nl3-ns { + margin-left: -1rem + } + + .swagger-ui .nl4-ns { + margin-left: -2rem + } + + .swagger-ui .nl5-ns { + margin-left: -4rem + } + + .swagger-ui .nl6-ns { + margin-left: -8rem + } + + .swagger-ui .nl7-ns { + margin-left: -16rem + } + + .swagger-ui .nr1-ns { + margin-right: -.25rem + } + + .swagger-ui .nr2-ns { + margin-right: -.5rem + } + + .swagger-ui .nr3-ns { + margin-right: -1rem + } + + .swagger-ui .nr4-ns { + margin-right: -2rem + } + + .swagger-ui .nr5-ns { + margin-right: -4rem + } + + .swagger-ui .nr6-ns { + margin-right: -8rem + } + + .swagger-ui .nr7-ns { + margin-right: -16rem + } + + .swagger-ui .nb1-ns { + margin-bottom: -.25rem + } + + .swagger-ui .nb2-ns { + margin-bottom: -.5rem + } + + .swagger-ui .nb3-ns { + margin-bottom: -1rem + } + + .swagger-ui .nb4-ns { + margin-bottom: -2rem + } + + .swagger-ui .nb5-ns { + margin-bottom: -4rem + } + + .swagger-ui .nb6-ns { + margin-bottom: -8rem + } + + .swagger-ui .nb7-ns { + margin-bottom: -16rem + } + + .swagger-ui .nt1-ns { + margin-top: -.25rem + } + + .swagger-ui .nt2-ns { + margin-top: -.5rem + } + + .swagger-ui .nt3-ns { + margin-top: -1rem + } + + .swagger-ui .nt4-ns { + margin-top: -2rem + } + + .swagger-ui .nt5-ns { + margin-top: -4rem + } + + .swagger-ui .nt6-ns { + margin-top: -8rem + } + + .swagger-ui .nt7-ns { + margin-top: -16rem + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .na1-m { + margin: -.25rem + } + + .swagger-ui .na2-m { + margin: -.5rem + } + + .swagger-ui .na3-m { + margin: -1rem + } + + .swagger-ui .na4-m { + margin: -2rem + } + + .swagger-ui .na5-m { + margin: -4rem + } + + .swagger-ui .na6-m { + margin: -8rem + } + + .swagger-ui .na7-m { + margin: -16rem + } + + .swagger-ui .nl1-m { + margin-left: -.25rem + } + + .swagger-ui .nl2-m { + margin-left: -.5rem + } + + .swagger-ui .nl3-m { + margin-left: -1rem + } + + .swagger-ui .nl4-m { + margin-left: -2rem + } + + .swagger-ui .nl5-m { + margin-left: -4rem + } + + .swagger-ui .nl6-m { + margin-left: -8rem + } + + .swagger-ui .nl7-m { + margin-left: -16rem + } + + .swagger-ui .nr1-m { + margin-right: -.25rem + } + + .swagger-ui .nr2-m { + margin-right: -.5rem + } + + .swagger-ui .nr3-m { + margin-right: -1rem + } + + .swagger-ui .nr4-m { + margin-right: -2rem + } + + .swagger-ui .nr5-m { + margin-right: -4rem + } + + .swagger-ui .nr6-m { + margin-right: -8rem + } + + .swagger-ui .nr7-m { + margin-right: -16rem + } + + .swagger-ui .nb1-m { + margin-bottom: -.25rem + } + + .swagger-ui .nb2-m { + margin-bottom: -.5rem + } + + .swagger-ui .nb3-m { + margin-bottom: -1rem + } + + .swagger-ui .nb4-m { + margin-bottom: -2rem + } + + .swagger-ui .nb5-m { + margin-bottom: -4rem + } + + .swagger-ui .nb6-m { + margin-bottom: -8rem + } + + .swagger-ui .nb7-m { + margin-bottom: -16rem + } + + .swagger-ui .nt1-m { + margin-top: -.25rem + } + + .swagger-ui .nt2-m { + margin-top: -.5rem + } + + .swagger-ui .nt3-m { + margin-top: -1rem + } + + .swagger-ui .nt4-m { + margin-top: -2rem + } + + .swagger-ui .nt5-m { + margin-top: -4rem + } + + .swagger-ui .nt6-m { + margin-top: -8rem + } + + .swagger-ui .nt7-m { + margin-top: -16rem + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .na1-l { + margin: -.25rem + } + + .swagger-ui .na2-l { + margin: -.5rem + } + + .swagger-ui .na3-l { + margin: -1rem + } + + .swagger-ui .na4-l { + margin: -2rem + } + + .swagger-ui .na5-l { + margin: -4rem + } + + .swagger-ui .na6-l { + margin: -8rem + } + + .swagger-ui .na7-l { + margin: -16rem + } + + .swagger-ui .nl1-l { + margin-left: -.25rem + } + + .swagger-ui .nl2-l { + margin-left: -.5rem + } + + .swagger-ui .nl3-l { + margin-left: -1rem + } + + .swagger-ui .nl4-l { + margin-left: -2rem + } + + .swagger-ui .nl5-l { + margin-left: -4rem + } + + .swagger-ui .nl6-l { + margin-left: -8rem + } + + .swagger-ui .nl7-l { + margin-left: -16rem + } + + .swagger-ui .nr1-l { + margin-right: -.25rem + } + + .swagger-ui .nr2-l { + margin-right: -.5rem + } + + .swagger-ui .nr3-l { + margin-right: -1rem + } + + .swagger-ui .nr4-l { + margin-right: -2rem + } + + .swagger-ui .nr5-l { + margin-right: -4rem + } + + .swagger-ui .nr6-l { + margin-right: -8rem + } + + .swagger-ui .nr7-l { + margin-right: -16rem + } + + .swagger-ui .nb1-l { + margin-bottom: -.25rem + } + + .swagger-ui .nb2-l { + margin-bottom: -.5rem + } + + .swagger-ui .nb3-l { + margin-bottom: -1rem + } + + .swagger-ui .nb4-l { + margin-bottom: -2rem + } + + .swagger-ui .nb5-l { + margin-bottom: -4rem + } + + .swagger-ui .nb6-l { + margin-bottom: -8rem + } + + .swagger-ui .nb7-l { + margin-bottom: -16rem + } + + .swagger-ui .nt1-l { + margin-top: -.25rem + } + + .swagger-ui .nt2-l { + margin-top: -.5rem + } + + .swagger-ui .nt3-l { + margin-top: -1rem + } + + .swagger-ui .nt4-l { + margin-top: -2rem + } + + .swagger-ui .nt5-l { + margin-top: -4rem + } + + .swagger-ui .nt6-l { + margin-top: -8rem + } + + .swagger-ui .nt7-l { + margin-top: -16rem + } +} + +.swagger-ui .collapse { + border-collapse: collapse; + border-spacing: 0 +} + +.swagger-ui .striped--light-silver:nth-child(odd) { + background-color: #aaa +} + +.swagger-ui .striped--moon-gray:nth-child(odd) { + background-color: #ccc +} + +.swagger-ui .striped--light-gray:nth-child(odd) { + background-color: #eee +} + +.swagger-ui .striped--near-white:nth-child(odd) { + background-color: #f4f4f4 +} + +.swagger-ui .stripe-light:nth-child(odd) { + background-color: hsla(0,0%,100%,.1) +} + +.swagger-ui .stripe-dark:nth-child(odd) { + background-color: rgba(0,0,0,.1) +} + +.swagger-ui .strike { + text-decoration: line-through +} + +.swagger-ui .underline { + text-decoration: underline +} + +.swagger-ui .no-underline { + text-decoration: none +} + +@media screen and (min-width: 30em) { + .swagger-ui .strike-ns { + text-decoration: line-through + } + + .swagger-ui .underline-ns { + text-decoration: underline + } + + .swagger-ui .no-underline-ns { + text-decoration: none + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .strike-m { + text-decoration: line-through + } + + .swagger-ui .underline-m { + text-decoration: underline + } + + .swagger-ui .no-underline-m { + text-decoration: none + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .strike-l { + text-decoration: line-through + } + + .swagger-ui .underline-l { + text-decoration: underline + } + + .swagger-ui .no-underline-l { + text-decoration: none + } +} + +.swagger-ui .tl { + text-align: left +} + +.swagger-ui .tr { + text-align: right +} + +.swagger-ui .tc { + text-align: center +} + +.swagger-ui .tj { + text-align: justify +} + +@media screen and (min-width: 30em) { + .swagger-ui .tl-ns { + text-align: left + } + + .swagger-ui .tr-ns { + text-align: right + } + + .swagger-ui .tc-ns { + text-align: center + } + + .swagger-ui .tj-ns { + text-align: justify + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .tl-m { + text-align: left + } + + .swagger-ui .tr-m { + text-align: right + } + + .swagger-ui .tc-m { + text-align: center + } + + .swagger-ui .tj-m { + text-align: justify + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .tl-l { + text-align: left + } + + .swagger-ui .tr-l { + text-align: right + } + + .swagger-ui .tc-l { + text-align: center + } + + .swagger-ui .tj-l { + text-align: justify + } +} + +.swagger-ui .ttc { + text-transform: capitalize +} + +.swagger-ui .ttl { + text-transform: lowercase +} + +.swagger-ui .ttu { + text-transform: uppercase +} + +.swagger-ui .ttn { + text-transform: none +} + +@media screen and (min-width: 30em) { + .swagger-ui .ttc-ns { + text-transform: capitalize + } + + .swagger-ui .ttl-ns { + text-transform: lowercase + } + + .swagger-ui .ttu-ns { + text-transform: uppercase + } + + .swagger-ui .ttn-ns { + text-transform: none + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .ttc-m { + text-transform: capitalize + } + + .swagger-ui .ttl-m { + text-transform: lowercase + } + + .swagger-ui .ttu-m { + text-transform: uppercase + } + + .swagger-ui .ttn-m { + text-transform: none + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .ttc-l { + text-transform: capitalize + } + + .swagger-ui .ttl-l { + text-transform: lowercase + } + + .swagger-ui .ttu-l { + text-transform: uppercase + } + + .swagger-ui .ttn-l { + text-transform: none + } +} + +.swagger-ui .f-6, .swagger-ui .f-headline { + font-size: 6rem +} + +.swagger-ui .f-5, .swagger-ui .f-subheadline { + font-size: 5rem +} + +.swagger-ui .f1 { + font-size: 3rem +} + +.swagger-ui .f2 { + font-size: 2.25rem +} + +.swagger-ui .f3 { + font-size: 1.5rem +} + +.swagger-ui .f4 { + font-size: 1.25rem +} + +.swagger-ui .f5 { + font-size: 1rem +} + +.swagger-ui .f6 { + font-size: .875rem +} + +.swagger-ui .f7 { + font-size: .75rem +} + +@media screen and (min-width: 30em) { + .swagger-ui .f-6-ns, .swagger-ui .f-headline-ns { + font-size: 6rem + } + + .swagger-ui .f-5-ns, .swagger-ui .f-subheadline-ns { + font-size: 5rem + } + + .swagger-ui .f1-ns { + font-size: 3rem + } + + .swagger-ui .f2-ns { + font-size: 2.25rem + } + + .swagger-ui .f3-ns { + font-size: 1.5rem + } + + .swagger-ui .f4-ns { + font-size: 1.25rem + } + + .swagger-ui .f5-ns { + font-size: 1rem + } + + .swagger-ui .f6-ns { + font-size: .875rem + } + + .swagger-ui .f7-ns { + font-size: .75rem + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .f-6-m, .swagger-ui .f-headline-m { + font-size: 6rem + } + + .swagger-ui .f-5-m, .swagger-ui .f-subheadline-m { + font-size: 5rem + } + + .swagger-ui .f1-m { + font-size: 3rem + } + + .swagger-ui .f2-m { + font-size: 2.25rem + } + + .swagger-ui .f3-m { + font-size: 1.5rem + } + + .swagger-ui .f4-m { + font-size: 1.25rem + } + + .swagger-ui .f5-m { + font-size: 1rem + } + + .swagger-ui .f6-m { + font-size: .875rem + } + + .swagger-ui .f7-m { + font-size: .75rem + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .f-6-l, .swagger-ui .f-headline-l { + font-size: 6rem + } + + .swagger-ui .f-5-l, .swagger-ui .f-subheadline-l { + font-size: 5rem + } + + .swagger-ui .f1-l { + font-size: 3rem + } + + .swagger-ui .f2-l { + font-size: 2.25rem + } + + .swagger-ui .f3-l { + font-size: 1.5rem + } + + .swagger-ui .f4-l { + font-size: 1.25rem + } + + .swagger-ui .f5-l { + font-size: 1rem + } + + .swagger-ui .f6-l { + font-size: .875rem + } + + .swagger-ui .f7-l { + font-size: .75rem + } +} + +.swagger-ui .measure { + max-width: 30em +} + +.swagger-ui .measure-wide { + max-width: 34em +} + +.swagger-ui .measure-narrow { + max-width: 20em +} + +.swagger-ui .indent { + margin-bottom: 0; + margin-top: 0; + text-indent: 1em +} + +.swagger-ui .small-caps { + font-feature-settings: "smcp"; + font-variant: small-caps +} + +.swagger-ui .truncate { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap +} + +@media screen and (min-width: 30em) { + .swagger-ui .measure-ns { + max-width: 30em + } + + .swagger-ui .measure-wide-ns { + max-width: 34em + } + + .swagger-ui .measure-narrow-ns { + max-width: 20em + } + + .swagger-ui .indent-ns { + margin-bottom: 0; + margin-top: 0; + text-indent: 1em + } + + .swagger-ui .small-caps-ns { + font-feature-settings: "smcp"; + font-variant: small-caps + } + + .swagger-ui .truncate-ns { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .measure-m { + max-width: 30em + } + + .swagger-ui .measure-wide-m { + max-width: 34em + } + + .swagger-ui .measure-narrow-m { + max-width: 20em + } + + .swagger-ui .indent-m { + margin-bottom: 0; + margin-top: 0; + text-indent: 1em + } + + .swagger-ui .small-caps-m { + font-feature-settings: "smcp"; + font-variant: small-caps + } + + .swagger-ui .truncate-m { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .measure-l { + max-width: 30em + } + + .swagger-ui .measure-wide-l { + max-width: 34em + } + + .swagger-ui .measure-narrow-l { + max-width: 20em + } + + .swagger-ui .indent-l { + margin-bottom: 0; + margin-top: 0; + text-indent: 1em + } + + .swagger-ui .small-caps-l { + font-feature-settings: "smcp"; + font-variant: small-caps + } + + .swagger-ui .truncate-l { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap + } +} + +.swagger-ui .overflow-container { + overflow-y: scroll +} + +.swagger-ui .center { + margin-left: auto; + margin-right: auto +} + +.swagger-ui .mr-auto { + margin-right: auto +} + +.swagger-ui .ml-auto { + margin-left: auto +} + +@media screen and (min-width: 30em) { + .swagger-ui .center-ns { + margin-left: auto; + margin-right: auto + } + + .swagger-ui .mr-auto-ns { + margin-right: auto + } + + .swagger-ui .ml-auto-ns { + margin-left: auto + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .center-m { + margin-left: auto; + margin-right: auto + } + + .swagger-ui .mr-auto-m { + margin-right: auto + } + + .swagger-ui .ml-auto-m { + margin-left: auto + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .center-l { + margin-left: auto; + margin-right: auto + } + + .swagger-ui .mr-auto-l { + margin-right: auto + } + + .swagger-ui .ml-auto-l { + margin-left: auto + } +} + +.swagger-ui .clip { + clip: rect(1px 1px 1px 1px); + clip: rect(1px,1px,1px,1px); + position: fixed !important; + _position: absolute !important +} + +@media screen and (min-width: 30em) { + .swagger-ui .clip-ns { + clip: rect(1px 1px 1px 1px); + clip: rect(1px,1px,1px,1px); + position: fixed !important; + _position: absolute !important + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .clip-m { + clip: rect(1px 1px 1px 1px); + clip: rect(1px,1px,1px,1px); + position: fixed !important; + _position: absolute !important + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .clip-l { + clip: rect(1px 1px 1px 1px); + clip: rect(1px,1px,1px,1px); + position: fixed !important; + _position: absolute !important + } +} + +.swagger-ui .ws-normal { + white-space: normal +} + +.swagger-ui .nowrap { + white-space: nowrap +} + +.swagger-ui .pre { + white-space: pre +} + +@media screen and (min-width: 30em) { + .swagger-ui .ws-normal-ns { + white-space: normal + } + + .swagger-ui .nowrap-ns { + white-space: nowrap + } + + .swagger-ui .pre-ns { + white-space: pre + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .ws-normal-m { + white-space: normal + } + + .swagger-ui .nowrap-m { + white-space: nowrap + } + + .swagger-ui .pre-m { + white-space: pre + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .ws-normal-l { + white-space: normal + } + + .swagger-ui .nowrap-l { + white-space: nowrap + } + + .swagger-ui .pre-l { + white-space: pre + } +} + +.swagger-ui .v-base { + vertical-align: baseline +} + +.swagger-ui .v-mid { + vertical-align: middle +} + +.swagger-ui .v-top { + vertical-align: top +} + +.swagger-ui .v-btm { + vertical-align: bottom +} + +@media screen and (min-width: 30em) { + .swagger-ui .v-base-ns { + vertical-align: baseline + } + + .swagger-ui .v-mid-ns { + vertical-align: middle + } + + .swagger-ui .v-top-ns { + vertical-align: top + } + + .swagger-ui .v-btm-ns { + vertical-align: bottom + } +} + +@media screen and (min-width: 30em)and (max-width:60em) { + .swagger-ui .v-base-m { + vertical-align: baseline + } + + .swagger-ui .v-mid-m { + vertical-align: middle + } + + .swagger-ui .v-top-m { + vertical-align: top + } + + .swagger-ui .v-btm-m { + vertical-align: bottom + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .v-base-l { + vertical-align: baseline + } + + .swagger-ui .v-mid-l { + vertical-align: middle + } + + .swagger-ui .v-top-l { + vertical-align: top + } + + .swagger-ui .v-btm-l { + vertical-align: bottom + } +} + +.swagger-ui .dim { + opacity: 1; + transition: opacity .15s ease-in +} + + .swagger-ui .dim:focus, .swagger-ui .dim:hover { + opacity: .5; + transition: opacity .15s ease-in + } + + .swagger-ui .dim:active { + opacity: .8; + transition: opacity .15s ease-out + } + +.swagger-ui .glow { + transition: opacity .15s ease-in +} + + .swagger-ui .glow:focus, .swagger-ui .glow:hover { + opacity: 1; + transition: opacity .15s ease-in + } + +.swagger-ui .hide-child .child { + opacity: 0; + transition: opacity .15s ease-in +} + +.swagger-ui .hide-child:active .child, .swagger-ui .hide-child:focus .child, .swagger-ui .hide-child:hover .child { + opacity: 1; + transition: opacity .15s ease-in +} + +.swagger-ui .underline-hover:focus, .swagger-ui .underline-hover:hover { + text-decoration: underline +} + +.swagger-ui .grow { + -moz-osx-font-smoothing: grayscale; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; + transform: translateZ(0); + transition: transform .25s ease-out +} + + .swagger-ui .grow:focus, .swagger-ui .grow:hover { + transform: scale(1.05) + } + + .swagger-ui .grow:active { + transform: scale(.9) + } + +.swagger-ui .grow-large { + -moz-osx-font-smoothing: grayscale; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; + transform: translateZ(0); + transition: transform .25s ease-in-out +} + + .swagger-ui .grow-large:focus, .swagger-ui .grow-large:hover { + transform: scale(1.2) + } + + .swagger-ui .grow-large:active { + transform: scale(.95) + } + +.swagger-ui .pointer:hover { + cursor: pointer +} + +.swagger-ui .shadow-hover { + cursor: pointer; + position: relative; + transition: all .5s cubic-bezier(.165,.84,.44,1) +} + + .swagger-ui .shadow-hover:after { + border-radius: inherit; + box-shadow: 0 0 16px 2px rgba(0,0,0,.2); + content: ""; + height: 100%; + left: 0; + opacity: 0; + position: absolute; + top: 0; + transition: opacity .5s cubic-bezier(.165,.84,.44,1); + width: 100%; + z-index: -1 + } + + .swagger-ui .shadow-hover:focus:after, .swagger-ui .shadow-hover:hover:after { + opacity: 1 + } + +.swagger-ui .bg-animate, .swagger-ui .bg-animate:focus, .swagger-ui .bg-animate:hover { + transition: background-color .15s ease-in-out +} + +.swagger-ui .z-0 { + z-index: 0 +} + +.swagger-ui .z-1 { + z-index: 1 +} + +.swagger-ui .z-2 { + z-index: 2 +} + +.swagger-ui .z-3 { + z-index: 3 +} + +.swagger-ui .z-4 { + z-index: 4 +} + +.swagger-ui .z-5 { + z-index: 5 +} + +.swagger-ui .z-999 { + z-index: 999 +} + +.swagger-ui .z-9999 { + z-index: 9999 +} + +.swagger-ui .z-max { + z-index: 2147483647 +} + +.swagger-ui .z-inherit { + z-index: inherit +} + +.swagger-ui .z-initial { + z-index: auto +} + +.swagger-ui .z-unset { + z-index: unset +} + +.swagger-ui .nested-copy-line-height ol, .swagger-ui .nested-copy-line-height p, .swagger-ui .nested-copy-line-height ul { + line-height: 1.5 +} + +.swagger-ui .nested-headline-line-height h1, .swagger-ui .nested-headline-line-height h2, .swagger-ui .nested-headline-line-height h3, .swagger-ui .nested-headline-line-height h4, .swagger-ui .nested-headline-line-height h5, .swagger-ui .nested-headline-line-height h6 { + line-height: 1.25 +} + +.swagger-ui .nested-list-reset ol, .swagger-ui .nested-list-reset ul { + list-style-type: none; + margin-left: 0; + padding-left: 0 +} + +.swagger-ui .nested-copy-indent p + p { + margin-bottom: 0; + margin-top: 0; + text-indent: .1em +} + +.swagger-ui .nested-copy-seperator p + p { + margin-top: 1.5em +} + +.swagger-ui .nested-img img { + display: block; + max-width: 100%; + width: 100% +} + +.swagger-ui .nested-links a { + color: #357edd; + transition: color .15s ease-in +} + + .swagger-ui .nested-links a:focus, .swagger-ui .nested-links a:hover { + color: #96ccff; + transition: color .15s ease-in + } + +.swagger-ui .wrapper { + box-sizing: border-box; + margin: 0 auto; + max-width: 1460px; + padding: 0 20px; + width: 100% +} + +.swagger-ui .opblock-tag-section { + display: flex; + flex-direction: column +} + +.swagger-ui .try-out.btn-group { + display: flex; + flex: .1 2 auto; + padding: 0 +} + +.swagger-ui .try-out__btn { + margin-left: 1.25rem +} + +.swagger-ui .opblock-tag { + align-items: center; + border-bottom: 1px solid rgba(59,65,81,.3); + cursor: pointer; + display: flex; + padding: 10px 20px 10px 10px; + transition: all .2s +} + + .swagger-ui .opblock-tag:hover { + background: rgba(0,0,0,.02) + } + +.swagger-ui .opblock-tag { + color: #3b4151; + font-family: sans-serif; + font-size: 24px; + margin: 0 0 5px +} + + .swagger-ui .opblock-tag.no-desc span { + flex: 1 + } + + .swagger-ui .opblock-tag svg { + transition: all .4s + } + + .swagger-ui .opblock-tag small { + color: #3b4151; + flex: 2; + font-family: sans-serif; + font-size: 14px; + font-weight: 400; + padding: 0 10px + } + + .swagger-ui .opblock-tag > div { + flex: 1 1 150px; + font-weight: 400; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap + } + +@media(max-width: 640px) { + .swagger-ui .opblock-tag small, .swagger-ui .opblock-tag > div { + flex: 1 + } +} + +.swagger-ui .opblock-tag .info__externaldocs { + text-align: right +} + +.swagger-ui .parameter__type { + color: #3b4151; + font-family: monospace; + font-size: 12px; + font-weight: 600; + padding: 5px 0 +} + +.swagger-ui .parameter-controls { + margin-top: .75em +} + +.swagger-ui .examples__title { + display: block; + font-size: 1.1em; + font-weight: 700; + margin-bottom: .75em +} + +.swagger-ui .examples__section { + margin-top: 1.5em +} + +.swagger-ui .examples__section-header { + font-size: .9rem; + font-weight: 700; + margin-bottom: .5rem +} + +.swagger-ui .examples-select { + display: inline-block; + margin-bottom: .75em +} + + .swagger-ui .examples-select .examples-select-element { + width: 100% + } + +.swagger-ui .examples-select__section-label { + font-size: .9rem; + font-weight: 700; + margin-right: .5rem +} + +.swagger-ui .example__section { + margin-top: 1.5em +} + +.swagger-ui .example__section-header { + font-size: .9rem; + font-weight: 700; + margin-bottom: .5rem +} + +.swagger-ui .view-line-link { + cursor: pointer; + margin: 0 5px; + position: relative; + top: 3px; + transition: all .5s; + width: 20px +} + +.swagger-ui .opblock { + border: 1px solid #000; + border-radius: 4px; + box-shadow: 0 0 3px rgba(0,0,0,.19); + margin: 0 0 15px +} + + .swagger-ui .opblock .tab-header { + display: flex; + flex: 1 + } + + .swagger-ui .opblock .tab-header .tab-item { + cursor: pointer; + padding: 0 40px + } + + .swagger-ui .opblock .tab-header .tab-item:first-of-type { + padding: 0 40px 0 0 + } + + .swagger-ui .opblock .tab-header .tab-item.active h4 span { + position: relative + } + + .swagger-ui .opblock .tab-header .tab-item.active h4 span:after { + background: gray; + bottom: -15px; + content: ""; + height: 4px; + left: 50%; + position: absolute; + transform: translateX(-50%); + width: 120% + } + + .swagger-ui .opblock.is-open .opblock-summary { + border-bottom: 1px solid #000 + } + + .swagger-ui .opblock .opblock-section-header { + align-items: center; + background: hsla(0,0%,100%,.8); + box-shadow: 0 1px 2px rgba(0,0,0,.1); + display: flex; + min-height: 50px; + padding: 8px 20px + } + + .swagger-ui .opblock .opblock-section-header > label { + align-items: center; + color: #3b4151; + display: flex; + font-family: sans-serif; + font-size: 12px; + font-weight: 700; + margin: 0 0 0 auto + } + + .swagger-ui .opblock .opblock-section-header > label > span { + padding: 0 10px 0 0 + } + + .swagger-ui .opblock .opblock-section-header h4 { + color: #3b4151; + flex: 1; + font-family: sans-serif; + font-size: 14px; + margin: 0 + } + + .swagger-ui .opblock .opblock-summary-method { + background: #000; + border-radius: 3px; + color: #fff; + font-family: sans-serif; + font-size: 14px; + font-weight: 700; + min-width: 80px; + padding: 6px 0; + text-align: center; + text-shadow: 0 1px 0 rgba(0,0,0,.1) + } + + .swagger-ui .opblock .opblock-summary-operation-id, .swagger-ui .opblock .opblock-summary-path, .swagger-ui .opblock .opblock-summary-path__deprecated { + align-items: center; + color: #3b4151; + display: flex; + font-family: monospace; + font-size: 16px; + font-weight: 600; + padding: 0 10px; + word-break: break-word + } + +@media(max-width: 768px) { + .swagger-ui .opblock .opblock-summary-operation-id, .swagger-ui .opblock .opblock-summary-path, .swagger-ui .opblock .opblock-summary-path__deprecated { + font-size: 12px + } +} + +.swagger-ui .opblock .opblock-summary-path { + flex-shrink: 0; + max-width: calc(100% - 110px - 15rem) +} + +@media(max-width: 640px) { + .swagger-ui .opblock .opblock-summary-path { + flex-shrink: 1; + max-width: 100% + } +} + +.swagger-ui .opblock .opblock-summary-path__deprecated { + text-decoration: line-through +} + +.swagger-ui .opblock .opblock-summary-operation-id { + font-size: 14px +} + +.swagger-ui .opblock .opblock-summary-description { + color: #3b4151; + flex: 1 1 auto; + font-family: sans-serif; + font-size: 13px; + word-break: break-word +} + +.swagger-ui .opblock .opblock-summary { + align-items: center; + cursor: pointer; + display: flex; + padding: 5px +} + + .swagger-ui .opblock .opblock-summary .view-line-link { + cursor: pointer; + margin: 0; + position: relative; + top: 2px; + transition: all .5s; + width: 0 + } + + .swagger-ui .opblock .opblock-summary:hover .view-line-link { + margin: 0 5px; + width: 18px + } + + .swagger-ui .opblock .opblock-summary:hover .view-line-link.copy-to-clipboard { + width: 24px + } + +.swagger-ui .opblock.opblock-post { + background: rgba(73,204,144,.1); + border-color: #49cc90 +} + + .swagger-ui .opblock.opblock-post .opblock-summary-method { + background: #49cc90 + } + + .swagger-ui .opblock.opblock-post .opblock-summary { + border-color: #49cc90 + } + + .swagger-ui .opblock.opblock-post .tab-header .tab-item.active h4 span:after { + background: #49cc90 + } + +.swagger-ui .opblock.opblock-put { + background: rgba(252,161,48,.1); + border-color: #fca130 +} + + .swagger-ui .opblock.opblock-put .opblock-summary-method { + background: #fca130 + } + + .swagger-ui .opblock.opblock-put .opblock-summary { + border-color: #fca130 + } + + .swagger-ui .opblock.opblock-put .tab-header .tab-item.active h4 span:after { + background: #fca130 + } + +.swagger-ui .opblock.opblock-delete { + background: rgba(249,62,62,.1); + border-color: #f93e3e +} + + .swagger-ui .opblock.opblock-delete .opblock-summary-method { + background: #f93e3e + } + + .swagger-ui .opblock.opblock-delete .opblock-summary { + border-color: #f93e3e + } + + .swagger-ui .opblock.opblock-delete .tab-header .tab-item.active h4 span:after { + background: #f93e3e + } + +.swagger-ui .opblock.opblock-get { + background: rgba(97,175,254,.1); + border-color: #61affe +} + + .swagger-ui .opblock.opblock-get .opblock-summary-method { + background: #61affe + } + + .swagger-ui .opblock.opblock-get .opblock-summary { + border-color: #61affe + } + + .swagger-ui .opblock.opblock-get .tab-header .tab-item.active h4 span:after { + background: #61affe + } + +.swagger-ui .opblock.opblock-patch { + background: rgba(80,227,194,.1); + border-color: #50e3c2 +} + + .swagger-ui .opblock.opblock-patch .opblock-summary-method { + background: #50e3c2 + } + + .swagger-ui .opblock.opblock-patch .opblock-summary { + border-color: #50e3c2 + } + + .swagger-ui .opblock.opblock-patch .tab-header .tab-item.active h4 span:after { + background: #50e3c2 + } + +.swagger-ui .opblock.opblock-head { + background: rgba(144,18,254,.1); + border-color: #9012fe +} + + .swagger-ui .opblock.opblock-head .opblock-summary-method { + background: #9012fe + } + + .swagger-ui .opblock.opblock-head .opblock-summary { + border-color: #9012fe + } + + .swagger-ui .opblock.opblock-head .tab-header .tab-item.active h4 span:after { + background: #9012fe + } + +.swagger-ui .opblock.opblock-options { + background: rgba(13,90,167,.1); + border-color: #0d5aa7 +} + + .swagger-ui .opblock.opblock-options .opblock-summary-method { + background: #0d5aa7 + } + + .swagger-ui .opblock.opblock-options .opblock-summary { + border-color: #0d5aa7 + } + + .swagger-ui .opblock.opblock-options .tab-header .tab-item.active h4 span:after { + background: #0d5aa7 + } + +.swagger-ui .opblock.opblock-deprecated { + background: hsla(0,0%,92%,.1); + border-color: #ebebeb; + opacity: .6 +} + + .swagger-ui .opblock.opblock-deprecated .opblock-summary-method { + background: #ebebeb + } + + .swagger-ui .opblock.opblock-deprecated .opblock-summary { + border-color: #ebebeb + } + + .swagger-ui .opblock.opblock-deprecated .tab-header .tab-item.active h4 span:after { + background: #ebebeb + } + +.swagger-ui .opblock .opblock-schemes { + padding: 8px 20px +} + + .swagger-ui .opblock .opblock-schemes .schemes-title { + padding: 0 10px 0 0 + } + +.swagger-ui .filter .operation-filter-input { + border: 2px solid #d8dde7; + margin: 20px 0; + padding: 10px; + width: 100% +} + +.swagger-ui .download-url-wrapper .failed, .swagger-ui .filter .failed { + color: red +} + +.swagger-ui .download-url-wrapper .loading, .swagger-ui .filter .loading { + color: #aaa +} + +.swagger-ui .model-example { + margin-top: 1em +} + +.swagger-ui .tab { + display: flex; + list-style: none; + padding: 0 +} + + .swagger-ui .tab li { + color: #3b4151; + cursor: pointer; + font-family: sans-serif; + font-size: 12px; + min-width: 60px; + padding: 0 + } + + .swagger-ui .tab li:first-of-type { + padding-left: 0; + padding-right: 12px; + position: relative + } + + .swagger-ui .tab li:first-of-type:after { + background: rgba(0,0,0,.2); + content: ""; + height: 100%; + position: absolute; + right: 6px; + top: 0; + width: 1px + } + + .swagger-ui .tab li.active { + font-weight: 700 + } + + .swagger-ui .tab li button.tablinks { + background: none; + border: 0; + color: inherit; + font-family: inherit; + font-weight: inherit; + padding: 0 + } + +.swagger-ui .opblock-description-wrapper, .swagger-ui .opblock-external-docs-wrapper, .swagger-ui .opblock-title_normal { + color: #3b4151; + font-family: sans-serif; + font-size: 12px; + margin: 0 0 5px; + padding: 15px 20px +} + + .swagger-ui .opblock-description-wrapper h4, .swagger-ui .opblock-external-docs-wrapper h4, .swagger-ui .opblock-title_normal h4 { + color: #3b4151; + font-family: sans-serif; + font-size: 12px; + margin: 0 0 5px + } + + .swagger-ui .opblock-description-wrapper p, .swagger-ui .opblock-external-docs-wrapper p, .swagger-ui .opblock-title_normal p { + color: #3b4151; + font-family: sans-serif; + font-size: 14px; + margin: 0 + } + + .swagger-ui .opblock-external-docs-wrapper h4 { + padding-left: 0 + } + +.swagger-ui .execute-wrapper { + padding: 20px; + text-align: right +} + + .swagger-ui .execute-wrapper .btn { + padding: 8px 40px; + width: 100% + } + +.swagger-ui .body-param-options { + display: flex; + flex-direction: column +} + + .swagger-ui .body-param-options .body-param-edit { + padding: 10px 0 + } + + .swagger-ui .body-param-options label { + padding: 8px 0 + } + + .swagger-ui .body-param-options label select { + margin: 3px 0 0 + } + +.swagger-ui .responses-inner { + padding: 20px +} + + .swagger-ui .responses-inner h4, .swagger-ui .responses-inner h5 { + color: #3b4151; + font-family: sans-serif; + font-size: 12px; + margin: 10px 0 5px + } + + .swagger-ui .responses-inner .curl { + white-space: normal + } + +.swagger-ui .response-col_status { + color: #3b4151; + font-family: sans-serif; + font-size: 14px +} + + .swagger-ui .response-col_status .response-undocumented { + color: #909090; + font-family: monospace; + font-size: 11px; + font-weight: 600 + } + +.swagger-ui .response-col_links { + color: #3b4151; + font-family: sans-serif; + font-size: 14px; + max-width: 40em; + padding-left: 2em +} + + .swagger-ui .response-col_links .response-undocumented { + color: #909090; + font-family: monospace; + font-size: 11px; + font-weight: 600 + } + + .swagger-ui .response-col_links .operation-link { + margin-bottom: 1.5em + } + + .swagger-ui .response-col_links .operation-link .description { + margin-bottom: .5em + } + +.swagger-ui .opblock-body .opblock-loading-animation { + display: block; + margin: 3em auto +} + +.swagger-ui .opblock-body pre.microlight { + word-wrap: break-word; + background: #333; + border-radius: 4px; + color: #fff; + font-family: monospace; + font-size: 12px; + font-weight: 600; + -webkit-hyphens: auto; + hyphens: auto; + margin: 0; + padding: 10px; + white-space: pre-wrap; + word-break: break-all; + word-break: break-word +} + + .swagger-ui .opblock-body pre.microlight .headerline { + display: block + } + +.swagger-ui .highlight-code { + position: relative +} + + .swagger-ui .highlight-code > .microlight { + max-height: 400px; + min-height: 6em; + overflow-y: auto + } + + .swagger-ui .highlight-code > .microlight code { + white-space: pre-wrap !important; + word-break: break-all + } + +.swagger-ui .curl-command { + position: relative +} + +.swagger-ui .download-contents { + align-items: center; + background: #7d8293; + border-radius: 4px; + bottom: 10px; + color: #fff; + cursor: pointer; + display: flex; + font-family: sans-serif; + font-size: 14px; + font-weight: 600; + height: 30px; + justify-content: center; + padding: 5px; + position: absolute; + right: 10px; + text-align: center +} + +.swagger-ui .scheme-container { + background: #fff; + box-shadow: 0 1px 2px 0 rgba(0,0,0,.15); + margin: 0 0 20px; + padding: 30px 0 +} + + .swagger-ui .scheme-container .schemes { + align-items: flex-end; + display: flex + } + + .swagger-ui .scheme-container .schemes > label { + color: #3b4151; + display: flex; + flex-direction: column; + font-family: sans-serif; + font-size: 12px; + font-weight: 700; + margin: -20px 15px 0 0 + } + + .swagger-ui .scheme-container .schemes > label select { + min-width: 130px; + text-transform: uppercase + } + +.swagger-ui .loading-container { + align-items: center; + display: flex; + flex-direction: column; + justify-content: center; + margin-top: 1em; + min-height: 1px; + padding: 40px 0 60px +} + + .swagger-ui .loading-container .loading { + position: relative + } + + .swagger-ui .loading-container .loading:after { + color: #3b4151; + content: "loading"; + font-family: sans-serif; + font-size: 10px; + font-weight: 700; + left: 50%; + position: absolute; + text-transform: uppercase; + top: 50%; + transform: translate(-50%,-50%) + } + + .swagger-ui .loading-container .loading:before { + -webkit-animation: rotation 1s linear infinite,opacity .5s; + animation: rotation 1s linear infinite,opacity .5s; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; + border: 2px solid rgba(85,85,85,.1); + border-radius: 100%; + border-top-color: rgba(0,0,0,.6); + content: ""; + display: block; + height: 60px; + left: 50%; + margin: -30px; + opacity: 1; + position: absolute; + top: 50%; + width: 60px + } + +@-webkit-keyframes rotation { + to { + transform: rotate(1turn) + } +} + +@keyframes rotation { + to { + transform: rotate(1turn) + } +} + +.swagger-ui .response-controls { + display: flex; + padding-top: 1em +} + +.swagger-ui .response-control-media-type { + margin-right: 1em +} + +.swagger-ui .response-control-media-type--accept-controller select { + border-color: #196619 +} + +.swagger-ui .response-control-media-type__accept-message { + color: #196619; + font-size: .7em +} + +.swagger-ui .response-control-examples__title, .swagger-ui .response-control-media-type__title { + display: block; + font-size: .7em; + margin-bottom: .2em +} + +@-webkit-keyframes blinker { + 50% { + opacity: 0 + } +} + +@keyframes blinker { + 50% { + opacity: 0 + } +} + +.swagger-ui .hidden { + display: none +} + +.swagger-ui .no-margin { + border: none; + height: auto; + margin: 0; + padding: 0 +} + +.swagger-ui .float-right { + float: right +} + +.swagger-ui .svg-assets { + height: 0; + position: absolute; + width: 0 +} + +.swagger-ui section h3 { + color: #3b4151; + font-family: sans-serif +} + +.swagger-ui a.nostyle { + display: inline +} + + .swagger-ui a.nostyle, .swagger-ui a.nostyle:visited { + color: inherit; + cursor: pointer; + text-decoration: inherit + } + +.swagger-ui .fallback { + color: #aaa; + padding: 1em +} + +.swagger-ui .version-pragma { + height: 100%; + padding: 5em 0 +} + +.swagger-ui .version-pragma__message { + display: flex; + font-size: 1.2em; + height: 100%; + justify-content: center; + line-height: 1.5em; + padding: 0 .6em; + text-align: center +} + + .swagger-ui .version-pragma__message > div { + flex: 1; + max-width: 55ch + } + + .swagger-ui .version-pragma__message code { + background-color: #dedede; + padding: 4px 4px 2px; + white-space: pre + } + +.swagger-ui .opblock-link { + font-weight: 400 +} + + .swagger-ui .opblock-link.shown { + font-weight: 700 + } + +.swagger-ui span.token-string { + color: #555 +} + +.swagger-ui span.token-not-formatted { + color: #555; + font-weight: 700 +} + +.swagger-ui .btn { + background: transparent; + border: 2px solid gray; + border-radius: 4px; + box-shadow: 0 1px 2px rgba(0,0,0,.1); + color: #3b4151; + font-family: sans-serif; + font-size: 14px; + font-weight: 700; + padding: 5px 23px; + transition: all .3s +} + + .swagger-ui .btn.btn-sm { + font-size: 12px; + padding: 4px 23px + } + + .swagger-ui .btn[disabled] { + cursor: not-allowed; + opacity: .3 + } + + .swagger-ui .btn:hover { + box-shadow: 0 0 5px rgba(0,0,0,.3) + } + + .swagger-ui .btn.cancel { + background-color: transparent; + border-color: #ff6060; + color: #ff6060; + font-family: sans-serif + } + + .swagger-ui .btn.authorize { + background-color: transparent; + border-color: #49cc90; + color: #49cc90; + display: inline; + line-height: 1 + } + + .swagger-ui .btn.authorize span { + float: left; + padding: 4px 20px 0 0 + } + + .swagger-ui .btn.authorize svg { + fill: #49cc90 + } + + .swagger-ui .btn.execute { + background-color: #4990e2; + border-color: #4990e2; + color: #fff + } + +.swagger-ui .btn-group { + display: flex; + padding: 30px +} + + .swagger-ui .btn-group .btn { + flex: 1 + } + + .swagger-ui .btn-group .btn:first-child { + border-radius: 4px 0 0 4px + } + + .swagger-ui .btn-group .btn:last-child { + border-radius: 0 4px 4px 0 + } + +.swagger-ui .authorization__btn { + background: none; + border: none; + padding: 0 0 0 10px +} + + .swagger-ui .authorization__btn.locked { + opacity: 1 + } + + .swagger-ui .authorization__btn.unlocked { + opacity: .4 + } + +.swagger-ui .model-box-control, .swagger-ui .models-control, .swagger-ui .opblock-summary-control { + all: inherit; + border-bottom: 0; + cursor: pointer; + flex: 1; + padding: 0 +} + + .swagger-ui .model-box-control:focus, .swagger-ui .models-control:focus, .swagger-ui .opblock-summary-control:focus { + outline-color: #62a03f; + outline-style: solid; + outline-width: 1px; + outline-offset: 2px; + } + +.swagger-ui .expand-methods, .swagger-ui .expand-operation { + background: none; + border: none +} + + .swagger-ui .expand-methods svg, .swagger-ui .expand-operation svg { + height: 20px; + width: 20px + } + +.swagger-ui .expand-methods { + padding: 0 10px +} + + .swagger-ui .expand-methods:hover svg { + fill: #404040 + } + + .swagger-ui .expand-methods svg { + fill: #707070; + transition: all .3s + } + +.swagger-ui button { + cursor: pointer +} + + .swagger-ui button.invalid { + -webkit-animation: shake .4s 1; + animation: shake .4s 1; + background: #feebeb; + border-color: #f93e3e + } + +.swagger-ui .copy-to-clipboard { + align-items: center; + background: #7d8293; + border: none; + border-radius: 4px; + bottom: 10px; + display: flex; + height: 30px; + justify-content: center; + position: absolute; + right: 100px; + width: 30px +} + + .swagger-ui .copy-to-clipboard button { + background: url("data:image/svg+xml;charset=utf-8,") 50% no-repeat; + border: none; + flex-grow: 1; + flex-shrink: 1; + height: 25px + } + +.swagger-ui .curl-command .copy-to-clipboard { + bottom: 5px; + height: 20px; + right: 10px; + width: 20px +} + + .swagger-ui .curl-command .copy-to-clipboard button { + height: 18px + } + +.swagger-ui .opblock .opblock-summary .view-line-link.copy-to-clipboard { + height: 26px; + position: unset +} + +.swagger-ui select { + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + background: #f7f7f7 url("data:image/svg+xml;charset=utf-8,") right 10px center no-repeat; + background-size: 20px; + border: 2px solid #41444e; + border-radius: 4px; + box-shadow: 0 1px 2px 0 rgba(0,0,0,.25); + color: #3b4151; + font-family: sans-serif; + font-size: 14px; + font-weight: 700; + padding: 5px 40px 5px 10px +} + + .swagger-ui select[multiple] { + background: #f7f7f7; + margin: 5px 0; + padding: 5px + } + + .swagger-ui select.invalid { + -webkit-animation: shake .4s 1; + animation: shake .4s 1; + background: #feebeb; + border-color: #f93e3e + } + +.swagger-ui .opblock-body select { + min-width: 230px +} + +@media(max-width: 768px) { + .swagger-ui .opblock-body select { + min-width: 180px + } +} + +@media(max-width: 640px) { + .swagger-ui .opblock-body select { + min-width: 100%; + width: 100% + } +} + +.swagger-ui label { + color: #3b4151; + font-family: sans-serif; + font-size: 12px; + font-weight: 700; + margin: 0 0 5px +} + +.swagger-ui input[type=email], .swagger-ui input[type=file], .swagger-ui input[type=password], .swagger-ui input[type=search], .swagger-ui input[type=text] { + line-height: 1 +} + +@media(max-width: 768px) { + .swagger-ui input[type=email], .swagger-ui input[type=file], .swagger-ui input[type=password], .swagger-ui input[type=search], .swagger-ui input[type=text] { + max-width: 175px + } +} + +.swagger-ui input[type=email], .swagger-ui input[type=file], .swagger-ui input[type=password], .swagger-ui input[type=search], .swagger-ui input[type=text], .swagger-ui textarea { + background: #fff; + border: 1px solid #d9d9d9; + border-radius: 4px; + margin: 5px 0; + min-width: 100px; + padding: 8px 10px +} + + .swagger-ui input[type=email].invalid, .swagger-ui input[type=file].invalid, .swagger-ui input[type=password].invalid, .swagger-ui input[type=search].invalid, .swagger-ui input[type=text].invalid, .swagger-ui textarea.invalid { + -webkit-animation: shake .4s 1; + animation: shake .4s 1; + background: #feebeb; + border-color: #f93e3e + } + + .swagger-ui input[disabled], .swagger-ui select[disabled], .swagger-ui textarea[disabled] { + background-color: #fafafa; + color: #888; + cursor: not-allowed + } + +.swagger-ui select[disabled] { + border-color: #888 +} + +.swagger-ui textarea[disabled] { + background-color: #41444e; + color: #fff +} + +@-webkit-keyframes shake { + 10%,90% { + transform: translate3d(-1px,0,0) + } + + 20%,80% { + transform: translate3d(2px,0,0) + } + + 30%,50%,70% { + transform: translate3d(-4px,0,0) + } + + 40%,60% { + transform: translate3d(4px,0,0) + } +} + +@keyframes shake { + 10%,90% { + transform: translate3d(-1px,0,0) + } + + 20%,80% { + transform: translate3d(2px,0,0) + } + + 30%,50%,70% { + transform: translate3d(-4px,0,0) + } + + 40%,60% { + transform: translate3d(4px,0,0) + } +} + +.swagger-ui textarea { + background: hsla(0,0%,100%,.8); + border: none; + border-radius: 4px; + color: #3b4151; + font-family: monospace; + font-size: 12px; + font-weight: 600; + min-height: 280px; + outline: none; + padding: 10px; + width: 100% +} + + .swagger-ui textarea:focus { + border: 2px solid #61affe + } + + .swagger-ui textarea.curl { + background: #41444e; + border-radius: 4px; + color: #fff; + font-family: monospace; + font-size: 12px; + font-weight: 600; + margin: 0; + min-height: 100px; + padding: 10px; + resize: none + } + +.swagger-ui .checkbox { + color: #303030; + padding: 5px 0 10px; + transition: opacity .5s +} + + .swagger-ui .checkbox label { + display: flex + } + + .swagger-ui .checkbox p { + color: #3b4151; + font-family: monospace; + font-style: italic; + font-weight: 400 !important; + font-weight: 600; + margin: 0 !important + } + + .swagger-ui .checkbox input[type=checkbox] { + display: none + } + + .swagger-ui .checkbox input[type=checkbox] + label > .item { + background: #e8e8e8; + border-radius: 1px; + box-shadow: 0 0 0 2px #e8e8e8; + cursor: pointer; + display: inline-block; + flex: none; + height: 16px; + margin: 0 8px 0 0; + padding: 5px; + position: relative; + top: 3px; + width: 16px + } + + .swagger-ui .checkbox input[type=checkbox] + label > .item:active { + transform: scale(.9) + } + + .swagger-ui .checkbox input[type=checkbox]:checked + label > .item { + background: #e8e8e8 url("data:image/svg+xml;charset=utf-8,") 50% no-repeat + } + +.swagger-ui .dialog-ux { + bottom: 0; + left: 0; + position: fixed; + right: 0; + top: 0; + z-index: 9999 +} + + .swagger-ui .dialog-ux .backdrop-ux { + background: rgba(0,0,0,.8); + bottom: 0; + left: 0; + position: fixed; + right: 0; + top: 0 + } + + .swagger-ui .dialog-ux .modal-ux { + background: #fff; + border: 1px solid #ebebeb; + border-radius: 4px; + box-shadow: 0 10px 30px 0 rgba(0,0,0,.2); + left: 50%; + max-width: 650px; + min-width: 300px; + position: absolute; + top: 50%; + transform: translate(-50%,-50%); + width: 100%; + z-index: 9999 + } + + .swagger-ui .dialog-ux .modal-ux-content { + max-height: 540px; + overflow-y: auto; + padding: 20px + } + + .swagger-ui .dialog-ux .modal-ux-content p { + color: #41444e; + color: #3b4151; + font-family: sans-serif; + font-size: 12px; + margin: 0 0 5px + } + + .swagger-ui .dialog-ux .modal-ux-content h4 { + color: #3b4151; + font-family: sans-serif; + font-size: 18px; + font-weight: 600; + margin: 15px 0 0 + } + + .swagger-ui .dialog-ux .modal-ux-header { + align-items: center; + border-bottom: 1px solid #ebebeb; + display: flex; + padding: 12px 0 + } + + .swagger-ui .dialog-ux .modal-ux-header .close-modal { + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + background: none; + border: none; + padding: 0 10px + } + + .swagger-ui .dialog-ux .modal-ux-header h3 { + color: #3b4151; + flex: 1; + font-family: sans-serif; + font-size: 20px; + font-weight: 600; + margin: 0; + padding: 0 20px + } + +.swagger-ui .model { + color: #3b4151; + font-family: monospace; + font-size: 12px; + font-weight: 300; + font-weight: 600 +} + + .swagger-ui .model .deprecated span, .swagger-ui .model .deprecated td { + color: #a0a0a0 !important + } + + .swagger-ui .model .deprecated > td:first-of-type { + text-decoration: line-through + } + +.swagger-ui .model-toggle { + cursor: pointer; + display: inline-block; + font-size: 10px; + margin: auto .3em; + position: relative; + top: 6px; + transform: rotate(90deg); + transform-origin: 50% 50%; + transition: transform .15s ease-in +} + + .swagger-ui .model-toggle.collapsed { + transform: rotate(0deg) + } + + .swagger-ui .model-toggle:after { + background: url("data:image/svg+xml;charset=utf-8,") 50% no-repeat; + background-size: 100%; + content: ""; + display: block; + height: 20px; + width: 20px + } + +.swagger-ui .model-jump-to-path { + cursor: pointer; + position: relative +} + + .swagger-ui .model-jump-to-path .view-line-link { + cursor: pointer; + position: absolute; + top: -.4em + } + +.swagger-ui .model-title { + position: relative +} + + .swagger-ui .model-title:hover .model-hint { + visibility: visible + } + +.swagger-ui .model-hint { + background: rgba(0,0,0,.7); + border-radius: 4px; + color: #ebebeb; + padding: .1em .5em; + position: absolute; + top: -1.8em; + visibility: hidden; + white-space: nowrap +} + +.swagger-ui .model p { + margin: 0 0 1em +} + +.swagger-ui .model .property { + color: #999; + font-style: italic +} + + .swagger-ui .model .property.primitive { + color: #6b6b6b + } + +.swagger-ui .model .external-docs, .swagger-ui table.model tr.description { + color: #666; + font-weight: 400 +} + + .swagger-ui table.model tr.description td:first-child, .swagger-ui table.model tr.property-row.required td:first-child { + font-weight: 700 + } + +.swagger-ui table.model tr.property-row td { + vertical-align: top +} + + .swagger-ui table.model tr.property-row td:first-child { + padding-right: .2em + } + +.swagger-ui table.model tr.property-row .star { + color: red +} + +.swagger-ui table.model tr.extension { + color: #777 +} + + .swagger-ui table.model tr.extension td:last-child { + vertical-align: top + } + +.swagger-ui table.model tr.external-docs td:first-child { + font-weight: 700 +} + +.swagger-ui table.model tr .renderedMarkdown p:first-child { + margin-top: 0 +} + +.swagger-ui section.models { + border: 1px solid rgba(59,65,81,.3); + border-radius: 4px; + margin: 30px 0 +} + + .swagger-ui section.models .pointer { + cursor: pointer + } + + .swagger-ui section.models.is-open { + padding: 0 0 20px + } + + .swagger-ui section.models.is-open h4 { + border-bottom: 1px solid rgba(59,65,81,.3); + margin: 0 0 5px + } + + .swagger-ui section.models h4 { + align-items: center; + color: #606060; + cursor: pointer; + display: flex; + font-family: sans-serif; + font-size: 16px; + margin: 0; + padding: 10px 20px 10px 10px; + transition: all .2s + } + + .swagger-ui section.models h4 svg { + transition: all .4s + } + + .swagger-ui section.models h4 span { + flex: 1 + } + + .swagger-ui section.models h4:hover { + background: rgba(0,0,0,.02) + } + + .swagger-ui section.models h5 { + color: #707070; + font-family: sans-serif; + font-size: 16px; + margin: 0 0 10px + } + + .swagger-ui section.models .model-jump-to-path { + position: relative; + top: 5px + } + + .swagger-ui section.models .model-container { + background: rgba(0,0,0,.05); + border-radius: 4px; + margin: 0 20px 15px; + position: relative; + transition: all .5s + } + + .swagger-ui section.models .model-container:hover { + background: rgba(0,0,0,.07) + } + + .swagger-ui section.models .model-container:first-of-type { + margin: 20px + } + + .swagger-ui section.models .model-container:last-of-type { + margin: 0 20px + } + + .swagger-ui section.models .model-container .models-jump-to-path { + opacity: .65; + position: absolute; + right: 5px; + top: 8px + } + + .swagger-ui section.models .model-box { + background: none + } + +.swagger-ui .model-box { + background: rgba(0,0,0,.1); + border-radius: 4px; + display: inline-block; + padding: 10px +} + + .swagger-ui .model-box .model-jump-to-path { + position: relative; + top: 4px + } + + .swagger-ui .model-box.deprecated { + opacity: .5 + } + +.swagger-ui .model-title { + color: #505050; + font-family: sans-serif; + font-size: 16px +} + + .swagger-ui .model-title img { + bottom: 0; + margin-left: 1em; + position: relative + } + +.swagger-ui .model-deprecated-warning { + color: #f93e3e; + font-family: sans-serif; + font-size: 16px; + font-weight: 600; + margin-right: 1em +} + +.swagger-ui span > span.model .brace-close { + padding: 0 0 0 10px +} + +.swagger-ui .prop-name { + display: inline-block; + margin-right: 1em +} + +.swagger-ui .prop-type { + color: #55a +} + +.swagger-ui .prop-enum { + display: block +} + +.swagger-ui .prop-format { + color: #606060 +} + +.swagger-ui .servers > label { + color: #3b4151; + font-family: sans-serif; + font-size: 12px; + margin: -20px 15px 0 0 +} + + .swagger-ui .servers > label select { + max-width: 100%; + min-width: 130px; + width: 100% + } + +.swagger-ui .servers h4.message { + padding-bottom: 2em +} + +.swagger-ui .servers table tr { + width: 30em +} + +.swagger-ui .servers table td { + display: inline-block; + max-width: 15em; + padding-bottom: 10px; + padding-top: 10px; + vertical-align: middle +} + + .swagger-ui .servers table td:first-of-type { + padding-right: 1em + } + + .swagger-ui .servers table td input { + height: 100%; + width: 100% + } + +.swagger-ui .servers .computed-url { + margin: 2em 0 +} + + .swagger-ui .servers .computed-url code { + display: inline-block; + font-size: 16px; + margin: 0 1em; + padding: 4px + } + +.swagger-ui .servers-title { + font-size: 12px; + font-weight: 700 +} + +.swagger-ui .operation-servers h4.message { + margin-bottom: 2em +} + +.swagger-ui table { + border-collapse: collapse; + padding: 0 10px; + width: 100% +} + + .swagger-ui table.model tbody tr td { + padding: 0; + vertical-align: top + } + + .swagger-ui table.model tbody tr td:first-of-type { + padding: 0 0 0 2em; + width: 174px + } + + .swagger-ui table.headers td { + color: #3b4151; + font-family: monospace; + font-size: 12px; + font-weight: 300; + font-weight: 600; + vertical-align: middle + } + + .swagger-ui table.headers .header-example { + color: #999; + font-style: italic + } + + .swagger-ui table tbody tr td { + padding: 10px 0 0; + vertical-align: top + } + + .swagger-ui table tbody tr td:first-of-type { + min-width: 6em; + padding: 10px 0 + } + + .swagger-ui table thead tr td, .swagger-ui table thead tr th { + border-bottom: 1px solid rgba(59,65,81,.2); + color: #3b4151; + font-family: sans-serif; + font-size: 12px; + font-weight: 700; + padding: 12px 0; + text-align: left + } + +.swagger-ui .parameters-col_description { + margin-bottom: 2em; + width: 99% +} + + .swagger-ui .parameters-col_description input { + max-width: 340px; + width: 100% + } + + .swagger-ui .parameters-col_description select { + border-width: 1px + } + + .swagger-ui .parameters-col_description .markdown p { + margin: 0 + } + +.swagger-ui .parameter__name { + color: #3b4151; + font-family: sans-serif; + font-size: 16px; + font-weight: 400; + margin-right: .75em +} + + .swagger-ui .parameter__name.required { + font-weight: 700 + } + + .swagger-ui .parameter__name.required span { + color: red + } + + .swagger-ui .parameter__name.required:after { + color: rgba(255,0,0,.6); + content: "required"; + font-size: 10px; + padding: 5px; + position: relative; + top: -6px + } + +.swagger-ui .parameter__extension, .swagger-ui .parameter__in { + color: gray; + font-family: monospace; + font-size: 12px; + font-style: italic; + font-weight: 600 +} + +.swagger-ui .parameter__deprecated { + color: red; + font-family: monospace; + font-size: 12px; + font-style: italic; + font-weight: 600 +} + +.swagger-ui .parameter__empty_value_toggle { + display: block; + font-size: 13px; + padding-bottom: 12px; + padding-top: 5px +} + + .swagger-ui .parameter__empty_value_toggle input { + margin-right: 7px + } + + .swagger-ui .parameter__empty_value_toggle.disabled { + opacity: .7 + } + +.swagger-ui .table-container { + padding: 20px +} + +.swagger-ui .response-col_description { + width: 99% +} + + .swagger-ui .response-col_description .markdown p { + margin: 0 + } + +.swagger-ui .response-col_links { + min-width: 6em +} + +.swagger-ui .response__extension { + color: gray; + font-family: monospace; + font-size: 12px; + font-style: italic; + font-weight: 600 +} + +.swagger-ui .topbar { + background-color: #1b1b1b; + padding: 10px 0 +} + + .swagger-ui .topbar .topbar-wrapper, .swagger-ui .topbar a { + align-items: center; + display: flex + } + + .swagger-ui .topbar a { + color: #fff; + flex: 1; + font-family: sans-serif; + font-size: 1.5em; + font-weight: 700; + max-width: 300px; + text-decoration: none + } + + .swagger-ui .topbar a span { + margin: 0; + padding: 0 10px + } + + .swagger-ui .topbar .download-url-wrapper { + display: flex; + flex: 3; + justify-content: flex-end + } + + .swagger-ui .topbar .download-url-wrapper input[type=text] { + border: 2px solid #62a03f; + border-radius: 4px 0 0 4px; + margin: 0; + outline: none; + width: 100% + } + + .swagger-ui .topbar .download-url-wrapper .select-label { + align-items: center; + color: #f0f0f0; + display: flex; + margin: 0; + max-width: 600px; + width: 100% + } + + .swagger-ui .topbar .download-url-wrapper .select-label span { + flex: 1; + font-size: 16px; + padding: 0 10px 0 0; + text-align: right + } + + .swagger-ui .topbar .download-url-wrapper .select-label select { + border: 2px solid #62a03f; + box-shadow: none; + flex: 2; + outline: none; + width: 100% + } + + .swagger-ui .topbar .download-url-wrapper .download-url-button { + background: #62a03f; + border: none; + border-radius: 0 4px 4px 0; + color: #fff; + font-family: sans-serif; + font-size: 16px; + font-weight: 700; + padding: 4px 30px + } + +.swagger-ui .info { + margin: 50px 0 +} + + .swagger-ui .info.failed-config { + margin-left: auto; + margin-right: auto; + max-width: 880px; + text-align: center + } + + .swagger-ui .info hgroup.main { + margin: 0 0 20px + } + + .swagger-ui .info hgroup.main a { + font-size: 12px + } + + .swagger-ui .info pre { + font-size: 14px + } + + .swagger-ui .info li, .swagger-ui .info p, .swagger-ui .info table { + color: #3b4151; + font-family: sans-serif; + font-size: 14px + } + + .swagger-ui .info h1, .swagger-ui .info h2, .swagger-ui .info h3, .swagger-ui .info h4, .swagger-ui .info h5 { + color: #3b4151; + font-family: sans-serif + } + + .swagger-ui .info a { + color: #4990e2; + font-family: sans-serif; + font-size: 14px; + transition: all .4s + } + + .swagger-ui .info a:hover { + color: #1f69c0 + } + + .swagger-ui .info > div { + margin: 0 0 5px + } + + .swagger-ui .info .base-url { + color: #3b4151; + font-family: monospace; + font-size: 12px; + font-weight: 300 !important; + font-weight: 600; + margin: 0 + } + + .swagger-ui .info .title { + color: #62a03f; + font-family: sans-serif; + font-size: 36px; + margin: 0 + } + + .swagger-ui .info .title small { + background: #7d8492; + border-radius: 57px; + display: inline-block; + font-size: 10px; + margin: 0 0 0 5px; + padding: 2px 4px; + position: relative; + top: -5px; + vertical-align: super + } + + .swagger-ui .info .title small.version-stamp { + background-color: #89bf04 + } + + .swagger-ui .info .title small pre { + color: #fff; + font-family: sans-serif; + margin: 0; + padding: 0 + } + +.swagger-ui .auth-btn-wrapper { + display: flex; + justify-content: center; + padding: 10px 0 +} + + .swagger-ui .auth-btn-wrapper .btn-done { + margin-right: 1em + } + +.swagger-ui .auth-wrapper { + display: flex; + flex: 1; + justify-content: flex-end +} + + .swagger-ui .auth-wrapper .authorize { + margin-left: 10px; + margin-right: 10px; + padding-right: 20px + } + +.swagger-ui .auth-container { + border-bottom: 1px solid #ebebeb; + margin: 0 0 10px; + padding: 10px 20px +} + + .swagger-ui .auth-container:last-of-type { + border: 0; + margin: 0; + padding: 10px 20px + } + + .swagger-ui .auth-container h4 { + margin: 5px 0 15px !important + } + + .swagger-ui .auth-container .wrapper { + margin: 0; + padding: 0 + } + + .swagger-ui .auth-container input[type=password], .swagger-ui .auth-container input[type=text] { + min-width: 230px + } + + .swagger-ui .auth-container .errors { + background-color: #fee; + border-radius: 4px; + color: red; + color: #3b4151; + font-family: monospace; + font-size: 12px; + font-weight: 600; + margin: 1em; + padding: 10px + } + + .swagger-ui .auth-container .errors b { + margin-right: 1em; + text-transform: capitalize + } + +.swagger-ui .scopes h2 { + color: #3b4151; + font-family: sans-serif; + font-size: 14px +} + + .swagger-ui .scopes h2 a { + color: #4990e2; + cursor: pointer; + font-size: 12px; + padding-left: 10px; + text-decoration: underline + } + +.swagger-ui .scope-def { + padding: 0 0 20px +} + +.swagger-ui .errors-wrapper { + -webkit-animation: scaleUp .5s; + animation: scaleUp .5s; + background: rgba(249,62,62,.1); + border: 2px solid #f93e3e; + border-radius: 4px; + margin: 20px; + padding: 10px 20px +} + + .swagger-ui .errors-wrapper .error-wrapper { + margin: 0 0 10px + } + + .swagger-ui .errors-wrapper .errors h4 { + color: #3b4151; + font-family: monospace; + font-size: 14px; + font-weight: 600; + margin: 0 + } + + .swagger-ui .errors-wrapper .errors small { + color: #606060 + } + + .swagger-ui .errors-wrapper .errors .message { + white-space: pre-line + } + + .swagger-ui .errors-wrapper .errors .message.thrown { + max-width: 100% + } + + .swagger-ui .errors-wrapper .errors .error-line { + cursor: pointer; + text-decoration: underline + } + + .swagger-ui .errors-wrapper hgroup { + align-items: center; + display: flex + } + + .swagger-ui .errors-wrapper hgroup h4 { + color: #3b4151; + flex: 1; + font-family: sans-serif; + font-size: 20px; + margin: 0 + } + +@-webkit-keyframes scaleUp { + 0% { + opacity: 0; + transform: scale(.8) + } + + to { + opacity: 1; + transform: scale(1) + } +} + +@keyframes scaleUp { + 0% { + opacity: 0; + transform: scale(.8) + } + + to { + opacity: 1; + transform: scale(1) + } +} + +.swagger-ui .Resizer.vertical.disabled { + display: none +} + +.swagger-ui .markdown p, .swagger-ui .markdown pre, .swagger-ui .renderedMarkdown p, .swagger-ui .renderedMarkdown pre { + margin: 1em auto; + word-break: break-all; + word-break: break-word +} + +.swagger-ui .markdown pre, .swagger-ui .renderedMarkdown pre { + background: none; + color: #000; + font-weight: 400; + padding: 0; + white-space: pre-wrap +} + +.swagger-ui .markdown code, .swagger-ui .renderedMarkdown code { + background: rgba(0,0,0,.05); + border-radius: 4px; + color: #9012fe; + font-family: monospace; + font-size: 14px; + font-weight: 600; + padding: 5px 7px +} + +.swagger-ui .markdown pre > code, .swagger-ui .renderedMarkdown pre > code { + display: block +} diff --git a/src/Atc.Rest.ApiGenerator.Framework/Resources/wwwroot/swagger-ui/SwaggerLight.css.bak b/src/Atc.Rest.ApiGenerator.Framework/Resources/wwwroot/swagger-ui/SwaggerLight.css.bak new file mode 100644 index 00000000..f1674c18 --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.Framework/Resources/wwwroot/swagger-ui/SwaggerLight.css.bak @@ -0,0 +1,1346 @@ +/* Inject clean Swagger Image */ +.topbar-wrapper .link { + background: url(swagger.png); + background-size: contain; + height: 22px; + width: 220px; + background-repeat: no-repeat; + flex: none !important; +} + +/* Remove Existing Swagger/SmartBear image */ +.topbar-wrapper .link img, .topbar-wrapper .link span { + display: none; +} + + +/* Light Mode */ +a { + color: #8c8cfa; +} + +::-webkit-scrollbar-track-piece { + background-color: rgba(247, 247, 247, .2) !important; +} + +::-webkit-scrollbar-track { + background-color: rgba(247, 247, 247, .3) !important; +} + +::-webkit-scrollbar-thumb { + background-color: rgba(247, 247, 247, .5) !important; +} + +embed[type="application/pdf"] { + filter: invert(90%); +} + +html { + background: #f7f7f7 !important; + box-sizing: border-box; + filter: contrast(100%) brightness(100%) saturate(100%); + overflow-y: scroll; +} + +body { + background: #f7f7f7; + background-color: #f7f7f7; + background-image: none !important; +} + +button, input, select, textarea { + background-color: #f7f7f7; + color: #bfbfbf; +} + +font, html { + color: #bfbfbf; +} + +.swagger-ui, .swagger-ui section h3 { + color: #b5bac9; +} + + .swagger-ui a { + background-color: transparent; + } + + .swagger-ui mark { + background-color: #664b00; + color: #bfbfbf; + } + + .swagger-ui legend { + color: inherit; + } + + .swagger-ui .debug * { + outline: #e6da99 solid 1px; + } + + .swagger-ui .debug-white * { + outline: #fff solid 1px; + } + + .swagger-ui .debug-black * { + outline: #bfbfbf solid 1px; + } + + .swagger-ui .debug-grid { + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTExIDc5LjE1ODMyNSwgMjAxNS8wOS8xMC0wMToxMDoyMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MTRDOTY4N0U2N0VFMTFFNjg2MzZDQjkwNkQ4MjgwMEIiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MTRDOTY4N0Q2N0VFMTFFNjg2MzZDQjkwNkQ4MjgwMEIiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUgKE1hY2ludG9zaCkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo3NjcyQkQ3NjY3QzUxMUU2QjJCQ0UyNDA4MTAwMjE3MSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo3NjcyQkQ3NzY3QzUxMUU2QjJCQ0UyNDA4MTAwMjE3MSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PsBS+GMAAAAjSURBVHjaYvz//z8DLsD4gcGXiYEAGBIKGBne//fFpwAgwAB98AaF2pjlUQAAAABJRU5ErkJggg==) 0 0; + } + + .swagger-ui .debug-grid-16 { + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTExIDc5LjE1ODMyNSwgMjAxNS8wOS8xMC0wMToxMDoyMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6ODYyRjhERDU2N0YyMTFFNjg2MzZDQjkwNkQ4MjgwMEIiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6ODYyRjhERDQ2N0YyMTFFNjg2MzZDQjkwNkQ4MjgwMEIiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUgKE1hY2ludG9zaCkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo3NjcyQkQ3QTY3QzUxMUU2QjJCQ0UyNDA4MTAwMjE3MSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo3NjcyQkQ3QjY3QzUxMUU2QjJCQ0UyNDA4MTAwMjE3MSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PvCS01IAAABMSURBVHjaYmR4/5+BFPBfAMFm/MBgx8RAGWCn1AAmSg34Q6kBDKMGMDCwICeMIemF/5QawEipAWwUhwEjMDvbAWlWkvVBwu8vQIABAEwBCph8U6c0AAAAAElFTkSuQmCC) 0 0; + } + + .swagger-ui .debug-grid-8-solid { + background: url(data:image/jpeg;base64,/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAAAAAAD/4QMxaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjYtYzExMSA3OS4xNTgzMjUsIDIwMTUvMDkvMTAtMDE6MTA6MjAgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bXA6Q3JlYXRvclRvb2w9IkFkb2JlIFBob3Rvc2hvcCBDQyAyMDE1IChNYWNpbnRvc2gpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkIxMjI0OTczNjdCMzExRTZCMkJDRTI0MDgxMDAyMTcxIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkIxMjI0OTc0NjdCMzExRTZCMkJDRTI0MDgxMDAyMTcxIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6QjEyMjQ5NzE2N0IzMTFFNkIyQkNFMjQwODEwMDIxNzEiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6QjEyMjQ5NzI2N0IzMTFFNkIyQkNFMjQwODEwMDIxNzEiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz7/7gAOQWRvYmUAZMAAAAAB/9sAhAAbGhopHSlBJiZBQi8vL0JHPz4+P0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHAR0pKTQmND8oKD9HPzU/R0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0f/wAARCAAIAAgDASIAAhEBAxEB/8QAWQABAQAAAAAAAAAAAAAAAAAAAAYBAQEAAAAAAAAAAAAAAAAAAAIEEAEBAAMBAAAAAAAAAAAAAAABADECA0ERAAEDBQAAAAAAAAAAAAAAAAARITFBUWESIv/aAAwDAQACEQMRAD8AoOnTV1QTD7JJshP3vSM3P//Z) 0 0 #1c1c21; + } + + .swagger-ui .debug-grid-16-solid { + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTExIDc5LjE1ODMyNSwgMjAxNS8wOS8xMC0wMToxMDoyMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NzY3MkJEN0U2N0M1MTFFNkIyQkNFMjQwODEwMDIxNzEiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NzY3MkJEN0Y2N0M1MTFFNkIyQkNFMjQwODEwMDIxNzEiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo3NjcyQkQ3QzY3QzUxMUU2QjJCQ0UyNDA4MTAwMjE3MSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo3NjcyQkQ3RDY3QzUxMUU2QjJCQ0UyNDA4MTAwMjE3MSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pve6J3kAAAAzSURBVHjaYvz//z8D0UDsMwMjSRoYP5Gq4SPNbRjVMEQ1fCRDg+in/6+J1AJUxsgAEGAA31BAJMS0GYEAAAAASUVORK5CYII=) 0 0 #1c1c21; + } + + .swagger-ui .b--black { + border-color: #000; + } + + .swagger-ui .b--near-black { + border-color: #121212; + } + + .swagger-ui .b--dark-gray { + border-color: #333; + } + + .swagger-ui .b--mid-gray { + border-color: #545454; + } + + .swagger-ui .b--gray { + border-color: #787878; + } + + .swagger-ui .b--silver { + border-color: #999; + } + + .swagger-ui .b--light-silver { + border-color: #6e6e6e; + } + + .swagger-ui .b--moon-gray { + border-color: #4d4d4d; + } + + .swagger-ui .b--light-gray { + border-color: #2b2b2b; + } + + .swagger-ui .b--near-white { + border-color: #242424; + } + + .swagger-ui .b--white { + border-color: #1c1c21; + } + + .swagger-ui .b--white-90 { + border-color: rgba(28, 28, 33, .9); + } + + .swagger-ui .b--white-80 { + border-color: rgba(28, 28, 33, .8); + } + + .swagger-ui .b--white-70 { + border-color: rgba(28, 28, 33, .7); + } + + .swagger-ui .b--white-60 { + border-color: rgba(28, 28, 33, .6); + } + + .swagger-ui .b--white-50 { + border-color: rgba(28, 28, 33, .5); + } + + .swagger-ui .b--white-40 { + border-color: rgba(28, 28, 33, .4); + } + + .swagger-ui .b--white-30 { + border-color: rgba(28, 28, 33, .3); + } + + .swagger-ui .b--white-20 { + border-color: rgba(28, 28, 33, .2); + } + + .swagger-ui .b--white-10 { + border-color: rgba(28, 28, 33, .1); + } + + .swagger-ui .b--white-05 { + border-color: rgba(28, 28, 33, .05); + } + + .swagger-ui .b--white-025 { + border-color: rgba(28, 28, 33, .024); + } + + .swagger-ui .b--white-0125 { + border-color: rgba(28, 28, 33, .01); + } + + .swagger-ui .b--black-90 { + border-color: rgba(0, 0, 0, .9); + } + + .swagger-ui .b--black-80 { + border-color: rgba(0, 0, 0, .8); + } + + .swagger-ui .b--black-70 { + border-color: rgba(0, 0, 0, .7); + } + + .swagger-ui .b--black-60 { + border-color: rgba(0, 0, 0, .6); + } + + .swagger-ui .b--black-50 { + border-color: rgba(0, 0, 0, .5); + } + + .swagger-ui .b--black-40 { + border-color: rgba(0, 0, 0, .4); + } + + .swagger-ui .b--black-30 { + border-color: rgba(0, 0, 0, .3); + } + + .swagger-ui .b--black-20 { + border-color: rgba(0, 0, 0, .2); + } + + .swagger-ui .b--black-10 { + border-color: rgba(0, 0, 0, .1); + } + + .swagger-ui .b--black-05 { + border-color: rgba(0, 0, 0, .05); + } + + .swagger-ui .b--black-025 { + border-color: rgba(0, 0, 0, .024); + } + + .swagger-ui .b--black-0125 { + border-color: rgba(0, 0, 0, .01); + } + + .swagger-ui .b--dark-red { + border-color: #bc2f36; + } + + .swagger-ui .b--red { + border-color: #c83932; + } + + .swagger-ui .b--light-red { + border-color: #ab3c2b; + } + + .swagger-ui .b--orange { + border-color: #cc6e33; + } + + .swagger-ui .b--purple { + border-color: #5e2ca5; + } + + .swagger-ui .b--light-purple { + border-color: #672caf; + } + + .swagger-ui .b--dark-pink { + border-color: #ab2b81; + } + + .swagger-ui .b--hot-pink { + border-color: #c03086; + } + + .swagger-ui .b--pink { + border-color: #8f2464; + } + + .swagger-ui .b--light-pink { + border-color: #721d4d; + } + + .swagger-ui .b--dark-green { + border-color: #1c6e50; + } + + .swagger-ui .b--green { + border-color: #279b70; + } + + .swagger-ui .b--light-green { + border-color: #228762; + } + + .swagger-ui .b--navy { + border-color: #0d1d35; + } + + .swagger-ui .b--dark-blue { + border-color: #20497e; + } + + .swagger-ui .b--blue { + border-color: #4380d0; + } + + .swagger-ui .b--light-blue { + border-color: #20517e; + } + + .swagger-ui .b--lightest-blue { + border-color: #143a52; + } + + .swagger-ui .b--washed-blue { + border-color: #0c312d; + } + + .swagger-ui .b--washed-green { + border-color: #0f3d2c; + } + + .swagger-ui .b--washed-red { + border-color: #411010; + } + + .swagger-ui .b--transparent { + border-color: transparent; + } + + .swagger-ui .b--gold, .swagger-ui .b--light-yellow, .swagger-ui .b--washed-yellow, .swagger-ui .b--yellow { + border-color: #664b00; + } + + .swagger-ui .shadow-1 { + box-shadow: rgba(0, 0, 0, .2) 0 0 4px 2px; + } + + .swagger-ui .shadow-2 { + box-shadow: rgba(0, 0, 0, .2) 0 0 8px 2px; + } + + .swagger-ui .shadow-3 { + box-shadow: rgba(0, 0, 0, .2) 2px 2px 4px 2px; + } + + .swagger-ui .shadow-4 { + box-shadow: rgba(0, 0, 0, .2) 2px 2px 8px 0; + } + + .swagger-ui .shadow-5 { + box-shadow: rgba(0, 0, 0, .2) 4px 4px 8px 0; + } + +@media screen and (min-width: 30em) { + .swagger-ui .shadow-1-ns { + box-shadow: rgba(0, 0, 0, .2) 0 0 4px 2px; + } + + .swagger-ui .shadow-2-ns { + box-shadow: rgba(0, 0, 0, .2) 0 0 8px 2px; + } + + .swagger-ui .shadow-3-ns { + box-shadow: rgba(0, 0, 0, .2) 2px 2px 4px 2px; + } + + .swagger-ui .shadow-4-ns { + box-shadow: rgba(0, 0, 0, .2) 2px 2px 8px 0; + } + + .swagger-ui .shadow-5-ns { + box-shadow: rgba(0, 0, 0, .2) 4px 4px 8px 0; + } +} + +@media screen and (max-width: 60em) and (min-width: 30em) { + .swagger-ui .shadow-1-m { + box-shadow: rgba(0, 0, 0, .2) 0 0 4px 2px; + } + + .swagger-ui .shadow-2-m { + box-shadow: rgba(0, 0, 0, .2) 0 0 8px 2px; + } + + .swagger-ui .shadow-3-m { + box-shadow: rgba(0, 0, 0, .2) 2px 2px 4px 2px; + } + + .swagger-ui .shadow-4-m { + box-shadow: rgba(0, 0, 0, .2) 2px 2px 8px 0; + } + + .swagger-ui .shadow-5-m { + box-shadow: rgba(0, 0, 0, .2) 4px 4px 8px 0; + } +} + +@media screen and (min-width: 60em) { + .swagger-ui .shadow-1-l { + box-shadow: rgba(0, 0, 0, .2) 0 0 4px 2px; + } + + .swagger-ui .shadow-2-l { + box-shadow: rgba(0, 0, 0, .2) 0 0 8px 2px; + } + + .swagger-ui .shadow-3-l { + box-shadow: rgba(0, 0, 0, .2) 2px 2px 4px 2px; + } + + .swagger-ui .shadow-4-l { + box-shadow: rgba(0, 0, 0, .2) 2px 2px 8px 0; + } + + .swagger-ui .shadow-5-l { + box-shadow: rgba(0, 0, 0, .2) 4px 4px 8px 0; + } +} + +.swagger-ui .black-05 { + color: rgba(191, 191, 191, .05); +} + +.swagger-ui .bg-black-05 { + background-color: rgba(0, 0, 0, .05); +} + +.swagger-ui .black-90, .swagger-ui .hover-black-90:focus, .swagger-ui .hover-black-90:hover { + color: rgba(191, 191, 191, .9); +} + +.swagger-ui .black-80, .swagger-ui .hover-black-80:focus, .swagger-ui .hover-black-80:hover { + color: rgba(191, 191, 191, .8); +} + +.swagger-ui .black-70, .swagger-ui .hover-black-70:focus, .swagger-ui .hover-black-70:hover { + color: rgba(191, 191, 191, .7); +} + +.swagger-ui .black-60, .swagger-ui .hover-black-60:focus, .swagger-ui .hover-black-60:hover { + color: rgba(191, 191, 191, .6); +} + +.swagger-ui .black-50, .swagger-ui .hover-black-50:focus, .swagger-ui .hover-black-50:hover { + color: rgba(191, 191, 191, .5); +} + +.swagger-ui .black-40, .swagger-ui .hover-black-40:focus, .swagger-ui .hover-black-40:hover { + color: rgba(191, 191, 191, .4); +} + +.swagger-ui .black-30, .swagger-ui .hover-black-30:focus, .swagger-ui .hover-black-30:hover { + color: rgba(191, 191, 191, .3); +} + +.swagger-ui .black-20, .swagger-ui .hover-black-20:focus, .swagger-ui .hover-black-20:hover { + color: rgba(191, 191, 191, .2); +} + +.swagger-ui .black-10, .swagger-ui .hover-black-10:focus, .swagger-ui .hover-black-10:hover { + color: rgba(191, 191, 191, .1); +} + +.swagger-ui .hover-white-90:focus, .swagger-ui .hover-white-90:hover, .swagger-ui .white-90 { + color: rgba(247, 247, 247, .9); +} + +.swagger-ui .hover-white-80:focus, .swagger-ui .hover-white-80:hover, .swagger-ui .white-80 { + color: rgba(247, 247, 247, .8); +} + +.swagger-ui .hover-white-70:focus, .swagger-ui .hover-white-70:hover, .swagger-ui .white-70 { + color: rgba(247, 247, 247, .7); +} + +.swagger-ui .hover-white-60:focus, .swagger-ui .hover-white-60:hover, .swagger-ui .white-60 { + color: rgba(247, 247, 247, .6); +} + +.swagger-ui .hover-white-50:focus, .swagger-ui .hover-white-50:hover, .swagger-ui .white-50 { + color: rgba(247, 247, 247, .5); +} + +.swagger-ui .hover-white-40:focus, .swagger-ui .hover-white-40:hover, .swagger-ui .white-40 { + color: rgba(247, 247, 247, .4); +} + +.swagger-ui .hover-white-30:focus, .swagger-ui .hover-white-30:hover, .swagger-ui .white-30 { + color: rgba(247, 247, 247, .3); +} + +.swagger-ui .hover-white-20:focus, .swagger-ui .hover-white-20:hover, .swagger-ui .white-20 { + color: rgba(247, 247, 247, .2); +} + +.swagger-ui .hover-white-10:focus, .swagger-ui .hover-white-10:hover, .swagger-ui .white-10 { + color: rgba(247, 247, 247, .1); +} + +.swagger-ui .hover-moon-gray:focus, .swagger-ui .hover-moon-gray:hover, .swagger-ui .moon-gray { + color: #ccc; +} + +.swagger-ui .hover-light-gray:focus, .swagger-ui .hover-light-gray:hover, .swagger-ui .light-gray { + color: #ededed; +} + +.swagger-ui .hover-near-white:focus, .swagger-ui .hover-near-white:hover, .swagger-ui .near-white { + color: #f5f5f5; +} + +.swagger-ui .dark-red, .swagger-ui .hover-dark-red:focus, .swagger-ui .hover-dark-red:hover { + color: #e6999d; +} + +.swagger-ui .hover-red:focus, .swagger-ui .hover-red:hover, .swagger-ui .red { + color: #e69d99; +} + +.swagger-ui .hover-light-red:focus, .swagger-ui .hover-light-red:hover, .swagger-ui .light-red { + color: #e6a399; +} + +.swagger-ui .hover-orange:focus, .swagger-ui .hover-orange:hover, .swagger-ui .orange { + color: #e6b699; +} + +.swagger-ui .gold, .swagger-ui .hover-gold:focus, .swagger-ui .hover-gold:hover { + color: #e6d099; +} + +.swagger-ui .hover-yellow:focus, .swagger-ui .hover-yellow:hover, .swagger-ui .yellow { + color: #e6da99; +} + +.swagger-ui .hover-light-yellow:focus, .swagger-ui .hover-light-yellow:hover, .swagger-ui .light-yellow { + color: #ede6b6; +} + +.swagger-ui .hover-purple:focus, .swagger-ui .hover-purple:hover, .swagger-ui .purple { + color: #b99ae4; +} + +.swagger-ui .hover-light-purple:focus, .swagger-ui .hover-light-purple:hover, .swagger-ui .light-purple { + color: #bb99e6; +} + +.swagger-ui .dark-pink, .swagger-ui .hover-dark-pink:focus, .swagger-ui .hover-dark-pink:hover { + color: #e699cc; +} + +.swagger-ui .hot-pink, .swagger-ui .hover-hot-pink:focus, .swagger-ui .hover-hot-pink:hover, .swagger-ui .hover-pink:focus, .swagger-ui .hover-pink:hover, .swagger-ui .pink { + color: #e699c7; +} + +.swagger-ui .hover-light-pink:focus, .swagger-ui .hover-light-pink:hover, .swagger-ui .light-pink { + color: #edb6d5; +} + +.swagger-ui .dark-green, .swagger-ui .green, .swagger-ui .hover-dark-green:focus, .swagger-ui .hover-dark-green:hover, .swagger-ui .hover-green:focus, .swagger-ui .hover-green:hover { + color: #99e6c9; +} + +.swagger-ui .hover-light-green:focus, .swagger-ui .hover-light-green:hover, .swagger-ui .light-green { + color: #a1e8ce; +} + +.swagger-ui .hover-navy:focus, .swagger-ui .hover-navy:hover, .swagger-ui .navy { + color: #99b8e6; +} + +.swagger-ui .blue, .swagger-ui .dark-blue, .swagger-ui .hover-blue:focus, .swagger-ui .hover-blue:hover, .swagger-ui .hover-dark-blue:focus, .swagger-ui .hover-dark-blue:hover { + color: #99bae6; +} + +.swagger-ui .hover-light-blue:focus, .swagger-ui .hover-light-blue:hover, .swagger-ui .light-blue { + color: #a9cbea; +} + +.swagger-ui .hover-lightest-blue:focus, .swagger-ui .hover-lightest-blue:hover, .swagger-ui .lightest-blue { + color: #d6e9f5; +} + +.swagger-ui .hover-washed-blue:focus, .swagger-ui .hover-washed-blue:hover, .swagger-ui .washed-blue { + color: #f7fdfc; +} + +.swagger-ui .hover-washed-green:focus, .swagger-ui .hover-washed-green:hover, .swagger-ui .washed-green { + color: #ebfaf4; +} + +.swagger-ui .hover-washed-yellow:focus, .swagger-ui .hover-washed-yellow:hover, .swagger-ui .washed-yellow { + color: #fbf9ef; +} + +.swagger-ui .hover-washed-red:focus, .swagger-ui .hover-washed-red:hover, .swagger-ui .washed-red { + color: #f9e7e7; +} + +.swagger-ui .color-inherit, .swagger-ui .hover-inherit:focus, .swagger-ui .hover-inherit:hover { + color: inherit; +} + +.swagger-ui .bg-black-90, .swagger-ui .hover-bg-black-90:focus, .swagger-ui .hover-bg-black-90:hover { + background-color: rgba(0, 0, 0, .9); +} + +.swagger-ui .bg-black-80, .swagger-ui .hover-bg-black-80:focus, .swagger-ui .hover-bg-black-80:hover { + background-color: rgba(0, 0, 0, .8); +} + +.swagger-ui .bg-black-70, .swagger-ui .hover-bg-black-70:focus, .swagger-ui .hover-bg-black-70:hover { + background-color: rgba(0, 0, 0, .7); +} + +.swagger-ui .bg-black-60, .swagger-ui .hover-bg-black-60:focus, .swagger-ui .hover-bg-black-60:hover { + background-color: rgba(0, 0, 0, .6); +} + +.swagger-ui .bg-black-50, .swagger-ui .hover-bg-black-50:focus, .swagger-ui .hover-bg-black-50:hover { + background-color: rgba(0, 0, 0, .5); +} + +.swagger-ui .bg-black-40, .swagger-ui .hover-bg-black-40:focus, .swagger-ui .hover-bg-black-40:hover { + background-color: rgba(0, 0, 0, .4); +} + +.swagger-ui .bg-black-30, .swagger-ui .hover-bg-black-30:focus, .swagger-ui .hover-bg-black-30:hover { + background-color: rgba(0, 0, 0, .3); +} + +.swagger-ui .bg-black-20, .swagger-ui .hover-bg-black-20:focus, .swagger-ui .hover-bg-black-20:hover { + background-color: rgba(0, 0, 0, .2); +} + +.swagger-ui .bg-white-90, .swagger-ui .hover-bg-white-90:focus, .swagger-ui .hover-bg-white-90:hover { + background-color: rgba(28, 28, 33, .9); +} + +.swagger-ui .bg-white-80, .swagger-ui .hover-bg-white-80:focus, .swagger-ui .hover-bg-white-80:hover { + background-color: rgba(28, 28, 33, .8); +} + +.swagger-ui .bg-white-70, .swagger-ui .hover-bg-white-70:focus, .swagger-ui .hover-bg-white-70:hover { + background-color: rgba(28, 28, 33, .7); +} + +.swagger-ui .bg-white-60, .swagger-ui .hover-bg-white-60:focus, .swagger-ui .hover-bg-white-60:hover { + background-color: rgba(28, 28, 33, .6); +} + +.swagger-ui .bg-white-50, .swagger-ui .hover-bg-white-50:focus, .swagger-ui .hover-bg-white-50:hover { + background-color: rgba(28, 28, 33, .5); +} + +.swagger-ui .bg-white-40, .swagger-ui .hover-bg-white-40:focus, .swagger-ui .hover-bg-white-40:hover { + background-color: rgba(28, 28, 33, .4); +} + +.swagger-ui .bg-white-30, .swagger-ui .hover-bg-white-30:focus, .swagger-ui .hover-bg-white-30:hover { + background-color: rgba(28, 28, 33, .3); +} + +.swagger-ui .bg-white-20, .swagger-ui .hover-bg-white-20:focus, .swagger-ui .hover-bg-white-20:hover { + background-color: rgba(28, 28, 33, .2); +} + +.swagger-ui .bg-black, .swagger-ui .hover-bg-black:focus, .swagger-ui .hover-bg-black:hover { + background-color: #000; +} + +.swagger-ui .bg-near-black, .swagger-ui .hover-bg-near-black:focus, .swagger-ui .hover-bg-near-black:hover { + background-color: #121212; +} + +.swagger-ui .bg-dark-gray, .swagger-ui .hover-bg-dark-gray:focus, .swagger-ui .hover-bg-dark-gray:hover { + background-color: #333; +} + +.swagger-ui .bg-mid-gray, .swagger-ui .hover-bg-mid-gray:focus, .swagger-ui .hover-bg-mid-gray:hover { + background-color: #545454; +} + +.swagger-ui .bg-gray, .swagger-ui .hover-bg-gray:focus, .swagger-ui .hover-bg-gray:hover { + background-color: #787878; +} + +.swagger-ui .bg-silver, .swagger-ui .hover-bg-silver:focus, .swagger-ui .hover-bg-silver:hover { + background-color: #999; +} + +.swagger-ui .bg-white, .swagger-ui .hover-bg-white:focus, .swagger-ui .hover-bg-white:hover { + background-color: #1c1c21; +} + +.swagger-ui .bg-transparent, .swagger-ui .hover-bg-transparent:focus, .swagger-ui .hover-bg-transparent:hover { + background-color: transparent; +} + +.swagger-ui .bg-dark-red, .swagger-ui .hover-bg-dark-red:focus, .swagger-ui .hover-bg-dark-red:hover { + background-color: #bc2f36; +} + +.swagger-ui .bg-red, .swagger-ui .hover-bg-red:focus, .swagger-ui .hover-bg-red:hover { + background-color: #c83932; +} + +.swagger-ui .bg-light-red, .swagger-ui .hover-bg-light-red:focus, .swagger-ui .hover-bg-light-red:hover { + background-color: #ab3c2b; +} + +.swagger-ui .bg-orange, .swagger-ui .hover-bg-orange:focus, .swagger-ui .hover-bg-orange:hover { + background-color: #cc6e33; +} + +.swagger-ui .bg-gold, .swagger-ui .bg-light-yellow, .swagger-ui .bg-washed-yellow, .swagger-ui .bg-yellow, .swagger-ui .hover-bg-gold:focus, .swagger-ui .hover-bg-gold:hover, .swagger-ui .hover-bg-light-yellow:focus, .swagger-ui .hover-bg-light-yellow:hover, .swagger-ui .hover-bg-washed-yellow:focus, .swagger-ui .hover-bg-washed-yellow:hover, .swagger-ui .hover-bg-yellow:focus, .swagger-ui .hover-bg-yellow:hover { + background-color: #664b00; +} + +.swagger-ui .bg-purple, .swagger-ui .hover-bg-purple:focus, .swagger-ui .hover-bg-purple:hover { + background-color: #5e2ca5; +} + +.swagger-ui .bg-light-purple, .swagger-ui .hover-bg-light-purple:focus, .swagger-ui .hover-bg-light-purple:hover { + background-color: #672caf; +} + +.swagger-ui .bg-dark-pink, .swagger-ui .hover-bg-dark-pink:focus, .swagger-ui .hover-bg-dark-pink:hover { + background-color: #ab2b81; +} + +.swagger-ui .bg-hot-pink, .swagger-ui .hover-bg-hot-pink:focus, .swagger-ui .hover-bg-hot-pink:hover { + background-color: #c03086; +} + +.swagger-ui .bg-pink, .swagger-ui .hover-bg-pink:focus, .swagger-ui .hover-bg-pink:hover { + background-color: #8f2464; +} + +.swagger-ui .bg-light-pink, .swagger-ui .hover-bg-light-pink:focus, .swagger-ui .hover-bg-light-pink:hover { + background-color: #721d4d; +} + +.swagger-ui .bg-dark-green, .swagger-ui .hover-bg-dark-green:focus, .swagger-ui .hover-bg-dark-green:hover { + background-color: #1c6e50; +} + +.swagger-ui .bg-green, .swagger-ui .hover-bg-green:focus, .swagger-ui .hover-bg-green:hover { + background-color: #279b70; +} + +.swagger-ui .bg-light-green, .swagger-ui .hover-bg-light-green:focus, .swagger-ui .hover-bg-light-green:hover { + background-color: #228762; +} + +.swagger-ui .bg-navy, .swagger-ui .hover-bg-navy:focus, .swagger-ui .hover-bg-navy:hover { + background-color: #0d1d35; +} + +.swagger-ui .bg-dark-blue, .swagger-ui .hover-bg-dark-blue:focus, .swagger-ui .hover-bg-dark-blue:hover { + background-color: #20497e; +} + +.swagger-ui .bg-blue, .swagger-ui .hover-bg-blue:focus, .swagger-ui .hover-bg-blue:hover { + background-color: #4380d0; +} + +.swagger-ui .bg-light-blue, .swagger-ui .hover-bg-light-blue:focus, .swagger-ui .hover-bg-light-blue:hover { + background-color: #20517e; +} + +.swagger-ui .bg-lightest-blue, .swagger-ui .hover-bg-lightest-blue:focus, .swagger-ui .hover-bg-lightest-blue:hover { + background-color: #143a52; +} + +.swagger-ui .bg-washed-blue, .swagger-ui .hover-bg-washed-blue:focus, .swagger-ui .hover-bg-washed-blue:hover { + background-color: #0c312d; +} + +.swagger-ui .bg-washed-green, .swagger-ui .hover-bg-washed-green:focus, .swagger-ui .hover-bg-washed-green:hover { + background-color: #0f3d2c; +} + +.swagger-ui .bg-washed-red, .swagger-ui .hover-bg-washed-red:focus, .swagger-ui .hover-bg-washed-red:hover { + background-color: #411010; +} + +.swagger-ui .bg-inherit, .swagger-ui .hover-bg-inherit:focus, .swagger-ui .hover-bg-inherit:hover { + background-color: inherit; +} + +.swagger-ui .shadow-hover { + transition: all .5s cubic-bezier(.165, .84, .44, 1) 0s; +} + + .swagger-ui .shadow-hover::after { + border-radius: inherit; + box-shadow: rgba(0, 0, 0, .2) 0 0 16px 2px; + content: ""; + height: 100%; + left: 0; + opacity: 0; + position: absolute; + top: 0; + transition: opacity .5s cubic-bezier(.165, .84, .44, 1) 0s; + width: 100%; + z-index: -1; + } + +.swagger-ui .bg-animate, .swagger-ui .bg-animate:focus, .swagger-ui .bg-animate:hover { + transition: background-color .15s ease-in-out 0s; +} + +.swagger-ui .nested-links a { + color: #99bae6; + transition: color .15s ease-in 0s; +} + + .swagger-ui .nested-links a:focus, .swagger-ui .nested-links a:hover { + color: #a9cbea; + transition: color .15s ease-in 0s; + } + +.swagger-ui .opblock-tag { + border-bottom: 1px solid rgba(58, 64, 80, .3); + color: #b5bac9; + transition: all .2s ease 0s; +} + + .swagger-ui .opblock-tag svg, .swagger-ui section.models h4 svg { + transition: all .4s ease 0s; + } + +.swagger-ui .opblock { + border: 1px solid #000; + border-radius: 4px; + box-shadow: rgba(0, 0, 0, .19) 0 0 3px; + margin: 0 0 15px; +} + + .swagger-ui .opblock .tab-header .tab-item.active h4 span::after { + background: gray; + } + + .swagger-ui .opblock.is-open .opblock-summary { + border-bottom: 1px solid #000; + } + + .swagger-ui .opblock .opblock-section-header { + background: rgba(28, 28, 33, .8); + box-shadow: rgba(0, 0, 0, .1) 0 1px 2px; + } + + .swagger-ui .opblock .opblock-section-header > label > span { + padding: 0 10px 0 0; + } + + .swagger-ui .opblock .opblock-summary-method { + background: #000; + color: #fff; + text-shadow: rgba(0, 0, 0, .1) 0 1px 0; + } + + .swagger-ui .opblock.opblock-post { + background: rgba(72, 203, 144, .1); + border-color: #48cb90; + } + + .swagger-ui .opblock.opblock-post .opblock-summary-method, .swagger-ui .opblock.opblock-post .tab-header .tab-item.active h4 span::after { + background: #48cb90; + } + + .swagger-ui .opblock.opblock-post .opblock-summary { + border-color: #48cb90; + } + + .swagger-ui .opblock.opblock-put { + background: rgba(213, 157, 88, .1); + border-color: #d59d58; + } + + .swagger-ui .opblock.opblock-put .opblock-summary-method, .swagger-ui .opblock.opblock-put .tab-header .tab-item.active h4 span::after { + background: #d59d58; + } + + .swagger-ui .opblock.opblock-put .opblock-summary { + border-color: #d59d58; + } + + .swagger-ui .opblock.opblock-delete { + background: rgba(200, 50, 50, .1); + border-color: #c83232; + } + + .swagger-ui .opblock.opblock-delete .opblock-summary-method, .swagger-ui .opblock.opblock-delete .tab-header .tab-item.active h4 span::after { + background: #c83232; + } + + .swagger-ui .opblock.opblock-delete .opblock-summary { + border-color: #c83232; + } + + .swagger-ui .opblock.opblock-get { + background: rgba(42, 105, 167, .1); + border-color: #2a69a7; + } + + .swagger-ui .opblock.opblock-get .opblock-summary-method, .swagger-ui .opblock.opblock-get .tab-header .tab-item.active h4 span::after { + background: #2a69a7; + } + + .swagger-ui .opblock.opblock-get .opblock-summary { + border-color: #2a69a7; + } + + .swagger-ui .opblock.opblock-patch { + background: rgba(92, 214, 188, .1); + border-color: #5cd6bc; + } + + .swagger-ui .opblock.opblock-patch .opblock-summary-method, .swagger-ui .opblock.opblock-patch .tab-header .tab-item.active h4 span::after { + background: #5cd6bc; + } + + .swagger-ui .opblock.opblock-patch .opblock-summary { + border-color: #5cd6bc; + } + + .swagger-ui .opblock.opblock-head { + background: rgba(140, 63, 207, .1); + border-color: #8c3fcf; + } + + .swagger-ui .opblock.opblock-head .opblock-summary-method, .swagger-ui .opblock.opblock-head .tab-header .tab-item.active h4 span::after { + background: #8c3fcf; + } + + .swagger-ui .opblock.opblock-head .opblock-summary { + border-color: #8c3fcf; + } + + .swagger-ui .opblock.opblock-options { + background: rgba(36, 89, 143, .1); + border-color: #24598f; + } + + .swagger-ui .opblock.opblock-options .opblock-summary-method, .swagger-ui .opblock.opblock-options .tab-header .tab-item.active h4 span::after { + background: #24598f; + } + + .swagger-ui .opblock.opblock-options .opblock-summary { + border-color: #24598f; + } + + .swagger-ui .opblock.opblock-deprecated { + background: rgba(46, 46, 46, .1); + border-color: #2e2e2e; + opacity: .6; + } + + .swagger-ui .opblock.opblock-deprecated .opblock-summary-method, .swagger-ui .opblock.opblock-deprecated .tab-header .tab-item.active h4 span::after { + background: #2e2e2e; + } + + .swagger-ui .opblock.opblock-deprecated .opblock-summary { + border-color: #2e2e2e; + } + +.swagger-ui .filter .operation-filter-input { + border: 2px solid #2b3446; +} + +.swagger-ui .tab li:first-of-type::after { + background: rgba(0, 0, 0, .2); +} + +.swagger-ui .download-contents { + background: #7c8192; + color: #fff; +} + +.swagger-ui .scheme-container { + background: #1c1c21; + box-shadow: rgba(0, 0, 0, .15) 0 1px 2px 0; +} + +.swagger-ui .loading-container .loading::before { + animation: 1s linear 0s infinite normal none running rotation, .5s ease 0s 1 normal none running opacity; + border-color: rgba(0, 0, 0, .6) rgba(84, 84, 84, .1) rgba(84, 84, 84, .1); +} + +.swagger-ui .response-control-media-type--accept-controller select { + border-color: #196619; +} + +.swagger-ui .response-control-media-type__accept-message { + color: #99e699; +} + +.swagger-ui .version-pragma__message code { + background-color: #3b3b3b; +} + +.swagger-ui .btn { + background: 0 0; + border: 2px solid gray; + box-shadow: rgba(0, 0, 0, .1) 0 1px 2px; + color: #b5bac9; +} + + .swagger-ui .btn:hover { + box-shadow: rgba(0, 0, 0, .3) 0 0 5px; + } + + .swagger-ui .btn.authorize, .swagger-ui .btn.cancel { + background-color: transparent; + border-color: #a72a2a; + color: #e69999; + } + + .swagger-ui .btn.authorize { + border-color: #48cb90; + color: #9ce3c3; + } + + .swagger-ui .btn.authorize svg { + fill: #9ce3c3; + } + + .swagger-ui .btn.execute { + background-color: #5892d5; + border-color: #5892d5; + color: #fff; + } + +.swagger-ui .copy-to-clipboard { + background: #7c8192; +} + + .swagger-ui .copy-to-clipboard button { + background: url("data:image/svg+xml;charset=utf-8,") 50% center no-repeat; + } + +.swagger-ui select { + background: url("data:image/svg+xml;charset=utf-8,") right 10px center/20px no-repeat #212121; + background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgeG1sbnM6c29kaXBvZGk9Imh0dHA6Ly9zb2RpcG9kaS5zb3VyY2Vmb3JnZS5uZXQvRFREL3NvZGlwb2RpLTAuZHRkIgogICB4bWxuczppbmtzY2FwZT0iaHR0cDovL3d3dy5pbmtzY2FwZS5vcmcvbmFtZXNwYWNlcy9pbmtzY2FwZSIKICAgaW5rc2NhcGU6dmVyc2lvbj0iMS4wICg0MDM1YTRmYjQ5LCAyMDIwLTA1LTAxKSIKICAgc29kaXBvZGk6ZG9jbmFtZT0iZG93bmxvYWQuc3ZnIgogICBpZD0ic3ZnNCIKICAgdmVyc2lvbj0iMS4xIgogICB2aWV3Qm94PSIwIDAgMjAgMjAiPgogIDxtZXRhZGF0YQogICAgIGlkPSJtZXRhZGF0YTEwIj4KICAgIDxyZGY6UkRGPgogICAgICA8Y2M6V29yawogICAgICAgICByZGY6YWJvdXQ9IiI+CiAgICAgICAgPGRjOmZvcm1hdD5pbWFnZS9zdmcreG1sPC9kYzpmb3JtYXQ+CiAgICAgICAgPGRjOnR5cGUKICAgICAgICAgICByZGY6cmVzb3VyY2U9Imh0dHA6Ly9wdXJsLm9yZy9kYy9kY21pdHlwZS9TdGlsbEltYWdlIiAvPgogICAgICA8L2NjOldvcms+CiAgICA8L3JkZjpSREY+CiAgPC9tZXRhZGF0YT4KICA8ZGVmcwogICAgIGlkPSJkZWZzOCIgLz4KICA8c29kaXBvZGk6bmFtZWR2aWV3CiAgICAgaW5rc2NhcGU6Y3VycmVudC1sYXllcj0ic3ZnNCIKICAgICBpbmtzY2FwZTp3aW5kb3ctbWF4aW1pemVkPSIxIgogICAgIGlua3NjYXBlOndpbmRvdy15PSItOSIKICAgICBpbmtzY2FwZTp3aW5kb3cteD0iLTkiCiAgICAgaW5rc2NhcGU6Y3k9IjEwIgogICAgIGlua3NjYXBlOmN4PSIxMCIKICAgICBpbmtzY2FwZTp6b29tPSI0MS41IgogICAgIHNob3dncmlkPSJmYWxzZSIKICAgICBpZD0ibmFtZWR2aWV3NiIKICAgICBpbmtzY2FwZTp3aW5kb3ctaGVpZ2h0PSIxMDAxIgogICAgIGlua3NjYXBlOndpbmRvdy13aWR0aD0iMTkyMCIKICAgICBpbmtzY2FwZTpwYWdlc2hhZG93PSIyIgogICAgIGlua3NjYXBlOnBhZ2VvcGFjaXR5PSIwIgogICAgIGd1aWRldG9sZXJhbmNlPSIxMCIKICAgICBncmlkdG9sZXJhbmNlPSIxMCIKICAgICBvYmplY3R0b2xlcmFuY2U9IjEwIgogICAgIGJvcmRlcm9wYWNpdHk9IjEiCiAgICAgYm9yZGVyY29sb3I9IiM2NjY2NjYiCiAgICAgcGFnZWNvbG9yPSIjZmZmZmZmIiAvPgogIDxwYXRoCiAgICAgc3R5bGU9ImZpbGw6I2ZmZmZmZiIKICAgICBpZD0icGF0aDIiCiAgICAgZD0iTTEzLjQxOCA3Ljg1OWEuNjk1LjY5NSAwIDAxLjk3OCAwIC42OC42OCAwIDAxMCAuOTY5bC0zLjkwOCAzLjgzYS42OTcuNjk3IDAgMDEtLjk3OSAwbC0zLjkwOC0zLjgzYS42OC42OCAwIDAxMC0uOTY5LjY5NS42OTUgMCAwMS45NzggMEwxMCAxMWwzLjQxOC0zLjE0MXoiIC8+Cjwvc3ZnPgo=) right 10px center/20px no-repeat #1c1c21; + border: 2px solid #41444e; +} + + .swagger-ui select[multiple] { + background: #212121; + } + + .swagger-ui button.invalid, .swagger-ui input[type=email].invalid, .swagger-ui input[type=file].invalid, .swagger-ui input[type=password].invalid, .swagger-ui input[type=search].invalid, .swagger-ui input[type=text].invalid, .swagger-ui select.invalid, .swagger-ui textarea.invalid { + background: #390e0e; + border-color: #c83232; + } + +.swagger-ui input[type=email], .swagger-ui input[type=file], .swagger-ui input[type=password], .swagger-ui input[type=search], .swagger-ui input[type=text], .swagger-ui textarea { + background: #1c1c21; + border: 1px solid #404040; +} + +.swagger-ui textarea { + background: rgba(28, 28, 33, .8); + color: #b5bac9; +} + +.swagger-ui input[disabled], .swagger-ui select[disabled] { + background-color: #f7f7f7; + color: #bfbfbf; +} + +.swagger-ui textarea[disabled] { + background-color: #41444e; + color: #fff; +} + +.swagger-ui select[disabled] { + border-color: #878787; +} + +.swagger-ui textarea:focus { + border: 2px solid #2a69a7; +} + +.swagger-ui .checkbox input[type=checkbox] + label > .item { + background: #303030; + box-shadow: #303030 0 0 0 2px; +} + +.swagger-ui .checkbox input[type=checkbox]:checked + label > .item { + background: url("data:image/svg+xml;charset=utf-8,") 50% center no-repeat #303030; +} + +.swagger-ui .dialog-ux .backdrop-ux { + background: rgba(0, 0, 0, .8); +} + +.swagger-ui .dialog-ux .modal-ux { + background: #1c1c21; + border: 1px solid #2e2e2e; + box-shadow: rgba(0, 0, 0, .2) 0 10px 30px 0; +} + +.swagger-ui .dialog-ux .modal-ux-header .close-modal { + background: 0 0; +} + +.swagger-ui .model .deprecated span, .swagger-ui .model .deprecated td { + color: #bfbfbf !important; +} + +.swagger-ui .model-toggle::after { + background: url("data:image/svg+xml;charset=utf-8,") 50% center/100% no-repeat; +} + +.swagger-ui .model-hint { + background: rgba(0, 0, 0, .7); + color: #ebebeb; +} + +.swagger-ui section.models { + border: 1px solid rgba(58, 64, 80, .3); +} + + .swagger-ui section.models.is-open h4 { + border-bottom: 1px solid rgba(58, 64, 80, .3); + } + + .swagger-ui section.models .model-container { + background: rgba(0, 0, 0, .05); + } + + .swagger-ui section.models .model-container:hover { + background: rgba(0, 0, 0, .07); + } + +.swagger-ui .model-box { + background: rgba(0, 0, 0, .1); +} + +.swagger-ui .prop-type { + color: #aaaad4; +} + +.swagger-ui table thead tr td, .swagger-ui table thead tr th { + border-bottom: 1px solid rgba(58, 64, 80, .2); + color: #b5bac9; +} + +.swagger-ui .parameter__name.required::after { + color: rgba(230, 153, 153, .6); +} + +.swagger-ui .topbar .download-url-wrapper .select-label { + color: #f0f0f0; +} + +.swagger-ui .topbar .download-url-wrapper .download-url-button { + background: #63a040; + color: #fff; +} + +.swagger-ui .info .title small { + background: #7c8492; +} + + .swagger-ui .info .title small.version-stamp { + background-color: #7a9b27; + } + +.swagger-ui .auth-container .errors { + background-color: #350d0d; + color: #b5bac9; +} + +.swagger-ui .errors-wrapper { + background: rgba(200, 50, 50, .1); + border: 2px solid #c83232; +} + +.swagger-ui .markdown code, .swagger-ui .renderedmarkdown code { + background: rgba(0, 0, 0, .05); + color: #c299e6; +} + +.swagger-ui .model-toggle:after { + background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgeG1sbnM6c29kaXBvZGk9Imh0dHA6Ly9zb2RpcG9kaS5zb3VyY2Vmb3JnZS5uZXQvRFREL3NvZGlwb2RpLTAuZHRkIgogICB4bWxuczppbmtzY2FwZT0iaHR0cDovL3d3dy5pbmtzY2FwZS5vcmcvbmFtZXNwYWNlcy9pbmtzY2FwZSIKICAgaW5rc2NhcGU6dmVyc2lvbj0iMS4wICg0MDM1YTRmYjQ5LCAyMDIwLTA1LTAxKSIKICAgc29kaXBvZGk6ZG9jbmFtZT0iZG93bmxvYWQyLnN2ZyIKICAgaWQ9InN2ZzQiCiAgIHZlcnNpb249IjEuMSIKICAgaGVpZ2h0PSIyNCIKICAgd2lkdGg9IjI0Ij4KICA8bWV0YWRhdGEKICAgICBpZD0ibWV0YWRhdGExMCI+CiAgICA8cmRmOlJERj4KICAgICAgPGNjOldvcmsKICAgICAgICAgcmRmOmFib3V0PSIiPgogICAgICAgIDxkYzpmb3JtYXQ+aW1hZ2Uvc3ZnK3htbDwvZGM6Zm9ybWF0PgogICAgICAgIDxkYzp0eXBlCiAgICAgICAgICAgcmRmOnJlc291cmNlPSJodHRwOi8vcHVybC5vcmcvZGMvZGNtaXR5cGUvU3RpbGxJbWFnZSIgLz4KICAgICAgPC9jYzpXb3JrPgogICAgPC9yZGY6UkRGPgogIDwvbWV0YWRhdGE+CiAgPGRlZnMKICAgICBpZD0iZGVmczgiIC8+CiAgPHNvZGlwb2RpOm5hbWVkdmlldwogICAgIGlua3NjYXBlOmN1cnJlbnQtbGF5ZXI9InN2ZzQiCiAgICAgaW5rc2NhcGU6d2luZG93LW1heGltaXplZD0iMSIKICAgICBpbmtzY2FwZTp3aW5kb3cteT0iLTkiCiAgICAgaW5rc2NhcGU6d2luZG93LXg9Ii05IgogICAgIGlua3NjYXBlOmN5PSIxMiIKICAgICBpbmtzY2FwZTpjeD0iMTIiCiAgICAgaW5rc2NhcGU6em9vbT0iMzQuNTgzMzMzIgogICAgIHNob3dncmlkPSJmYWxzZSIKICAgICBpZD0ibmFtZWR2aWV3NiIKICAgICBpbmtzY2FwZTp3aW5kb3ctaGVpZ2h0PSIxMDAxIgogICAgIGlua3NjYXBlOndpbmRvdy13aWR0aD0iMTkyMCIKICAgICBpbmtzY2FwZTpwYWdlc2hhZG93PSIyIgogICAgIGlua3NjYXBlOnBhZ2VvcGFjaXR5PSIwIgogICAgIGd1aWRldG9sZXJhbmNlPSIxMCIKICAgICBncmlkdG9sZXJhbmNlPSIxMCIKICAgICBvYmplY3R0b2xlcmFuY2U9IjEwIgogICAgIGJvcmRlcm9wYWNpdHk9IjEiCiAgICAgYm9yZGVyY29sb3I9IiM2NjY2NjYiCiAgICAgcGFnZWNvbG9yPSIjZmZmZmZmIiAvPgogIDxwYXRoCiAgICAgc3R5bGU9ImZpbGw6I2ZmZmZmZiIKICAgICBpZD0icGF0aDIiCiAgICAgZD0iTTEwIDZMOC41OSA3LjQxIDEzLjE3IDEybC00LjU4IDQuNTlMMTAgMThsNi02eiIgLz4KPC9zdmc+Cg==) 50% no-repeat; +} + +.swagger-ui .expand-operation svg, .swagger-ui section.models h4 svg { + fill: #fff; +} + +::-webkit-scrollbar-track { + background-color: #646464 !important; +} + +::-webkit-scrollbar-thumb { + background-color: #242424 !important; + border: 2px solid #3e4346 !important; +} + +::-webkit-scrollbar-button:vertical:start:decrement { + background: linear-gradient(130deg, #696969 40%, rgba(255, 0, 0, 0) 41%), linear-gradient(230deg, #696969 40%, transparent 41%), linear-gradient(0deg, #696969 40%, transparent 31%); + background-color: #b6b6b6; +} + +::-webkit-scrollbar-button:vertical:end:increment { + background: linear-gradient(310deg, #696969 40%, transparent 41%), linear-gradient(50deg, #696969 40%, transparent 41%), linear-gradient(180deg, #696969 40%, transparent 31%); + background-color: #b6b6b6; +} + +::-webkit-scrollbar-button:horizontal:end:increment { + background: linear-gradient(210deg, #696969 40%, transparent 41%), linear-gradient(330deg, #696969 40%, transparent 41%), linear-gradient(90deg, #696969 30%, transparent 31%); + background-color: #b6b6b6; +} + +::-webkit-scrollbar-button:horizontal:start:decrement { + background: linear-gradient(30deg, #696969 40%, transparent 41%), linear-gradient(150deg, #696969 40%, transparent 41%), linear-gradient(270deg, #696969 30%, transparent 31%); + background-color: #b6b6b6; +} + +::-webkit-scrollbar-button, ::-webkit-scrollbar-track-piece { + background-color: #3e4346 !important; +} + +.swagger-ui .black, .swagger-ui .checkbox, .swagger-ui .dark-gray, .swagger-ui .download-url-wrapper .loading, .swagger-ui .errors-wrapper .errors small, .swagger-ui .fallback, .swagger-ui .filter .loading, .swagger-ui .gray, .swagger-ui .hover-black:focus, .swagger-ui .hover-black:hover, .swagger-ui .hover-dark-gray:focus, .swagger-ui .hover-dark-gray:hover, .swagger-ui .hover-gray:focus, .swagger-ui .hover-gray:hover, .swagger-ui .hover-light-silver:focus, .swagger-ui .hover-light-silver:hover, .swagger-ui .hover-mid-gray:focus, .swagger-ui .hover-mid-gray:hover, .swagger-ui .hover-near-black:focus, .swagger-ui .hover-near-black:hover, .swagger-ui .hover-silver:focus, .swagger-ui .hover-silver:hover, .swagger-ui .light-silver, .swagger-ui .markdown pre, .swagger-ui .mid-gray, .swagger-ui .model .property, .swagger-ui .model .property.primitive, .swagger-ui .model-title, .swagger-ui .near-black, .swagger-ui .parameter__extension, .swagger-ui .parameter__in, .swagger-ui .prop-format, .swagger-ui .renderedmarkdown pre, .swagger-ui .response-col_links .response-undocumented, .swagger-ui .response-col_status .response-undocumented, .swagger-ui .silver, .swagger-ui section.models h4, .swagger-ui section.models h5, .swagger-ui span.token-not-formatted, .swagger-ui span.token-string, .swagger-ui table.headers .header-example, .swagger-ui table.model tr.description, .swagger-ui table.model tr.extension { + color: #bfbfbf; +} + +.swagger-ui .hover-white:focus, .swagger-ui .hover-white:hover, .swagger-ui .info .title small pre, .swagger-ui .topbar a, .swagger-ui .white { + color: #fff; +} + +.swagger-ui .bg-black-10, .swagger-ui .hover-bg-black-10:focus, .swagger-ui .hover-bg-black-10:hover, .swagger-ui .stripe-dark:nth-child(2n + 1) { + background-color: rgba(0, 0, 0, .1); +} + +.swagger-ui .bg-white-10, .swagger-ui .hover-bg-white-10:focus, .swagger-ui .hover-bg-white-10:hover, .swagger-ui .stripe-light:nth-child(2n + 1) { + background-color: rgba(28, 28, 33, .1); +} + +.swagger-ui .bg-light-silver, .swagger-ui .hover-bg-light-silver:focus, .swagger-ui .hover-bg-light-silver:hover, .swagger-ui .striped--light-silver:nth-child(2n + 1) { + background-color: #6e6e6e; +} + +.swagger-ui .bg-moon-gray, .swagger-ui .hover-bg-moon-gray:focus, .swagger-ui .hover-bg-moon-gray:hover, .swagger-ui .striped--moon-gray:nth-child(2n + 1) { + background-color: #4d4d4d; +} + +.swagger-ui .bg-light-gray, .swagger-ui .hover-bg-light-gray:focus, .swagger-ui .hover-bg-light-gray:hover, .swagger-ui .striped--light-gray:nth-child(2n + 1) { + background-color: #2b2b2b; +} + +.swagger-ui .bg-near-white, .swagger-ui .hover-bg-near-white:focus, .swagger-ui .hover-bg-near-white:hover, .swagger-ui .striped--near-white:nth-child(2n + 1) { + background-color: #242424; +} + +.swagger-ui .opblock-tag:hover, .swagger-ui section.models h4:hover { + background: rgba(0, 0, 0, .02); +} + +.swagger-ui .checkbox p, .swagger-ui .dialog-ux .modal-ux-content h4, .swagger-ui .dialog-ux .modal-ux-content p, .swagger-ui .dialog-ux .modal-ux-header h3, .swagger-ui .errors-wrapper .errors h4, .swagger-ui .errors-wrapper hgroup h4, .swagger-ui .info .base-url, .swagger-ui .info .title, .swagger-ui .info h1, .swagger-ui .info h2, .swagger-ui .info h3, .swagger-ui .info h4, .swagger-ui .info h5, .swagger-ui .info li, .swagger-ui .info p, .swagger-ui .info table, .swagger-ui .loading-container .loading::after, .swagger-ui .model, .swagger-ui .opblock .opblock-section-header h4, .swagger-ui .opblock .opblock-section-header > label, .swagger-ui .opblock .opblock-summary-description, .swagger-ui .opblock .opblock-summary-operation-id, .swagger-ui .opblock .opblock-summary-path, .swagger-ui .opblock .opblock-summary-path__deprecated, .swagger-ui .opblock-description-wrapper, .swagger-ui .opblock-description-wrapper h4, .swagger-ui .opblock-description-wrapper p, .swagger-ui .opblock-external-docs-wrapper, .swagger-ui .opblock-external-docs-wrapper h4, .swagger-ui .opblock-external-docs-wrapper p, .swagger-ui .opblock-tag small, .swagger-ui .opblock-title_normal, .swagger-ui .opblock-title_normal h4, .swagger-ui .opblock-title_normal p, .swagger-ui .parameter__name, .swagger-ui .parameter__type, .swagger-ui .response-col_links, .swagger-ui .response-col_status, .swagger-ui .responses-inner h4, .swagger-ui .responses-inner h5, .swagger-ui .scheme-container .schemes > label, .swagger-ui .scopes h2, .swagger-ui .servers > label, .swagger-ui .tab li, .swagger-ui label, .swagger-ui select, .swagger-ui table.headers td { + color: #b5bac9; +} + + .swagger-ui .download-url-wrapper .failed, .swagger-ui .filter .failed, .swagger-ui .model-deprecated-warning, .swagger-ui .parameter__deprecated, .swagger-ui .parameter__name.required span, .swagger-ui table.model tr.property-row .star { + color: #e69999; + } + +.swagger-ui .opblock-body pre.microlight, .swagger-ui textarea.curl { + background: #41444e; + border-radius: 4px; + color: #fff; +} + +.swagger-ui .expand-methods svg, .swagger-ui .expand-methods:hover svg { + fill: #bfbfbf; +} + +.swagger-ui .auth-container, .swagger-ui .dialog-ux .modal-ux-header { + border-bottom: 1px solid #2e2e2e; +} + +.swagger-ui .topbar .download-url-wrapper .select-label select, .swagger-ui .topbar .download-url-wrapper input[type=text] { + border: 2px solid #63a040; +} + +.swagger-ui .info a, .swagger-ui .info a:hover, .swagger-ui .scopes h2 a { + color: #99bde6; +} + +/* Dark Scrollbar */ +::-webkit-scrollbar { + width: 14px; + height: 14px; +} + +::-webkit-scrollbar-button { + background-color: #3e4346 !important; +} + +::-webkit-scrollbar-track { + background-color: #646464 !important; +} + +::-webkit-scrollbar-track-piece { + background-color: #3e4346 !important; +} + +::-webkit-scrollbar-thumb { + height: 50px; + background-color: #242424 !important; + border: 2px solid #3e4346 !important; +} + +::-webkit-scrollbar-corner { +} + +::-webkit-resizer { +} + +::-webkit-scrollbar-button:vertical:start:decrement { + background: linear-gradient(130deg, #696969 40%, rgba(255, 0, 0, 0) 41%), linear-gradient(230deg, #696969 40%, rgba(0, 0, 0, 0) 41%), linear-gradient(0deg, #696969 40%, rgba(0, 0, 0, 0) 31%); + background-color: #b6b6b6; +} + +::-webkit-scrollbar-button:vertical:end:increment { + background: linear-gradient(310deg, #696969 40%, rgba(0, 0, 0, 0) 41%), linear-gradient(50deg, #696969 40%, rgba(0, 0, 0, 0) 41%), linear-gradient(180deg, #696969 40%, rgba(0, 0, 0, 0) 31%); + background-color: #b6b6b6; +} + +::-webkit-scrollbar-button:horizontal:end:increment { + background: linear-gradient(210deg, #696969 40%, rgba(0, 0, 0, 0) 41%), linear-gradient(330deg, #696969 40%, rgba(0, 0, 0, 0) 41%), linear-gradient(90deg, #696969 30%, rgba(0, 0, 0, 0) 31%); + background-color: #b6b6b6; +} + +::-webkit-scrollbar-button:horizontal:start:decrement { + background: linear-gradient(30deg, #696969 40%, rgba(0, 0, 0, 0) 41%), linear-gradient(150deg, #696969 40%, rgba(0, 0, 0, 0) 41%), linear-gradient(270deg, #696969 30%, rgba(0, 0, 0, 0) 31%); + background-color: #b6b6b6; +} diff --git a/sample/src/Demo.Api.Full/wwwroot/swagger-ui/main.js b/src/Atc.Rest.ApiGenerator.Framework/Resources/wwwroot/swagger-ui/main.js similarity index 100% rename from sample/src/Demo.Api.Full/wwwroot/swagger-ui/main.js rename to src/Atc.Rest.ApiGenerator.Framework/Resources/wwwroot/swagger-ui/main.js diff --git a/sample/src/Demo.Api.Full/wwwroot/swagger-ui/swagger.png b/src/Atc.Rest.ApiGenerator.Framework/Resources/wwwroot/swagger-ui/swagger.png similarity index 100% rename from sample/src/Demo.Api.Full/wwwroot/swagger-ui/swagger.png rename to src/Atc.Rest.ApiGenerator.Framework/Resources/wwwroot/swagger-ui/swagger.png diff --git a/src/Atc.Rest.ApiGenerator.Nuget/Atc.Rest.ApiGenerator.Nuget.csproj b/src/Atc.Rest.ApiGenerator.Nuget/Atc.Rest.ApiGenerator.Nuget.csproj index 40821de4..80d8d362 100644 --- a/src/Atc.Rest.ApiGenerator.Nuget/Atc.Rest.ApiGenerator.Nuget.csproj +++ b/src/Atc.Rest.ApiGenerator.Nuget/Atc.Rest.ApiGenerator.Nuget.csproj @@ -1,13 +1,13 @@ - net6.0 + net8.0 false - - + + diff --git a/src/Atc.Rest.ApiGenerator.Nuget/GlobalUsings.cs b/src/Atc.Rest.ApiGenerator.Nuget/GlobalUsings.cs index a2dbf299..1ceb6643 100644 --- a/src/Atc.Rest.ApiGenerator.Nuget/GlobalUsings.cs +++ b/src/Atc.Rest.ApiGenerator.Nuget/GlobalUsings.cs @@ -3,6 +3,4 @@ global using System.Diagnostics.CodeAnalysis; global using System.Net; -global using Atc.Helpers; - global using Microsoft.Extensions.Logging; \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.OpenApi/Atc.Rest.ApiGenerator.OpenApi.csproj b/src/Atc.Rest.ApiGenerator.OpenApi/Atc.Rest.ApiGenerator.OpenApi.csproj index 2faa2377..272e620e 100644 --- a/src/Atc.Rest.ApiGenerator.OpenApi/Atc.Rest.ApiGenerator.OpenApi.csproj +++ b/src/Atc.Rest.ApiGenerator.OpenApi/Atc.Rest.ApiGenerator.OpenApi.csproj @@ -1,20 +1,20 @@ - net6.0 + net8.0 false - - - - - + + + + + - + diff --git a/src/Atc.Rest.ApiGenerator.OpenApi/Extensions/OpenApiAnyExtensions.cs b/src/Atc.Rest.ApiGenerator.OpenApi/Extensions/OpenApiAnyExtensions.cs index c26fedb9..9422855d 100644 --- a/src/Atc.Rest.ApiGenerator.OpenApi/Extensions/OpenApiAnyExtensions.cs +++ b/src/Atc.Rest.ApiGenerator.OpenApi/Extensions/OpenApiAnyExtensions.cs @@ -12,8 +12,10 @@ public static class OpenApiAnyExtensions return openApiAny switch { + OpenApiDouble apiDouble => apiDouble.Value.ToString("N"), + OpenApiFloat apiFloat => apiFloat.Value.ToString("N"), OpenApiInteger apiInteger => apiInteger.Value.ToString(), - OpenApiString apiString => string.IsNullOrEmpty(apiString.Value) ? "string.Empty" : $"\"{apiString.Value}\"", + OpenApiString apiString => string.IsNullOrEmpty(apiString.Value) ? "string.Empty" : $"{apiString.Value}", OpenApiBoolean { Value: true } => "true", OpenApiBoolean { Value: false } => "false", _ => throw new NotImplementedException("Property initializer: " + openApiAny.GetType()), diff --git a/src/Atc.Rest.ApiGenerator.OpenApi/Extensions/OpenApiDocumentExtensions.cs b/src/Atc.Rest.ApiGenerator.OpenApi/Extensions/OpenApiDocumentExtensions.cs index 8c4e589e..cc7d3405 100644 --- a/src/Atc.Rest.ApiGenerator.OpenApi/Extensions/OpenApiDocumentExtensions.cs +++ b/src/Atc.Rest.ApiGenerator.OpenApi/Extensions/OpenApiDocumentExtensions.cs @@ -1,32 +1,30 @@ // ReSharper disable InvertIf // ReSharper disable LoopCanBeConvertedToQuery // ReSharper disable ForeachCanBePartlyConvertedToQueryUsingAnotherGetEnumerator +// ReSharper disable ForeachCanBeConvertedToQueryUsingAnotherGetEnumerator namespace Atc.Rest.ApiGenerator.OpenApi.Extensions; public static class OpenApiDocumentExtensions { - public static bool IsSpecificationUsingAuthorization( + public static IEnumerable ExtractApiOperationResponseModels( this OpenApiDocument openApiDocument) { - foreach (var openApiPath in openApiDocument.Paths) + var result = new List(); + + foreach (var apiPath in openApiDocument.Paths) { - var apiPathAuthentication = openApiPath.Value.Extensions.ExtractAuthenticationRequired(); - if (apiPathAuthentication is not null && apiPathAuthentication.Value) - { - return true; - } + var apiGroupName = apiPath.GetApiGroupName(); - foreach (var openApiOperation in openApiPath.Value.Operations) + foreach (var apiOperation in apiPath.Value.Operations) { - var apiOperationAuthentication = openApiOperation.Value.Extensions.ExtractAuthenticationRequired(); - if (apiOperationAuthentication is not null && apiOperationAuthentication.Value) + foreach (var responseModel in apiOperation.Value.ExtractApiOperationResponseModels()) { - return true; + result.Add(responseModel with { GroupName = apiGroupName }); } } } - return false; + return result; } public static bool HasAllPathsAuthenticationRequiredSet( @@ -108,9 +106,229 @@ public static string GetServerUrlBasePath( .Replace("http://", string.Empty, StringComparison.OrdinalIgnoreCase) .Replace("https://", string.Empty, StringComparison.OrdinalIgnoreCase); - return temp.Substring(temp.IndexOf('/', StringComparison.Ordinal)); + var indexOfSlash = temp.IndexOf('/', StringComparison.Ordinal); + return indexOfSlash == -1 + ? string.Empty + : temp[indexOfSlash..]; } return serverUrl; } + + public static bool IsUsingRequiredForSystem( + this OpenApiDocument openApiDocument, + bool includeDeprecated) + { + foreach (var openApiPath in openApiDocument.Paths) + { + foreach (var openApiOperation in openApiPath.Value.Operations) + { + if (openApiOperation.Value.Deprecated && !includeDeprecated) + { + continue; + } + + foreach (var response in openApiOperation.Value.Responses.Values) + { + foreach (var mediaType in response.Content.Values) + { + foreach (var schemaProperty in mediaType.Schema.Properties) + { + if (schemaProperty.Value.Deprecated && !includeDeprecated) + { + continue; + } + + if (schemaProperty.Value.IsFormatTypeUuid()) + { + return true; + } + } + } + } + } + } + + return false; + } + + public static bool IsUsingRequiredForSystemCollectionGeneric( + this OpenApiDocument openApiDocument, + bool includeDeprecated) + { + foreach (var openApiPath in openApiDocument.Paths) + { + foreach (var openApiOperation in openApiPath.Value.Operations) + { + if (openApiOperation.Value.Deprecated && !includeDeprecated) + { + continue; + } + + foreach (var response in openApiOperation.Value.Responses.Values) + { + foreach (var mediaType in response.Content.Values) + { + if (mediaType.Schema.IsTypeArray()) + { + return true; + } + } + } + } + } + + return false; + } + + public static bool IsUsingRequiredForSystemLinq( + this OpenApiDocument openApiDocument, + bool includeDeprecated) + { + foreach (var openApiPath in openApiDocument.Paths) + { + foreach (var openApiOperation in openApiPath.Value.Operations) + { + if (openApiOperation.Value.Deprecated && !includeDeprecated) + { + continue; + } + + foreach (var parameter in openApiOperation.Value.Parameters) + { + if (parameter.Schema.IsTypeArray()) + { + return true; + } + } + } + } + + return false; + } + + public static bool IsUsingRequiredForSystemTextJsonSerializationAndSystemRuntimeSerialization( + this OpenApiDocument openApiDocument, + bool includeDeprecated) + { + foreach (var openApiPath in openApiDocument.Paths) + { + foreach (var openApiOperation in openApiPath.Value.Operations) + { + if (openApiOperation.Value.Deprecated && !includeDeprecated) + { + continue; + } + + foreach (var parameter in openApiOperation.Value.Parameters) + { + if (parameter.Schema.IsSchemaEnum()) + { + foreach (var openApiAny in parameter.Schema.Enum) + { + if (openApiAny is not OpenApiString openApiString) + { + continue; + } + + if ((!parameter.Schema.Type.Equals("string", StringComparison.Ordinal) && openApiString.Value.IsFirstCharacterLowerCase()) || + openApiString.Value.Contains('-', StringComparison.Ordinal)) + { + return true; + } + } + } + } + } + } + + return false; + } + + public static bool IsUsingRequiredForAtcRestResults( + this OpenApiDocument openApiDocument) + { + foreach (var path in openApiDocument.Paths) + { + foreach (var openApiOperation in path.Value.Operations.Values) + { + foreach (var response in openApiOperation.Responses.OrderBy(x => x.GetFormattedKey(), StringComparer.Ordinal)) + { + if (!Enum.TryParse(typeof(HttpStatusCode), response.Key, out var parsedType)) + { + continue; + } + + var httpStatusCode = (HttpStatusCode)parsedType; + if (httpStatusCode != HttpStatusCode.OK) + { + continue; + } + + var usePagination = openApiOperation.Responses.IsSchemaTypePaginationForStatusCode(httpStatusCode); + if (!usePagination) + { + continue; + } + + return true; + } + } + } + + return false; + } + + public static bool IsUsingRequiredForAtcRestMinimalApiFiltersEndpoints( + this OpenApiDocument openApiDocument) + { + // TODO: Check for any use of operations parameters + return true; + } + + public static bool IsUsingRequiredForMicrosoftAspNetCoreAuthorization( + this OpenApiDocument openApiDocument, + bool includeDeprecated) + { + foreach (var openApiPath in openApiDocument.Paths) + { + var isAuthenticationRequired = openApiPath.Value.Extensions.ExtractAuthenticationRequired(); + if (isAuthenticationRequired is not null && isAuthenticationRequired.Value) + { + return true; + } + + foreach (var openApiOperation in openApiPath.Value.Operations) + { + if (openApiOperation.Value.Deprecated && !includeDeprecated) + { + continue; + } + + var isOperationAuthenticationRequired = openApiOperation.Value.Extensions.ExtractAuthenticationRequired(); + if (isOperationAuthenticationRequired is not null && isOperationAuthenticationRequired.Value) + { + return true; + } + + var operationAuthenticationRoles = openApiPath.Value.Extensions.ExtractAuthorizationRoles(); + var operationAuthenticationSchemes = openApiPath.Value.Extensions.ExtractAuthenticationSchemes(); + if (operationAuthenticationRoles is not null && operationAuthenticationRoles.Count > 0 && + operationAuthenticationSchemes is not null && operationAuthenticationSchemes.Count > 0) + { + return true; + } + } + + var authenticationRoles = openApiPath.Value.Extensions.ExtractAuthorizationRoles(); + var authenticationSchemes = openApiPath.Value.Extensions.ExtractAuthenticationSchemes(); + if (authenticationRoles is not null && authenticationRoles.Count > 0 && + authenticationSchemes is not null && authenticationSchemes.Count > 0) + { + return true; + } + } + + return false; + } } \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.OpenApi/Extensions/OpenApiKeyValuePairExtensions.cs b/src/Atc.Rest.ApiGenerator.OpenApi/Extensions/OpenApiKeyValuePairExtensions.cs new file mode 100644 index 00000000..9d88207b --- /dev/null +++ b/src/Atc.Rest.ApiGenerator.OpenApi/Extensions/OpenApiKeyValuePairExtensions.cs @@ -0,0 +1,13 @@ +// ReSharper disable InvertIf +namespace Atc.Rest.ApiGenerator.OpenApi.Extensions; + +public static class OpenApiKeyValuePairExtensions +{ + public static string GetFormattedKey( + this KeyValuePair value) + => value.Key.PascalCase(ApiOperationExtractor.ModelNameSeparators, removeSeparators: true); + + public static string GetFormattedKey( + this KeyValuePair value) + => value.Key.PascalCase(ApiOperationExtractor.ModelNameSeparators, removeSeparators: true); +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.OpenApi/Extensions/OpenApiOperationExtensions.cs b/src/Atc.Rest.ApiGenerator.OpenApi/Extensions/OpenApiOperationExtensions.cs index 84dc294b..2df6d042 100644 --- a/src/Atc.Rest.ApiGenerator.OpenApi/Extensions/OpenApiOperationExtensions.cs +++ b/src/Atc.Rest.ApiGenerator.OpenApi/Extensions/OpenApiOperationExtensions.cs @@ -61,4 +61,159 @@ public static CodeDocumentationTags ExtractDocumentationTags( return new CodeDocumentationTags(sbSummary.ToString()); } + + public static ApiAuthorizeModel? ExtractApiOperationAuthorization( + this OpenApiOperation apiOperation, + OpenApiPathItem apiPath) + { + var authorizationRolesForPath = apiPath.Extensions.ExtractAuthorizationRoles(); + var authenticationSchemesForPath = apiPath.Extensions.ExtractAuthenticationSchemes(); + var authorizationRolesForOperation = apiOperation.Extensions.ExtractAuthorizationRoles(); + var authenticationSchemesForOperation = apiOperation.Extensions.ExtractAuthenticationSchemes(); + + if (authorizationRolesForPath is null && + authenticationSchemesForPath is null && + authorizationRolesForOperation is null && + authenticationSchemesForOperation is null) + { + return null; + } + + IList? authorizationRoles = null; + IList? authenticationSchemes = null; + + if (authorizationRolesForPath is not null) + { + authorizationRoles = authorizationRolesForPath + .Distinct(StringComparer.Ordinal) + .OrderBy(x => x, StringComparer.Ordinal) + .ToList(); + } + + if (authorizationRolesForOperation is not null) + { + authorizationRoles = authorizationRoles is null + ? authorizationRolesForOperation + .Distinct(StringComparer.Ordinal) + .OrderBy(x => x, StringComparer.Ordinal) + .ToList() + : authorizationRoles + .Union(authorizationRolesForOperation, StringComparer.Ordinal) + .Distinct(StringComparer.Ordinal) + .OrderBy(x => x, StringComparer.Ordinal) + .ToList(); + } + + if (authenticationSchemesForPath is not null) + { + authenticationSchemes = authenticationSchemesForPath + .Distinct(StringComparer.Ordinal) + .OrderBy(x => x, StringComparer.Ordinal) + .ToList(); + } + + if (authorizationRolesForOperation is not null) + { + authenticationSchemes = authenticationSchemes is null + ? authenticationSchemesForOperation + .Distinct(StringComparer.Ordinal) + .OrderBy(x => x, StringComparer.Ordinal) + .ToList() + : authenticationSchemes + .Union(authenticationSchemesForOperation, StringComparer.Ordinal) + .Distinct(StringComparer.Ordinal) + .OrderBy(x => x, StringComparer.Ordinal) + .ToList(); + } + + return new ApiAuthorizeModel( + Roles: authorizationRoles, + AuthenticationSchemes: authenticationSchemes, + UseAllowAnonymous: false); + } + + public static IEnumerable ExtractApiOperationResponseModels( + this OpenApiOperation apiOperation) + { + var result = new List(); + + foreach (var apiResponse in apiOperation.Responses) + { + if (apiResponse.Value.Content.Count == 0) + { + if (!apiResponse.Key.TryParseToHttpStatusCode(out var httpStatusCode)) + { + continue; + } + + result.Add( + new ApiOperationResponseModel( + StatusCode: httpStatusCode, + OperationName: apiOperation.GetOperationName(), + GroupName: null, + MediaType: null, + CollectionDataType: null, + DataType: null, + Description: apiResponse.Value.Description)); + } + else + { + foreach (var apiMediaType in apiResponse.Value.Content.Where(x => x.Key.Equals(MediaTypeNames.Application.Json, StringComparison.OrdinalIgnoreCase))) + { + if (!apiResponse.Key.TryParseToHttpStatusCode(out var httpStatusCode)) + { + continue; + } + + string? collectionDataType = null; + var dataType = apiMediaType.Value.Schema.GetModelName(); + + if (string.IsNullOrEmpty(dataType) && + apiMediaType.Value.Schema.IsSimpleDataType()) + { + dataType = apiMediaType.Value.Schema.GetDataType(); + } + + if (string.IsNullOrEmpty(dataType)) + { + dataType = null; + + if (apiMediaType.Value.Schema.IsTypeCustomPagination()) + { + var customPaginationItemsSchema = apiMediaType.Value.Schema.GetCustomPaginationItemsSchema(); + if (customPaginationItemsSchema is not null) + { + dataType = customPaginationItemsSchema.GetModelName(); + if (dataType.Length == 0 && apiMediaType.Value.Schema.IsSimpleDataType()) + { + dataType = apiMediaType.Value.Schema.GetDataType(); + } + + var customPaginationSchema = apiMediaType.Value.Schema.GetCustomPaginationSchema(); + collectionDataType = customPaginationSchema is not null + ? customPaginationSchema.GetDataType() + : NameConstants.Pagination + ContentGeneratorConstants.Result; + } + } + } + else + { + collectionDataType = apiMediaType.Value.Schema.GetCollectionDataType(); + } + + result.Add( + new ApiOperationResponseModel( + StatusCode: httpStatusCode, + OperationName: apiOperation.GetOperationName(), + GroupName: null, + MediaType: apiMediaType.Key, + CollectionDataType: collectionDataType, + DataType: dataType, + Description: apiResponse.Value.Description)); + } + } + } + + return result; + } } \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.OpenApi/Extensions/OpenApiParameterExtensions.cs b/src/Atc.Rest.ApiGenerator.OpenApi/Extensions/OpenApiParameterExtensions.cs index 76f23de5..4f78714e 100644 --- a/src/Atc.Rest.ApiGenerator.OpenApi/Extensions/OpenApiParameterExtensions.cs +++ b/src/Atc.Rest.ApiGenerator.OpenApi/Extensions/OpenApiParameterExtensions.cs @@ -25,7 +25,7 @@ public static string ExtractDocumentationTagSummary( summery = apiParameter.Description; } - return summery.EnsureEndsWithDot(); + return summery.EnsureFormatForDocumentationTag(); } public static string? ExtractDocumentationTagRemark( diff --git a/src/Atc.Rest.ApiGenerator.OpenApi/Extensions/OpenApiPathsExtensions.cs b/src/Atc.Rest.ApiGenerator.OpenApi/Extensions/OpenApiPathsExtensions.cs index 4b53adbd..e98406ff 100644 --- a/src/Atc.Rest.ApiGenerator.OpenApi/Extensions/OpenApiPathsExtensions.cs +++ b/src/Atc.Rest.ApiGenerator.OpenApi/Extensions/OpenApiPathsExtensions.cs @@ -2,12 +2,61 @@ namespace Atc.Rest.ApiGenerator.OpenApi.Extensions; public static class OpenApiPathsExtensions { + [SuppressMessage("Naming", "CA1867:Use 'string.Method(char)' instead of 'string.Method(string)' for string with single char", Justification = "OK.")] public static string GetApiGroupName( this KeyValuePair apiPath) { var sa = apiPath.Key.Split('/', StringSplitOptions.RemoveEmptyEntries); - return sa.Length == 0 - ? "Root" - : sa[0].PascalCase(removeSeparators: true); + return sa.Length switch + { + 0 => "Root", + > 2 when sa[0].Equals("api", StringComparison.OrdinalIgnoreCase) && + sa[1].StartsWith("v", StringComparison.OrdinalIgnoreCase) => sa[2].PascalCase(removeSeparators: true), + _ => sa[0].PascalCase(removeSeparators: true), + }; + } + + public static ApiAuthorizeModel? ExtractApiPathAuthorization( + this OpenApiPathItem apiPath) + { + var data = apiPath.Operations + .Select(apiOperation => apiOperation.Value.ExtractApiOperationAuthorization(apiPath)) + .ToList(); + + if (data.Count == 0) + { + return null; + } + + IList? authorizationRoles = null; + IList? authenticationSchemes = null; + + foreach (var authorizeModel in data.OfType()) + { + if (authorizeModel.Roles is not null) + { + authorizationRoles = authorizationRoles? + .Union(authorizeModel.Roles, StringComparer.Ordinal) + .Distinct(StringComparer.Ordinal) + .OrderBy(x => x, StringComparer.Ordinal) + .ToList() ?? authorizeModel.Roles; + } + + if (authorizeModel.AuthenticationSchemes is not null) + { + authenticationSchemes = authenticationSchemes? + .Union(authorizeModel.AuthenticationSchemes, StringComparer.Ordinal) + .Distinct(StringComparer.Ordinal) + .OrderBy(x => x, StringComparer.Ordinal) + .ToList() ?? authorizeModel.AuthenticationSchemes; + } + } + + var useAllowAnonymous = apiPath.Operations.Keys.Count != data.OfType().Count(); + + return new ApiAuthorizeModel( + Roles: authorizationRoles, + AuthenticationSchemes: authenticationSchemes, + UseAllowAnonymous: useAllowAnonymous); } } \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.OpenApi/Extensions/OpenApiResponsesExtensions.cs b/src/Atc.Rest.ApiGenerator.OpenApi/Extensions/OpenApiResponsesExtensions.cs deleted file mode 100644 index 63ef8f34..00000000 --- a/src/Atc.Rest.ApiGenerator.OpenApi/Extensions/OpenApiResponsesExtensions.cs +++ /dev/null @@ -1,218 +0,0 @@ -namespace Atc.Rest.ApiGenerator.OpenApi.Extensions; - -public static class OpenApiResponsesExtensions -{ - public static List GetProducesResponseAttributeParts( - this OpenApiResponses responses, - IList apiOperationSchemaMappings, - string apiGroupName, - string projectName, - bool useProblemDetailsAsDefaultResponseBody, - bool includeIfNotDefinedValidation, - bool includeIfNotDefinedAuthorization, - bool includeIfNotDefinedInternalServerError) - { - var responseTypes = GetResponseTypes( - responses, - apiOperationSchemaMappings, - apiGroupName, - projectName, - useProblemDetailsAsDefaultResponseBody, - includeEmptyResponseTypes: true, - includeIfNotDefinedValidation, - includeIfNotDefinedAuthorization, - includeIfNotDefinedInternalServerError); - - return responseTypes - .OrderBy(x => x.Item1) - .Select(x => string.IsNullOrEmpty(x.Item2) - ? $"ProducesResponseType(StatusCodes.Status{(int)x.Item1}{x.Item1})" - : $"ProducesResponseType(typeof({x.Item2}), StatusCodes.Status{(int)x.Item1}{x.Item1})") - .ToList(); - } - - public static List> GetResponseTypes( - this OpenApiResponses responses, - IList apiOperationSchemaMappings, - string apiGroupName, - string projectName, - bool useProblemDetailsAsDefaultResponseBody, - bool includeEmptyResponseTypes, - bool includeIfNotDefinedValidation, - bool includeIfNotDefinedAuthorization, - bool includeIfNotDefinedInternalServerError) - { - var result = new List>(); - foreach (var response in responses.OrderBy(x => x.Key, StringComparer.Ordinal)) - { - if (!Enum.TryParse(typeof(HttpStatusCode), response.Key, out var parsedType)) - { - continue; - } - - var httpStatusCode = parsedType is HttpStatusCode code ? code : 0; - - var isList = responses.IsSchemaTypeArrayForStatusCode(httpStatusCode); - var modelName = responses.GetModelNameForStatusCode(httpStatusCode); - - var isShared = apiOperationSchemaMappings.IsShared(modelName); - modelName = OpenApiDocumentSchemaModelNameResolver.EnsureModelNameWithNamespaceIfNeeded(projectName, apiGroupName, modelName, isShared); - - var useProblemDetails = responses.IsSchemaTypeProblemDetailsForStatusCode(httpStatusCode); - if (!useProblemDetails && - useProblemDetailsAsDefaultResponseBody) - { - useProblemDetails = true; - } - - string? typeResponseName = null; - switch (httpStatusCode) - { - case HttpStatusCode.OK: - case HttpStatusCode.Created: - var dataType = modelName; - - var useBinaryResponse = responses.IsSchemaUsingBinaryFormatForOkResponse(); - if (useBinaryResponse) - { - typeResponseName = "byte[]"; - } - else - { - if (string.IsNullOrEmpty(modelName)) - { - var schema = responses.GetSchemaForStatusCode(httpStatusCode); - if (schema is not null) - { - if (schema.IsSimpleDataType()) - { - dataType = schema.GetDataType(); - } - else if (schema.HasArrayItemsWithSimpleDataType()) - { - dataType = schema.GetSimpleDataTypeFromArray(); - } - else if (schema.HasPaginationItemsWithSimpleDataType()) - { - dataType = schema.GetSimpleDataTypeFromPagination(); - } - else if (schema.IsTypeCustomPagination()) - { - var customPaginationSchema = schema.GetCustomPaginationSchema(); - var customPaginationItemsSchema = schema.GetCustomPaginationItemsSchema(); - if (customPaginationSchema is not null && - customPaginationItemsSchema is not null) - { - var genericDataTypeName = customPaginationSchema.GetDataType(); - if (customPaginationItemsSchema.Items.IsSimpleDataType()) - { - dataType = customPaginationItemsSchema.GetDataType(); - typeResponseName = $"{genericDataTypeName}<{dataType}>"; - } - else - { - dataType = customPaginationItemsSchema.GetModelName(); - dataType = OpenApiDocumentSchemaModelNameResolver.EnsureModelNameWithNamespaceIfNeeded(projectName, apiGroupName, dataType, isShared); - typeResponseName = $"{genericDataTypeName}<{dataType}>"; - } - } - } - } - - if (string.IsNullOrEmpty(dataType)) - { - dataType = "string"; - } - } - - if (string.IsNullOrEmpty(typeResponseName)) - { - if (isList) - { - typeResponseName = $"{NameConstants.List}<{dataType}>"; - } - else - { - var isPagination = responses.IsSchemaTypePaginationForStatusCode(httpStatusCode); - typeResponseName = isPagination - ? $"{NameConstants.Pagination}<{dataType}>" - : dataType; - } - } - } - - break; - case HttpStatusCode.NotModified: - typeResponseName = null; - break; - case HttpStatusCode.Accepted: - case HttpStatusCode.NoContent: - case HttpStatusCode.Unauthorized: - case HttpStatusCode.Forbidden: - typeResponseName = useProblemDetails - ? "ProblemDetails" - : null; - break; - case HttpStatusCode.BadRequest: - typeResponseName = "ValidationProblemDetails"; - break; - case HttpStatusCode.NotFound: - case HttpStatusCode.MethodNotAllowed: - case HttpStatusCode.Conflict: - case HttpStatusCode.InternalServerError: - case HttpStatusCode.NotImplemented: - case HttpStatusCode.BadGateway: - case HttpStatusCode.ServiceUnavailable: - case HttpStatusCode.GatewayTimeout: - typeResponseName = useProblemDetails - ? "ProblemDetails" - : "string"; - break; - default: - throw new NotImplementedException($"ResponseType for {(int)httpStatusCode} - {httpStatusCode} is missing."); - } - - if (typeResponseName is not null) - { - result.Add(Tuple.Create(httpStatusCode, typeResponseName)); - } - else if (includeEmptyResponseTypes) - { - result.Add(Tuple.Create(httpStatusCode, string.Empty)); - } - } - - if (includeIfNotDefinedValidation && - result.All(x => x.Item1 != HttpStatusCode.BadRequest)) - { - result.Add(Tuple.Create(HttpStatusCode.BadRequest, "ValidationProblemDetails")); - } - - if (includeIfNotDefinedAuthorization) - { - if (result.All(x => x.Item1 != HttpStatusCode.Unauthorized)) - { - result.Add(useProblemDetailsAsDefaultResponseBody - ? Tuple.Create(HttpStatusCode.Unauthorized, "ProblemDetails") - : Tuple.Create(HttpStatusCode.Unauthorized, string.Empty)); - } - - if (result.All(x => x.Item1 != HttpStatusCode.Forbidden)) - { - result.Add(useProblemDetailsAsDefaultResponseBody - ? Tuple.Create(HttpStatusCode.Forbidden, "ProblemDetails") - : Tuple.Create(HttpStatusCode.Forbidden, string.Empty)); - } - } - - if (includeIfNotDefinedInternalServerError && - result.All(x => x.Item1 != HttpStatusCode.InternalServerError)) - { - result.Add(useProblemDetailsAsDefaultResponseBody - ? Tuple.Create(HttpStatusCode.InternalServerError, "ProblemDetails") - : Tuple.Create(HttpStatusCode.InternalServerError, "string")); - } - - return result; - } -} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.OpenApi/Extensions/OpenApiSchemaExtensions.cs b/src/Atc.Rest.ApiGenerator.OpenApi/Extensions/OpenApiSchemaExtensions.cs index 0cbe2e12..46165029 100644 --- a/src/Atc.Rest.ApiGenerator.OpenApi/Extensions/OpenApiSchemaExtensions.cs +++ b/src/Atc.Rest.ApiGenerator.OpenApi/Extensions/OpenApiSchemaExtensions.cs @@ -81,56 +81,21 @@ public static IDictionary GetPaginationParameters( return apiSchemaForItems.Value.Value; } - public static string GetSimpleDataTypeFromCustomPagination( + public static string? GetCollectionDataType( this OpenApiSchema schema) { - if (schema is null) + if (schema.IsArray()) { - throw new ArgumentNullException(nameof(schema)); + return NameConstants.List; } - var customPaginationItemsSchema = schema.GetCustomPaginationItemsSchema(); - return customPaginationItemsSchema is null - ? string.Empty - : customPaginationItemsSchema.GetDataType(); - } - - public static string? GetCustomPaginationGenericTypeWithItemType( - this OpenApiSchema schema, - string projectName, - string apiGroupName, - bool isClient = false) - { - if (!schema.IsTypeCustomPagination()) - { - return null; - } - - var customPaginationSchema = schema.GetCustomPaginationSchema(); - var customPaginationItemsSchema = schema.GetCustomPaginationItemsSchema(); - if (customPaginationSchema is null || - customPaginationItemsSchema is null) - { - return null; - } - - string? itemTypeName; - if (customPaginationItemsSchema.IsSimpleDataType()) - { - itemTypeName = customPaginationItemsSchema.GetDataType(); - } - else + if (schema.IsTypePagination() || + schema.IsTypeCustomPagination()) { - itemTypeName = OpenApiDocumentSchemaModelNameResolver.EnsureModelNameWithNamespaceIfNeeded( - projectName, - apiGroupName, - customPaginationItemsSchema.GetModelName(), - isShared: false, - isClient); + return NameConstants.Pagination; } - var customPaginationTypeName = customPaginationSchema.GetModelName(); - return $"{customPaginationTypeName}<{itemTypeName}>"; + return null; } public static bool IsModelOfTypeArray( @@ -141,7 +106,7 @@ public static bool IsModelOfTypeArray( if (modelType is null && apiSchema.Reference?.Id is not null) { - var (key, value) = modelSchemas.FirstOrDefault(x => x.Key.Equals(apiSchema.Reference.Id, StringComparison.OrdinalIgnoreCase)); + var (key, value) = modelSchemas.FirstOrDefault(x => x.GetFormattedKey().Equals(apiSchema.Reference.Id, StringComparison.OrdinalIgnoreCase)); if (key is not null) { return value.Type is not null && @@ -161,23 +126,32 @@ public static bool IsArray( public static bool IsTypeCustomPagination( this OpenApiSchema schema) { - if (schema is null) - { - throw new ArgumentNullException(nameof(schema)); - } + ArgumentNullException.ThrowIfNull(schema); if (schema.AllOf.Count == 2) { if (schema.AllOf[0].Reference?.Id is null && schema.AllOf[1].Reference?.Id is not null) { - return true; + var dataType = schema.AllOf[1].Reference?.Id.PascalCase(ApiOperationExtractor.ModelNameSeparators, removeSeparators: true); + if (dataType is not null && + (dataType.Contains(NameConstants.Pagination, StringComparison.Ordinal) || + dataType.Contains("Paginated", StringComparison.Ordinal))) + { + return true; + } } if (schema.AllOf[0].Reference?.Id is not null && schema.AllOf[1].Reference?.Id is null) { - return true; + var dataType = schema.AllOf[0].Reference?.Id.PascalCase(ApiOperationExtractor.ModelNameSeparators, removeSeparators: true); + if (dataType is not null && + (dataType.Contains(NameConstants.Pagination, StringComparison.Ordinal) || + dataType.Contains("Paginated", StringComparison.Ordinal))) + { + return true; + } } } @@ -217,7 +191,7 @@ public static string ExtractDocumentationTagSummary( summery = defaultSummary; } - return summery.EnsureEndsWithDot(); + return summery.EnsureFormatForDocumentationTag(); } public static string? ExtractDocumentationTagRemark( diff --git a/src/Atc.Rest.ApiGenerator.OpenApi/Extensions/StringExtensions.cs b/src/Atc.Rest.ApiGenerator.OpenApi/Extensions/StringExtensions.cs index 5eafb99b..1f69c2c3 100644 --- a/src/Atc.Rest.ApiGenerator.OpenApi/Extensions/StringExtensions.cs +++ b/src/Atc.Rest.ApiGenerator.OpenApi/Extensions/StringExtensions.cs @@ -6,4 +6,40 @@ public static bool IsNamedAsItemsOrResult( this string value) => value.Equals("items", StringComparison.Ordinal) || value.Equals("results", StringComparison.Ordinal); + + public static string EnsureFormatForDocumentationTag( + this string value) + { + if (value.Contains("
", StringComparison.OrdinalIgnoreCase)) + { + value = value + .EnsureEndsWithDot() + .Replace("
", "
", StringComparison.OrdinalIgnoreCase); + } + + if (value.Contains('<', StringComparison.Ordinal) || + value.Contains('>', StringComparison.Ordinal)) + { + value = value + .Replace("<", "<", StringComparison.OrdinalIgnoreCase) + .Replace(">", ">", StringComparison.OrdinalIgnoreCase); + } + + while (value.Contains(" ", StringComparison.Ordinal)) + { + value = value.Replace(" ", " ", StringComparison.Ordinal); + } + + while (value.Contains("\n ", StringComparison.Ordinal)) + { + value = value.Replace("\n ", "\n", StringComparison.Ordinal); + } + + if (value.EndsWith("\n", StringComparison.Ordinal)) + { + value = value[..^1]; + } + + return value.EnsureEndsWithDot(); + } } \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.OpenApi/Extractors/ApiOperationExtractor.cs b/src/Atc.Rest.ApiGenerator.OpenApi/Extractors/ApiOperationExtractor.cs index ce410649..46a08396 100644 --- a/src/Atc.Rest.ApiGenerator.OpenApi/Extractors/ApiOperationExtractor.cs +++ b/src/Atc.Rest.ApiGenerator.OpenApi/Extractors/ApiOperationExtractor.cs @@ -5,6 +5,8 @@ namespace Atc.Rest.ApiGenerator.OpenApi.Extractors; public sealed class ApiOperationExtractor : IApiOperationExtractor { + public static readonly char[] ModelNameSeparators = { ' ', '-', '_', '.' }; + public IList Extract( OpenApiDocument apiDocument) { @@ -41,11 +43,25 @@ private static void ExtractMappingsFromParameters( continue; } - foreach (var apiMediaType in apiParameter.Content) + if (apiParameter.Content.Keys.Count > 0) + { + foreach (var apiMediaType in apiParameter.Content) + { + CollectSchema( + componentsSchemas, + apiSchema: apiMediaType.Value.Schema, + locatedArea: ApiSchemaMapLocatedAreaType.Parameter, + apiPath.Key, + httpOperation: apiOperation.HttpOperationType, + parentApiSchema: null, + result); + } + } + else { CollectSchema( componentsSchemas, - apiSchema: apiMediaType.Value.Schema, + apiSchema: apiParameter.Schema, locatedArea: ApiSchemaMapLocatedAreaType.Parameter, apiPath.Key, httpOperation: apiOperation.HttpOperationType, @@ -66,16 +82,19 @@ private static void ExtractMappingsFromRequestBody( return; } - foreach (var apiMediaType in apiOperation.OpenApiOperation.RequestBody.Content) + if (apiOperation.OpenApiOperation.RequestBody.Content.Count > 0) { - CollectSchema( - componentsSchemas, - apiSchema: apiMediaType.Value.Schema, - locatedArea: ApiSchemaMapLocatedAreaType.RequestBody, - apiPath.Key, - apiOperation.HttpOperationType, - parentApiSchema: null, - result); + foreach (var apiMediaType in apiOperation.OpenApiOperation.RequestBody.Content) + { + CollectSchema( + componentsSchemas, + apiSchema: apiMediaType.Value.Schema, + locatedArea: ApiSchemaMapLocatedAreaType.RequestBody, + apiPath.Key, + apiOperation.HttpOperationType, + parentApiSchema: null, + result); + } } } @@ -92,16 +111,19 @@ private static void ExtractMappingsFromResponses( continue; } - foreach (var apiMediaType in apiResponse.Value.Content) + if (apiResponse.Value.Content.Keys.Count > 0) { - CollectSchema( - componentsSchemas, - apiSchema: apiMediaType.Value.Schema, - locatedArea: ApiSchemaMapLocatedAreaType.Response, - apiPath.Key, - apiOperation.HttpOperationType, - parentApiSchema: null, - result); + foreach (var apiMediaType in apiResponse.Value.Content.Where(x => x.Key.Equals(MediaTypeNames.Application.Json, StringComparison.OrdinalIgnoreCase))) + { + CollectSchema( + componentsSchemas, + apiSchema: apiMediaType.Value.Schema, + locatedArea: ApiSchemaMapLocatedAreaType.Response, + apiPath.Key, + apiOperation.HttpOperationType, + parentApiSchema: null, + result); + } } } } @@ -120,46 +142,48 @@ private static void CollectSchema( return; } - (var schemaKey, apiSchema) = ConsolidateSchemaObjectTypes(apiSchema); - - if (schemaKey.Length == 0 || - schemaKey == nameof(ProblemDetails) || - schemaKey.Equals(NameConstants.Pagination, StringComparison.OrdinalIgnoreCase)) + if (apiSchema.IsTypeCustomPagination()) { - if (apiSchema.IsTypeCustomPagination()) + var apiSchemaForCustomPagination = apiSchema.GetCustomPaginationSchema(); + var apiSchemaForCustomPaginationItems = apiSchema.GetCustomPaginationItemsSchema(); + if (apiSchemaForCustomPagination is not null && + apiSchemaForCustomPaginationItems is not null) { - var apiSchemaForCustomPagination = apiSchema.GetCustomPaginationSchema(); - var apiSchemaForCustomPaginationItems = apiSchema.GetCustomPaginationItemsSchema(); - if (apiSchemaForCustomPagination is not null && - apiSchemaForCustomPaginationItems is not null) - { - var consolidateSchemaForCustomPaginationItems = ConsolidateSchemaObjectTypes(apiSchemaForCustomPaginationItems); - CollectSchema( - componentsSchemas, - consolidateSchemaForCustomPaginationItems.Item2, - locatedArea, - apiPath, - httpOperation, - parentApiSchema, - result); + var consolidateSchemaForCustomPaginationItems = ConsolidateSchemaObjectTypes(apiSchemaForCustomPaginationItems); + CollectSchema( + componentsSchemas, + consolidateSchemaForCustomPaginationItems.Item2, + locatedArea, + apiPath, + httpOperation, + parentApiSchema, + result); - var consolidateSchemaForCustomPagination = ConsolidateSchemaObjectTypes(apiSchemaForCustomPagination); - CollectSchema( - componentsSchemas, - consolidateSchemaForCustomPagination.Item2, - locatedArea, - apiPath, - httpOperation, - parentApiSchema, - result); - } + var consolidateSchemaForCustomPagination = ConsolidateSchemaObjectTypes(apiSchemaForCustomPagination); + CollectSchema( + componentsSchemas, + consolidateSchemaForCustomPagination.Item2, + locatedArea, + apiPath, + httpOperation, + parentApiSchema, + result); } return; } - var apiOperation = new ApiOperation(schemaKey, locatedArea, apiPath, httpOperation, parentApiSchema); - if (result.Any(x => x.Equals(apiOperation))) + (var schemaKey, apiSchema) = ConsolidateSchemaObjectTypes(apiSchema); + + if (string.IsNullOrEmpty(schemaKey) || + schemaKey == "ProblemDetails" || + schemaKey.Equals(NameConstants.Pagination, StringComparison.OrdinalIgnoreCase)) + { + return; + } + + var apiOperation = new ApiOperation(schemaKey.PascalCase(), locatedArea, apiPath, httpOperation, parentApiSchema); + if (result.Exists(x => x.Equals(apiOperation))) { return; } @@ -227,7 +251,7 @@ private static void HandleCardinalityMultiple( result.Add(subApiOperation); - var subApiSchema = componentsSchemas.Single(x => x.Key.Equals(subSchemaKey, StringComparison.OrdinalIgnoreCase)).Value; + var subApiSchema = componentsSchemas.Single(x => x.GetFormattedKey().Equals(subSchemaKey, StringComparison.OrdinalIgnoreCase)).Value; if (subApiSchema.Properties.Any()) { Collect( @@ -266,7 +290,7 @@ private static void HandleCardinalityPaged( return; } - var subApiSchema = componentsSchemas.Single(x => x.Key.Equals(schemaKey, StringComparison.OrdinalIgnoreCase)).Value; + var subApiSchema = componentsSchemas.Single(x => x.GetFormattedKey().Equals(schemaKey, StringComparison.OrdinalIgnoreCase)).Value; Collect( componentsSchemas, @@ -306,24 +330,30 @@ private static (string, OpenApiSchema) ConsolidateSchemaObjectTypes( var schemaKey = string.Empty; if (apiSchema.Reference?.Id is not null) { - schemaKey = apiSchema.Reference.Id.EnsureFirstCharacterToUpper(); + schemaKey = apiSchema.Reference.Id.PascalCase(ModelNameSeparators, removeSeparators: true); } else if (apiSchema.IsArray()) { - schemaKey = apiSchema.Items.Reference.Id.EnsureFirstCharacterToUpper(); + schemaKey = apiSchema.Items.Reference.Id.PascalCase(ModelNameSeparators, removeSeparators: true); apiSchema = apiSchema.Items; } else if (apiSchema.OneOf.Any() && - apiSchema.OneOf.First().Reference?.Id is not null) + apiSchema.OneOf[0].Reference?.Id is not null) { - schemaKey = apiSchema.OneOf.First().Reference.Id.EnsureFirstCharacterToUpper(); - apiSchema = apiSchema.OneOf.First(); + schemaKey = apiSchema.OneOf[0].Reference.Id.PascalCase(ModelNameSeparators, removeSeparators: true); + apiSchema = apiSchema.OneOf[0]; } else if (apiSchema.AnyOf.Any() && - apiSchema.AnyOf.First().Reference?.Id is not null) + apiSchema.AnyOf[0].Reference?.Id is not null) + { + schemaKey = apiSchema.AnyOf[0].Reference.Id.PascalCase(ModelNameSeparators, removeSeparators: true); + apiSchema = apiSchema.AnyOf[0]; + } + else if (apiSchema.AllOf.Any() && + apiSchema.AllOf[0].Reference?.Id is not null) { - schemaKey = apiSchema.AnyOf.First().Reference.Id.EnsureFirstCharacterToUpper(); - apiSchema = apiSchema.AnyOf.First(); + schemaKey = apiSchema.AllOf[0].Reference.Id.PascalCase(ModelNameSeparators, removeSeparators: true); + apiSchema = apiSchema.AllOf[0]; } else if (apiSchema.IsTypePagination()) { diff --git a/src/Atc.Rest.ApiGenerator.OpenApi/Factories/LogItemFactory.cs b/src/Atc.Rest.ApiGenerator.OpenApi/Factories/LogItemFactory.cs index 91ee0be2..af971ef1 100644 --- a/src/Atc.Rest.ApiGenerator.OpenApi/Factories/LogItemFactory.cs +++ b/src/Atc.Rest.ApiGenerator.OpenApi/Factories/LogItemFactory.cs @@ -26,7 +26,7 @@ private static string ExtractAreaFromRuleName( list.Add(new Tuple(fieldInfo.Name, fieldValue!)); } - var tuple = list.FirstOrDefault(x => x.Item2 == ruleName); + var tuple = list.Find(x => x.Item2 == ruleName); if (tuple is null || string.IsNullOrEmpty(tuple.Item2)) { diff --git a/src/Atc.Rest.ApiGenerator.OpenApi/GlobalUsings.cs b/src/Atc.Rest.ApiGenerator.OpenApi/GlobalUsings.cs index 71971e3b..2689646d 100644 --- a/src/Atc.Rest.ApiGenerator.OpenApi/GlobalUsings.cs +++ b/src/Atc.Rest.ApiGenerator.OpenApi/GlobalUsings.cs @@ -2,21 +2,20 @@ global using System.Diagnostics.CodeAnalysis; global using System.Globalization; global using System.Net; +global using System.Net.Mime; global using System.Text; global using Atc.CodeDocumentation.CodeComment; global using Atc.Data.Models; -global using Atc.Rest.ApiGenerator.Framework.Contracts; -global using Atc.Rest.ApiGenerator.Framework.Contracts.ContentGeneratorsParameters.Server; -global using Atc.Rest.ApiGenerator.Framework.Contracts.Extensions; -global using Atc.Rest.ApiGenerator.Framework.Contracts.Models; -global using Atc.Rest.ApiGenerator.Framework.Contracts.Options; -global using Atc.Rest.ApiGenerator.Framework.Contracts.Resolver; +global using Atc.Rest.ApiGenerator.Contracts; +global using Atc.Rest.ApiGenerator.Contracts.ContentGeneratorsParameters.Server; +global using Atc.Rest.ApiGenerator.Contracts.Models; +global using Atc.Rest.ApiGenerator.Contracts.Options; global using Atc.Rest.ApiGenerator.OpenApi.Extensions; +global using Atc.Rest.ApiGenerator.OpenApi.Extractors; global using Atc.Rest.ApiGenerator.OpenApi.Factories; global using Atc.Rest.ApiGenerator.OpenApi.Models; -global using Microsoft.AspNetCore.Mvc; global using Microsoft.Extensions.Logging; global using Microsoft.OpenApi; global using Microsoft.OpenApi.Any; diff --git a/src/Atc.Rest.ApiGenerator.OpenApi/Validators/IOpenApiDocumentValidator.cs b/src/Atc.Rest.ApiGenerator.OpenApi/Validators/IOpenApiDocumentValidator.cs index 33527b63..9b4a76ce 100644 --- a/src/Atc.Rest.ApiGenerator.OpenApi/Validators/IOpenApiDocumentValidator.cs +++ b/src/Atc.Rest.ApiGenerator.OpenApi/Validators/IOpenApiDocumentValidator.cs @@ -4,5 +4,6 @@ public interface IOpenApiDocumentValidator { bool IsValid( ApiOptionsValidation apiOptionsValidation, + bool includeDeprecated, OpenApiDocumentContainer apiDocumentContainer); } \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.OpenApi/Validators/OpenApiDocumentValidator.cs b/src/Atc.Rest.ApiGenerator.OpenApi/Validators/OpenApiDocumentValidator.cs index b541813a..f430cf1c 100644 --- a/src/Atc.Rest.ApiGenerator.OpenApi/Validators/OpenApiDocumentValidator.cs +++ b/src/Atc.Rest.ApiGenerator.OpenApi/Validators/OpenApiDocumentValidator.cs @@ -23,6 +23,7 @@ public OpenApiDocumentValidator( public bool IsValid( ApiOptionsValidation apiOptionsValidation, + bool includeDeprecated, OpenApiDocumentContainer apiDocumentContainer) { logger.LogInformation($"{AreaValidationEmoji} Working on validation"); @@ -38,7 +39,7 @@ public bool IsValid( } return IsValidUsingMicrosoftOpenApi(apiDocumentContainer) && - IsValidUsingAtcOptions(apiOptionsValidation, apiDocumentContainer); + IsValidUsingAtcOptions(apiOptionsValidation, includeDeprecated, apiDocumentContainer); } private bool IsValidUsingMicrosoftOpenApi( @@ -59,7 +60,7 @@ private bool IsValidUsingMicrosoftOpenApi( .ToList(); logger.LogKeyValueItems(validationErrors); - return false; + return logCategory != LogCategoryType.Error; } if (apiDocumentContainer.Diagnostic.SpecificationVersion == OpenApiSpecVersion.OpenApi2_0) @@ -73,11 +74,12 @@ private bool IsValidUsingMicrosoftOpenApi( private bool IsValidUsingAtcOptions( ApiOptionsValidation validationOptions, + bool includeDeprecated, OpenApiDocumentContainer apiDocumentContainer) { ValidateSecurity(apiDocumentContainer.Document!); ValidateServers(apiDocumentContainer.Document!.Servers); - ValidateSchemas(validationOptions, apiDocumentContainer.Document!.Components.Schemas.Values); + ValidateSchemas(validationOptions, includeDeprecated, apiDocumentContainer.Document!.Components.Schemas.Values); ValidateOperations(validationOptions, apiDocumentContainer.Document.Paths, apiDocumentContainer.Document!.Components.Schemas); ValidatePathsAndOperations(apiDocumentContainer.Document!.Paths); ValidateOperationsParametersAndResponses(apiDocumentContainer.Document!.Paths.Values); @@ -85,7 +87,7 @@ private bool IsValidUsingAtcOptions( AddIndentationToLogItemKeys(logItems); logger.LogKeyValueItems(logItems); - return logItems.All(x => x.LogCategory != LogCategoryType.Error); + return !validationOptions.StrictMode || logItems.TrueForAll(x => x.LogCategory != LogCategoryType.Error); } private void ValidateSecurity( @@ -311,6 +313,7 @@ private static bool IsServerUrlValid( private void ValidateSchemas( ApiOptionsValidation validationOptions, + bool includeDeprecated, IEnumerable schemas) { foreach (var schema in schemas) @@ -345,6 +348,11 @@ private void ValidateSchemas( foreach (var (key, value) in schema.Properties) { + if (value.Deprecated && !includeDeprecated) + { + continue; + } + if (string.IsNullOrEmpty(key)) { logItems.Add(logItemFactory.Create(logCategory, ValidationRuleNameConstants.Schema12, $"Missing key/name for one or more properties on object type '{schema.Reference.ReferenceV3}'.")); diff --git a/src/Atc.Rest.ApiGenerator.Projects/.editorconfig b/src/Atc.Rest.ApiGenerator.Projects/.editorconfig deleted file mode 100644 index fea9030f..00000000 --- a/src/Atc.Rest.ApiGenerator.Projects/.editorconfig +++ /dev/null @@ -1,53 +0,0 @@ -# ATC coding rules - https://github.com/atc-net/atc-coding-rules -# Version: 1.0.9 -# Updated: 01-02-2022 -# Location: Atc.Rest.ApiGenerator.Projects -# Distribution: DotNet6 -# Inspired by: https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/code-style-rule-options - -########################################## -# Code Analyzers Rules -########################################## -[*.{cs,csx,cake}] - -# AsyncFixer -# http://www.asyncfixer.com - - -# Asyncify -# https://github.com/hvanbakel/Asyncify-CSharp - - -# Meziantou -# https://www.meziantou.net/enforcing-asynchronous-code-good-practices-using-a-roslyn-analyzer.htm - - -# Microsoft - Code Analysis -# https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ - - -# Microsoft - Compiler Errors -# https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-messages/ - - -# SecurityCodeScan -# https://security-code-scan.github.io/ - - -# StyleCop -# https://github.com/DotNetAnalyzers/StyleCopAnalyzers - - -# SonarAnalyzer.CSharp -# https://rules.sonarsource.com/csharp - - -########################################## -# Custom - Code Analyzers Rules -########################################## -dotnet_diagnostic.CA1031.severity = none # Do not catch general exception types -dotnet_diagnostic.CA1062.severity = none # Validate arguments of public methods -dotnet_diagnostic.CA2007.severity = none # Consider calling ConfigureAwait on the awaited task - -dotnet_diagnostic.MA0004.severity = none # Use Task.ConfigureAwait(false) -dotnet_diagnostic.MA0076.severity = none # Do not use implicit culture-sensitive ToString in interpolated strings \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Projects/Atc.Rest.ApiGenerator.Projects.csproj b/src/Atc.Rest.ApiGenerator.Projects/Atc.Rest.ApiGenerator.Projects.csproj deleted file mode 100644 index 316738a2..00000000 --- a/src/Atc.Rest.ApiGenerator.Projects/Atc.Rest.ApiGenerator.Projects.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - net6.0 - false - - - - - - - diff --git a/src/Atc.Rest.ApiGenerator.Projects/GlobalUsings.cs b/src/Atc.Rest.ApiGenerator.Projects/GlobalUsings.cs deleted file mode 100644 index 32b47904..00000000 --- a/src/Atc.Rest.ApiGenerator.Projects/GlobalUsings.cs +++ /dev/null @@ -1,4 +0,0 @@ -global using Atc.Helpers; -global using Atc.Rest.ApiGenerator.Nuget.Clients; - -global using Microsoft.Extensions.Logging.Abstractions; \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Projects/INugetPackageReferenceProvider.cs b/src/Atc.Rest.ApiGenerator.Projects/INugetPackageReferenceProvider.cs deleted file mode 100644 index 9e69dd25..00000000 --- a/src/Atc.Rest.ApiGenerator.Projects/INugetPackageReferenceProvider.cs +++ /dev/null @@ -1,16 +0,0 @@ -namespace Atc.Rest.ApiGenerator.Projects; - -public interface INugetPackageReferenceProvider -{ - Task GetAtcApiGeneratorVersion(); - - Task> GetPackageReferencesBaseLineForHostProject( - bool useRestExtended); - - Task> GetPackageReferencesBaseLineForApiProject(); - - Task> GetPackageReferencesBaseLineForApiClientProject(); - - IList<(string PackageId, string PackageVersion, string? SubElements)> GetPackageReferencesBaseLineForTestProject( - bool useMvc); -} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator.Projects/NugetPackageReferenceProvider.cs b/src/Atc.Rest.ApiGenerator.Projects/NugetPackageReferenceProvider.cs deleted file mode 100644 index 26c2b805..00000000 --- a/src/Atc.Rest.ApiGenerator.Projects/NugetPackageReferenceProvider.cs +++ /dev/null @@ -1,121 +0,0 @@ -namespace Atc.Rest.ApiGenerator.Projects; - -public class NugetPackageReferenceProvider : INugetPackageReferenceProvider -{ - private readonly IAtcApiNugetClient atcApiNugetClient; - - public NugetPackageReferenceProvider( - IAtcApiNugetClient atcApiNugetClient) - { - this.atcApiNugetClient = atcApiNugetClient; - } - - public async Task GetAtcApiGeneratorVersion() - { - var version = await atcApiNugetClient.RetrieveLatestVersionForPackageId( - "Atc.Rest.ApiGenerator", - CancellationToken.None) ?? new Version(2, 0, 360, 0); - - var assemblyVersion = CliHelper.GetCurrentVersion(); - - return assemblyVersion.GreaterThan(version) - ? assemblyVersion - : new Version(2, 0, 360, 0); - } - - public async Task> GetPackageReferencesBaseLineForHostProject( - bool useRestExtended) - { - var atcVersion = await GetAtcVersionAsString3(); - - var packageReferences = new List<(string, string, string?)> - { - new("Atc", atcVersion, null), - new("Atc.Rest", atcVersion, null), - }; - - if (!useRestExtended) - { - return packageReferences; - } - - packageReferences.Add(("Atc.Rest.Extended", atcVersion, null)); - packageReferences.Add(("FluentValidation.AspNetCore", "11.3.0", null)); - packageReferences.Add(("Microsoft.ApplicationInsights.AspNetCore", "2.21.0", null)); - packageReferences.Add(("Microsoft.AspNetCore.Authentication.JwtBearer", "6.0.9", null)); - packageReferences.Add(("Microsoft.AspNetCore.Mvc.Versioning", "5.1.0", null)); - packageReferences.Add(("Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer", "5.1.0", null)); - packageReferences.Add(("Swashbuckle.AspNetCore", "6.5.0", null)); - - return packageReferences; - } - - public async Task> GetPackageReferencesBaseLineForApiProject() - { - var atcVersion = await GetAtcVersionAsString3(); - - var packageReferences = new List<(string, string, string?)> - { - new("Atc", atcVersion, null), - new("Atc.Rest", atcVersion, null), - }; - - return packageReferences; - } - - public async Task> GetPackageReferencesBaseLineForApiClientProject() - { - var atcVersion = await GetAtcVersionAsString3(); - - var packageReferences = new List<(string, string, string?)> - { - new("Atc", atcVersion, null), - new("Atc.Rest", atcVersion, null), - new("Atc.Rest.Client", "1.0.36", null), - }; - - return packageReferences; - } - - public IList<(string PackageId, string PackageVersion, string? SubElements)> GetPackageReferencesBaseLineForTestProject( - bool useMvc) - { - var packageReferences = new List<(string, string, string?)> - { - new("Atc.XUnit", "2.0.93", null), - new("AutoFixture", "4.18.0", null), - new("AutoFixture.AutoNSubstitute", "4.18.0", null), - new("AutoFixture.Xunit2", "4.18.0", null), - new("FluentAssertions", "6.11.0", null), - }; - - if (useMvc) - { - packageReferences.Add(("Microsoft.AspNetCore.Mvc.Testing", "6.0.3", null)); - } - - packageReferences.AddRange(new List<(string, string, string?)> - { - new("Microsoft.NET.Test.Sdk", "17.6.2", null), - new("NSubstitute", "5.0.0", null), - new("xunit", "2.4.2", null), - new("xunit.runner.visualstudio", "2.4.4", "all\nruntime; build; native; contentfiles; analyzers; buildtransitive"), - }); - - return packageReferences; - } - - private async Task GetAtcVersion() - { - var version = await atcApiNugetClient.RetrieveLatestVersionForPackageId( - "Atc", - CancellationToken.None); - return version ?? new Version(2, 0, 280, 0); - } - - private async Task GetAtcVersionAsString3() - { - var atcVersion = await GetAtcVersion(); - return $"{atcVersion.Major}.{atcVersion.Minor}.{atcVersion.Build}"; - } -} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator/Atc.Rest.ApiGenerator.csproj b/src/Atc.Rest.ApiGenerator/Atc.Rest.ApiGenerator.csproj index fa4afd5f..69bc5eed 100644 --- a/src/Atc.Rest.ApiGenerator/Atc.Rest.ApiGenerator.csproj +++ b/src/Atc.Rest.ApiGenerator/Atc.Rest.ApiGenerator.csproj @@ -1,35 +1,29 @@ - net6.0 + net8.0 Atc.Rest.ApiGenerator rest;api;netstandard;generator Atc.Rest.ApiGenerator is a WebApi C# code generator using a OpenApi 3.0.x specification YAML file. - - - - - - - - - + + + + + + + + + - - - - - - - + + + - - \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator/AtcRestApiGeneratorAssemblyTypeInitializer.cs b/src/Atc.Rest.ApiGenerator/AtcRestApiGeneratorAssemblyTypeInitializer.cs deleted file mode 100644 index c76c0bdb..00000000 --- a/src/Atc.Rest.ApiGenerator/AtcRestApiGeneratorAssemblyTypeInitializer.cs +++ /dev/null @@ -1,8 +0,0 @@ -[assembly: CLSCompliant(false)] - -namespace Atc.Rest.ApiGenerator; - -public class AtcRestApiGeneratorAssemblyTypeInitializer -{ - // Dummy -} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator/Generators/ClientCSharpApiGenerator.cs b/src/Atc.Rest.ApiGenerator/Generators/ClientCSharpApiGenerator.cs index b3352576..5490edfe 100644 --- a/src/Atc.Rest.ApiGenerator/Generators/ClientCSharpApiGenerator.cs +++ b/src/Atc.Rest.ApiGenerator/Generators/ClientCSharpApiGenerator.cs @@ -5,549 +5,64 @@ namespace Atc.Rest.ApiGenerator.Generators; public class ClientCSharpApiGenerator { private readonly ILogger logger; - private readonly IApiOperationExtractor apiOperationExtractor; - private readonly INugetPackageReferenceProvider nugetPackageReferenceProvider; private readonly ClientCSharpApiProjectOptions projectOptions; - private readonly ApiProjectOptions apiProjectOptions; - private readonly string codeGeneratorContentHeader; - private readonly AttributeParameters codeGeneratorAttribute; + private readonly IClientCSharpApiGenerator clientCSharpApiGenerator; public ClientCSharpApiGenerator( - ILogger logger, + ILoggerFactory loggerFactory, IApiOperationExtractor apiOperationExtractor, INugetPackageReferenceProvider nugetPackageReferenceProvider, ClientCSharpApiProjectOptions projectOptions) { - this.logger = logger ?? throw new ArgumentNullException(nameof(logger)); - this.apiOperationExtractor = apiOperationExtractor ?? throw new ArgumentNullException(nameof(apiOperationExtractor)); - this.nugetPackageReferenceProvider = nugetPackageReferenceProvider ?? throw new ArgumentNullException(nameof(nugetPackageReferenceProvider)); - this.projectOptions = projectOptions ?? throw new ArgumentNullException(nameof(projectOptions)); - - apiProjectOptions = new ApiProjectOptions( - projectOptions.PathForSrcGenerate, - projectTestGeneratePath: null, - projectOptions.Document, - projectOptions.DocumentFile, - projectOptions.ProjectName, - projectSuffixName: null, - projectOptions.ApiOptions, - projectOptions.UsingCodingRules, - projectOptions.RemoveNamespaceGroupSeparatorInGlobalUsings, - projectOptions.ForClient, - projectOptions.ClientFolderName); + ArgumentNullException.ThrowIfNull(loggerFactory); + ArgumentNullException.ThrowIfNull(apiOperationExtractor); - // TODO: Optimize codeGeneratorContentHeader & codeGeneratorAttribute - var codeHeaderGenerator = new GeneratedCodeHeaderGenerator( - new GeneratedCodeGeneratorParameters( - projectOptions.ApiGeneratorVersion)); - codeGeneratorContentHeader = codeHeaderGenerator.Generate(); - - codeGeneratorAttribute = new AttributeParameters( - "GeneratedCode", - $"\"{ContentWriterConstants.ApiGeneratorName}\", \"{projectOptions.ApiGeneratorVersion}\""); - } - - public bool Generate() - { - logger.LogInformation($"{ContentWriterConstants.AreaGenerateCode} Working on client api generation ({projectOptions.ProjectName})"); - - ScaffoldSrc(); + logger = loggerFactory.CreateLogger(); + this.projectOptions = projectOptions ?? throw new ArgumentNullException(nameof(projectOptions)); var operationSchemaMappings = apiOperationExtractor.Extract(projectOptions.Document); - GenerateModels(projectOptions.Document, operationSchemaMappings); - - GenerateParameters(projectOptions.Document); - - if (!projectOptions.ExcludeEndpointGeneration) - { - GenerateEndpointInterfaces(projectOptions.Document); - - GenerateEndpoints(projectOptions.Document); - - GenerateEndpointResultInterfaces(projectOptions.Document); - - GenerateEndpointResults(projectOptions.Document); - } - - GenerateSrcGlobalUsings( - projectOptions.RemoveNamespaceGroupSeparatorInGlobalUsings, - operationSchemaMappings); - - return true; - } - - private void ScaffoldSrc() - { - if (!Directory.Exists(projectOptions.PathForSrcGenerate.FullName)) - { - Directory.CreateDirectory(projectOptions.PathForSrcGenerate.FullName); - } - - if (projectOptions.PathForSrcGenerate.Exists && - projectOptions.ProjectSrcCsProj.Exists) - { - var hasUpdates = SolutionAndProjectHelper.EnsureLatestPackageReferencesVersionInProjFile( - logger, - projectOptions.ProjectSrcCsProj, - projectOptions.ProjectSrcCsProjDisplayLocation, - ProjectType.ClientApi, - isTestProject: false); - if (!hasUpdates) - { - logger.LogDebug($"{EmojisConstants.FileNotUpdated} No updates for csproj"); - } - } - else - { - IList<(string PackageId, string PackageVersion, string? SubElements)>? packageReferencesBaseLineForApiClientProject = null; - TaskHelper.RunSync(async () => - { - packageReferencesBaseLineForApiClientProject = await nugetPackageReferenceProvider.GetPackageReferencesBaseLineForApiClientProject(); - }); - - SolutionAndProjectHelper.ScaffoldProjFile( - logger, - projectOptions.ProjectSrcCsProj, - projectOptions.ProjectSrcCsProjDisplayLocation, - ProjectType.ClientApi, - createAsWeb: false, - createAsTestProject: false, - projectName: projectOptions.ProjectName, - "net6.0", - frameworkReferences: null, - packageReferences: packageReferencesBaseLineForApiClientProject, - projectReferences: null, - includeApiSpecification: false, - usingCodingRules: projectOptions.UsingCodingRules); - } - } - - private void GenerateModels( - OpenApiDocument document, - IList operationSchemaMappings) - { - ArgumentNullException.ThrowIfNull(operationSchemaMappings); - - foreach (var apiGroupName in projectOptions.ApiGroupNames) - { - var apiOperations = operationSchemaMappings - .Where(x => x.LocatedArea is ApiSchemaMapLocatedAreaType.Response or ApiSchemaMapLocatedAreaType.RequestBody && - x.ApiGroupName.Equals(apiGroupName, StringComparison.OrdinalIgnoreCase)) - .ToList(); - - var apiOperationModels = GetDistinctApiOperationModels(apiOperations); - - foreach (var apiOperationModel in apiOperationModels) - { - var apiSchema = document.Components.Schemas.First(x => - x.Key.Equals(apiOperationModel.Name, StringComparison.OrdinalIgnoreCase)); - - var modelName = apiSchema.Key.EnsureFirstCharacterToUpper(); - - if (apiOperationModel.IsEnum) - { - GenerateEnumerationType(modelName, apiSchema.Value.GetEnumSchema().Item2); - } - else - { - GenerateModel(modelName, apiSchema.Value, apiGroupName, apiOperationModel.IsShared); - } - } - } - } - - private void GenerateEnumerationType( - string enumerationName, - OpenApiSchema openApiSchemaEnumeration) - { - var fullNamespace = $"{projectOptions.ProjectName}.{ContentGeneratorConstants.Contracts}"; - - // Generate - var enumParameters = ContentGeneratorServerClientEnumParametersFactory.Create( - codeGeneratorContentHeader, - fullNamespace, - codeGeneratorAttribute, - enumerationName, - openApiSchemaEnumeration.Enum); - - var contentGeneratorEnum = new GenerateContentForEnum( - new CodeDocumentationTagsGenerator(), - enumParameters); - - var enumContent = contentGeneratorEnum.Generate(); - - // Write - var file = new FileInfo(Helpers.DirectoryInfoHelper.GetCsFileNameForContractEnumTypes( - apiProjectOptions.PathForContracts, - enumerationName)); - - var contentWriter = new ContentWriter(logger); - contentWriter.Write( - projectOptions.PathForSrcGenerate, - file, - ContentWriterArea.Src, - enumContent); - } - - private void GenerateModel( - string modelName, - OpenApiSchema apiSchemaModel, - string apiGroupName, - bool isSharedContract) - { - var fullNamespace = $"{projectOptions.ProjectName}.{ContentGeneratorConstants.Contracts}"; - - // Generate - var classParameters = ContentGeneratorServerClientModelParametersFactory.Create( - codeGeneratorContentHeader, - fullNamespace, - codeGeneratorAttribute, - modelName, - apiSchemaModel); - - var contentGeneratorClass = new GenerateContentForClass( - new CodeDocumentationTagsGenerator(), - classParameters); - - var classContent = contentGeneratorClass.Generate(); - - // Write - FileInfo file; - if (modelName.EndsWith(ContentGeneratorConstants.Request, StringComparison.Ordinal)) - { - file = new FileInfo( - Helpers.DirectoryInfoHelper.GetCsFileNameForContract( - apiProjectOptions.PathForContracts, - apiGroupName, - ContentGeneratorConstants.RequestParameters, - modelName)); - } - else - { - if (isSharedContract) - { - file = new FileInfo( - Helpers.DirectoryInfoHelper.GetCsFileNameForContractShared( - apiProjectOptions.PathForContractsShared, - modelName)); - } - else - { - file = new FileInfo( - Helpers.DirectoryInfoHelper.GetCsFileNameForContract( - apiProjectOptions.PathForContracts, - apiGroupName, - ContentGeneratorConstants.Models, - modelName)); - } - } - - var contentWriter = new ContentWriter(logger); - contentWriter.Write( - projectOptions.PathForSrcGenerate, - file, - ContentWriterArea.Src, - classContent); - } - - private void GenerateParameters( - OpenApiDocument document) - { - foreach (var openApiPath in document.Paths) - { - var apiGroupName = openApiPath.GetApiGroupName(); - - foreach (var apiOperation in openApiPath.Value.Operations) - { - if (!apiOperation.Value.HasParametersOrRequestBody() && - !openApiPath.Value.HasParameters()) - { - continue; - } - - GenerateParameter(apiGroupName, openApiPath.Value, apiOperation.Value); - } - } - } - - private void GenerateParameter( - string apiGroupName, - OpenApiPathItem apiPath, - OpenApiOperation apiOperation) - { - var operationName = apiOperation.GetOperationName(); - var parameterName = $"{operationName}Parameters"; - - var fullNamespace = string.IsNullOrEmpty(projectOptions.ClientFolderName) - ? $"{projectOptions.ProjectName}.{ContentGeneratorConstants.Contracts}" - : $"{projectOptions.ProjectName}.{projectOptions.ClientFolderName}.{ContentGeneratorConstants.Contracts}"; - - // Generate - var parameterParameters = ContentGeneratorClientParameterParametersFactory.Create( - fullNamespace, - apiOperation, - apiPath.Parameters); - - var contentGeneratorParameter = new ContentGeneratorClientParameter( - new GeneratedCodeHeaderGenerator(new GeneratedCodeGeneratorParameters(projectOptions.ApiGeneratorVersion)), - new GeneratedCodeAttributeGenerator(new GeneratedCodeGeneratorParameters(projectOptions.ApiGeneratorVersion)), - new CodeDocumentationTagsGenerator(), - parameterParameters); - - var parameterContent = contentGeneratorParameter.Generate(); - - // Write - var file = new FileInfo( - Helpers.DirectoryInfoHelper.GetCsFileNameForContract( - apiProjectOptions.PathForContracts, - apiGroupName, - ContentGeneratorConstants.RequestParameters, - parameterName)); - - var contentWriter = new ContentWriter(logger); - contentWriter.Write( + clientCSharpApiGenerator = new Client.CSharp.ProjectGenerator.ClientCSharpApiGenerator( + loggerFactory, + nugetPackageReferenceProvider, + projectOptions.ApiGeneratorVersion, + projectOptions.ProjectName, projectOptions.PathForSrcGenerate, - file, - ContentWriterArea.Src, - parameterContent); - } - - private static List GetDistinctApiOperationModels( - List apiOperations) - { - var result = new List(); - - foreach (var apiOperation in apiOperations) - { - var apiOperationModel = result.FirstOrDefault(x => x.Name.Equals(apiOperation.Model.Name, StringComparison.Ordinal)); - if (apiOperationModel is null) - { - result.Add(apiOperation.Model); - } - } - - return result; - } - - private void GenerateSrcGlobalUsings( - bool removeNamespaceGroupSeparatorInGlobalUsings, - IList operationSchemaMappings) - { - var requiredUsings = new List + projectOptions.Document, + operationSchemaMappings, + projectOptions.ApiOptions.Generator.Response.UseProblemDetailsAsDefaultBody, + projectOptions.ApiOptions.Generator.IncludeDeprecated) { - "System.CodeDom.Compiler", - "System.ComponentModel.DataAnnotations", - "System.Net", - "Atc.Rest.Client", - "Atc.Rest.Client.Builder", - "Microsoft.AspNetCore.Mvc", - $"{projectOptions.ProjectName}.Contracts", + HttpClientName = projectOptions.HttpClientName, + ClientFolderName = projectOptions.ClientFolderName, }; - - if (operationSchemaMappings.FirstOrDefault(x => x.Model.UsesIFormFile) is not null) - { - requiredUsings.Add("Microsoft.AspNetCore.Http"); - } - - GlobalUsingsHelper.CreateOrUpdate( - logger, - ContentWriterArea.Src, - projectOptions.PathForSrcGenerate, - requiredUsings, - removeNamespaceGroupSeparatorInGlobalUsings); } - private void GenerateEndpointInterfaces( - OpenApiDocument document) + public async Task Generate() { - var fullNamespace = string.IsNullOrEmpty(projectOptions.ClientFolderName) - ? $"{projectOptions.ProjectName}.{ContentGeneratorConstants.Endpoints}" - : $"{projectOptions.ProjectName}.{projectOptions.ClientFolderName}.{ContentGeneratorConstants.Endpoints}"; - - foreach (var openApiPath in document.Paths) - { - var apiGroupName = openApiPath.GetApiGroupName(); - - foreach (var openApiOperation in openApiPath.Value.Operations) - { - // Generate - var interfaceParameters = ContentGeneratorClientEndpointInterfaceParametersFactory.Create( - codeGeneratorContentHeader, - fullNamespace, - codeGeneratorAttribute, - openApiPath.Value, - openApiOperation.Value, - projectOptions.HttpClientName); - - var contentGeneratorInterface = new GenerateContentForInterface( - new CodeDocumentationTagsGenerator(), - interfaceParameters); - - var interfaceContent = contentGeneratorInterface.Generate(); - - // Write - var file = new FileInfo( - Helpers.DirectoryInfoHelper.GetCsFileNameForContract( - apiProjectOptions.PathForEndpoints, - apiGroupName, - ContentGeneratorConstants.Interfaces, - interfaceParameters.TypeName)); - - var contentWriter = new ContentWriter(logger); - contentWriter.Write( - projectOptions.PathForSrcGenerate, - file, - ContentWriterArea.Src, - interfaceContent); - } - } - } - - private void GenerateEndpoints( - OpenApiDocument document) - { - var fullNamespace = string.IsNullOrEmpty(projectOptions.ClientFolderName) - ? $"{projectOptions.ProjectName}.{ContentGeneratorConstants.Endpoints}" - : $"{projectOptions.ProjectName}.{projectOptions.ClientFolderName}.{ContentGeneratorConstants.Endpoints}"; - - foreach (var openApiPath in document.Paths) - { - var apiGroupName = openApiPath.GetApiGroupName(); - - foreach (var openApiOperation in openApiPath.Value.Operations) - { - // Generate - var endpointParameters = ContentGeneratorClientEndpointParametersFactory.Create( - apiProjectOptions.ApiOptions.Generator.Response.UseProblemDetailsAsDefaultBody, - projectOptions.ProjectName, - apiGroupName, - fullNamespace, - openApiPath.Value, - openApiOperation.Key, - openApiOperation.Value, - projectOptions.HttpClientName, - $"{apiProjectOptions.RouteBase}{openApiPath.Key}"); - - var contentGeneratorEndpoint = new ContentGeneratorClientEndpoint( - new GeneratedCodeHeaderGenerator(new GeneratedCodeGeneratorParameters(projectOptions.ApiGeneratorVersion)), - new GeneratedCodeAttributeGenerator(new GeneratedCodeGeneratorParameters(projectOptions.ApiGeneratorVersion)), - new CodeDocumentationTagsGenerator(), - endpointParameters); - - var endpointContent = contentGeneratorEndpoint.Generate(); + logger.LogInformation($"{ContentWriterConstants.AreaGenerateCode} Working on client api generation ({projectOptions.ProjectName})"); - // Write - var file = new FileInfo( - Helpers.DirectoryInfoHelper.GetCsFileNameForContract( - apiProjectOptions.PathForEndpoints, - apiGroupName, - endpointParameters.EndpointName)); + await clientCSharpApiGenerator.ScaffoldProjectFile(); - var contentWriter = new ContentWriter(logger); - contentWriter.Write( - projectOptions.PathForSrcGenerate, - file, - ContentWriterArea.Src, - endpointContent); - } - } - } + clientCSharpApiGenerator.GenerateModels(); - private void GenerateEndpointResultInterfaces( - OpenApiDocument document) - { - var fullNamespace = string.IsNullOrEmpty(projectOptions.ClientFolderName) - ? $"{projectOptions.ProjectName}.{ContentGeneratorConstants.Endpoints}" - : $"{projectOptions.ProjectName}.{projectOptions.ClientFolderName}.{ContentGeneratorConstants.Endpoints}"; + clientCSharpApiGenerator.GenerateParameters(); - foreach (var openApiPath in document.Paths) + if (!projectOptions.ExcludeEndpointGeneration) { - var apiGroupName = openApiPath.GetApiGroupName(); + clientCSharpApiGenerator.GenerateEndpointInterfaces(); - foreach (var openApiOperation in openApiPath.Value.Operations) - { - // Generate - var endpointResultInterfaceParameters = ContentGeneratorClientEndpointResultInterfaceParametersFactory.Create( - apiProjectOptions.ApiOptions.Generator.Response.UseProblemDetailsAsDefaultBody, - apiGroupName, - projectOptions.ProjectName, - fullNamespace, - openApiPath.Value, - openApiOperation.Value); + clientCSharpApiGenerator.GenerateEndpoints(); - var contentGeneratorEndpointResult = new ContentGeneratorClientEndpointResultInterface( - new GeneratedCodeHeaderGenerator(new GeneratedCodeGeneratorParameters(projectOptions.ApiGeneratorVersion)), - new GeneratedCodeAttributeGenerator(new GeneratedCodeGeneratorParameters(projectOptions.ApiGeneratorVersion)), - new CodeDocumentationTagsGenerator(), - endpointResultInterfaceParameters); + clientCSharpApiGenerator.GenerateEndpointResultInterfaces(); - var endpointContent = contentGeneratorEndpointResult.Generate(); - - // Write - var file = new FileInfo( - Helpers.DirectoryInfoHelper.GetCsFileNameForContract( - apiProjectOptions.PathForEndpoints, - apiGroupName, - ContentGeneratorConstants.Interfaces, - endpointResultInterfaceParameters.InterfaceName)); - - var contentWriter = new ContentWriter(logger); - contentWriter.Write( - projectOptions.PathForSrcGenerate, - file, - ContentWriterArea.Src, - endpointContent); - } + clientCSharpApiGenerator.GenerateEndpointResults(); } - } - - private void GenerateEndpointResults( - OpenApiDocument document) - { - var fullNamespace = string.IsNullOrEmpty(projectOptions.ClientFolderName) - ? $"{projectOptions.ProjectName}.{ContentGeneratorConstants.Endpoints}" - : $"{projectOptions.ProjectName}.{projectOptions.ClientFolderName}.{ContentGeneratorConstants.Endpoints}"; - - foreach (var openApiPath in document.Paths) - { - var apiGroupName = openApiPath.GetApiGroupName(); - - foreach (var openApiOperation in openApiPath.Value.Operations) - { - // Generate - var endpointResultParameters = ContentGeneratorClientEndpointResultParametersFactory.Create( - apiProjectOptions.ApiOptions.Generator.Response.UseProblemDetailsAsDefaultBody, - projectOptions.ProjectName, - apiGroupName, - fullNamespace, - projectOptions.ApiOptions.Generator.Response.UseProblemDetailsAsDefaultBody, - openApiPath.Value, - openApiOperation.Value); - var contentGeneratorEndpointResult = new ContentGeneratorClientEndpointResult( - new GeneratedCodeHeaderGenerator(new GeneratedCodeGeneratorParameters(projectOptions.ApiGeneratorVersion)), - new GeneratedCodeAttributeGenerator(new GeneratedCodeGeneratorParameters(projectOptions.ApiGeneratorVersion)), - new CodeDocumentationTagsGenerator(), - endpointResultParameters); + clientCSharpApiGenerator.MaintainGlobalUsings( + projectOptions.RemoveNamespaceGroupSeparatorInGlobalUsings); - var endpointContent = contentGeneratorEndpointResult.Generate(); - - // Write - var file = new FileInfo( - Helpers.DirectoryInfoHelper.GetCsFileNameForContract( - apiProjectOptions.PathForEndpoints, - apiGroupName, - endpointResultParameters.EndpointResultName)); - - var contentWriter = new ContentWriter(logger); - contentWriter.Write( - projectOptions.PathForSrcGenerate, - file, - ContentWriterArea.Src, - endpointContent); - } - } + return true; } } \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator/Generators/ServerApiGenerator.cs b/src/Atc.Rest.ApiGenerator/Generators/ServerApiGenerator.cs index d1b695e1..7f1143d4 100644 --- a/src/Atc.Rest.ApiGenerator/Generators/ServerApiGenerator.cs +++ b/src/Atc.Rest.ApiGenerator/Generators/ServerApiGenerator.cs @@ -8,58 +8,95 @@ namespace Atc.Rest.ApiGenerator.Generators; public class ServerApiGenerator { private readonly ILogger logger; - private readonly IApiOperationExtractor apiOperationExtractor; private readonly INugetPackageReferenceProvider nugetPackageReferenceProvider; private readonly ApiProjectOptions projectOptions; - private readonly string codeGeneratorContentHeader; - private readonly AttributeParameters codeGeneratorAttribute; + private readonly IServerApiGenerator serverApiGeneratorMvc; + private readonly IServerApiGenerator serverApiGeneratorMinimalApi; public ServerApiGenerator( - ILogger logger, + ILoggerFactory loggerFactory, IApiOperationExtractor apiOperationExtractor, INugetPackageReferenceProvider nugetPackageReferenceProvider, ApiProjectOptions projectOptions) { - this.logger = logger ?? throw new ArgumentNullException(nameof(logger)); - this.apiOperationExtractor = apiOperationExtractor ?? throw new ArgumentNullException(nameof(apiOperationExtractor)); + ArgumentNullException.ThrowIfNull(loggerFactory); + ArgumentNullException.ThrowIfNull(apiOperationExtractor); + + logger = loggerFactory.CreateLogger(); this.nugetPackageReferenceProvider = nugetPackageReferenceProvider ?? throw new ArgumentNullException(nameof(nugetPackageReferenceProvider)); this.projectOptions = projectOptions ?? throw new ArgumentNullException(nameof(projectOptions)); - // TODO: Optimize codeGeneratorContentHeader & codeGeneratorAttribute - var codeHeaderGenerator = new GeneratedCodeHeaderGenerator( - new GeneratedCodeGeneratorParameters( - projectOptions.ApiGeneratorVersion)); - codeGeneratorContentHeader = codeHeaderGenerator.Generate(); + var operationSchemaMappings = apiOperationExtractor.Extract(projectOptions.Document); - codeGeneratorAttribute = new AttributeParameters( - "GeneratedCode", - $"\"{ContentWriterConstants.ApiGeneratorName}\", \"{projectOptions.ApiGeneratorVersion}\""); + serverApiGeneratorMvc = new Framework.Mvc.ProjectGenerator.ServerApiGenerator( + loggerFactory, + nugetPackageReferenceProvider, + projectOptions.ApiGeneratorVersion, + projectOptions.ProjectName, + projectOptions.PathForSrcGenerate, + projectOptions.Document, + operationSchemaMappings, + projectOptions.RouteBase, + projectOptions.ApiOptions.Generator.Response.UseProblemDetailsAsDefaultBody, + projectOptions.ApiOptions.Generator.IncludeDeprecated); + + serverApiGeneratorMinimalApi = new Framework.Minimal.ProjectGenerator.ServerApiGenerator( + loggerFactory, + nugetPackageReferenceProvider, + projectOptions.ApiGeneratorVersion, + projectOptions.ProjectName, + projectOptions.PathForSrcGenerate, + projectOptions.Document, + operationSchemaMappings, + projectOptions.RouteBase, + projectOptions.ApiOptions.Generator.Response.UseProblemDetailsAsDefaultBody, + projectOptions.ApiOptions.Generator.IncludeDeprecated); } - public bool Generate() + public async Task Generate() { logger.LogInformation($"{ContentWriterConstants.AreaGenerateCode} Working on server api generation ({projectOptions.ProjectName})"); - var isVersionValid = ValidateVersioning(); - if (!isVersionValid) + if (projectOptions.ApiOptions.Generator.AspNetOutputType == AspNetOutputType.Mvc) { - return false; + var isVersionValid = ValidateVersioning(); + if (!isVersionValid) + { + return false; + } } - ScaffoldSrc(); + if (projectOptions.ApiOptions.Generator.AspNetOutputType == AspNetOutputType.Mvc) + { + await serverApiGeneratorMvc.ScaffoldProjectFile(); - CopyApiSpecification(); + serverApiGeneratorMvc.GenerateAssemblyMarker(); + serverApiGeneratorMvc.GenerateModels(); + serverApiGeneratorMvc.GenerateParameters(); + serverApiGeneratorMvc.GenerateResults(); + serverApiGeneratorMvc.GenerateInterfaces(); + serverApiGeneratorMvc.GenerateEndpoints(); - var operationSchemaMappings = apiOperationExtractor.Extract(projectOptions.Document); + serverApiGeneratorMvc.MaintainApiSpecification(projectOptions.DocumentFile); + serverApiGeneratorMvc.MaintainGlobalUsings( + projectOptions.RemoveNamespaceGroupSeparatorInGlobalUsings); + } + else + { + await serverApiGeneratorMinimalApi.ScaffoldProjectFile(); - GenerateModels(projectOptions.Document, operationSchemaMappings); - GenerateParameters(projectOptions.Document); - GenerateResults(projectOptions.Document); - GenerateInterfaces(projectOptions.Document); + serverApiGeneratorMinimalApi.GenerateAssemblyMarker(); + serverApiGeneratorMinimalApi.GenerateModels(); + serverApiGeneratorMinimalApi.GenerateParameters(); + serverApiGeneratorMinimalApi.GenerateResults(); + serverApiGeneratorMinimalApi.GenerateInterfaces(); + serverApiGeneratorMinimalApi.GenerateEndpoints(); - GenerateEndpoints(operationSchemaMappings); - GenerateSrcGlobalUsings(projectOptions.RemoveNamespaceGroupSeparatorInGlobalUsings); + serverApiGeneratorMinimalApi.MaintainApiSpecification(projectOptions.DocumentFile); + serverApiGeneratorMinimalApi.MaintainGlobalUsings( + projectOptions.RemoveNamespaceGroupSeparatorInGlobalUsings); + } return true; } @@ -120,452 +157,4 @@ private bool ValidateVersioning() logger.LogError($" {ValidationRuleNameConstants.ProjectApiGenerated06} - Existing project did not contain a version."); return false; } - - private void ScaffoldSrc() - { - if (!Directory.Exists(projectOptions.PathForSrcGenerate.FullName)) - { - Directory.CreateDirectory(projectOptions.PathForSrcGenerate.FullName); - } - - if (projectOptions.PathForSrcGenerate.Exists && - projectOptions.ProjectSrcCsProj.Exists) - { - var hasUpdates = SolutionAndProjectHelper.EnsureLatestPackageReferencesVersionInProjFile( - logger, - projectOptions.ProjectSrcCsProj, - projectOptions.ProjectSrcCsProjDisplayLocation, - ProjectType.ServerApi, - isTestProject: false); - if (!hasUpdates) - { - logger.LogDebug($"{EmojisConstants.FileNotUpdated} No updates for csproj"); - } - } - else - { - IList<(string PackageId, string PackageVersion, string? SubElements)>? packageReferencesBaseLineForApiProject = null; - TaskHelper.RunSync(async () => - { - packageReferencesBaseLineForApiProject = await nugetPackageReferenceProvider.GetPackageReferencesBaseLineForApiProject(); - }); - - SolutionAndProjectHelper.ScaffoldProjFile( - logger, - projectOptions.ProjectSrcCsProj, - projectOptions.ProjectSrcCsProjDisplayLocation, - ProjectType.ServerApi, - createAsWeb: false, - createAsTestProject: false, - projectOptions.ProjectName, - "net6.0", - new List { "Microsoft.AspNetCore.App" }, - packageReferencesBaseLineForApiProject, - projectReferences: null, - includeApiSpecification: true, - usingCodingRules: projectOptions.UsingCodingRules); - - ScaffoldBasicFileApiGenerated(); - } - } - - private void CopyApiSpecification() - { - var resourceFolder = new DirectoryInfo(Path.Combine(projectOptions.PathForSrcGenerate.FullName, "Resources")); - if (!resourceFolder.Exists) - { - Directory.CreateDirectory(resourceFolder.FullName); - } - - var resourceFile = new FileInfo(Path.Combine(resourceFolder.FullName, "ApiSpecification.yaml")); - if (File.Exists(resourceFile.FullName)) - { - File.Delete(resourceFile.FullName); - } - - if (projectOptions.DocumentFile.Extension.Equals(".json", StringComparison.OrdinalIgnoreCase)) - { - using var writeFile = new StreamWriter(resourceFile.FullName); - projectOptions.Document.SerializeAsV3(new OpenApiYamlWriter(writeFile)); - } - else - { - File.Copy(projectOptions.DocumentFile.FullName, resourceFile.FullName); - } - } - - private void GenerateModels( - OpenApiDocument document, - IList operationSchemaMappings) - { - ArgumentNullException.ThrowIfNull(operationSchemaMappings); - - foreach (var apiGroupName in projectOptions.ApiGroupNames) - { - var apiOperations = operationSchemaMappings - .Where(x => x.LocatedArea is ApiSchemaMapLocatedAreaType.Response or ApiSchemaMapLocatedAreaType.RequestBody && - x.ApiGroupName.Equals(apiGroupName, StringComparison.OrdinalIgnoreCase)) - .ToList(); - - var apiOperationModels = GetDistinctApiOperationModels(apiOperations); - - foreach (var apiOperationModel in apiOperationModels) - { - var apiSchema = document.Components.Schemas.First(x => x.Key.Equals(apiOperationModel.Name, StringComparison.OrdinalIgnoreCase)); - - var modelName = apiSchema.Key.EnsureFirstCharacterToUpper(); - - if (apiOperationModel.IsEnum) - { - GenerateEnumerationType(modelName, apiSchema.Value.GetEnumSchema().Item2); - } - else - { - GenerateModel(modelName, apiSchema.Value, apiGroupName, apiOperationModel.IsShared); - } - } - } - } - - private void GenerateEnumerationType( - string enumerationName, - OpenApiSchema openApiSchemaEnumeration) - { - var fullNamespace = $"{projectOptions.ProjectName}.{ContentGeneratorConstants.Contracts}"; - - // Generate - var enumParameters = ContentGeneratorServerClientEnumParametersFactory.Create( - codeGeneratorContentHeader, - fullNamespace, - codeGeneratorAttribute, - enumerationName, - openApiSchemaEnumeration.Enum); - - var contentGeneratorEnum = new GenerateContentForEnum( - new CodeDocumentationTagsGenerator(), - enumParameters); - - var enumContent = contentGeneratorEnum.Generate(); - - // Write - var file = new FileInfo( - Helpers.DirectoryInfoHelper.GetCsFileNameForContractEnumTypes( - projectOptions.PathForContracts, - enumerationName)); - - var contentWriter = new ContentWriter(logger); - contentWriter.Write( - projectOptions.PathForSrcGenerate, - file, - ContentWriterArea.Src, - enumContent); - } - - private void GenerateModel( - string modelName, - OpenApiSchema apiSchemaModel, - string apiGroupName, - bool isSharedContract) - { - var fullNamespace = isSharedContract - ? $"{projectOptions.ProjectName}.{ContentGeneratorConstants.Contracts}" - : $"{projectOptions.ProjectName}.{ContentGeneratorConstants.Contracts}.{apiGroupName}"; - - // Generate - var classParameters = ContentGeneratorServerClientModelParametersFactory.Create( - codeGeneratorContentHeader, - fullNamespace, - codeGeneratorAttribute, - modelName, - apiSchemaModel); - - var contentGeneratorClass = new GenerateContentForClass( - new CodeDocumentationTagsGenerator(), - classParameters); - - var classContent = contentGeneratorClass.Generate(); - - // Write - FileInfo file; - if (isSharedContract) - { - file = new FileInfo( - Helpers.DirectoryInfoHelper.GetCsFileNameForContractShared( - projectOptions.PathForContractsShared, - modelName)); - } - else - { - file = new FileInfo( - Helpers.DirectoryInfoHelper.GetCsFileNameForContract( - projectOptions.PathForContracts, - apiGroupName, - ContentGeneratorConstants.Models, - modelName)); - } - - var contentWriter = new ContentWriter(logger); - contentWriter.Write( - projectOptions.PathForSrcGenerate, - file, - ContentWriterArea.Src, - classContent); - } - - private void GenerateParameters( - OpenApiDocument document) - { - foreach (var openApiPath in document.Paths) - { - var apiGroupName = openApiPath.GetApiGroupName(); - - var fullNamespace = $"{projectOptions.ProjectName}.{ContentGeneratorConstants.Contracts}.{apiGroupName}"; - - foreach (var openApiOperation in openApiPath.Value.Operations) - { - if (!openApiPath.Value.HasParameters() && !openApiOperation.Value.HasParametersOrRequestBody()) - { - continue; - } - - // Generate - var parameterParameters = ContentGeneratorServerParameterParametersFactory.Create( - fullNamespace, - openApiOperation.Value, - openApiPath.Value.Parameters); - - var contentGeneratorParameter = new ContentGeneratorServerParameter( - new GeneratedCodeHeaderGenerator(new GeneratedCodeGeneratorParameters(projectOptions.ApiGeneratorVersion)), - new GeneratedCodeAttributeGenerator(new GeneratedCodeGeneratorParameters(projectOptions.ApiGeneratorVersion)), - new CodeDocumentationTagsGenerator(), - parameterParameters); - - var parameterContent = contentGeneratorParameter.Generate(); - - // Write - var file = new FileInfo( - Helpers.DirectoryInfoHelper.GetCsFileNameForContract( - projectOptions.PathForContracts, - apiGroupName, - ContentGeneratorConstants.Parameters, - parameterParameters.ParameterName)); - - var contentWriter = new ContentWriter(logger); - contentWriter.Write( - projectOptions.PathForSrcGenerate, - file, - ContentWriterArea.Src, - parameterContent); - } - } - } - - private void GenerateResults( - OpenApiDocument document) - { - foreach (var openApiPath in document.Paths) - { - var apiGroupName = openApiPath.GetApiGroupName(); - - var fullNamespace = $"{projectOptions.ProjectName}.{ContentGeneratorConstants.Contracts}.{apiGroupName}"; - - foreach (var openApiOperation in openApiPath.Value.Operations) - { - // Generate - var resultParameters = ContentGeneratorServerResultParametersFactory.Create( - fullNamespace, - openApiOperation.Value, - projectOptions.ApiOptions.Generator.Response.UseProblemDetailsAsDefaultBody); - - var contentGeneratorResult = new ContentGeneratorServerResult( - new GeneratedCodeHeaderGenerator(new GeneratedCodeGeneratorParameters(projectOptions.ApiGeneratorVersion)), - new GeneratedCodeAttributeGenerator(new GeneratedCodeGeneratorParameters(projectOptions.ApiGeneratorVersion)), - new CodeDocumentationTagsGenerator(), - resultParameters); - - var resultContent = contentGeneratorResult.Generate(); - - // Write - var file = new FileInfo( - Helpers.DirectoryInfoHelper.GetCsFileNameForContract( - projectOptions.PathForContracts, - apiGroupName, - ContentGeneratorConstants.Results, - resultParameters.ResultName)); - - var contentWriter = new ContentWriter(logger); - contentWriter.Write( - projectOptions.PathForSrcGenerate, - file, - ContentWriterArea.Src, - resultContent); - } - } - } - - private void GenerateInterfaces( - OpenApiDocument document) - { - foreach (var openApiPath in document.Paths) - { - var apiGroupName = openApiPath.GetApiGroupName(); - - var fullNamespace = $"{projectOptions.ProjectName}.{ContentGeneratorConstants.Contracts}.{apiGroupName}"; - - foreach (var openApiOperation in openApiPath.Value.Operations) - { - // Generate - var interfaceParameters = ContentGeneratorServerHandlerInterfaceParametersFactory.Create( - codeGeneratorContentHeader, - fullNamespace, - codeGeneratorAttribute, - openApiPath.Value, - openApiOperation.Value); - - var contentGeneratorInterface = new GenerateContentForInterface( - new CodeDocumentationTagsGenerator(), - interfaceParameters); - - var interfaceContent = contentGeneratorInterface.Generate(); - - // Write - var file = new FileInfo( - Helpers.DirectoryInfoHelper.GetCsFileNameForContract( - projectOptions.PathForContracts, - apiGroupName, - ContentGeneratorConstants.Interfaces, - interfaceParameters.TypeName)); - - var contentWriter = new ContentWriter(logger); - contentWriter.Write( - projectOptions.PathForSrcGenerate, - file, - ContentWriterArea.Src, - interfaceContent); - } - } - } - - private void GenerateEndpoints( - IList operationSchemaMappings) - { - ArgumentNullException.ThrowIfNull(operationSchemaMappings); - - foreach (var apiGroupName in projectOptions.ApiGroupNames) - { - var controllerParameters = ContentGeneratorServerControllerParametersFactory.Create( - operationSchemaMappings, - projectOptions.ProjectName, - projectOptions.ApiOptions.Generator.Response.UseProblemDetailsAsDefaultBody, - $"{projectOptions.ProjectName}.{ContentGeneratorConstants.Endpoints}", - apiGroupName, - GetRouteByApiGroupName(apiGroupName), - projectOptions.Document); - - var contentGenerator = new ContentGeneratorServerController( - new GeneratedCodeHeaderGenerator(new GeneratedCodeGeneratorParameters(projectOptions.ApiGeneratorVersion)), - new GeneratedCodeAttributeGenerator(new GeneratedCodeGeneratorParameters(projectOptions.ApiGeneratorVersion)), - new CodeDocumentationTagsGenerator(), - controllerParameters); - - var content = contentGenerator.Generate(); - - var file = new FileInfo( - Helpers.DirectoryInfoHelper.GetCsFileNameForEndpoints( - projectOptions.PathForEndpoints, - controllerParameters.ControllerName)); - - var contentWriter = new ContentWriter(logger); - contentWriter.Write( - projectOptions.PathForSrcGenerate, - file, - ContentWriterArea.Src, - content); - } - } - - private static List GetDistinctApiOperationModels( - List apiOperations) - { - var result = new List(); - - foreach (var apiOperation in apiOperations) - { - var apiOperationModel = result.FirstOrDefault(x => x.Name.Equals(apiOperation.Model.Name, StringComparison.Ordinal)); - if (apiOperationModel is null) - { - result.Add(apiOperation.Model); - } - } - - return result; - } - - private string GetRouteByApiGroupName( - string apiGroupName) - { - var (key, _) = projectOptions.Document.Paths.FirstOrDefault(x => x.IsPathStartingSegmentName(apiGroupName)); - if (key is null) - { - throw new NotSupportedException($"{nameof(apiGroupName)} was not found in any route."); - } - - var routeSuffix = key - .Split('/', StringSplitOptions.RemoveEmptyEntries) - .FirstOrDefault(); - - return $"{projectOptions.RouteBase}/{routeSuffix}"; - } - - private void ScaffoldBasicFileApiGenerated() - { - var classParameters = ClassParametersFactory.Create( - codeGeneratorContentHeader, - projectOptions.ProjectName, - codeGeneratorAttribute, - "ApiRegistration"); - - var contentGeneratorClass = new GenerateContentForClass( - new CodeDocumentationTagsGenerator(), - classParameters); - - var classContent = contentGeneratorClass.Generate(); - - var file = new FileInfo(Path.Combine(projectOptions.PathForSrcGenerate.FullName, "ApiRegistration.cs")); - - var contentWriter = new ContentWriter(logger); - contentWriter.Write( - projectOptions.PathForSrcGenerate, - file, - ContentWriterArea.Src, - classContent); - } - - private void GenerateSrcGlobalUsings( - bool removeNamespaceGroupSeparatorInGlobalUsings) - { - var requiredUsings = new List - { - "System.CodeDom.Compiler", - "System.ComponentModel.DataAnnotations", - "System.Net", - "Microsoft.AspNetCore.Authorization", - "Microsoft.AspNetCore.Http", - "Microsoft.AspNetCore.Mvc", - "Atc.Rest.Results", - $"{projectOptions.ProjectName}.Contracts", - }; - - foreach (var apiGroupName in projectOptions.ApiGroupNames) - { - requiredUsings.Add($"{projectOptions.ProjectName}.Contracts.{apiGroupName}"); - } - - GlobalUsingsHelper.CreateOrUpdate( - logger, - ContentWriterArea.Src, - projectOptions.PathForSrcGenerate, - requiredUsings, - removeNamespaceGroupSeparatorInGlobalUsings); - } } \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator/Generators/ServerDomainGenerator.cs b/src/Atc.Rest.ApiGenerator/Generators/ServerDomainGenerator.cs index 64a852d2..b4bb0103 100644 --- a/src/Atc.Rest.ApiGenerator/Generators/ServerDomainGenerator.cs +++ b/src/Atc.Rest.ApiGenerator/Generators/ServerDomainGenerator.cs @@ -8,328 +8,113 @@ namespace Atc.Rest.ApiGenerator.Generators; public class ServerDomainGenerator { private readonly ILogger logger; - private readonly INugetPackageReferenceProvider nugetPackageReferenceProvider; private readonly DomainProjectOptions projectOptions; - private readonly string codeGeneratorContentHeader; - private readonly AttributeParameters codeGeneratorAttribute; + private readonly IServerDomainGenerator serverDomainGeneratorMvc; + private readonly IServerDomainGenerator serverDomainGeneratorMinimalApi; + private readonly IServerDomainTestGenerator? serverDomainTestGenerator; public ServerDomainGenerator( - ILogger logger, + ILoggerFactory loggerFactory, + IApiOperationExtractor apiOperationExtractor, INugetPackageReferenceProvider nugetPackageReferenceProvider, DomainProjectOptions projectOptions) { - this.logger = logger ?? throw new ArgumentNullException(nameof(logger)); - this.nugetPackageReferenceProvider = nugetPackageReferenceProvider ?? throw new ArgumentNullException(nameof(nugetPackageReferenceProvider)); - this.projectOptions = projectOptions ?? throw new ArgumentNullException(nameof(projectOptions)); - - // TODO: Optimize codeGeneratorContentHeader & codeGeneratorAttribute - var codeHeaderGenerator = new GeneratedCodeHeaderGenerator( - new GeneratedCodeGeneratorParameters( - projectOptions.ApiGeneratorVersion)); - codeGeneratorContentHeader = codeHeaderGenerator.Generate(); - - codeGeneratorAttribute = new AttributeParameters( - "GeneratedCode", - $"\"{ContentWriterConstants.ApiGeneratorName}\", \"{projectOptions.ApiGeneratorVersion}\""); - } - - public bool Generate() - { - logger.LogInformation($"{ContentWriterConstants.AreaGenerateCode} Working on server domain generation ({projectOptions.ProjectName})"); - - if (!projectOptions.SetPropertiesAfterValidationsOfProjectReferencesPathAndFiles(logger)) - { - return false; - } - - ScaffoldSrc(); - - GenerateSrcHandlers(projectOptions.Document); - - GenerateSrcGlobalUsings(projectOptions.RemoveNamespaceGroupSeparatorInGlobalUsings); - - if (projectOptions.PathForTestGenerate is not null) - { - logger.LogInformation($"{ContentWriterConstants.AreaGenerateTest} Working on server domain unit-test generation ({projectOptions.ProjectName}.Tests)"); - - ScaffoldTest(); - - GenerateTestHandlers(projectOptions.Document); - - GenerateTestGlobalUsings(projectOptions.UsingCodingRules, projectOptions.RemoveNamespaceGroupSeparatorInGlobalUsings); - } - - return true; - } - - private void GenerateSrcHandlers( - OpenApiDocument document) - { - ArgumentNullException.ThrowIfNull(projectOptions); - - foreach (var urlPath in document.Paths) - { - var apiGroupName = urlPath.GetApiGroupName(); - - foreach (var openApiOperation in urlPath.Value.Operations) - { - GenerateSrcHandler(apiGroupName, urlPath.Value, openApiOperation.Value); - } - } - } - - private void GenerateSrcHandler( - string apiGroupName, - OpenApiPathItem apiPath, - OpenApiOperation apiOperation) - { - var fullNamespace = $"{projectOptions.ProjectName}.{ContentGeneratorConstants.Handlers}.{apiGroupName}"; + ArgumentNullException.ThrowIfNull(loggerFactory); + ArgumentNullException.ThrowIfNull(apiOperationExtractor); + ArgumentNullException.ThrowIfNull(nugetPackageReferenceProvider); - // Generate - var classParameters = ContentGeneratorServerHandlerParametersFactory.Create( - fullNamespace, - apiPath, - apiOperation); - - var contentGeneratorClass = new GenerateContentForClass( - new CodeDocumentationTagsGenerator(), - classParameters); - - var classContent = contentGeneratorClass.Generate(); + logger = loggerFactory.CreateLogger(); + this.projectOptions = projectOptions ?? throw new ArgumentNullException(nameof(projectOptions)); - // Write - var file = new FileInfo( - Helpers.DirectoryInfoHelper.GetCsFileNameForHandler( - projectOptions.PathForSrcHandlers!, - apiGroupName, - classParameters.TypeName)); + var apiProjectName = projectOptions.ProjectName.Replace(".Domain", ".Api.Generated", StringComparison.Ordinal); - var contentWriter = new ContentWriter(logger); - contentWriter.Write( + serverDomainGeneratorMvc = new Framework.Mvc.ProjectGenerator.ServerDomainGenerator( + loggerFactory, + projectOptions.ApiGeneratorVersion, + projectOptions.ProjectName, + apiProjectName, projectOptions.PathForSrcGenerate, - file, - ContentWriterArea.Src, - classContent, - overrideIfExist: false); - } + projectOptions.Document); - private void GenerateTestHandlers( - OpenApiDocument document) - { - ArgumentNullException.ThrowIfNull(projectOptions); + serverDomainGeneratorMinimalApi = new Framework.Minimal.ProjectGenerator.ServerDomainGenerator( + loggerFactory, + nugetPackageReferenceProvider, + projectOptions.ApiGeneratorVersion, + projectOptions.ProjectName, + apiProjectName, + projectOptions.PathForSrcGenerate, + projectOptions.Document); - foreach (var urlPath in document.Paths) + if (projectOptions.PathForTestGenerate is not null) { - var apiGroupName = urlPath.GetApiGroupName(); - - foreach (var openApiOperation in urlPath.Value.Operations) - { - GenerateTestHandler(apiGroupName, openApiOperation.Value); - } + serverDomainTestGenerator = new Framework.ProjectGenerator.ServerDomainTestGenerator( + loggerFactory, + nugetPackageReferenceProvider, + projectOptions.ApiGeneratorVersion, + $"{projectOptions.ProjectName}.{ContentGeneratorConstants.Tests}", + apiProjectName, + projectOptions.ProjectName, + projectOptions.PathForTestGenerate, + projectOptions.Document); } } - private void GenerateTestHandler( - string apiGroupName, - OpenApiOperation apiOperation) - { - var fullNamespace = $"{projectOptions.ProjectName}.{ContentGeneratorConstants.Tests}.{ContentGeneratorConstants.Handlers}.{apiGroupName}"; - - // Generate - var classParameters = ContentGeneratorServerHandlerParametersFactory.CreateForCustomTest( - fullNamespace, - apiOperation); - - var contentGeneratorClass = new GenerateContentForClass( - new CodeDocumentationTagsGenerator(), - classParameters); - - var classContent = contentGeneratorClass.Generate(); - - // Write - var file = new FileInfo( - Helpers.DirectoryInfoHelper.GetCsFileNameForHandler( - projectOptions.PathForTestHandlers!, - apiGroupName, - classParameters.TypeName)); - - var contentWriter = new ContentWriter(logger); - contentWriter.Write( - projectOptions.PathForTestGenerate!, - file, - ContentWriterArea.Test, - classContent, - overrideIfExist: false); - } - - private void ScaffoldSrc() + public async Task Generate() { - if (!Directory.Exists(projectOptions.PathForSrcGenerate.FullName)) - { - Directory.CreateDirectory(projectOptions.PathForSrcGenerate.FullName); - } + logger.LogInformation($"{ContentWriterConstants.AreaGenerateCode} Working on server domain generation ({projectOptions.ProjectName})"); - if (projectOptions.PathForSrcGenerate.Exists && - projectOptions.ProjectSrcCsProj.Exists) + if (projectOptions.ApiOptions.Generator.AspNetOutputType == AspNetOutputType.Mvc) { - var hasUpdates = SolutionAndProjectHelper.EnsureLatestPackageReferencesVersionInProjFile( - logger, - projectOptions.ProjectSrcCsProj, - projectOptions.ProjectSrcCsProjDisplayLocation, - ProjectType.ServerDomain, - isTestProject: false); - if (!hasUpdates) + if (!projectOptions.SetPropertiesAfterValidationsOfProjectReferencesPathAndFilesForMvc(logger)) { - logger.LogDebug($"{EmojisConstants.FileNotUpdated} No updates for csproj"); + return false; } } else { - var projectReferences = new List(); - if (projectOptions.ApiProjectSrcCsProj is not null) + if (!projectOptions.SetPropertiesAfterValidationsOfProjectReferencesPathAndFilesForMinimalApi(logger)) { - projectReferences.Add(projectOptions.ApiProjectSrcCsProj); + return false; } - - SolutionAndProjectHelper.ScaffoldProjFile( - logger, - projectOptions.ProjectSrcCsProj, - projectOptions.ProjectSrcCsProjDisplayLocation, - ProjectType.ServerDomain, - createAsWeb: false, - createAsTestProject: false, - projectOptions.ProjectName, - "net6.0", - new List { "Microsoft.AspNetCore.App" }, - packageReferences: null, - projectReferences, - includeApiSpecification: false, - usingCodingRules: projectOptions.UsingCodingRules); - - ScaffoldBasicFileDomainRegistration(); } - } - private void ScaffoldTest() - { - if (projectOptions.PathForTestGenerate is null || - projectOptions.ProjectTestCsProj is null) + if (projectOptions.ApiOptions.Generator.AspNetOutputType == AspNetOutputType.Mvc) { - return; - } + await serverDomainGeneratorMvc.ScaffoldProjectFile(); + serverDomainGeneratorMvc.ScaffoldHandlers(); - if (projectOptions.PathForTestGenerate.Exists && - projectOptions.ProjectTestCsProj.Exists) - { - var hasUpdates = SolutionAndProjectHelper.EnsureLatestPackageReferencesVersionInProjFile( - logger, - projectOptions.ProjectTestCsProj, - projectOptions.ProjectTestCsProjDisplayLocation, - ProjectType.ServerDomain, - isTestProject: true); + serverDomainGeneratorMvc.GenerateAssemblyMarker(); - if (!hasUpdates) - { - logger.LogDebug($"{EmojisConstants.FileNotUpdated} No updates for csproj"); - } + serverDomainGeneratorMvc.MaintainGlobalUsings( + projectOptions.RemoveNamespaceGroupSeparatorInGlobalUsings); } else { - if (!Directory.Exists(projectOptions.PathForTestGenerate.FullName)) - { - Directory.CreateDirectory(projectOptions.PathForTestGenerate.FullName); - } + await serverDomainGeneratorMinimalApi.ScaffoldProjectFile(); + serverDomainGeneratorMinimalApi.ScaffoldHandlers(); - var projectReferences = new List(); - if (projectOptions.ApiProjectSrcCsProj is not null) - { - projectReferences.Add(projectOptions.ApiProjectSrcCsProj); - projectReferences.Add(projectOptions.ProjectSrcCsProj); - } + serverDomainGeneratorMinimalApi.GenerateAssemblyMarker(); + serverDomainGeneratorMinimalApi.GenerateServiceCollectionExtensions(); - SolutionAndProjectHelper.ScaffoldProjFile( - logger, - projectOptions.ProjectTestCsProj, - projectOptions.ProjectTestCsProjDisplayLocation, - ProjectType.ServerDomain, - createAsWeb: false, - createAsTestProject: true, - $"{projectOptions.ProjectName}.Tests", - "net6.0", - frameworkReferences: null, - nugetPackageReferenceProvider.GetPackageReferencesBaseLineForTestProject(useMvc: false), - projectReferences, - includeApiSpecification: true, - usingCodingRules: projectOptions.UsingCodingRules); + serverDomainGeneratorMinimalApi.MaintainGlobalUsings( + projectOptions.RemoveNamespaceGroupSeparatorInGlobalUsings); } - } - - private void ScaffoldBasicFileDomainRegistration() - { - var classParameters = ClassParametersFactory.Create( - codeGeneratorContentHeader, - projectOptions.ProjectName, - codeGeneratorAttribute, - "DomainRegistration"); - - var contentGeneratorClass = new GenerateContentForClass( - new CodeDocumentationTagsGenerator(), - classParameters); - - var classContent = contentGeneratorClass.Generate(); - var file = new FileInfo( - Path.Combine( - projectOptions.PathForSrcGenerate.FullName, - "DomainRegistration.cs")); - - var contentWriter = new ContentWriter(logger); - contentWriter.Write( - projectOptions.PathForSrcGenerate, - file, - ContentWriterArea.Src, - classContent); - } - - private void GenerateSrcGlobalUsings( - bool removeNamespaceGroupSeparatorInGlobalUsings) - { - var requiredUsings = new List + if (serverDomainTestGenerator is not null && + projectOptions.PathForTestGenerate is not null) { - "System.CodeDom.Compiler", - }; + logger.LogInformation($"{ContentWriterConstants.AreaGenerateTest} Working on server domain unit-test generation ({projectOptions.ProjectName}.Tests)"); - var projectName = projectOptions.ProjectName.Replace(".Domain", ".Api.Generated", StringComparison.Ordinal); - foreach (var apiGroupName in projectOptions.ApiGroupNames) - { - requiredUsings.Add($"{projectName}.Contracts.{apiGroupName}"); - } + await serverDomainTestGenerator.ScaffoldProjectFile(); - GlobalUsingsHelper.CreateOrUpdate( - logger, - ContentWriterArea.Src, - projectOptions.PathForSrcGenerate, - requiredUsings, - removeNamespaceGroupSeparatorInGlobalUsings); - } - - private void GenerateTestGlobalUsings( - bool usingCodingRules, - bool removeNamespaceGroupSeparatorInGlobalUsings) - { - var requiredUsings = new List(); + serverDomainTestGenerator.ScaffoldHandlers(); - if (!usingCodingRules) - { - requiredUsings.Add("Xunit"); + serverDomainTestGenerator.MaintainGlobalUsings( + projectOptions.UsingCodingRules, + projectOptions.RemoveNamespaceGroupSeparatorInGlobalUsings); } - GlobalUsingsHelper.CreateOrUpdate( - logger, - ContentWriterArea.Test, - projectOptions.PathForTestGenerate!, - requiredUsings, - removeNamespaceGroupSeparatorInGlobalUsings); + return true; } } \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator/Generators/ServerHostGenerator.cs b/src/Atc.Rest.ApiGenerator/Generators/ServerHostGenerator.cs index 113b3983..770b0d73 100644 --- a/src/Atc.Rest.ApiGenerator/Generators/ServerHostGenerator.cs +++ b/src/Atc.Rest.ApiGenerator/Generators/ServerHostGenerator.cs @@ -1,528 +1,179 @@ // ReSharper disable ForeachCanBePartlyConvertedToQueryUsingAnotherGetEnumerator // ReSharper disable SuggestBaseTypeForParameter // ReSharper disable ReturnTypeCanBeEnumerable.Local +// ReSharper disable StringLiteralTypo namespace Atc.Rest.ApiGenerator.Generators; public class ServerHostGenerator { private readonly ILogger logger; - private readonly INugetPackageReferenceProvider nugetPackageReferenceProvider; private readonly HostProjectOptions projectOptions; - private readonly string codeGeneratorContentHeader; - private readonly AttributeParameters codeGeneratorAttribute; + private readonly IServerHostGenerator serverHostGeneratorMvc; + private readonly IServerHostGenerator serverHostGeneratorMinimalApi; + private readonly IServerHostTestGenerator? serverHostTestGeneratorMvc; + private readonly IServerHostTestGenerator? serverHostTestGeneratorMinimalApi; public ServerHostGenerator( - ILogger logger, + ILoggerFactory loggerFactory, + IApiOperationExtractor apiOperationExtractor, INugetPackageReferenceProvider nugetPackageReferenceProvider, HostProjectOptions projectOptions) { - this.logger = logger ?? throw new ArgumentNullException(nameof(logger)); - this.nugetPackageReferenceProvider = nugetPackageReferenceProvider ?? throw new ArgumentNullException(nameof(nugetPackageReferenceProvider)); - this.projectOptions = projectOptions ?? throw new ArgumentNullException(nameof(projectOptions)); - - // TODO: Optimize codeGeneratorContentHeader & codeGeneratorAttribute - var codeHeaderGenerator = new GeneratedCodeHeaderGenerator( - new GeneratedCodeGeneratorParameters( - projectOptions.ApiGeneratorVersion)); - codeGeneratorContentHeader = codeHeaderGenerator.Generate(); + ArgumentNullException.ThrowIfNull(loggerFactory); + ArgumentNullException.ThrowIfNull(apiOperationExtractor); + ArgumentNullException.ThrowIfNull(nugetPackageReferenceProvider); - codeGeneratorAttribute = new AttributeParameters( - "GeneratedCode", - $"\"{ContentWriterConstants.ApiGeneratorName}\", \"{projectOptions.ApiGeneratorVersion}\""); - } - - public bool Generate() - { - logger.LogInformation($"{ContentWriterConstants.AreaGenerateCode} Working on server host generation ({projectOptions.ProjectName})"); + logger = loggerFactory.CreateLogger(); + this.projectOptions = projectOptions ?? throw new ArgumentNullException(nameof(projectOptions)); - if (!projectOptions.SetPropertiesAfterValidationsOfProjectReferencesPathAndFiles(logger)) + var apiProjectName = projectOptions.ProjectName.Replace(".Api", ".Api.Generated", StringComparison.Ordinal); + var domainProjectName = projectOptions.ProjectName.Replace(".Api", ".Domain", StringComparison.Ordinal); + var operationSchemaMappings = apiOperationExtractor.Extract(projectOptions.Document); + + serverHostGeneratorMvc = new Framework.Mvc.ProjectGenerator.ServerHostGenerator( + loggerFactory, + nugetPackageReferenceProvider, + projectOptions.ApiGeneratorVersion, + projectOptions.ProjectName, + apiProjectName, + domainProjectName, + projectOptions.PathForSrcGenerate, + projectOptions.Document) { - return false; - } + UseRestExtended = projectOptions.UseRestExtended, + }; - ScaffoldSrc(); - GenerateSrcGlobalUsings(projectOptions.RemoveNamespaceGroupSeparatorInGlobalUsings); + serverHostGeneratorMinimalApi = new Framework.Minimal.ProjectGenerator.ServerHostGenerator( + loggerFactory, + nugetPackageReferenceProvider, + projectOptions.ApiGeneratorVersion, + projectOptions.ProjectName, + apiProjectName, + domainProjectName, + projectOptions.PathForSrcGenerate, + projectOptions.Document); if (projectOptions.PathForTestGenerate is not null) { - logger.LogInformation($"{ContentWriterConstants.AreaGenerateTest} Working on server host unit-test generation ({projectOptions.ProjectName}.Tests)"); - ScaffoldTest(); - - GenerateTestEndpoints(projectOptions.Document); - - GenerateTestGlobalUsings(projectOptions.UsingCodingRules, projectOptions.RemoveNamespaceGroupSeparatorInGlobalUsings); + serverHostTestGeneratorMvc = new Framework.Mvc.ProjectGenerator.ServerHostTestGenerator( + loggerFactory, + nugetPackageReferenceProvider, + projectOptions.ApiGeneratorVersion, + $"{projectOptions.ProjectName}.{ContentGeneratorConstants.Tests}", + projectOptions.ProjectName, + apiProjectName, + domainProjectName, + projectOptions.PathForTestGenerate, + projectOptions.Document, + operationSchemaMappings, + projectOptions.ApiOptions.IncludeDeprecated); + + serverHostTestGeneratorMinimalApi = new Framework.Minimal.ProjectGenerator.ServerHostTestGenerator( + loggerFactory, + nugetPackageReferenceProvider, + projectOptions.ApiGeneratorVersion, + $"{projectOptions.ProjectName}.{ContentGeneratorConstants.Tests}", + projectOptions.ProjectName, + apiProjectName, + domainProjectName, + projectOptions.PathForTestGenerate, + projectOptions.Document, + operationSchemaMappings); } - - return true; } - private void ScaffoldSrc() + public async Task Generate() { - if (!Directory.Exists(projectOptions.PathForSrcGenerate.FullName)) - { - Directory.CreateDirectory(projectOptions.PathForSrcGenerate.FullName); - } + logger.LogInformation($"{ContentWriterConstants.AreaGenerateCode} Working on server host generation ({projectOptions.ProjectName})"); - if (projectOptions.PathForSrcGenerate.Exists && - projectOptions.ProjectSrcCsProj.Exists) + if (projectOptions.ApiOptions.Generator.AspNetOutputType == AspNetOutputType.Mvc) { - var hasUpdates = SolutionAndProjectHelper.EnsureLatestPackageReferencesVersionInProjFile( - logger, - projectOptions.ProjectSrcCsProj, - projectOptions.ProjectSrcCsProjDisplayLocation, - ProjectType.ServerHost, - isTestProject: false); - if (!hasUpdates) + if (!projectOptions.SetPropertiesAfterValidationsOfProjectReferencesPathAndFilesForMvc(logger)) { - logger.LogDebug($"{EmojisConstants.FileNotUpdated} No updates for csproj"); + return false; } } else { - var projectReferences = new List(); - if (projectOptions.ApiProjectSrcCsProj is not null) + if (!projectOptions.SetPropertiesAfterValidationsOfProjectReferencesPathAndFilesForMinimalApi(logger)) { - projectReferences.Add(projectOptions.ApiProjectSrcCsProj); - } - - if (projectOptions.DomainProjectSrcCsProj is not null) - { - projectReferences.Add(projectOptions.DomainProjectSrcCsProj); - } - - IList<(string PackageId, string PackageVersion, string? SubElements)>? packageReferencesBaseLineForHostProject = null; - TaskHelper.RunSync(async () => - { - packageReferencesBaseLineForHostProject = await nugetPackageReferenceProvider.GetPackageReferencesBaseLineForHostProject(projectOptions.UseRestExtended); - }); - - SolutionAndProjectHelper.ScaffoldProjFile( - logger, - projectOptions.ProjectSrcCsProj, - projectOptions.ProjectSrcCsProjDisplayLocation, - ProjectType.ServerHost, - createAsWeb: true, - createAsTestProject: false, - projectOptions.ProjectName, - "net6.0", - frameworkReferences: null, - packageReferencesBaseLineForHostProject, - projectReferences, - includeApiSpecification: false, - usingCodingRules: projectOptions.UsingCodingRules); - - ScaffoldPropertiesLaunchSettingsFile( - projectOptions.PathForSrcGenerate, - projectOptions.UseRestExtended); - - ScaffoldProgramFile(); - ScaffoldStartupFile(); - ScaffoldWebConfig(); - - if (projectOptions.UseRestExtended) - { - ScaffoldConfigureSwaggerDocOptions(); + return false; } } - } - private void ScaffoldPropertiesLaunchSettingsFile( - DirectoryInfo pathForSrcGenerate, - bool useExtended) - { - var propertiesPath = new DirectoryInfo(Path.Combine(pathForSrcGenerate.FullName, "Properties")); - propertiesPath.Create(); - - var resourceName = "Atc.Rest.ApiGenerator.Resources.launchSettings.json"; - if (useExtended) + if (projectOptions.ApiOptions.Generator.AspNetOutputType == AspNetOutputType.Mvc) { - resourceName = "Atc.Rest.ApiGenerator.Resources.launchSettingsExtended.json"; - } + await serverHostGeneratorMvc.ScaffoldProjectFile(); + serverHostGeneratorMvc.ScaffoldPropertiesLaunchSettingsFile(); + serverHostGeneratorMvc.ScaffoldProgramFile( + projectOptions.ApiOptions.Generator.SwaggerThemeMode); + serverHostGeneratorMvc.ScaffoldStartupFile(); + serverHostGeneratorMvc.ScaffoldWebConfig(); - var resourceStream = typeof(ServerHostGenerator).Assembly.GetManifestResourceStream(resourceName); - var json = resourceStream!.ToStringData(); + serverHostGeneratorMvc.GenerateConfigureSwaggerDocOptions(); - var file = new FileInfo(Path.Combine(propertiesPath.FullName, "launchSettings.json")); + serverHostGeneratorMvc.MaintainGlobalUsings( + projectOptions.RemoveNamespaceGroupSeparatorInGlobalUsings); - if (file.Exists) - { - logger.LogTrace($"{EmojisConstants.FileNotUpdated} {file.FullName} nothing to update"); - } - else - { - var contentWriter = new ContentWriter(logger); - contentWriter.Write( - projectOptions.PathForSrcGenerate, - file, - ContentWriterArea.Src, - json); - } - } + if (serverHostTestGeneratorMvc is not null && + projectOptions.PathForTestGenerate is not null) + { + logger.LogInformation($"{ContentWriterConstants.AreaGenerateTest} Working on server host unit-test generation ({projectOptions.ProjectName}.Tests)"); - private void ScaffoldTest() - { - if (projectOptions.PathForTestGenerate is null || - projectOptions.ProjectTestCsProj is null) - { - return; - } + await serverHostTestGeneratorMvc.ScaffoldProjectFile(); + serverHostTestGeneratorMvc.ScaffoldAppSettingsIntegrationTestFile(); - if (projectOptions.PathForTestGenerate.Exists && - projectOptions.ProjectTestCsProj.Exists) - { - var hasUpdates = SolutionAndProjectHelper.EnsureLatestPackageReferencesVersionInProjFile( - logger, - projectOptions.ProjectTestCsProj, - projectOptions.ProjectTestCsProjDisplayLocation, - ProjectType.ServerHost, - isTestProject: true); - if (!hasUpdates) - { - logger.LogDebug($"{EmojisConstants.FileNotUpdated} No updates for csproj"); + serverHostTestGeneratorMvc.GenerateWebApiStartupFactoryFile(); + serverHostTestGeneratorMvc.GenerateWebApiControllerBaseTestFile(); + serverHostTestGeneratorMvc.GenerateEndpointHandlerStubs(); + serverHostTestGeneratorMvc.GenerateEndpointTests(); + + serverHostTestGeneratorMvc.MaintainGlobalUsings( + projectOptions.UsingCodingRules, + projectOptions.RemoveNamespaceGroupSeparatorInGlobalUsings); } } else { - if (!Directory.Exists(projectOptions.PathForTestGenerate.FullName)) - { - Directory.CreateDirectory(projectOptions.PathForTestGenerate.FullName); - } - - var projectReferences = new List(); - if (projectOptions.ApiProjectSrcCsProj is not null) - { - projectReferences.Add(projectOptions.ProjectSrcCsProj); - projectReferences.Add(projectOptions.ApiProjectSrcCsProj); - } - - if (projectOptions.DomainProjectSrcCsProj is not null) - { - projectReferences.Add(projectOptions.DomainProjectSrcCsProj); - } + await serverHostGeneratorMinimalApi.ScaffoldProjectFile(); + serverHostGeneratorMinimalApi.ScaffoldPropertiesLaunchSettingsFile(); + serverHostGeneratorMinimalApi.ScaffoldProgramFile( + projectOptions.ApiOptions.Generator.SwaggerThemeMode); + serverHostGeneratorMinimalApi.ScaffoldWebConfig(); - SolutionAndProjectHelper.ScaffoldProjFile( - logger, - projectOptions.ProjectTestCsProj, - projectOptions.ProjectTestCsProjDisplayLocation, - ProjectType.ServerHost, - createAsWeb: false, - createAsTestProject: true, - $"{projectOptions.ProjectName}.Tests", - "net6.0", - frameworkReferences: null, - nugetPackageReferenceProvider.GetPackageReferencesBaseLineForTestProject(useMvc: true), - projectReferences, - includeApiSpecification: true, - usingCodingRules: projectOptions.UsingCodingRules); - } + serverHostGeneratorMinimalApi.ScaffoldJsonSerializerOptionsExtensions(); + serverHostGeneratorMinimalApi.ScaffoldServiceCollectionExtensions(); + serverHostGeneratorMinimalApi.ScaffoldWebApplicationBuilderExtensions(); + serverHostGeneratorMinimalApi.ScaffoldWebApplicationExtensions( + projectOptions.ApiOptions.Generator.SwaggerThemeMode); + serverHostGeneratorMinimalApi.ScaffoldConfigureSwaggerOptions(); - GenerateTestWebApiStartupFactory(); - GenerateTestWebApiControllerBaseTest(); - ScaffoldAppSettingsIntegrationTest(); - } + serverHostGeneratorMinimalApi.GenerateConfigureSwaggerDocOptions(); - private void GenerateTestEndpoints( - OpenApiDocument document) - { - foreach (var openApiPath in document.Paths) - { - var apiGroupName = openApiPath.GetApiGroupName(); + serverHostGeneratorMinimalApi.MaintainGlobalUsings( + projectOptions.RemoveNamespaceGroupSeparatorInGlobalUsings); + serverHostGeneratorMinimalApi.MaintainWwwResources(); - foreach (var openApiOperation in openApiPath.Value.Operations) + if (serverHostTestGeneratorMinimalApi is not null && + projectOptions.PathForTestGenerate is not null) { - GenerateTestEndpointHandlerStub(apiGroupName, openApiPath.Value, openApiOperation.Value); - GenerateTestEndpointTests(apiGroupName, openApiOperation.Value); - } - } - } - - private void GenerateTestEndpointHandlerStub( - string apiGroupName, - OpenApiPathItem openApiPath, - OpenApiOperation openApiOperation) - { - var fullNamespace = $"{projectOptions.ProjectName}.{ContentGeneratorConstants.Tests}.{ContentGeneratorConstants.Endpoints}.{apiGroupName}"; - - // Generate - var classParameters = ContentGeneratorServerTestEndpointHandlerStubParametersFactory.Create( - codeGeneratorContentHeader, - fullNamespace, - codeGeneratorAttribute, - openApiPath, - openApiOperation); - - var contentGeneratorClass = new GenerateContentForClass( - new CodeDocumentationTagsGenerator(), - classParameters); - - var classContent = contentGeneratorClass.Generate(); - - // Write - var pathA = Path.Combine(projectOptions.PathForTestGenerate!.FullName, ContentGeneratorConstants.Endpoints); - var pathB = Path.Combine(pathA, apiGroupName); - var fileName = $"{classParameters.TypeName}.cs"; - var file = new FileInfo(Path.Combine(pathB, fileName)); - - var contentWriter = new ContentWriter(logger); - contentWriter.Write( - projectOptions.PathForTestGenerate, - file, - ContentWriterArea.Test, - classContent); - } - - private void GenerateTestEndpointTests( - string apiGroupName, - OpenApiOperation openApiOperation) - { - var fullNamespace = $"{projectOptions.ProjectName}.{ContentGeneratorConstants.Tests}.{ContentGeneratorConstants.Endpoints}.{apiGroupName}"; - - // Generate - var classParameters = ContentGeneratorServerTestEndpointTestsParametersFactory.Create( - fullNamespace, - openApiOperation); - - var contentGeneratorClass = new GenerateContentForClass( - new CodeDocumentationTagsGenerator(), - classParameters); + logger.LogInformation($"{ContentWriterConstants.AreaGenerateTest} Working on server host unit-test generation ({projectOptions.ProjectName}.Tests)"); - var classContent = contentGeneratorClass.Generate(); + await serverHostTestGeneratorMinimalApi.ScaffoldProjectFile(); + serverHostTestGeneratorMinimalApi.ScaffoldAppSettingsIntegrationTestFile(); - // Write - var pathA = Path.Combine(projectOptions.PathForTestGenerate!.FullName, ContentGeneratorConstants.Endpoints); - var pathB = Path.Combine(pathA, apiGroupName); - var fileName = $"{classParameters.TypeName}.cs"; - var file = new FileInfo(Path.Combine(pathB, fileName)); + serverHostTestGeneratorMinimalApi.GenerateWebApiStartupFactoryFile(); + serverHostTestGeneratorMinimalApi.GenerateWebApiControllerBaseTestFile(); + serverHostTestGeneratorMinimalApi.GenerateEndpointHandlerStubs(); + serverHostTestGeneratorMinimalApi.GenerateEndpointTests(); - var contentWriter = new ContentWriter(logger); - contentWriter.Write( - projectOptions.PathForTestGenerate, - file, - ContentWriterArea.Test, - classContent, - overrideIfExist: false); - } - - private void ScaffoldProgramFile() - { - var fullNamespace = $"{projectOptions.ProjectName}"; - - var contentGenerator = new ContentGeneratorServerProgram( - new ContentGeneratorBaseParameters(fullNamespace)); - - var content = contentGenerator.Generate(); - - var file = new FileInfo(Path.Combine(projectOptions.PathForSrcGenerate.FullName, "Program.cs")); - - var contentWriter = new ContentWriter(logger); - contentWriter.Write( - projectOptions.PathForSrcGenerate, - file, - ContentWriterArea.Src, - content, - overrideIfExist: false); - } - - private void ScaffoldStartupFile() - { - var fullNamespace = $"{projectOptions.ProjectName}"; - - var contentGenerator = new ContentGeneratorServerStartup( - new ContentGeneratorBaseParameters(fullNamespace)); - - var content = contentGenerator.Generate(); - - var file = new FileInfo(Path.Combine(projectOptions.PathForSrcGenerate.FullName, "Startup.cs")); - - var contentWriter = new ContentWriter(logger); - contentWriter.Write( - projectOptions.PathForSrcGenerate, - file, - ContentWriterArea.Src, - content, - overrideIfExist: false); - } - - private void ScaffoldWebConfig() - { - var contentGenerator = new ContentGeneratorServerWebConfig(); - - var content = contentGenerator.Generate(); - - var file = new FileInfo(Path.Combine(projectOptions.PathForSrcGenerate.FullName, "web.config")); - - var contentWriter = new ContentWriter(logger); - contentWriter.Write( - projectOptions.PathForSrcGenerate, - file, - ContentWriterArea.Src, - content, - overrideIfExist: false); - } - - private void ScaffoldConfigureSwaggerDocOptions() - { - var fullNamespace = $"{projectOptions.ProjectName}"; - - var contentGeneratorServerSwaggerDocOptionsParameters = ContentGeneratorServerSwaggerDocOptionsParameterFactory - .Create( - fullNamespace, - projectOptions.Document.ToSwaggerDocOptionsParameters()); - - var contentGenerator = new ContentGeneratorServerSwaggerDocOptions( - new GeneratedCodeHeaderGenerator(new GeneratedCodeGeneratorParameters(projectOptions.ApiGeneratorVersion)), - new GeneratedCodeAttributeGenerator(new GeneratedCodeGeneratorParameters(projectOptions.ApiGeneratorVersion)), - contentGeneratorServerSwaggerDocOptionsParameters); - - var content = contentGenerator.Generate(); - - var file = new FileInfo(Path.Combine(projectOptions.PathForSrcGenerate.FullName, "ConfigureSwaggerDocOptions.cs")); - - var contentWriter = new ContentWriter(logger); - contentWriter.Write( - projectOptions.PathForSrcGenerate, - file, - ContentWriterArea.Src, - content); - } - - private void GenerateTestWebApiStartupFactory() - { - var fullNamespace = $"{projectOptions.ProjectName}.Tests"; - - var contentGeneratorServerWebApiStartupFactoryParameters = ContentGeneratorServerWebApiStartupFactoryParametersFactory.Create( - fullNamespace); - - var contentGenerator = new ContentGeneratorServerWebApiStartupFactory( - new GeneratedCodeHeaderGenerator(new GeneratedCodeGeneratorParameters(projectOptions.ApiGeneratorVersion)), - new GeneratedCodeAttributeGenerator(new GeneratedCodeGeneratorParameters(projectOptions.ApiGeneratorVersion)), - new CodeDocumentationTagsGenerator(), - contentGeneratorServerWebApiStartupFactoryParameters); - - var content = contentGenerator.Generate(); - - var file = new FileInfo(Path.Combine(projectOptions.PathForTestGenerate!.FullName, "WebApiStartupFactory.cs")); - - var contentWriter = new ContentWriter(logger); - contentWriter.Write( - projectOptions.PathForTestGenerate, - file, - ContentWriterArea.Test, - content); - } - - private void GenerateTestWebApiControllerBaseTest() - { - var fullNamespace = $"{projectOptions.ProjectName}.Tests"; - - var contentGenerator = new ContentGeneratorServerWebApiControllerBaseTest( - new GeneratedCodeHeaderGenerator(new GeneratedCodeGeneratorParameters(projectOptions.ApiGeneratorVersion)), - new GeneratedCodeAttributeGenerator(new GeneratedCodeGeneratorParameters(projectOptions.ApiGeneratorVersion)), - new ContentGeneratorBaseParameters(fullNamespace)); - - var content = contentGenerator.Generate(); - - var file = new FileInfo(Path.Combine(projectOptions.PathForTestGenerate!.FullName, "WebApiControllerBaseTest.cs")); - - var contentWriter = new ContentWriter(logger); - contentWriter.Write( - projectOptions.PathForTestGenerate, - file, - ContentWriterArea.Test, - content); - } - - private void ScaffoldAppSettingsIntegrationTest() - { - var contentGenerator = new ContentGeneratorServerAppSettingsIntegrationTest(); - - var content = contentGenerator.Generate(); - - var file = new FileInfo(Path.Combine(projectOptions.PathForTestGenerate!.FullName, "appsettings.integrationtest.json")); - - var contentWriter = new ContentWriter(logger); - contentWriter.Write( - projectOptions.PathForTestGenerate, - file, - ContentWriterArea.Test, - content, - overrideIfExist: false); - } - - private void GenerateSrcGlobalUsings( - bool removeNamespaceGroupSeparatorInGlobalUsings) - { - var requiredUsings = new List - { - "System.CodeDom.Compiler", - "System.Reflection", - projectOptions.ProjectName.Replace(".Api", ".Domain", StringComparison.Ordinal), - $"{projectOptions.ProjectName}.Generated", - }; - - if (projectOptions.UseRestExtended) - { - requiredUsings.Add("Atc.Rest.Extended.Options"); - requiredUsings.Add("Microsoft.AspNetCore.Mvc.ApiExplorer"); - requiredUsings.Add("Microsoft.Extensions.Options"); - requiredUsings.Add("Microsoft.OpenApi.Models"); - requiredUsings.Add("Swashbuckle.AspNetCore.SwaggerGen"); - } - - GlobalUsingsHelper.CreateOrUpdate( - logger, - ContentWriterArea.Src, - projectOptions.PathForSrcGenerate, - requiredUsings, - removeNamespaceGroupSeparatorInGlobalUsings); - } - - private void GenerateTestGlobalUsings( - bool usingCodingRules, - bool removeNamespaceGroupSeparatorInGlobalUsings) - { - var requiredUsings = new List - { - "System.CodeDom.Compiler", - "System.Text", - "System.Text.Json", - "System.Text.Json.Serialization", - "System.Reflection", - "Atc.XUnit", - "Atc.Rest.Results", - "Atc.Rest.Options", - "Microsoft.AspNetCore.Hosting", - "Microsoft.AspNetCore.Http", - "Microsoft.AspNetCore.TestHost", - "Microsoft.AspNetCore.Mvc.Testing", - "Microsoft.Extensions.Configuration", - "Microsoft.Extensions.DependencyInjection", - $"{projectOptions.ProjectName}.Generated", - $"{projectOptions.ProjectName}.Generated.Contracts", - }; - - if (!usingCodingRules) - { - requiredUsings.Add("AutoFixture"); - requiredUsings.Add("Xunit"); - } - - foreach (var apiGroupName in projectOptions.ApiGroupNames) - { - if (apiGroupName.Equals("Tasks", StringComparison.OrdinalIgnoreCase)) - { - continue; + serverHostTestGeneratorMinimalApi.MaintainGlobalUsings( + projectOptions.UsingCodingRules, + projectOptions.RemoveNamespaceGroupSeparatorInGlobalUsings); } - - requiredUsings.Add($"{projectOptions.ProjectName}.Generated.Contracts.{apiGroupName}"); } - GlobalUsingsHelper.CreateOrUpdate( - logger, - ContentWriterArea.Test, - projectOptions.PathForTestGenerate!, - requiredUsings, - removeNamespaceGroupSeparatorInGlobalUsings); + return true; } } \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator/GlobalUsings.cs b/src/Atc.Rest.ApiGenerator/GlobalUsings.cs index 28ba1c06..8ebdc5bf 100644 --- a/src/Atc.Rest.ApiGenerator/GlobalUsings.cs +++ b/src/Atc.Rest.ApiGenerator/GlobalUsings.cs @@ -1,37 +1,22 @@ global using System.Diagnostics.CodeAnalysis; -global using System.Net; -global using System.Text; -global using Atc.CodeDocumentation.CodeComment; -global using Atc.CodeGeneration.CSharp.Content; -global using Atc.CodeGeneration.CSharp.Content.Factories; -global using Atc.CodeGeneration.CSharp.Content.Generators; global using Atc.Console.Spectre; -global using Atc.DotNet; global using Atc.Helpers; -global using Atc.Rest.ApiGenerator.Framework.ContentGenerators; -global using Atc.Rest.ApiGenerator.Framework.Contracts; -global using Atc.Rest.ApiGenerator.Framework.Contracts.ContentGeneratorsParameters; -global using Atc.Rest.ApiGenerator.Framework.Contracts.Extensions; -global using Atc.Rest.ApiGenerator.Framework.Contracts.Models; -global using Atc.Rest.ApiGenerator.Framework.Contracts.Options; -global using Atc.Rest.ApiGenerator.Framework.Factories.Parameters.Client; -global using Atc.Rest.ApiGenerator.Framework.Factories.Parameters.Server; -global using Atc.Rest.ApiGenerator.Framework.Factories.Parameters.ServerClient; -global using Atc.Rest.ApiGenerator.Framework.Mvc.ContentGenerators.Client; -global using Atc.Rest.ApiGenerator.Framework.Mvc.ContentGenerators.Server; +global using Atc.Rest.ApiGenerator.Client.CSharp.ProjectGenerator; +global using Atc.Rest.ApiGenerator.Contracts; +global using Atc.Rest.ApiGenerator.Contracts.Options; +global using Atc.Rest.ApiGenerator.Framework.ProjectGenerator; +global using Atc.Rest.ApiGenerator.Framework.Providers; global using Atc.Rest.ApiGenerator.Framework.Writers; global using Atc.Rest.ApiGenerator.Generators; -global using Atc.Rest.ApiGenerator.Helpers; global using Atc.Rest.ApiGenerator.Models; global using Atc.Rest.ApiGenerator.Nuget.Clients; global using Atc.Rest.ApiGenerator.OpenApi; global using Atc.Rest.ApiGenerator.OpenApi.Extensions; global using Atc.Rest.ApiGenerator.OpenApi.Extractors; global using Atc.Rest.ApiGenerator.OpenApi.Models; -global using Atc.Rest.ApiGenerator.Projects; +global using Atc.Rest.ApiGenerator.Options; global using Microsoft.Extensions.Logging; global using Microsoft.Extensions.Logging.Abstractions; -global using Microsoft.OpenApi.Models; -global using Microsoft.OpenApi.Writers; \ No newline at end of file +global using Microsoft.OpenApi.Models; \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator/Helpers/DirectoryInfoHelper.cs b/src/Atc.Rest.ApiGenerator/Helpers/DirectoryInfoHelper.cs deleted file mode 100644 index 3befd274..00000000 --- a/src/Atc.Rest.ApiGenerator/Helpers/DirectoryInfoHelper.cs +++ /dev/null @@ -1,94 +0,0 @@ -namespace Atc.Rest.ApiGenerator.Helpers; - -public static class DirectoryInfoHelper -{ - public static DirectoryInfo GetProjectPath() - { - var currentDomainBaseDirectory = AppDomain.CurrentDomain.BaseDirectory; - - var projectPath = currentDomainBaseDirectory! - .Replace("\\Bin", string.Empty, StringComparison.OrdinalIgnoreCase) - .Replace("\\net6.0", string.Empty, StringComparison.OrdinalIgnoreCase) - .Replace("\\Debug", string.Empty, StringComparison.OrdinalIgnoreCase) - .Replace("\\ApiGenerator", string.Empty, StringComparison.OrdinalIgnoreCase); - - return new DirectoryInfo(projectPath!); - } - - public static string GetCsFileNameForEndpoints( - DirectoryInfo pathForEndpoints, - string modelName) - { - ArgumentNullException.ThrowIfNull(pathForEndpoints); - ArgumentNullException.ThrowIfNull(modelName); - - return Path.Combine(pathForEndpoints.FullName, $"{modelName}.cs"); - } - - public static string GetCsFileNameForContract( - DirectoryInfo pathForContracts, - string apiGroupName, - string modelName) - { - ArgumentNullException.ThrowIfNull(pathForContracts); - ArgumentNullException.ThrowIfNull(apiGroupName); - ArgumentNullException.ThrowIfNull(modelName); - - var a = Path.Combine(pathForContracts.FullName, apiGroupName); - var b = Path.Combine(a, $"{modelName}.cs"); - return b; - } - - public static string GetCsFileNameForContract( - DirectoryInfo pathForContracts, - string apiGroupName, - string subArea, - string modelName) - { - ArgumentNullException.ThrowIfNull(pathForContracts); - ArgumentNullException.ThrowIfNull(apiGroupName); - ArgumentNullException.ThrowIfNull(subArea); - ArgumentNullException.ThrowIfNull(modelName); - - var a = Path.Combine(pathForContracts.FullName, apiGroupName); - var b = Path.Combine(a, subArea); - var c = Path.Combine(b, $"{modelName}.cs"); - return c; - } - - public static string GetCsFileNameForContractEnumTypes( - DirectoryInfo pathForContracts, - string modelName) - { - ArgumentNullException.ThrowIfNull(pathForContracts); - ArgumentNullException.ThrowIfNull(modelName); - - var a = Path.Combine(pathForContracts.FullName, ContentGeneratorConstants.SpecialFolderEnumerationTypes); - var b = Path.Combine(a, $"{modelName}.cs"); - return b; - } - - public static string GetCsFileNameForContractShared( - DirectoryInfo pathForContracts, - string modelName) - { - ArgumentNullException.ThrowIfNull(pathForContracts); - ArgumentNullException.ThrowIfNull(modelName); - - return Path.Combine(pathForContracts.FullName, $"{modelName}.cs"); - } - - public static string GetCsFileNameForHandler( - DirectoryInfo pathForHandlers, - string apiGroupName, - string handlerName) - { - ArgumentNullException.ThrowIfNull(pathForHandlers); - ArgumentNullException.ThrowIfNull(apiGroupName); - ArgumentNullException.ThrowIfNull(handlerName); - - var a = Path.Combine(pathForHandlers.FullName, apiGroupName); - var b = Path.Combine(a, $"{handlerName}.cs"); - return b; - } -} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator/Helpers/GenerateHelper.cs b/src/Atc.Rest.ApiGenerator/Helpers/GenerateHelper.cs index eedae0c0..f42f79b0 100644 --- a/src/Atc.Rest.ApiGenerator/Helpers/GenerateHelper.cs +++ b/src/Atc.Rest.ApiGenerator/Helpers/GenerateHelper.cs @@ -4,7 +4,7 @@ namespace Atc.Rest.ApiGenerator.Helpers; public static class GenerateHelper { public static bool GenerateServerApi( - ILogger logger, + ILoggerFactory loggerFactory, IApiOperationExtractor apiOperationExtractor, INugetPackageReferenceProvider nugetPackageReferenceProvider, string projectPrefixName, @@ -15,7 +15,6 @@ public static bool GenerateServerApi( bool useCodingRules, bool removeNamespaceGroupSeparatorInGlobalUsings) { - ArgumentNullException.ThrowIfNull(logger); ArgumentNullException.ThrowIfNull(apiOperationExtractor); ArgumentNullException.ThrowIfNull(projectPrefixName); ArgumentNullException.ThrowIfNull(outputPath); @@ -32,12 +31,20 @@ public static bool GenerateServerApi( apiOptions, useCodingRules, removeNamespaceGroupSeparatorInGlobalUsings); - var serverApiGenerator = new ServerApiGenerator(logger, apiOperationExtractor, nugetPackageReferenceProvider, projectOptions); - return serverApiGenerator.Generate(); + var serverApiGenerator = new ServerApiGenerator(loggerFactory, apiOperationExtractor, nugetPackageReferenceProvider, projectOptions); + + var generateResult = false; + TaskHelper.RunSync(async () => + { + generateResult = await serverApiGenerator.Generate(); + }); + + return generateResult; } public static bool GenerateServerDomain( - ILogger logger, + ILoggerFactory loggerFactory, + IApiOperationExtractor apiOperationExtractor, INugetPackageReferenceProvider nugetPackageReferenceProvider, string projectPrefixName, DirectoryInfo outputSourcePath, @@ -48,7 +55,6 @@ public static bool GenerateServerDomain( bool removeNamespaceGroupSeparatorInGlobalUsings, DirectoryInfo apiPath) { - ArgumentNullException.ThrowIfNull(logger); ArgumentNullException.ThrowIfNull(projectPrefixName); ArgumentNullException.ThrowIfNull(outputSourcePath); ArgumentNullException.ThrowIfNull(apiDocumentContainer); @@ -65,12 +71,20 @@ public static bool GenerateServerDomain( useCodingRules, removeNamespaceGroupSeparatorInGlobalUsings, apiPath); - var serverDomainGenerator = new ServerDomainGenerator(logger, nugetPackageReferenceProvider, domainProjectOptions); - return serverDomainGenerator.Generate(); + var serverDomainGenerator = new ServerDomainGenerator(loggerFactory, apiOperationExtractor, nugetPackageReferenceProvider, domainProjectOptions); + + var generateResult = false; + TaskHelper.RunSync(async () => + { + generateResult = await serverDomainGenerator.Generate(); + }); + + return generateResult; } public static bool GenerateServerHost( - ILogger logger, + ILoggerFactory loggerFactory, + IApiOperationExtractor apiOperationExtractor, INugetPackageReferenceProvider nugetPackageReferenceProvider, string projectPrefixName, DirectoryInfo outputSourcePath, @@ -82,7 +96,6 @@ public static bool GenerateServerHost( DirectoryInfo apiPath, DirectoryInfo domainPath) { - ArgumentNullException.ThrowIfNull(logger); ArgumentNullException.ThrowIfNull(projectPrefixName); ArgumentNullException.ThrowIfNull(outputSourcePath); ArgumentNullException.ThrowIfNull(apiDocumentContainer); @@ -101,66 +114,95 @@ public static bool GenerateServerHost( removeNamespaceGroupSeparatorInGlobalUsings, apiPath, domainPath); - var serverHostGenerator = new ServerHostGenerator(logger, nugetPackageReferenceProvider, hostProjectOptions); - return serverHostGenerator.Generate(); + var serverHostGenerator = new ServerHostGenerator(loggerFactory, apiOperationExtractor, nugetPackageReferenceProvider, hostProjectOptions); + + var generateResult = false; + TaskHelper.RunSync(async () => + { + generateResult = await serverHostGenerator.Generate(); + }); + + return generateResult; } public static bool GenerateServerSln( - ILogger logger, + ILoggerFactory loggerFactory, string projectPrefixName, string outputSlnPath, - DirectoryInfo outputSourcePath, - DirectoryInfo? outputTestPath) + DirectoryInfo srcPath, + DirectoryInfo? testPath, + AspNetOutputType aspNetOutputType) { - ArgumentNullException.ThrowIfNull(logger); + ArgumentNullException.ThrowIfNull(loggerFactory); ArgumentNullException.ThrowIfNull(projectPrefixName); ArgumentNullException.ThrowIfNull(outputSlnPath); - ArgumentNullException.ThrowIfNull(outputSourcePath); + ArgumentNullException.ThrowIfNull(srcPath); var projectName = projectPrefixName .Replace(" ", ".", StringComparison.Ordinal) .Replace("-", ".", StringComparison.Ordinal) .Trim(); - var apiPath = new DirectoryInfo(Path.Combine(outputSourcePath.FullName, $"{projectName}.Api.Generated")); - var domainPath = new DirectoryInfo(Path.Combine(outputSourcePath.FullName, $"{projectName}.Domain")); - var hostPath = new DirectoryInfo(Path.Combine(outputSourcePath.FullName, $"{projectName}.Api")); + var rootPath = outputSlnPath.EndsWith(".sln", StringComparison.OrdinalIgnoreCase) + ? new FileInfo(outputSlnPath).Directory! + : new DirectoryInfo(outputSlnPath); + + IServerGenerator serverGeneratorMvc = new Framework.Mvc.ProjectGenerator.ServerGenerator( + loggerFactory, + projectName, + rootPath, + srcPath, + testPath); - var slnFile = outputSlnPath.EndsWith(".sln", StringComparison.OrdinalIgnoreCase) - ? new FileInfo(outputSlnPath) - : new FileInfo(Path.Combine(outputSlnPath, $"{projectName}.sln")); + IServerGenerator serverGeneratorMinimalApi = new Framework.Minimal.ProjectGenerator.ServerGenerator( + loggerFactory, + projectName, + rootPath, + srcPath, + testPath); - if (outputTestPath is not null) + if (aspNetOutputType == AspNetOutputType.Mvc) + { + serverGeneratorMvc.ScaffoldSolutionFile(); + serverGeneratorMvc.ScaffoldSolutionDotSettingsFile(); + } + else { - var domainTestPath = new DirectoryInfo(Path.Combine(outputTestPath.FullName, $"{projectName}.Domain")); - var hostTestPath = new DirectoryInfo(Path.Combine(outputTestPath.FullName, $"{projectName}.Api")); - - SolutionAndProjectHelper.ScaffoldSlnFile( - logger, - slnFile, - projectName, - apiPath, - domainPath, - hostPath, - domainTestPath, - hostTestPath); - - return true; + serverGeneratorMinimalApi.ScaffoldSolutionFile(); + serverGeneratorMinimalApi.ScaffoldSolutionDotSettingsFile(); } - SolutionAndProjectHelper.ScaffoldSlnFile( - logger, - slnFile, - projectName, - apiPath, - domainPath, - hostPath); + ////if (outputTestPath is not null) + ////{ + //// var domainTestPath = new DirectoryInfo(Path.Combine(outputTestPath.FullName, $"{projectName}.Domain")); + //// var hostTestPath = new DirectoryInfo(Path.Combine(outputTestPath.FullName, $"{projectName}.Api")); + + //// SolutionAndProjectHelper.ScaffoldSlnFile( + //// loggerFactory, + //// slnFile, + //// projectName, + //// apiPath, + //// domainPath, + //// hostPath, + //// domainTestPath, + //// hostTestPath); + + //// return true; + ////} + + ////SolutionAndProjectHelper.ScaffoldSlnFile( + //// loggerFactory, + //// slnFile, + //// projectName, + //// apiPath, + //// domainPath, + //// hostPath); return true; } public static bool GenerateServerCSharpClient( - ILogger logger, + ILoggerFactory loggerFactory, IApiOperationExtractor apiOperationExtractor, INugetPackageReferenceProvider nugetPackageReferenceProvider, string projectPrefixName, @@ -173,7 +215,7 @@ public static bool GenerateServerCSharpClient( bool useCodingRules, bool removeNamespaceGroupSeparatorInGlobalUsings) { - ArgumentNullException.ThrowIfNull(logger); + ArgumentNullException.ThrowIfNull(loggerFactory); ArgumentNullException.ThrowIfNull(projectPrefixName); ArgumentNullException.ThrowIfNull(outputPath); ArgumentNullException.ThrowIfNull(apiDocumentContainer); @@ -191,7 +233,14 @@ public static bool GenerateServerCSharpClient( apiOptions, useCodingRules, removeNamespaceGroupSeparatorInGlobalUsings); - var clientCSharpApiGenerator = new ClientCSharpApiGenerator(logger, apiOperationExtractor, nugetPackageReferenceProvider, clientCSharpApiProjectOptions); - return clientCSharpApiGenerator.Generate(); + var clientCSharpApiGenerator = new Generators.ClientCSharpApiGenerator(loggerFactory, apiOperationExtractor, nugetPackageReferenceProvider, clientCSharpApiProjectOptions); + + var generateResult = false; + TaskHelper.RunSync(async () => + { + generateResult = await clientCSharpApiGenerator.Generate(); + }); + + return generateResult; } } \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator/Helpers/SolutionAndProjectHelper.cs b/src/Atc.Rest.ApiGenerator/Helpers/SolutionAndProjectHelper.cs deleted file mode 100644 index 53213212..00000000 --- a/src/Atc.Rest.ApiGenerator/Helpers/SolutionAndProjectHelper.cs +++ /dev/null @@ -1,614 +0,0 @@ -// ReSharper disable ForeachCanBePartlyConvertedToQueryUsingAnotherGetEnumerator -// ReSharper disable InvertIf -// ReSharper disable SuggestBaseTypeForParameter -namespace Atc.Rest.ApiGenerator.Helpers; - -[SuppressMessage("Globalization", "CA1305:Specify IFormatProvider", Justification = "OK.")] -[SuppressMessage("Usage", "MA0011:IFormatProvider is missing", Justification = "OK.")] -public static class SolutionAndProjectHelper -{ - [SuppressMessage("Major Code Smell", "S107:Methods should not have too many parameters", Justification = "OK.")] - [SuppressMessage("Critical Code Smell", "S3776:Cognitive Complexity of methods should not be too high", Justification = "OK.")] - public static void ScaffoldProjFile( - ILogger logger, - FileInfo projectCsProjFile, - string fileDisplayLocation, - ProjectType projectType, - bool createAsWeb, - bool createAsTestProject, - string projectName, - string targetFramework, - IList? frameworkReferences, - IList<(string, string, string?)>? packageReferences, - IList? projectReferences, - bool includeApiSpecification, - bool usingCodingRules) - { - ArgumentNullException.ThrowIfNull(logger); - ArgumentNullException.ThrowIfNull(projectCsProjFile); - - var sb = new StringBuilder(); - sb.AppendLine(createAsWeb - ? "" - : ""); - sb.AppendLine(); - sb.AppendLine(2, ""); - sb.AppendLine(4, $"{targetFramework}"); - - if (!usingCodingRules) - { - sb.AppendLine(4, "10.0"); - sb.AppendLine(4, "enable"); - sb.AppendLine(4, "enable"); - } - - if (!createAsTestProject) - { - sb.AppendLine(4, "false"); - } - - sb.AppendLine(2, ""); - sb.AppendLine(); - if (!createAsTestProject) - { - sb.AppendLine(); - sb.AppendLine(2, ""); - sb.AppendLine(4, "true"); - sb.AppendLine(2, ""); - - if (usingCodingRules) - { - sb.AppendLine(); - sb.AppendLine(2, ""); - } - - sb.AppendLine(); - sb.AppendLine(2, ""); - sb.AppendLine(4, $"bin{Path.DirectorySeparatorChar}Debug{Path.DirectorySeparatorChar}{targetFramework}{Path.DirectorySeparatorChar}{projectName}.xml"); - sb.AppendLine(4, "1573;1591;1701;1702;1712;8618"); - sb.AppendLine(2, ""); - sb.AppendLine(); - - if (includeApiSpecification) - { - sb.AppendLine(2, ""); - sb.AppendLine(4, $""); - sb.AppendLine(4, $""); - sb.AppendLine(2, ""); - sb.AppendLine(); - } - } - - if (frameworkReferences is not null && - frameworkReferences.Count > 0) - { - sb.AppendLine(2, ""); - foreach (var frameworkReference in frameworkReferences.OrderBy(x => x, StringComparer.Ordinal)) - { - sb.AppendLine(4, $""); - } - - sb.AppendLine(2, ""); - sb.AppendLine(); - } - - if (packageReferences is not null && - packageReferences.Count > 0) - { - sb.AppendLine(2, ""); - foreach (var (package, version, extra) in packageReferences.OrderBy(x => x.Item1, StringComparer.Ordinal)) - { - if (extra is null) - { - sb.AppendLine(4, $""); - } - else - { - sb.AppendLine(4, $""); - var sa = extra.Split('\n'); - foreach (var s in sa) - { - sb.AppendLine(6, $"{s}"); - } - - sb.AppendLine(4, ""); - } - } - - sb.AppendLine(2, ""); - sb.AppendLine(); - } - - if (projectReferences is not null && - projectReferences.Count > 0) - { - sb.AppendLine(2, ""); - foreach (var projectReference in projectReferences.OrderBy(x => x.Name, StringComparer.Ordinal)) - { - var packageReferenceValue = GetProjectReference(projectCsProjFile, projectReference); - sb.AppendLine(4, $""); - } - - sb.AppendLine(2, ""); - sb.AppendLine(); - } - - if (createAsTestProject && - projectType == ProjectType.ServerHost) - { - sb.AppendLine(2, ""); - sb.AppendLine(4, ""); - sb.AppendLine(6, "Always"); - sb.AppendLine(4, ""); - sb.AppendLine(2, ""); - } - - sb.AppendLine(""); - - var contentWriter = new ContentWriter(logger); - contentWriter.Write( - projectCsProjFile.Directory!, - projectCsProjFile, - ContentWriterArea.Src, - sb.ToString()); - } - - public static void ScaffoldSlnFile( - ILogger logger, - FileInfo slnFile, - string projectName, - DirectoryInfo apiPath, - DirectoryInfo domainPath, - DirectoryInfo hostPath, - DirectoryInfo? domainTestPath = null, - DirectoryInfo? hostTestPath = null) - { - ArgumentNullException.ThrowIfNull(logger); - ArgumentNullException.ThrowIfNull(slnFile); - ArgumentNullException.ThrowIfNull(apiPath); - ArgumentNullException.ThrowIfNull(domainPath); - ArgumentNullException.ThrowIfNull(hostPath); - - var slnId = Guid.NewGuid(); - var apiId = Guid.NewGuid(); - var domainId = Guid.NewGuid(); - var hostId = Guid.NewGuid(); - var domainTestId = Guid.NewGuid(); - var hostTestId = Guid.NewGuid(); - - var apiPrefixPath = GetProjectReference(slnFile, apiPath, projectName); - var domainPrefixPath = GetProjectReference(slnFile, domainPath, projectName); - var hostPrefixPath = GetProjectReference(slnFile, hostPath, projectName); - - var codeInspectionExcludeProjects = new List(); - var codeInspectionExcludeProjectsFolders = new List>>(); - if (slnFile.Exists) - { - var lines = File.ReadAllLines(slnFile.FullName); - if (TryGetGuidByProject(lines, "Api.Generated.csproj", out var idApiGenerated)) - { - codeInspectionExcludeProjects.Add(idApiGenerated); - } - - if (hostTestPath is not null && - TryGetGuidByProject(lines, "Api.Tests.csproj", out var idHostTest)) - { - var hostTestDirectory = new DirectoryInfo(hostTestPath.FullName + ".Tests"); - var generatedDirectories = hostTestDirectory.GetDirectories("Generated", SearchOption.AllDirectories).ToList(); - codeInspectionExcludeProjectsFolders.Add(new Tuple>(idHostTest, hostTestDirectory, generatedDirectories)); - } - - if (domainTestPath is not null && - TryGetGuidByProject(lines, "Domain.Tests.csproj", out var idDomainTest)) - { - var domainTestDirectory = new DirectoryInfo(domainTestPath.FullName + ".Tests"); - var generatedDirectories = domainTestDirectory.GetDirectories("Generated", SearchOption.AllDirectories).ToList(); - codeInspectionExcludeProjectsFolders.Add(new Tuple>(idDomainTest, domainTestDirectory, generatedDirectories)); - } - } - else - { - codeInspectionExcludeProjects.Add(apiId); - - if (hostTestPath is not null) - { - var hostTestDirectory = new DirectoryInfo(hostTestPath.FullName + ".Tests"); - var generatedDirectories = hostTestDirectory.GetDirectories("Generated", SearchOption.AllDirectories).ToList(); - codeInspectionExcludeProjectsFolders.Add(new Tuple>(hostTestId, hostTestDirectory, generatedDirectories)); - } - - if (domainTestPath is not null) - { - var domainTestDirectory = new DirectoryInfo(domainTestPath.FullName + ".Tests"); - var generatedDirectories = domainTestDirectory.GetDirectories("Generated", SearchOption.AllDirectories).ToList(); - codeInspectionExcludeProjectsFolders.Add(new Tuple>(domainTestId, domainTestDirectory, generatedDirectories)); - } - } - - var slnFileContent = CreateSlnFileContent( - slnFile, - projectName, - domainTestPath, - hostTestPath, - apiPrefixPath, - apiId, - domainPrefixPath, - domainId, - hostPrefixPath, - hostId, - hostTestId, - domainTestId, - slnId); - - var slnDotSettingsFile = new FileInfo(slnFile + ".DotSettings"); - var slnDotSettingsFileContent = CreateSlnDotSettingsFileContent( - codeInspectionExcludeProjects, - codeInspectionExcludeProjectsFolders); - - var slnDotSettingsFileOverrideIfExist = true; - if (slnDotSettingsFile.Exists) - { - var lines = File.ReadAllLines(slnDotSettingsFile.FullName); - if (lines.Any(line => !line.Contains("ResourceDictionary", StringComparison.Ordinal) && - !line.Contains("/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2", StringComparison.Ordinal))) - { - slnDotSettingsFileOverrideIfExist = false; - } - } - - var contentWriter = new ContentWriter(logger); - - contentWriter.Write( - slnFile.Directory!, - slnFile, - ContentWriterArea.Root, - slnFileContent, - overrideIfExist: false); - - contentWriter.Write( - slnFile.Directory!, - slnDotSettingsFile, - ContentWriterArea.Root, - slnDotSettingsFileContent, - overrideIfExist: slnDotSettingsFileOverrideIfExist); - } - - public static bool EnsureLatestPackageReferencesVersionInProjFile( - ILogger logger, - FileInfo projectCsProjFile, - string fileDisplayLocation, - ProjectType projectType, - bool isTestProject) - { - ArgumentNullException.ThrowIfNull(logger); - ArgumentNullException.ThrowIfNull(projectCsProjFile); - - var fileContent = File.ReadAllText(projectCsProjFile.FullName); - if (isTestProject && - projectType == ProjectType.ServerHost && - !fileContent.Contains("Atc.XUnit", StringComparison.Ordinal)) - { - fileContent = fileContent.Replace( - "" + Environment.NewLine + " {item.NewestVersion}"; - logger.LogTrace(logMessage); - } - - FileHelper.WriteAllText(projectCsProjFile, fileContent); - - return true; - } - - private static bool TryGetGuidByProject( - IEnumerable lines, - string csProjectEndPart, - out Guid id) - { - id = Guid.NewGuid(); - foreach (var line in lines) - { - var index = line.IndexOf(csProjectEndPart, StringComparison.Ordinal); - if (index == -1) - { - continue; - } - - var s = line.Substring(index + csProjectEndPart.Length) - .Replace("\"", string.Empty, StringComparison.Ordinal) - .Replace(",", string.Empty, StringComparison.Ordinal) - .Replace(" ", string.Empty, StringComparison.Ordinal) - .Replace("{", string.Empty, StringComparison.Ordinal) - .Replace("}", string.Empty, StringComparison.Ordinal); - - if (Guid.TryParse(s, out var projId)) - { - id = projId; - return true; - } - - return false; - } - - return false; - } - - private static string CreateSlnFileContent( - FileInfo slnFile, - string projectName, - DirectoryInfo? domainTestPath, - DirectoryInfo? hostTestPath, - string apiPrefixPath, - Guid apiId, - string domainPrefixPath, - Guid domainId, - string hostPrefixPath, - Guid hostId, - Guid hostTestId, - Guid domainTestId, - Guid slnId) - { - var sb = new StringBuilder(); - sb.AppendLine(); - sb.AppendLine("Microsoft Visual Studio Solution File, Format Version 12.00"); - sb.AppendLine("# Visual Studio Version 17"); - sb.AppendLine("VisualStudioVersion = 17.0.31903.59"); - sb.AppendLine("MinimumVisualStudioVersion = 15.0.26124.0"); - sb.AppendLine($"Project(\"{{9A19103F-16F7-4668-BE54-9A1E7A4F7556}}\") = \"{projectName}.Api.Generated\", \"{apiPrefixPath}{projectName}.Api.Generated\\{projectName}.Api.Generated.csproj\", \"{{{apiId}}}\""); - sb.AppendLine("EndProject"); - sb.AppendLine($"Project(\"{{9A19103F-16F7-4668-BE54-9A1E7A4F7556}}\") = \"{projectName}.Domain\", \"{domainPrefixPath}{projectName}.Domain\\{projectName}.Domain.csproj\", \"{{{domainId}}}\""); - sb.AppendLine("EndProject"); - sb.AppendLine($"Project(\"{{9A19103F-16F7-4668-BE54-9A1E7A4F7556}}\") = \"{projectName}.Api\", \"{hostPrefixPath}{projectName}.Api\\{projectName}.Api.csproj\", \"{{{hostId}}}\""); - sb.AppendLine("EndProject"); - - if (domainTestPath is not null) - { - var domainTestPrefixPath = GetProjectReference(slnFile, domainTestPath, projectName); - sb.AppendLine($"Project(\"{{9A19103F-16F7-4668-BE54-9A1E7A4F7556}}\") = \"{projectName}.Domain.Tests\", \"{domainTestPrefixPath}{projectName}.Domain.Tests\\{projectName}.Domain.Tests.csproj\", \"{{{domainTestId}}}\""); - sb.AppendLine("EndProject"); - } - - if (hostTestPath is not null) - { - var hostTestPrefixPath = GetProjectReference(slnFile, hostTestPath, projectName); - sb.AppendLine($"Project(\"{{9A19103F-16F7-4668-BE54-9A1E7A4F7556}}\") = \"{projectName}.Api.Tests\", \"{hostTestPrefixPath}{projectName}.Api.Tests\\{projectName}.Api.Tests.csproj\", \"{{{hostTestId}}}\""); - sb.AppendLine("EndProject"); - } - - sb.AppendLine("Global"); - sb.AppendLine("\tGlobalSection(SolutionConfigurationPlatforms) = preSolution"); - sb.AppendLine("\t\tDebug|Any CPU = Debug|Any CPU"); - sb.AppendLine("\t\tRelease|Any CPU = Release|Any CPU"); - sb.AppendLine("\tEndGlobalSection"); - sb.AppendLine("\tGlobalSection(ProjectConfigurationPlatforms) = postSolution"); - sb.AppendLine($"\t\t{{{apiId}}}.Debug|Any CPU.ActiveCfg = Debug|Any CPU"); - sb.AppendLine($"\t\t{{{apiId}}}.Debug|Any CPU.Build.0 = Debug|Any CPU"); - sb.AppendLine($"\t\t{{{apiId}}}.Release|Any CPU.ActiveCfg = Release|Any CPU"); - sb.AppendLine($"\t\t{{{apiId}}}.Release|Any CPU.Build.0 = Release|Any CPU"); - sb.AppendLine($"\t\t{{{domainId}}}.Debug|Any CPU.ActiveCfg = Debug|Any CPU"); - sb.AppendLine($"\t\t{{{domainId}}}.Debug|Any CPU.Build.0 = Debug|Any CPU"); - sb.AppendLine($"\t\t{{{domainId}}}.Release|Any CPU.ActiveCfg = Release|Any CPU"); - sb.AppendLine($"\t\t{{{domainId}}}.Release|Any CPU.Build.0 = Release|Any CPU"); - sb.AppendLine($"\t\t{{{hostId}}}.Debug|Any CPU.ActiveCfg = Debug|Any CPU"); - sb.AppendLine($"\t\t{{{hostId}}}.Debug|Any CPU.Build.0 = Debug|Any CPU"); - sb.AppendLine($"\t\t{{{hostId}}}.Release|Any CPU.ActiveCfg = Release|Any CPU"); - sb.AppendLine($"\t\t{{{hostId}}}.Release|Any CPU.Build.0 = Release|Any CPU"); - - if (hostTestPath is not null) - { - sb.AppendLine($"\t\t{{{hostTestId}}}.Debug|Any CPU.ActiveCfg = Debug|Any CPU"); - sb.AppendLine($"\t\t{{{hostTestId}}}.Debug|Any CPU.Build.0 = Debug|Any CPU"); - sb.AppendLine($"\t\t{{{hostTestId}}}.Release|Any CPU.ActiveCfg = Release|Any CPU"); - sb.AppendLine($"\t\t{{{hostTestId}}}.Release|Any CPU.Build.0 = Release|Any CPU"); - } - - if (domainTestPath is not null) - { - sb.AppendLine($"\t\t{{{domainTestId}}}.Debug|Any CPU.ActiveCfg = Debug|Any CPU"); - sb.AppendLine($"\t\t{{{domainTestId}}}.Debug|Any CPU.Build.0 = Debug|Any CPU"); - sb.AppendLine($"\t\t{{{domainTestId}}}.Release|Any CPU.ActiveCfg = Release|Any CPU"); - sb.AppendLine($"\t\t{{{domainTestId}}}.Release|Any CPU.Build.0 = Release|Any CPU"); - } - - sb.AppendLine("\tEndGlobalSection"); - sb.AppendLine("\tGlobalSection(SolutionProperties) = preSolution"); - sb.AppendLine("\t\tHideSolutionNode = FALSE"); - sb.AppendLine("\tEndGlobalSection"); - sb.AppendLine("\tGlobalSection(ExtensibilityGlobals) = postSolution"); - sb.AppendLine($"\t\tSolutionGuid = {{{slnId}}}"); - sb.AppendLine("\tEndGlobalSection"); - sb.AppendLine("EndGlobal"); - return sb.ToString(); - } - - private static string CreateSlnDotSettingsFileContent( - IEnumerable codeInspectionExcludeProjects, - IEnumerable>> codeInspectionExcludeProjectsFolders) - { - var sb = new StringBuilder(); - sb.AppendLine(""); - foreach (var (projectId, rootDirectory, directories) in codeInspectionExcludeProjectsFolders) - { - foreach (var directoryInfo in directories) - { - var pathPart = directoryInfo.FullName.Replace(rootDirectory.FullName, string.Empty, StringComparison.Ordinal); - var skipPath = ReSharperFormatGuidAndPath(new Tuple(projectId, pathPart)); - if (string.IsNullOrEmpty(skipPath)) - { - continue; - } - - sb.AppendLine($"\tExplicitlyExcluded"); - } - } - - foreach (var skipPath in codeInspectionExcludeProjects.Select(ReSharperFormatGuid)) - { - sb.AppendLine($"\tExplicitlyExcluded"); - } - - sb.AppendLine(""); - return sb.ToString(); - } - - private static string ReSharperFormatGuid( - Guid projectId) - { - var sa = projectId.ToString().Split('-'); - var sb = new StringBuilder(); - for (var i = 0; i < sa.Length; i++) - { - var s = sa[i].ToUpper(GlobalizationConstants.EnglishCultureInfo); - if (i == 0) - { - sb.Append(s); - } - else - { - sb.Append("002D" + s); - } - - if (i != sa.Length - 1) - { - sb.Append('_'); - } - } - - return sb.ToString(); - } - - private static string ReSharperFormatGuidAndPath( - Tuple data) - { - var (projectId, pathPart) = data; - var sb = new StringBuilder(); - sb.Append(ReSharperFormatGuid(projectId)); - sb.Append(pathPart.Replace(Path.DirectorySeparatorChar.ToString(), "_002Fd_003A", StringComparison.Ordinal)); - return sb.ToString(); - } - - private static string GetProjectReference( - FileSystemInfo source, - FileSystemInfo destination, - string projectName) - { - var sa1 = source.FullName.Split(Path.DirectorySeparatorChar); - var sa2 = destination.FullName.Split(Path.DirectorySeparatorChar); - var diffIndex = sa1.Where((t, i) => i < sa2.Length && t == sa2[i]).Count(); - - var goForward = 0; - for (var i = diffIndex; i < sa2.Length; i++) - { - if (sa2[i].StartsWith(projectName, StringComparison.OrdinalIgnoreCase)) - { - break; - } - - goForward++; - } - - var sb = new StringBuilder(); - for (var i = 0; i < goForward; i++) - { - sb.Append(@$"{sa2[diffIndex + i]}\"); - } - - return sb.ToString(); - } - - private static string GetProjectReference( - FileInfo source, - FileInfo destination) - { - var sa1 = source.FullName.Split(Path.DirectorySeparatorChar); - var sa2 = destination.FullName.Split(Path.DirectorySeparatorChar); - var diffIndex = sa1.Where((t, i) => i < sa2.Length && t == sa2[i]).Count(); - - var goBack = 0; - for (var i = diffIndex; i < sa2.Length; i++) - { - if (sa2[i].EndsWith(".csproj", StringComparison.OrdinalIgnoreCase)) - { - break; - } - - goBack++; - } - - var sb1 = new StringBuilder(); - for (var i = 0; i < goBack; i++) - { - sb1.Append($"..{Path.DirectorySeparatorChar}"); - } - - var sb2 = new StringBuilder(); - for (var i = diffIndex; i < sa2.Length; i++) - { - if (sb2.Length != 0) - { - sb2.Append(Path.DirectorySeparatorChar); - } - - sb2.Append(sa2[i]); - } - - return $"{sb1}{sb2}"; - } - - [SuppressMessage("Maintainability", "CA1508:Avoid dead conditional code", Justification = "OK.")] - private static List GetPackageReferencesThatNeedsToBeUpdated( - string fileContent) - { - var result = new List(); - - var packageReferencesGit = DotnetNugetHelper.GetAllPackageReferences(fileContent); - if (packageReferencesGit.Any()) - { - foreach (var item in packageReferencesGit) - { - if (Version.TryParse(item.Version, out var version)) - { - // TODO: Cleanup this temp re-write hack! - var atcApiNugetClient = new AtcApiNugetClient(NullLogger.Instance); - - Version? latestVersion = default; - TaskHelper.RunSync(async () => - { - latestVersion = - await atcApiNugetClient.RetrieveLatestVersionForPackageId( - item.PackageId, - CancellationToken.None); - }); - - if (latestVersion is not null && - latestVersion.IsNewerThan(version, withinMinorReleaseOnly: true)) - { - result.Add( - new DotnetNugetPackage( - item.PackageId, - version, - latestVersion!)); - } - } - } - } - - return result; - } -} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator/Helpers/TrailingCharType.cs b/src/Atc.Rest.ApiGenerator/Helpers/TrailingCharType.cs deleted file mode 100644 index a362eec7..00000000 --- a/src/Atc.Rest.ApiGenerator/Helpers/TrailingCharType.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Atc.Rest.ApiGenerator.Helpers; - -public enum TrailingCharType -{ - None, - Comma, - SemiColon, - Colon, -} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator/Models/DomainProjectOptions.cs b/src/Atc.Rest.ApiGenerator/Models/DomainProjectOptions.cs index b822ce2b..3c59134b 100644 --- a/src/Atc.Rest.ApiGenerator/Models/DomainProjectOptions.cs +++ b/src/Atc.Rest.ApiGenerator/Models/DomainProjectOptions.cs @@ -39,7 +39,7 @@ public DomainProjectOptions( public DirectoryInfo? PathForTestHandlers { get; } - public bool SetPropertiesAfterValidationsOfProjectReferencesPathAndFiles( + public bool SetPropertiesAfterValidationsOfProjectReferencesPathAndFilesForMvc( ILogger logger) { if (ApiProjectSrcPath.Exists) @@ -65,4 +65,31 @@ public bool SetPropertiesAfterValidationsOfProjectReferencesPathAndFiles( return true; } + + public bool SetPropertiesAfterValidationsOfProjectReferencesPathAndFilesForMinimalApi( + ILogger logger) + { + if (ApiProjectSrcPath.Exists) + { + var files = Directory.GetFiles(ApiProjectSrcPath.FullName, "IApiContractAssemblyMarker.cs", SearchOption.AllDirectories); + if (files.Length == 1) + { + ApiProjectSrcPath = new FileInfo(files[0]).Directory!; + files = Directory.GetFiles(ApiProjectSrcPath.FullName, "*.csproj", SearchOption.AllDirectories); + if (files.Length == 1) + { + ApiProjectSrcCsProj = new FileInfo(files[0]); + } + } + } + + if (ApiProjectSrcCsProj is null || + !ApiProjectSrcCsProj.Exists) + { + logger.LogError($"{EmojisConstants.Error} {ValidationRuleNameConstants.ProjectHostGenerated04} - Can't find API .csproj file"); + return false; + } + + return true; + } } \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator/Models/DotnetNugetPackage.cs b/src/Atc.Rest.ApiGenerator/Models/DotnetNugetPackage.cs deleted file mode 100644 index 9667d2b8..00000000 --- a/src/Atc.Rest.ApiGenerator/Models/DotnetNugetPackage.cs +++ /dev/null @@ -1,29 +0,0 @@ -namespace Atc.Rest.ApiGenerator.Models; - -public class DotnetNugetPackage -{ - public DotnetNugetPackage(string packageId, Version currentVersion) - { - PackageId = packageId; - Version = currentVersion; - NewestVersion = currentVersion; - } - - public DotnetNugetPackage(string packageId, Version currentVersion, Version newestVersion) - { - PackageId = packageId; - Version = currentVersion; - NewestVersion = newestVersion; - } - - public string PackageId { get; } - - public Version Version { get; } - - public Version NewestVersion { get; set; } - - public bool IsNewest => Version >= NewestVersion; - - public override string ToString() - => $"{nameof(PackageId)}: {PackageId}, {nameof(Version)}: {Version}, {nameof(NewestVersion)}: {NewestVersion}, {nameof(IsNewest)}: {IsNewest}"; -} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator/Models/HostProjectOptions.cs b/src/Atc.Rest.ApiGenerator/Models/HostProjectOptions.cs index 06f70518..f6a51c6c 100644 --- a/src/Atc.Rest.ApiGenerator/Models/HostProjectOptions.cs +++ b/src/Atc.Rest.ApiGenerator/Models/HostProjectOptions.cs @@ -42,7 +42,7 @@ public HostProjectOptions( public bool UseRestExtended { get; set; } - public bool SetPropertiesAfterValidationsOfProjectReferencesPathAndFiles( + public bool SetPropertiesAfterValidationsOfProjectReferencesPathAndFilesForMvc( ILogger logger) { if (ApiProjectSrcPath.Exists) @@ -89,4 +89,52 @@ public bool SetPropertiesAfterValidationsOfProjectReferencesPathAndFiles( return true; } + + public bool SetPropertiesAfterValidationsOfProjectReferencesPathAndFilesForMinimalApi( + ILogger logger) + { + if (ApiProjectSrcPath.Exists) + { + var files = Directory.GetFiles(ApiProjectSrcPath.FullName, "IApiContractAssemblyMarker.cs", SearchOption.AllDirectories); + if (files.Length == 1) + { + ApiProjectSrcPath = new FileInfo(files[0]).Directory!; + files = Directory.GetFiles(ApiProjectSrcPath.FullName, "*.csproj", SearchOption.AllDirectories); + if (files.Length == 1) + { + ApiProjectSrcCsProj = new FileInfo(files[0]); + } + } + } + + if (ApiProjectSrcCsProj is null || + !ApiProjectSrcCsProj.Exists) + { + logger.LogError($"{EmojisConstants.Error} {ValidationRuleNameConstants.ProjectHostGenerated04} - Can't find API .csproj file"); + return false; + } + + if (DomainProjectSrcPath.Exists) + { + var files = Directory.GetFiles(DomainProjectSrcPath.FullName, "IDomainAssemblyMarker.cs", SearchOption.AllDirectories); + if (files.Length == 1) + { + DomainProjectSrcPath = new FileInfo(files[0]).Directory!; + files = Directory.GetFiles(DomainProjectSrcPath.FullName, "*.csproj", SearchOption.AllDirectories); + if (files.Length == 1) + { + DomainProjectSrcCsProj = new FileInfo(files[0]); + } + } + } + + if (DomainProjectSrcCsProj is null || + !DomainProjectSrcCsProj.Exists) + { + logger.LogError($"{EmojisConstants.Error} {ValidationRuleNameConstants.ProjectHostGenerated05} - Can't find Domain .csproj file"); + return false; + } + + return true; + } } \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator/Models/ProjectType.cs b/src/Atc.Rest.ApiGenerator/Models/ProjectType.cs deleted file mode 100644 index f93be506..00000000 --- a/src/Atc.Rest.ApiGenerator/Models/ProjectType.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Atc.Rest.ApiGenerator.Models; - -public enum ProjectType -{ - ServerHost, - ServerApi, - ServerDomain, - ClientApi, -} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator/Models/ResponseTypeNameAndItemSchema.cs b/src/Atc.Rest.ApiGenerator/Models/ResponseTypeNameAndItemSchema.cs deleted file mode 100644 index 7b1cf50c..00000000 --- a/src/Atc.Rest.ApiGenerator/Models/ResponseTypeNameAndItemSchema.cs +++ /dev/null @@ -1,29 +0,0 @@ -namespace Atc.Rest.ApiGenerator.Models; - -public class ResponseTypeNameAndItemSchema -{ - public ResponseTypeNameAndItemSchema( - HttpStatusCode statusCode, - string fullModelName, - OpenApiSchema? schema) - { - StatusCode = statusCode; - FullModelName = fullModelName; - Schema = schema; - } - - public HttpStatusCode StatusCode { get; } - - public string FullModelName { get; } - - public OpenApiSchema? Schema { get; } - - public bool HasModelName - => !string.IsNullOrEmpty(FullModelName); - - public bool HasSchema - => Schema is not null; - - public override string ToString() - => $"{nameof(StatusCode)}: {StatusCode}, {nameof(FullModelName)}: {FullModelName}, {nameof(Schema)}: {Schema?.GetModelType()}"; -} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator/Options/ApiOptions.cs b/src/Atc.Rest.ApiGenerator/Options/ApiOptions.cs new file mode 100644 index 00000000..a006e795 --- /dev/null +++ b/src/Atc.Rest.ApiGenerator/Options/ApiOptions.cs @@ -0,0 +1,10 @@ +namespace Atc.Rest.ApiGenerator.Options; + +public class ApiOptions +{ + public ApiOptionsGenerator Generator { get; set; } = new(); + + public ApiOptionsValidation Validation { get; set; } = new(); + + public bool IncludeDeprecated { get; set; } +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator/Options/ApiOptionsGenerator.cs b/src/Atc.Rest.ApiGenerator/Options/ApiOptionsGenerator.cs new file mode 100644 index 00000000..95b0b54f --- /dev/null +++ b/src/Atc.Rest.ApiGenerator/Options/ApiOptionsGenerator.cs @@ -0,0 +1,16 @@ +namespace Atc.Rest.ApiGenerator.Options; + +public class ApiOptionsGenerator +{ + public AspNetOutputType AspNetOutputType { get; set; } = AspNetOutputType.Mvc; + + public SwaggerThemeMode SwaggerThemeMode { get; set; } = SwaggerThemeMode.None; + + public bool UseRestExtended { get; set; } = true; + + public bool IncludeDeprecated { get; set; } + + public ApiOptionsGeneratorRequest Request { get; set; } = new(); + + public ApiOptionsGeneratorResponse Response { get; set; } = new(); +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator/Options/ApiOptionsGeneratorRequest.cs b/src/Atc.Rest.ApiGenerator/Options/ApiOptionsGeneratorRequest.cs new file mode 100644 index 00000000..3683c397 --- /dev/null +++ b/src/Atc.Rest.ApiGenerator/Options/ApiOptionsGeneratorRequest.cs @@ -0,0 +1,6 @@ +namespace Atc.Rest.ApiGenerator.Options; + +[SuppressMessage("X", "S2094: Remove this empty class, write its code or make it an interface", Justification = "OK - WIP")] +public class ApiOptionsGeneratorRequest +{ +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator/Options/ApiOptionsGeneratorResponse.cs b/src/Atc.Rest.ApiGenerator/Options/ApiOptionsGeneratorResponse.cs new file mode 100644 index 00000000..672993d4 --- /dev/null +++ b/src/Atc.Rest.ApiGenerator/Options/ApiOptionsGeneratorResponse.cs @@ -0,0 +1,6 @@ +namespace Atc.Rest.ApiGenerator.Options; + +public class ApiOptionsGeneratorResponse +{ + public bool UseProblemDetailsAsDefaultBody { get; set; } +} \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator/Resources/launchSettings.json b/src/Atc.Rest.ApiGenerator/Resources/launchSettings.json deleted file mode 100644 index 7522861f..00000000 --- a/src/Atc.Rest.ApiGenerator/Resources/launchSettings.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:2597", - "sslPort": 44312 - } - }, - "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "Demo.Api": { - "commandName": "Project", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "applicationUrl": "https://localhost:5001;http://localhost:5000" - } - } -} \ No newline at end of file diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 68b212bd..798213e9 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -53,8 +53,8 @@ - - + + \ No newline at end of file diff --git a/test/.editorconfig b/test/.editorconfig index 10c2c4c5..5ba71813 100644 --- a/test/.editorconfig +++ b/test/.editorconfig @@ -1,8 +1,8 @@ # ATC coding rules - https://github.com/atc-net/atc-coding-rules -# Version: 1.0.9 -# Updated: 01-02-2022 +# Version: 1.0.0 +# Updated: 25-09-2023 # Location: test -# Distribution: DotNet6 +# Distribution: DotNet8 # Inspired by: https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/code-style-rule-options ########################################## @@ -27,6 +27,7 @@ dotnet_diagnostic.MA0016.severity = none # https://github.com/atc-net # Microsoft - Code Analysis # https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ dotnet_diagnostic.CA1068.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA1068.md +dotnet_diagnostic.CA1602.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA1602.md dotnet_diagnostic.CA1707.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA1707.md dotnet_diagnostic.CA2007.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA2007.md diff --git a/test/Atc.CodeGeneration.CSharp.Tests/Atc.CodeGeneration.CSharp.Tests.csproj b/test/Atc.CodeGeneration.CSharp.Tests/Atc.CodeGeneration.CSharp.Tests.csproj index d91cb264..ce96d81e 100644 --- a/test/Atc.CodeGeneration.CSharp.Tests/Atc.CodeGeneration.CSharp.Tests.csproj +++ b/test/Atc.CodeGeneration.CSharp.Tests/Atc.CodeGeneration.CSharp.Tests.csproj @@ -1,18 +1,18 @@ - net6.0 + net8.0 false - - - + + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all @@ -20,6 +20,7 @@ + diff --git a/test/Atc.CodeGeneration.CSharp.Tests/Content/Generators/GenerateContentForClassTests.cs b/test/Atc.CodeGeneration.CSharp.Tests/Content/Generators/GenerateContentForClassTests.cs index f970d7c8..650eb704 100644 --- a/test/Atc.CodeGeneration.CSharp.Tests/Content/Generators/GenerateContentForClassTests.cs +++ b/test/Atc.CodeGeneration.CSharp.Tests/Content/Generators/GenerateContentForClassTests.cs @@ -40,8 +40,10 @@ public override string ToString() GenericTypeName: null, IsGenericListType: false, TypeName: "string", + IsNullableType: false, IsReferenceType: false, Name: "Name", + JsonName: null, DefaultValue: null, UseAutoProperty: true, UseGet: true, @@ -55,7 +57,7 @@ public override string ToString() Namespace: "Demo.Api.Generated.Contracts.Accounts", DocumentationTags: documentationTags, Attributes: AttributesWithGeneratedCode, - AccessModifier: AccessModifiers.Public, + AccessModifier: AccessModifiers.PublicClass, ClassTypeName: "UpdateAccountRequest", GenericTypeName: null, InheritedClassTypeName: null, @@ -130,8 +132,10 @@ public override string ToString() GenericTypeName: null, IsGenericListType: false, TypeName: "Guid", + IsNullableType: false, IsReferenceType: false, Name: "AccountId", + JsonName: null, DefaultValue: null, UseAutoProperty: true, UseGet: true, @@ -148,8 +152,10 @@ public override string ToString() GenericTypeName: null, IsGenericListType: false, TypeName: "string", + IsNullableType: false, IsReferenceType: false, Name: "Name", + JsonName: null, DefaultValue: null, UseAutoProperty: true, UseGet: true, @@ -163,7 +169,7 @@ public override string ToString() Namespace: "Demo.Api.Generated.Contracts.Accounts", DocumentationTags: documentationTags, Attributes: AttributesWithGeneratedCode, - AccessModifier: AccessModifiers.Public, + AccessModifier: AccessModifiers.PublicClass, ClassTypeName: "UpdateAccountNameParameters", GenericTypeName: null, InheritedClassTypeName: null, @@ -244,7 +250,7 @@ public async Task SetAccountName( new("Authorize", null), new("ApiController", null), new("Route", "\"/api/v1/accounts\""), - AttributesWithGeneratedCode.First(), + AttributesWithGeneratedCode[0], }; var methodParameters = new List @@ -265,9 +271,9 @@ public async Task SetAccountName( Name: "UpdateAccountName", Parameters: new List { - new(null, null, false, "UpdateAccountNameParameters", true, "parameters", null), - new(new List { new("FromServices", null) }, null, false, "IUpdateAccountNameHandler", true, "handler", null), - new(null, null, false, "CancellationToken", false, "cancellationToken", null), + new(null, null, false, "UpdateAccountNameParameters", false, true, "parameters", null), + new(new List { new("FromServices", null) }, null, false, "IUpdateAccountNameHandler", false, true, "handler", null), + new(null, null, false, "CancellationToken", false, false, "cancellationToken", null), }, AlwaysBreakDownParameters: false, UseExpressionBody: true, @@ -288,9 +294,9 @@ public async Task SetAccountName( Name: "SetAccountName", Parameters: new List { - new(null, null, false, "SetAccountNameParameters", true, "parameters", null), - new(new List { new("FromServices", null) }, null, false, "ISetAccountNameHandler", true, "handler", null), - new(null, null, false, "CancellationToken", false, "cancellationToken", null), + new(null, null, false, "SetAccountNameParameters", false, true, "parameters", null), + new(new List { new("FromServices", null) }, null, false, "ISetAccountNameHandler", false, true, "handler", null), + new(null, null, false, "CancellationToken", false, false, "cancellationToken", null), }, AlwaysBreakDownParameters: false, UseExpressionBody: true, @@ -302,7 +308,7 @@ public async Task SetAccountName( Namespace: "Demo.Api.Generated.Endpoints", DocumentationTags: documentationTags, Attributes: attributes, - AccessModifier: AccessModifiers.Public, + AccessModifier: AccessModifiers.PublicClass, ClassTypeName: "AccountsController", GenericTypeName: null, InheritedClassTypeName: "ControllerBase", @@ -374,6 +380,7 @@ public static implicit operator UpdateAccountNameResult(string response) new( GenericTypeName: null, TypeName: "ActionResult", + IsNullableType: false, Name: "result", DefaultValue: null, PassToInheritedClass: true, @@ -391,7 +398,7 @@ public static implicit operator UpdateAccountNameResult(string response) ReturnGenericTypeName: null, ReturnTypeName: "UpdateAccountNameResult", Name: "Ok", - Parameters: new List { new(null, null, false, "string?", false, "message", "null") }, + Parameters: new List { new(null, null, false, "string", true, false, "message", "null") }, AlwaysBreakDownParameters: false, UseExpressionBody: true, Content: "new UpdateAccountNameResult(new OkObjectResult(message))"), @@ -402,7 +409,7 @@ public static implicit operator UpdateAccountNameResult(string response) ReturnGenericTypeName: null, ReturnTypeName: null, Name: "UpdateAccountNameResult", - Parameters: new List { new(null, null, false, "string", false, "response", null) }, + Parameters: new List { new(null, null, false, "string", false, false, "response", null) }, AlwaysBreakDownParameters: false, UseExpressionBody: true, Content: "Ok(response)"), @@ -413,7 +420,7 @@ public static implicit operator UpdateAccountNameResult(string response) Namespace: "Demo.Api.Generated.Contracts.Accounts", DocumentationTags: documentationTags, Attributes: AttributesWithGeneratedCode, - AccessModifier: AccessModifiers.Public, + AccessModifier: AccessModifiers.PublicClass, ClassTypeName: "UpdateAccountNameResult", GenericTypeName: null, InheritedClassTypeName: "ResultBase", @@ -469,7 +476,7 @@ public async Task ExecuteAsync( CreateLocationParameters parameters, CancellationToken cancellationToken = default) { - var client = factory.CreateClient(""ERUT-ApiClient""); + var client = factory.CreateClient(""ApiClient""); var requestBuilder = httpMessageFactory.FromTemplate(""/api/v1/locations""); requestBuilder.WithBody(parameters.Request); @@ -492,7 +499,7 @@ public async Task ExecuteAsync( "Client Endpoint.\r\nDescription: Create a new location.\r\nOperation: CreateLocation."); const string executeMethodContent = - @"var client = factory.CreateClient(""ERUT-ApiClient""); + @"var client = factory.CreateClient(""ApiClient""); var requestBuilder = httpMessageFactory.FromTemplate(""/api/v1/locations""); requestBuilder.WithBody(parameters.Request); @@ -522,6 +529,7 @@ public async Task ExecuteAsync( new( GenericTypeName: null, TypeName: "IHttpClientFactory", + IsNullableType: false, Name: "factory", DefaultValue: null, PassToInheritedClass: false, @@ -530,6 +538,7 @@ public async Task ExecuteAsync( new( GenericTypeName: null, TypeName: "IHttpMessageFactory", + IsNullableType: false, Name: "httpMessageFactory", DefaultValue: null, PassToInheritedClass: false, @@ -554,6 +563,7 @@ public async Task ExecuteAsync( GenericTypeName: null, IsGenericListType: false, TypeName: "CreateLocationParameters", + IsNullableType: false, IsReferenceType: true, Name: "parameters", DefaultValue: null), @@ -562,6 +572,7 @@ public async Task ExecuteAsync( GenericTypeName: null, IsGenericListType: false, TypeName: "CancellationToken", + IsNullableType: false, IsReferenceType: true, Name: "cancellationToken", DefaultValue: "default"), @@ -576,7 +587,7 @@ public async Task ExecuteAsync( Namespace: "XXX.ApiClient.Generated.Endpoints", DocumentationTags: documentationTags, Attributes: AttributesWithGeneratedCode, - AccessModifier: AccessModifiers.Public, + AccessModifier: AccessModifiers.PublicClass, ClassTypeName: "CreateLocationEndpoint", GenericTypeName: null, InheritedClassTypeName: "ICreateLocationEndpoint", @@ -615,7 +626,7 @@ namespace XXX.ApiClient.Generated.Endpoints; /// Operation: CreateLocation. ///
[GeneratedCode(""ApiGenerator"", ""X.X.X.X"")] -public class CreateLocationEndpointResult : EndpointResponse, ICreateLocationEndpointResult +public class CreateLocationEndpointResult : EndpointResponse { public CreateLocationEndpointResult(EndpointResponse response) : base(response) @@ -679,6 +690,7 @@ public ProblemDetails InternalServerErrorContent new( GenericTypeName: null, TypeName: "EndpointResponse", + IsNullableType: false, Name: "response", DefaultValue: null, PassToInheritedClass: true, @@ -696,8 +708,10 @@ public ProblemDetails InternalServerErrorContent GenericTypeName: null, IsGenericListType: false, TypeName: "bool", + IsNullableType: false, IsReferenceType: false, Name: "IsOk", + JsonName: null, DefaultValue: null, UseAutoProperty: false, UseGet: false, @@ -711,8 +725,10 @@ public ProblemDetails InternalServerErrorContent GenericTypeName: null, IsGenericListType: false, TypeName: "bool", + IsNullableType: false, IsReferenceType: false, Name: "IsBadRequest", + JsonName: null, DefaultValue: null, UseAutoProperty: false, UseGet: false, @@ -726,8 +742,10 @@ public ProblemDetails InternalServerErrorContent GenericTypeName: null, IsGenericListType: false, TypeName: "bool", + IsNullableType: false, IsReferenceType: false, Name: "IsUnauthorized", + JsonName: null, DefaultValue: null, UseAutoProperty: false, UseGet: false, @@ -741,8 +759,10 @@ public ProblemDetails InternalServerErrorContent GenericTypeName: null, IsGenericListType: false, TypeName: "bool", + IsNullableType: false, IsReferenceType: false, Name: "IsForbidden", + JsonName: null, DefaultValue: null, UseAutoProperty: false, UseGet: false, @@ -756,8 +776,10 @@ public ProblemDetails InternalServerErrorContent GenericTypeName: null, IsGenericListType: false, TypeName: "bool", + IsNullableType: false, IsReferenceType: false, Name: "IsInternalServerError", + JsonName: null, DefaultValue: null, UseAutoProperty: false, UseGet: false, @@ -771,8 +793,10 @@ public ProblemDetails InternalServerErrorContent GenericTypeName: null, IsGenericListType: false, TypeName: "Location", + IsNullableType: false, IsReferenceType: false, Name: "OkContent", + JsonName: null, DefaultValue: null, UseAutoProperty: false, UseGet: false, @@ -786,8 +810,10 @@ public ProblemDetails InternalServerErrorContent GenericTypeName: null, IsGenericListType: false, TypeName: "ValidationProblemDetails", + IsNullableType: false, IsReferenceType: false, Name: "BadRequestContent", + JsonName: null, DefaultValue: null, UseAutoProperty: false, UseGet: false, @@ -801,8 +827,10 @@ public ProblemDetails InternalServerErrorContent GenericTypeName: null, IsGenericListType: false, TypeName: "ProblemDetails", + IsNullableType: false, IsReferenceType: false, Name: "UnauthorizedContent", + JsonName: null, DefaultValue: null, UseAutoProperty: false, UseGet: false, @@ -816,8 +844,10 @@ public ProblemDetails InternalServerErrorContent GenericTypeName: null, IsGenericListType: false, TypeName: "ProblemDetails", + IsNullableType: false, IsReferenceType: false, Name: "ForbiddenContent", + JsonName: null, DefaultValue: null, UseAutoProperty: false, UseGet: false, @@ -831,8 +861,10 @@ public ProblemDetails InternalServerErrorContent GenericTypeName: null, IsGenericListType: false, TypeName: "ProblemDetails", + IsNullableType: false, IsReferenceType: false, Name: "InternalServerErrorContent", + JsonName: null, DefaultValue: null, UseAutoProperty: false, UseGet: false, @@ -846,12 +878,12 @@ public ProblemDetails InternalServerErrorContent Namespace: "XXX.ApiClient.Generated.Endpoints", DocumentationTags: documentationTags, Attributes: AttributesWithGeneratedCode, - AccessModifier: AccessModifiers.Public, + AccessModifier: AccessModifiers.PublicClass, ClassTypeName: "CreateLocationEndpointResult", GenericTypeName: null, InheritedClassTypeName: "EndpointResponse", InheritedGenericClassTypeName: null, - InheritedInterfaceTypeName: "ICreateLocationEndpointResult", + InheritedInterfaceTypeName: null, Constructors: constructorParameters, Properties: propertyParameters, Methods: null, diff --git a/test/Atc.CodeGeneration.CSharp.Tests/Content/Generators/GenerateContentForInterfaceTests.cs b/test/Atc.CodeGeneration.CSharp.Tests/Content/Generators/GenerateContentForInterfaceTests.cs index 2943801d..42c260dd 100644 --- a/test/Atc.CodeGeneration.CSharp.Tests/Content/Generators/GenerateContentForInterfaceTests.cs +++ b/test/Atc.CodeGeneration.CSharp.Tests/Content/Generators/GenerateContentForInterfaceTests.cs @@ -124,6 +124,7 @@ Task ExecuteAsync( GenericTypeName: null, IsGenericListType: false, TypeName: "SetAccountNameParameters", + IsNullableType: false, IsReferenceType: true, Name: "parameters", DefaultValue: null), @@ -132,6 +133,7 @@ Task ExecuteAsync( GenericTypeName: null, IsGenericListType: false, TypeName: "CancellationToken", + IsNullableType: false, IsReferenceType: true, Name: "cancellationToken", DefaultValue: "default"), @@ -222,6 +224,7 @@ Task ExecuteAsync( GenericTypeName: null, IsGenericListType: false, TypeName: "UpdateAccountNameParameters", + IsNullableType: false, IsReferenceType: true, Name: "parameters", DefaultValue: null), @@ -230,6 +233,7 @@ Task ExecuteAsync( GenericTypeName: null, IsGenericListType: false, TypeName: "CancellationToken", + IsNullableType: false, IsReferenceType: true, Name: "cancellationToken", DefaultValue: "default"), @@ -320,6 +324,7 @@ Task ExecuteAsync( GenericTypeName: null, IsGenericListType: false, TypeName: "CreateLocationParameters", + IsNullableType: false, IsReferenceType: true, Name: "parameters", DefaultValue: null), @@ -328,6 +333,7 @@ Task ExecuteAsync( GenericTypeName: null, IsGenericListType: false, TypeName: "CancellationToken", + IsNullableType: false, IsReferenceType: true, Name: "cancellationToken", DefaultValue: "default"), @@ -411,8 +417,10 @@ public interface ICreateLocationEndpointResult : IEndpointResponse GenericTypeName: null, IsGenericListType: false, TypeName: "bool", + IsNullableType: false, IsReferenceType: false, Name: "IsOk", + JsonName: null, DefaultValue: null, UseAutoProperty: true, UseGet: true, @@ -426,8 +434,10 @@ public interface ICreateLocationEndpointResult : IEndpointResponse GenericTypeName: null, IsGenericListType: false, TypeName: "bool", + IsNullableType: false, IsReferenceType: false, Name: "IsBadRequest", + JsonName: null, DefaultValue: null, UseAutoProperty: true, UseGet: true, @@ -441,8 +451,10 @@ public interface ICreateLocationEndpointResult : IEndpointResponse GenericTypeName: null, IsGenericListType: false, TypeName: "bool", + IsNullableType: false, IsReferenceType: false, Name: "IsUnauthorized", + JsonName: null, DefaultValue: null, UseAutoProperty: true, UseGet: true, @@ -456,8 +468,10 @@ public interface ICreateLocationEndpointResult : IEndpointResponse GenericTypeName: null, IsGenericListType: false, TypeName: "bool", + IsNullableType: false, IsReferenceType: false, Name: "IsForbidden", + JsonName: null, DefaultValue: null, UseAutoProperty: true, UseGet: true, @@ -471,8 +485,10 @@ public interface ICreateLocationEndpointResult : IEndpointResponse GenericTypeName: null, IsGenericListType: false, TypeName: "bool", + IsNullableType: false, IsReferenceType: false, Name: "IsInternalServerError", + JsonName: null, DefaultValue: null, UseAutoProperty: true, UseGet: true, @@ -486,8 +502,10 @@ public interface ICreateLocationEndpointResult : IEndpointResponse GenericTypeName: null, IsGenericListType: false, TypeName: "Location", + IsNullableType: false, IsReferenceType: true, Name: "OkContent", + JsonName: null, DefaultValue: null, UseAutoProperty: true, UseGet: true, @@ -501,8 +519,10 @@ public interface ICreateLocationEndpointResult : IEndpointResponse GenericTypeName: null, IsGenericListType: false, TypeName: "ValidationProblemDetails", + IsNullableType: false, IsReferenceType: true, Name: "BadRequestContent", + JsonName: null, DefaultValue: null, UseAutoProperty: true, UseGet: true, @@ -516,8 +536,10 @@ public interface ICreateLocationEndpointResult : IEndpointResponse GenericTypeName: null, IsGenericListType: false, TypeName: "ProblemDetails", + IsNullableType: false, IsReferenceType: true, Name: "UnauthorizedContent", + JsonName: null, DefaultValue: null, UseAutoProperty: true, UseGet: true, @@ -531,8 +553,10 @@ public interface ICreateLocationEndpointResult : IEndpointResponse GenericTypeName: null, IsGenericListType: false, TypeName: "ProblemDetails", + IsNullableType: false, IsReferenceType: true, Name: "ForbiddenContent", + JsonName: null, DefaultValue: null, UseAutoProperty: true, UseGet: true, @@ -546,8 +570,10 @@ public interface ICreateLocationEndpointResult : IEndpointResponse GenericTypeName: null, IsGenericListType: false, TypeName: "ProblemDetails", + IsNullableType: false, IsReferenceType: true, Name: "InternalServerErrorContent", + JsonName: null, DefaultValue: null, UseAutoProperty: true, UseGet: true, diff --git a/test/Atc.CodeGeneration.CSharp.Tests/Content/Generators/GenerateContentForRecordsTests.cs b/test/Atc.CodeGeneration.CSharp.Tests/Content/Generators/GenerateContentForRecordsTests.cs index c3e85523..44a1a55e 100644 --- a/test/Atc.CodeGeneration.CSharp.Tests/Content/Generators/GenerateContentForRecordsTests.cs +++ b/test/Atc.CodeGeneration.CSharp.Tests/Content/Generators/GenerateContentForRecordsTests.cs @@ -8,14 +8,14 @@ public void Scenario_EnergyConsumption_CreateLocationParameters() const string expectedCode = @"namespace Energy.Consumption.Api.Contracts.Contracts.Petrol.Parameters; -public record struct CreateLocationParameters( +public record CreateLocationParameters( CreateLocationRequest? Request); -public record struct GetLocationByIdParameters( - [FromRoute, Required] Guid LocationId); +public record GetLocationByIdParameters( + [property: FromRoute, Required] Guid LocationId); -public record struct GetLocationsByCountryCodeA3Parameters( - [FromQuery] string CountryCodeA3);"; +public record GetLocationsByCountryCodeA3Parameters( + [property: FromQuery] string CountryCodeA3);"; var recordsParameters = new RecordsParameters( HeaderContent: null, @@ -26,7 +26,7 @@ public record struct GetLocationsByCountryCodeA3Parameters( { new( DocumentationTags: null, - AccessModifiers.PublicRecordStruct, + AccessModifiers.PublicRecord, Name: "CreateLocationParameters", new List { @@ -34,14 +34,15 @@ public record struct GetLocationsByCountryCodeA3Parameters( Attributes: null, GenericTypeName: null, IsGenericListType: false, - TypeName: "CreateLocationRequest?", + TypeName: "CreateLocationRequest", + IsNullableType: true, IsReferenceType: true, Name: "Request", DefaultValue: null), }), new( DocumentationTags: null, - AccessModifiers.PublicRecordStruct, + AccessModifiers.PublicRecord, Name: "GetLocationByIdParameters", new List { @@ -50,13 +51,14 @@ public record struct GetLocationsByCountryCodeA3Parameters( GenericTypeName: null, IsGenericListType: false, TypeName: "Guid", + IsNullableType: false, IsReferenceType: false, Name: "LocationId", DefaultValue: null), }), new( DocumentationTags: null, - AccessModifiers.PublicRecordStruct, + AccessModifiers.PublicRecord, Name: "GetLocationsByCountryCodeA3Parameters", new List { @@ -65,6 +67,7 @@ public record struct GetLocationsByCountryCodeA3Parameters( GenericTypeName: null, IsGenericListType: false, TypeName: "string", + IsNullableType: false, IsReferenceType: false, Name: "CountryCodeA3", DefaultValue: null), diff --git a/test/Atc.CodeGeneration.CSharp.Tests/Extensions/RegularExpressionAttributeExtensionsTests.cs b/test/Atc.CodeGeneration.CSharp.Tests/Extensions/RegularExpressionAttributeExtensionsTests.cs new file mode 100644 index 00000000..768b64c8 --- /dev/null +++ b/test/Atc.CodeGeneration.CSharp.Tests/Extensions/RegularExpressionAttributeExtensionsTests.cs @@ -0,0 +1,20 @@ +namespace Atc.CodeGeneration.CSharp.Tests.Extensions; + +public class RegularExpressionAttributeExtensionsTests +{ + [Theory] + [InlineData("\"^[a-zA-Z0-9]*$\"", "^[a-zA-Z0-9]*$")] + [InlineData(@"""^\\d+\\.\\d+\\.\\d+\\.\\d+$""", @"^\d+\.\d+\.\d+\.\d+$")] + [InlineData(@"""^(-?\\d*\\.\\d+|\\d+\\.\\d*)(,)(-?\\d*\\.\\d+|\\d+\\.\\d*)$""", @"^(-?\\d*\\.\\d+|\\d+\\.\\d*)(,)(-?\\d*\\.\\d+|\\d+\\.\\d*)$")] + public void GetEscapedPattern(string expected, string input) + { + // Arrange + var regularExpressionAttribute = new RegularExpressionAttribute(input); + + // Act + var actual = regularExpressionAttribute.GetEscapedPattern(); + + // Assert + Assert.Equal(expected, actual); + } +} \ No newline at end of file diff --git a/test/Atc.CodeGeneration.CSharp.Tests/Extensions/StringBuilderExtensionsTests.cs b/test/Atc.CodeGeneration.CSharp.Tests/Extensions/StringBuilderExtensionsTests.cs index 739eeb6e..e6b76f66 100644 --- a/test/Atc.CodeGeneration.CSharp.Tests/Extensions/StringBuilderExtensionsTests.cs +++ b/test/Atc.CodeGeneration.CSharp.Tests/Extensions/StringBuilderExtensionsTests.cs @@ -57,19 +57,20 @@ public void AppendAccessModifier_WithIndentSpaces( } [Theory] - [InlineData("int age", null, "int", "age")] - [InlineData("List ages", "List", "int", "ages")] + [InlineData("int age", null, "int", false, "age")] + [InlineData("List ages", "List", "int", false, "ages")] public void AppendTypeAndName( string expected, string? genericTypeName, string typeName, + bool isNullableType, string name) { // Arrange var sb = new StringBuilder(); // Act - sb.AppendTypeAndName(genericTypeName, typeName, name); + sb.AppendTypeAndName(genericTypeName, typeName, isNullableType, name); var actual = sb.ToString(); // Assert @@ -77,20 +78,21 @@ public void AppendTypeAndName( } [Theory] - [InlineData(" int age", 3, null, "int", "age")] - [InlineData(" List ages", 3, "List", "int", "ages")] + [InlineData(" int age", 3, null, "int", false, "age")] + [InlineData(" List ages", 3, "List", "int", false, "ages")] public void AppendTypeAndName_WithIndentSpaces( string expected, int indentSpaces, string? genericTypeName, string typeName, + bool isNullableType, string name) { // Arrange var sb = new StringBuilder(); // Act - sb.AppendTypeAndName(indentSpaces, genericTypeName, typeName, name); + sb.AppendTypeAndName(indentSpaces, genericTypeName, typeName, isNullableType, name); var actual = sb.ToString(); // Assert @@ -98,16 +100,17 @@ public void AppendTypeAndName_WithIndentSpaces( } [Theory] - [InlineData(" int age", 3, null, "int", "age", null)] - [InlineData(" List ages", 3, "List", "int", "ages", null)] - [InlineData(" int age = 5", 3, null, "int", "age", "5")] - [InlineData(" int? age = null", 3, null, "int?", "age", "null")] - [InlineData(" List ages = new List", 3, "List", "int", "ages", "new List")] + [InlineData(" int age", 3, null, "int", false, "age", null)] + [InlineData(" List ages", 3, "List", "int", false, "ages", null)] + [InlineData(" int age = 5", 3, null, "int", false, "age", "5")] + [InlineData(" int? age = null", 3, null, "int", true, "age", "null")] + [InlineData(" List ages = new List", 3, "List", "int", false, "ages", "new List")] public void AppendTypeAndName_WithIndentSpaces_AndDefaultValue( string expected, int indentSpaces, string? genericTypeName, string typeName, + bool isNullableType, string name, string? defaultValue) { @@ -115,7 +118,7 @@ public void AppendTypeAndName_WithIndentSpaces_AndDefaultValue( var sb = new StringBuilder(); // Act - sb.AppendTypeAndName(indentSpaces, genericTypeName, typeName, name, defaultValue); + sb.AppendTypeAndName(indentSpaces, genericTypeName, typeName, isNullableType, name, defaultValue); var actual = sb.ToString(); // Assert @@ -132,7 +135,7 @@ public void AppendAttributesAsLines_WithIndentSpaces( var sb = new StringBuilder(); // Act - sb.AppendAttributesAsLines(indentSpaces, attributes); + sb.AppendAttributesAsLines(indentSpaces, usePropertyPrefix: false, attributes); var actual = sb.ToString(); // Assert @@ -152,7 +155,7 @@ public void AppendAttribute( var sb = new StringBuilder(); // Act - sb.AppendAttribute(attribute); + sb.AppendAttribute(usePropertyPrefix: false, attribute); var actual = sb.ToString(); // Assert @@ -171,7 +174,7 @@ public void AppendAttribute_WithIndentSpaces( var sb = new StringBuilder(); // Act - sb.AppendAttribute(indentSpaces, attribute); + sb.AppendAttribute(indentSpaces, usePropertyPrefix: false, attribute); var actual = sb.ToString(); // Assert @@ -192,7 +195,7 @@ public void AppendAttribute_AsSimpleValues_WithIndentSpaces( var sb = new StringBuilder(); // Act - sb.AppendAttribute(indentSpaces, name, content); + sb.AppendAttribute(indentSpaces, usePropertyPrefix: false, name, content); var actual = sb.ToString(); // Assert @@ -220,7 +223,7 @@ public void AppendInputParameterLine( var sb = new StringBuilder(); // Act - sb.AppendInputParameter(indentSpaces, attributes, genericTypeName, typeName, name, defaultValue, useCommaForEndChar); + sb.AppendInputParameter(indentSpaces, usePropertyPrefix: false, attributes, genericTypeName, typeName, isNullableType: false, name, defaultValue, useCommaForEndChar); var actual = sb.ToString(); // Assert diff --git a/test/Atc.CodeGeneration.CSharp.Tests/GlobalUsings.cs b/test/Atc.CodeGeneration.CSharp.Tests/GlobalUsings.cs index e14cca35..7367b0cf 100644 --- a/test/Atc.CodeGeneration.CSharp.Tests/GlobalUsings.cs +++ b/test/Atc.CodeGeneration.CSharp.Tests/GlobalUsings.cs @@ -1,3 +1,4 @@ +global using System.ComponentModel.DataAnnotations; global using System.Diagnostics.CodeAnalysis; global using System.Text; @@ -5,4 +6,5 @@ global using Atc.CodeGeneration.CSharp.Content; global using Atc.CodeGeneration.CSharp.Content.Factories; global using Atc.CodeGeneration.CSharp.Content.Generators; -global using Atc.CodeGeneration.CSharp.Extensions; \ No newline at end of file +global using Atc.CodeGeneration.CSharp.Extensions; +global using Atc.Rest.ApiGenerator.Framework.Factories.Parameters.ServerClient; \ No newline at end of file diff --git a/test/Atc.CodeGeneration.CSharp.Tests/Usings.cs b/test/Atc.CodeGeneration.CSharp.Tests/Usings.cs deleted file mode 100644 index e69de29b..00000000 diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Atc.Rest.ApiGenerator.CLI.Tests.csproj b/test/Atc.Rest.ApiGenerator.CLI.Tests/Atc.Rest.ApiGenerator.CLI.Tests.csproj index fb6b4b4d..25a3314c 100644 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/Atc.Rest.ApiGenerator.CLI.Tests.csproj +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Atc.Rest.ApiGenerator.CLI.Tests.csproj @@ -1,7 +1,7 @@ - net6.0 + net8.0 false false false @@ -9,20 +9,59 @@ - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -32,17 +71,4 @@ - - - - - - - - - - - - - diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Accounts/RequestParameters/SetAccountNameParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Accounts/RequestParameters/SetAccountNameParameters.verified.cs deleted file mode 100644 index 56bec527..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Accounts/RequestParameters/SetAccountNameParameters.verified.cs +++ /dev/null @@ -1,32 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Contracts; - -/// -/// Parameters for operation request. -/// Description: Set name of account. -/// Operation: SetAccountName. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class SetAccountNameParameters -{ - /// - /// The accountId. - /// - [Required] - public Guid AccountId { get; set; } - - /// - /// UpdateAccountRequest. - /// - [Required] - public UpdateAccountRequest Request { get; set; } - - /// - public override string ToString() - => $"{nameof(AccountId)}: {AccountId}, {nameof(Request)}: ({Request})"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Accounts/RequestParameters/UpdateAccountNameParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Accounts/RequestParameters/UpdateAccountNameParameters.verified.cs deleted file mode 100644 index 5e327254..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Accounts/RequestParameters/UpdateAccountNameParameters.verified.cs +++ /dev/null @@ -1,31 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Contracts; - -/// -/// Parameters for operation request. -/// Description: Update name of account. -/// Operation: UpdateAccountName. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UpdateAccountNameParameters -{ - /// - /// The accountId. - /// - [Required] - public Guid AccountId { get; set; } - - /// - /// The account name. - /// - public string Name { get; set; } - - /// - public override string ToString() - => $"{nameof(AccountId)}: {AccountId}, {nameof(Name)}: {Name}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Accounts/RequestParameters/UpdateAccountRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Accounts/RequestParameters/UpdateAccountRequest.verified.cs deleted file mode 100644 index c7eddb47..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Accounts/RequestParameters/UpdateAccountRequest.verified.cs +++ /dev/null @@ -1,20 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Contracts; - -/// -/// UpdateAccountRequest. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UpdateAccountRequest -{ - public string Name { get; set; } - - /// - public override string ToString() - => $"{nameof(Name)}: {Name}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Addresses/RequestParameters/GetAddressesByPostalCodesParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Addresses/RequestParameters/GetAddressesByPostalCodesParameters.verified.cs deleted file mode 100644 index 715190c1..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Addresses/RequestParameters/GetAddressesByPostalCodesParameters.verified.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Contracts; - -/// -/// Parameters for operation request. -/// Description: Get addresses by postal code. -/// Operation: GetAddressesByPostalCodes. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetAddressesByPostalCodesParameters -{ - /// - /// The postalCode to limit addresses on. - /// - [Required] - public string PostalCode { get; set; } - - /// - public override string ToString() - => $"{nameof(PostalCode)}: {PostalCode}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/EventArgs/Models/EventArgs.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/EventArgs/Models/EventArgs.verified.cs deleted file mode 100644 index a93e5021..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/EventArgs/Models/EventArgs.verified.cs +++ /dev/null @@ -1,22 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Contracts; - -/// -/// EventArgs. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class EventArgs -{ - public Guid Id { get; set; } - - public string EventName { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}, {nameof(EventName)}: {EventName}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/EventArgs/RequestParameters/GetEventArgByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/EventArgs/RequestParameters/GetEventArgByIdParameters.verified.cs deleted file mode 100644 index 52b13c5b..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/EventArgs/RequestParameters/GetEventArgByIdParameters.verified.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Contracts; - -/// -/// Parameters for operation request. -/// Description: Get EventArgs By Id. -/// Operation: GetEventArgById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetEventArgByIdParameters -{ - /// - /// The id of the eventArgs. - /// - [Required] - public string Id { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Files/RequestParameters/FileAsFormDataRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Files/RequestParameters/FileAsFormDataRequest.verified.cs deleted file mode 100644 index 7f6a6112..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Files/RequestParameters/FileAsFormDataRequest.verified.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Contracts; - -/// -/// FileAsFormDataRequest. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class FileAsFormDataRequest -{ - [Required] - public string ItemName { get; set; } - - public IFormFile? File { get; set; } - - [Required] - public List Items { get; set; } - - /// - public override string ToString() - => $"{nameof(ItemName)}: {ItemName}, {nameof(File)}: {File}, {nameof(Items)}.Count: {Items?.Count ?? 0}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Files/RequestParameters/FilesAsFormDataRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Files/RequestParameters/FilesAsFormDataRequest.verified.cs deleted file mode 100644 index 97b4de9d..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Files/RequestParameters/FilesAsFormDataRequest.verified.cs +++ /dev/null @@ -1,23 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Contracts; - -/// -/// FilesAsFormDataRequest. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class FilesAsFormDataRequest -{ - /// - /// A list of File(s). - /// - public List Files { get; set; } = new List(); - - /// - public override string ToString() - => $"{nameof(Files)}.Count: {Files?.Count ?? 0}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Files/RequestParameters/GetFileByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Files/RequestParameters/GetFileByIdParameters.verified.cs deleted file mode 100644 index fa9f4a6e..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Files/RequestParameters/GetFileByIdParameters.verified.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Contracts; - -/// -/// Parameters for operation request. -/// Description: Get File By Id. -/// Operation: GetFileById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetFileByIdParameters -{ - /// - /// The file id. - /// - [Required] - public string Id { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Files/RequestParameters/UploadMultiFilesAsFormDataParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Files/RequestParameters/UploadMultiFilesAsFormDataParameters.verified.cs deleted file mode 100644 index 68044c48..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Files/RequestParameters/UploadMultiFilesAsFormDataParameters.verified.cs +++ /dev/null @@ -1,23 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Contracts; - -/// -/// Parameters for operation request. -/// Description: Upload multi files as form data. -/// Operation: UploadMultiFilesAsFormData. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UploadMultiFilesAsFormDataParameters -{ - [Required] - public List Request { get; set; } = new List(); - - /// - public override string ToString() - => $"{nameof(Request)}.Count: {Request?.Count ?? 0}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Files/RequestParameters/UploadSingleFileAsFormDataParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Files/RequestParameters/UploadSingleFileAsFormDataParameters.verified.cs deleted file mode 100644 index c6123fb4..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Files/RequestParameters/UploadSingleFileAsFormDataParameters.verified.cs +++ /dev/null @@ -1,23 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Contracts; - -/// -/// Parameters for operation request. -/// Description: Upload a file as OctetStream. -/// Operation: UploadSingleFileAsFormData. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UploadSingleFileAsFormDataParameters -{ - [Required] - public IFormFile Request { get; set; } - - /// - public override string ToString() - => $"{nameof(Request)}: ({Request})"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Files/RequestParameters/UploadSingleObjectWithFileAsFormDataParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Files/RequestParameters/UploadSingleObjectWithFileAsFormDataParameters.verified.cs deleted file mode 100644 index 049afa59..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Files/RequestParameters/UploadSingleObjectWithFileAsFormDataParameters.verified.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Contracts; - -/// -/// Parameters for operation request. -/// Description: Upload a file as FormData. -/// Operation: UploadSingleObjectWithFileAsFormData. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UploadSingleObjectWithFileAsFormDataParameters -{ - /// - /// FileAsFormDataRequest. - /// - [Required] - public FileAsFormDataRequest Request { get; set; } - - /// - public override string ToString() - => $"{nameof(Request)}: ({Request})"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Files/RequestParameters/UploadSingleObjectWithFilesAsFormDataParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Files/RequestParameters/UploadSingleObjectWithFilesAsFormDataParameters.verified.cs deleted file mode 100644 index a1513c3f..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Files/RequestParameters/UploadSingleObjectWithFilesAsFormDataParameters.verified.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Contracts; - -/// -/// Parameters for operation request. -/// Description: Upload files as FormData. -/// Operation: UploadSingleObjectWithFilesAsFormData. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UploadSingleObjectWithFilesAsFormDataParameters -{ - /// - /// FilesAsFormDataRequest. - /// - [Required] - public FilesAsFormDataRequest Request { get; set; } - - /// - public override string ToString() - => $"{nameof(Request)}: ({Request})"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Items/Models/Item.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Items/Models/Item.verified.cs deleted file mode 100644 index cba4dc57..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Items/Models/Item.verified.cs +++ /dev/null @@ -1,21 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Contracts; - -/// -/// Item. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class Item -{ - [Required] - public string Name { get; set; } - - /// - public override string ToString() - => $"{nameof(Name)}: {Name}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Items/RequestParameters/CreateItemParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Items/RequestParameters/CreateItemParameters.verified.cs deleted file mode 100644 index ed1e8e21..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Items/RequestParameters/CreateItemParameters.verified.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Contracts; - -/// -/// Parameters for operation request. -/// Description: Create a new item. -/// Operation: CreateItem. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class CreateItemParameters -{ - /// - /// CreateItemRequest. - /// - [Required] - public CreateItemRequest Request { get; set; } - - /// - public override string ToString() - => $"{nameof(Request)}: ({Request})"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Items/RequestParameters/CreateItemRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Items/RequestParameters/CreateItemRequest.verified.cs deleted file mode 100644 index 4348a791..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Items/RequestParameters/CreateItemRequest.verified.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Contracts; - -/// -/// CreateItemRequest. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class CreateItemRequest -{ - /// - /// Item. - /// - [Required] - public Item Item { get; set; } - - /// - /// A list of Item. - /// - [Required] - public List MyItems { get; set; } - - /// - public override string ToString() - => $"{nameof(Item)}: ({Item}), {nameof(MyItems)}.Count: {MyItems?.Count ?? 0}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Items/RequestParameters/UpdateItemParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Items/RequestParameters/UpdateItemParameters.verified.cs deleted file mode 100644 index 355613b5..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Items/RequestParameters/UpdateItemParameters.verified.cs +++ /dev/null @@ -1,32 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Contracts; - -/// -/// Parameters for operation request. -/// Description: Updates an item. -/// Operation: UpdateItem. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UpdateItemParameters -{ - /// - /// The id of the order. - /// - [Required] - public Guid Id { get; set; } - - /// - /// UpdateItemRequest. - /// - [Required] - public UpdateItemRequest Request { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}, {nameof(Request)}: ({Request})"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Items/RequestParameters/UpdateItemRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Items/RequestParameters/UpdateItemRequest.verified.cs deleted file mode 100644 index 88f77550..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Items/RequestParameters/UpdateItemRequest.verified.cs +++ /dev/null @@ -1,24 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Contracts; - -/// -/// UpdateItemRequest. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UpdateItemRequest -{ - /// - /// Item. - /// - [Required] - public Item Item { get; set; } - - /// - public override string ToString() - => $"{nameof(Item)}: ({Item})"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Orders/Models/Order.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Orders/Models/Order.verified.cs deleted file mode 100644 index aaea2c4a..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Orders/Models/Order.verified.cs +++ /dev/null @@ -1,79 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Contracts; - -/// -/// A single order. -/// Hallo description with multiline and no ending dot. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class Order -{ - public Guid Id { get; set; } - - public string Description { get; set; } - - public DateTimeOffset MyTime { get; set; } - - /// - /// Undefined description. - /// - /// - /// Email validation being enforced. - /// - [EmailAddress] - public string MyEmail { get; set; } = "a@a.com"; - - public DateTimeOffset? MyNullableDateTime { get; set; } - - public DateTimeOffset MyDateTime { get; set; } - - [Range(1.1, 20.2)] - public double MyNumber { get; set; } - - [Range(-2147483648, 50)] - public int MyInteger { get; set; } = 15; - - /// - /// MyBool is great. - /// - public bool MyBool { get; set; } - - /// - /// This is the good uri :-). - /// - /// - /// Url validation being enforced. - /// - [Uri] - public Uri MyUri { get; set; } - - /// - /// Undefined description. - /// - /// - /// This string should be base64-encoded. - /// - public string MyByte { get; set; } - - /// - /// Hallo myStringList desc :-). - /// - public List MyStringList { get; set; } = new List(); - - [Range(10, 2147483647)] - public long MyLong { get; set; } - - /// - /// Address. - /// - public Address DeliveryAddress { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}, {nameof(Description)}: {Description}, {nameof(MyTime)}: ({MyTime}), {nameof(MyEmail)}: {MyEmail}, {nameof(MyNullableDateTime)}: ({MyNullableDateTime}), {nameof(MyDateTime)}: ({MyDateTime}), {nameof(MyNumber)}: {MyNumber}, {nameof(MyInteger)}: {MyInteger}, {nameof(MyBool)}: {MyBool}, {nameof(MyUri)}: ({MyUri}), {nameof(MyByte)}: {MyByte}, {nameof(MyStringList)}.Count: {MyStringList?.Count ?? 0}, {nameof(MyLong)}: {MyLong}, {nameof(DeliveryAddress)}: ({DeliveryAddress})"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Orders/RequestParameters/GetOrderByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Orders/RequestParameters/GetOrderByIdParameters.verified.cs deleted file mode 100644 index a562e2f3..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Orders/RequestParameters/GetOrderByIdParameters.verified.cs +++ /dev/null @@ -1,35 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Contracts; - -/// -/// Parameters for operation request. -/// Description: Get order by id. -/// Operation: GetOrderById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetOrderByIdParameters -{ - /// - /// The id of the order. - /// - [Required] - public Guid Id { get; set; } - - /// - /// The email for filter orders to retrieve. - /// - /// - /// Email validation being enforced. - /// - [EmailAddress] - public string? MyEmail { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}, {nameof(MyEmail)}: {MyEmail}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Orders/RequestParameters/GetOrdersParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Orders/RequestParameters/GetOrdersParameters.verified.cs deleted file mode 100644 index 1989d464..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Orders/RequestParameters/GetOrdersParameters.verified.cs +++ /dev/null @@ -1,48 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Contracts; - -/// -/// Parameters for operation request. -/// Description: Get orders. -/// Operation: GetOrders. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetOrdersParameters -{ - /// - /// The numbers of items to return. - /// - [Required] - [Range(1, 100)] - public int PageSize { get; set; } = 10; - - /// - /// The number of items to skip before starting to collect the result set. - /// - [Range(0, 2147483647)] - public int PageIndex { get; set; } = 0; - - /// - /// The query string. - /// - public string? QueryString { get; set; } - - /// - /// The query array of string. - /// - public List QueryStringArray { get; set; } = new List(); - - /// - /// The continuation token. - /// - public string? ContinuationToken { get; set; } - - /// - public override string ToString() - => $"{nameof(PageSize)}: {PageSize}, {nameof(PageIndex)}: {PageIndex}, {nameof(QueryString)}: {QueryString}, {nameof(QueryStringArray)}.Count: {QueryStringArray?.Count ?? 0}, {nameof(ContinuationToken)}: {ContinuationToken}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Orders/RequestParameters/PatchOrdersIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Orders/RequestParameters/PatchOrdersIdParameters.verified.cs deleted file mode 100644 index 0ae709bd..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Orders/RequestParameters/PatchOrdersIdParameters.verified.cs +++ /dev/null @@ -1,56 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Contracts; - -/// -/// Parameters for operation request. -/// Description: Update part of order by id. -/// Operation: PatchOrdersId. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class PatchOrdersIdParameters -{ - /// - /// The id of the order. - /// - [Required] - public Guid Id { get; set; } - - /// - /// The myTestHeader special key. - /// - [Required] - public string MyTestHeader { get; set; } - - /// - /// The myTestHeaderBool special key. - /// - [Required] - public bool MyTestHeaderBool { get; set; } - - /// - /// The myTestHeaderInt special key. - /// - [Required] - public int MyTestHeaderInt { get; set; } - - /// - /// The correlationId. - /// - [Required] - public string CorrelationId { get; set; } - - /// - /// Request to update an order. - /// - [Required] - public UpdateOrderRequest Request { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}, {nameof(MyTestHeader)}: {MyTestHeader}, {nameof(MyTestHeaderBool)}: {MyTestHeaderBool}, {nameof(MyTestHeaderInt)}: {MyTestHeaderInt}, {nameof(CorrelationId)}: {CorrelationId}, {nameof(Request)}: ({Request})"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Orders/RequestParameters/UpdateOrderRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Orders/RequestParameters/UpdateOrderRequest.verified.cs deleted file mode 100644 index 70af2b15..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Orders/RequestParameters/UpdateOrderRequest.verified.cs +++ /dev/null @@ -1,28 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Contracts; - -/// -/// Request to update an order. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UpdateOrderRequest -{ - /// - /// Undefined description. - /// - /// - /// Email validation being enforced. - /// - [Required] - [EmailAddress] - public string MyEmail { get; set; } - - /// - public override string ToString() - => $"{nameof(MyEmail)}: {MyEmail}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Tasks/Models/Task.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Tasks/Models/Task.verified.cs deleted file mode 100644 index 600bced5..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Tasks/Models/Task.verified.cs +++ /dev/null @@ -1,22 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Contracts; - -/// -/// Describes a single task. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class Task -{ - public Guid Id { get; set; } - - public string Name { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}, {nameof(Name)}: {Name}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Tasks/Models/Tasks.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Tasks/Models/Tasks.verified.cs deleted file mode 100644 index df785597..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Tasks/Models/Tasks.verified.cs +++ /dev/null @@ -1,23 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Contracts; - -/// -/// Contains a list of Tasks. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class Tasks -{ - /// - /// A list of Task. - /// - public List TaskList { get; set; } = new List(); - - /// - public override string ToString() - => $"{nameof(TaskList)}.Count: {TaskList?.Count ?? 0}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Users/Models/User.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Users/Models/User.verified.cs deleted file mode 100644 index 8b2e220b..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Users/Models/User.verified.cs +++ /dev/null @@ -1,62 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Contracts; - -/// -/// A single user. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class User -{ - public Guid Id { get; set; } - - /// - /// GenderType. - /// - public GenderType Gender { get; set; } - - public string FirstName { get; set; } - - public string LastName { get; set; } - - /// - /// Undefined description. - /// - /// - /// Email validation being enforced. - /// - [EmailAddress] - public string Email { get; set; } - - /// - /// Undefined description. - /// - /// - /// Url validation being enforced. - /// - [Uri] - public Uri Homepage { get; set; } - - /// - /// ColorType. - /// - public ColorType Color { get; set; } - - /// - /// Address. - /// - public Address HomeAddress { get; set; } - - /// - /// Address. - /// - public Address CompanyAddress { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}, {nameof(Gender)}: {Gender}, {nameof(FirstName)}: {FirstName}, {nameof(LastName)}: {LastName}, {nameof(Email)}: {Email}, {nameof(Homepage)}: ({Homepage}), {nameof(Color)}: {Color}, {nameof(HomeAddress)}: ({HomeAddress}), {nameof(CompanyAddress)}: ({CompanyAddress})"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Users/Models/Users.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Users/Models/Users.verified.cs deleted file mode 100644 index 084e9f4d..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Users/Models/Users.verified.cs +++ /dev/null @@ -1,23 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Contracts; - -/// -/// A list of users. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class Users -{ - /// - /// A list of User. - /// - public List UserList { get; set; } = new List(); - - /// - public override string ToString() - => $"{nameof(UserList)}.Count: {UserList?.Count ?? 0}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Users/RequestParameters/CreateUserRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Users/RequestParameters/CreateUserRequest.verified.cs deleted file mode 100644 index 55d7c167..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Users/RequestParameters/CreateUserRequest.verified.cs +++ /dev/null @@ -1,65 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Contracts; - -/// -/// Request to create a user. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class CreateUserRequest -{ - [Required] - public string FirstName { get; set; } - - [Required] - public string LastName { get; set; } - - public DateTimeOffset? MyNullableDateTime { get; set; } - - [Required] - public DateTimeOffset MyDateTime { get; set; } - - /// - /// Undefined description. - /// - /// - /// Email validation being enforced. - /// - [Required] - [EmailAddress] - public string Email { get; set; } - - /// - /// Undefined description. - /// - /// - /// Url validation being enforced. - /// - [Uri] - public Uri Homepage { get; set; } - - /// - /// GenderType. - /// - [Required] - public GenderType Gender { get; set; } - - public Address? MyNullableAddress { get; set; } - - [Required] - public Dictionary Tags { get; set; } - - public Dictionary DesiredProperties1 { get; set; } - - public Dictionary? DesiredProperties2 { get; set; } - - public Dictionary? DesiredProperties3 { get; set; } - - /// - public override string ToString() - => $"{nameof(FirstName)}: {FirstName}, {nameof(LastName)}: {LastName}, {nameof(MyNullableDateTime)}: ({MyNullableDateTime}), {nameof(MyDateTime)}: ({MyDateTime}), {nameof(Email)}: {Email}, {nameof(Homepage)}: ({Homepage}), {nameof(Gender)}: {Gender}, {nameof(MyNullableAddress)}: ({MyNullableAddress}), {nameof(Tags)}: ({Tags}), {nameof(DesiredProperties1)}: ({DesiredProperties1}), {nameof(DesiredProperties2)}: ({DesiredProperties2}), {nameof(DesiredProperties3)}: ({DesiredProperties3})"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Users/RequestParameters/DeleteUserByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Users/RequestParameters/DeleteUserByIdParameters.verified.cs deleted file mode 100644 index 2e64a874..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Users/RequestParameters/DeleteUserByIdParameters.verified.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Contracts; - -/// -/// Parameters for operation request. -/// Description: Delete user by id. -/// Operation: DeleteUserById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class DeleteUserByIdParameters -{ - /// - /// Id of the user. - /// - [Required] - public Guid Id { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Users/RequestParameters/GetUserByEmailParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Users/RequestParameters/GetUserByEmailParameters.verified.cs deleted file mode 100644 index afef2451..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Users/RequestParameters/GetUserByEmailParameters.verified.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Contracts; - -/// -/// Parameters for operation request. -/// Description: Get user by email. -/// Operation: GetUserByEmail. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetUserByEmailParameters -{ - /// - /// The email of the user to retrieve. - /// - /// - /// Email validation being enforced. - /// - [Required] - [EmailAddress] - public string Email { get; set; } - - /// - public override string ToString() - => $"{nameof(Email)}: {Email}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Users/RequestParameters/GetUserByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Users/RequestParameters/GetUserByIdParameters.verified.cs deleted file mode 100644 index d39713f1..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Users/RequestParameters/GetUserByIdParameters.verified.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Contracts; - -/// -/// Parameters for operation request. -/// Description: Get user by id. -/// Operation: GetUserById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetUserByIdParameters -{ - /// - /// Id of the user. - /// - [Required] - public Guid Id { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Users/RequestParameters/PostUserParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Users/RequestParameters/PostUserParameters.verified.cs deleted file mode 100644 index 14c7fc0e..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Users/RequestParameters/PostUserParameters.verified.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Contracts; - -/// -/// Parameters for operation request. -/// Description: Create a new user. -/// Operation: PostUser. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class PostUserParameters -{ - /// - /// Request to create a user. - /// - [Required] - public CreateUserRequest Request { get; set; } - - /// - public override string ToString() - => $"{nameof(Request)}: ({Request})"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Users/RequestParameters/UpdateMyTestGenderParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Users/RequestParameters/UpdateMyTestGenderParameters.verified.cs deleted file mode 100644 index 0d426636..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Users/RequestParameters/UpdateMyTestGenderParameters.verified.cs +++ /dev/null @@ -1,37 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Contracts; - -/// -/// Parameters for operation request. -/// Description: Update gender on a user. -/// Operation: UpdateMyTestGender. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UpdateMyTestGenderParameters -{ - /// - /// Id of the user. - /// - [Required] - public Guid Id { get; set; } - - /// - /// The gender to set on the user. - /// - public GenderType? GenderParam { get; set; } - - /// - /// Update test-gender Request. - /// - [Required] - public UpdateTestGenderRequest Request { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}, {nameof(GenderParam)}: {GenderParam}, {nameof(Request)}: ({Request})"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Users/RequestParameters/UpdateTestGenderRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Users/RequestParameters/UpdateTestGenderRequest.verified.cs deleted file mode 100644 index c7b29bff..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Users/RequestParameters/UpdateTestGenderRequest.verified.cs +++ /dev/null @@ -1,23 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Contracts; - -/// -/// Update test-gender Request. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UpdateTestGenderRequest -{ - /// - /// GenderType. - /// - public GenderType Gender { get; set; } - - /// - public override string ToString() - => $"{nameof(Gender)}: {Gender}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Users/RequestParameters/UpdateUserByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Users/RequestParameters/UpdateUserByIdParameters.verified.cs deleted file mode 100644 index 6dcdc847..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Users/RequestParameters/UpdateUserByIdParameters.verified.cs +++ /dev/null @@ -1,32 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Contracts; - -/// -/// Parameters for operation request. -/// Description: Update user by id. -/// Operation: UpdateUserById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UpdateUserByIdParameters -{ - /// - /// Id of the user. - /// - [Required] - public Guid Id { get; set; } - - /// - /// Request to update a user. - /// - [Required] - public UpdateUserRequest Request { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}, {nameof(Request)}: ({Request})"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Users/RequestParameters/UpdateUserRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Users/RequestParameters/UpdateUserRequest.verified.cs deleted file mode 100644 index 0c34f6cd..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/Users/RequestParameters/UpdateUserRequest.verified.cs +++ /dev/null @@ -1,36 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Contracts; - -/// -/// Request to update a user. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UpdateUserRequest -{ - public string FirstName { get; set; } - - public string LastName { get; set; } - - /// - /// Undefined description. - /// - /// - /// Email validation being enforced. - /// - [EmailAddress] - public string Email { get; set; } - - /// - /// GenderType. - /// - public GenderType Gender { get; set; } - - /// - public override string ToString() - => $"{nameof(FirstName)}: {FirstName}, {nameof(LastName)}: {LastName}, {nameof(Email)}: {Email}, {nameof(Gender)}: {Gender}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/_EnumerationTypes/ColorType.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/_EnumerationTypes/ColorType.verified.cs deleted file mode 100644 index e7762cd1..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/_EnumerationTypes/ColorType.verified.cs +++ /dev/null @@ -1,21 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Contracts; - -/// -/// Enumeration: ColorType. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -[Flags] -public enum ColorType -{ - None = 0, - Black = 1, - White = 2, - Yellow = 4, - Red = 8, -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/_EnumerationTypes/GenderType.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/_EnumerationTypes/GenderType.verified.cs deleted file mode 100644 index 511edd31..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/_EnumerationTypes/GenderType.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Contracts; - -/// -/// Enumeration: GenderType. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public enum GenderType -{ - None, - NonBinary, - Male, - Female, -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/_Shared/Address.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/_Shared/Address.verified.cs deleted file mode 100644 index 9287802c..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/_Shared/Address.verified.cs +++ /dev/null @@ -1,32 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Contracts; - -/// -/// Address. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class Address -{ - [StringLength(255)] - public string StreetName { get; set; } - - public string StreetNumber { get; set; } - - public string PostalCode { get; set; } - - public string CityName { get; set; } - - /// - /// Country. - /// - public Country MyCountry { get; set; } - - /// - public override string ToString() - => $"{nameof(StreetName)}: {StreetName}, {nameof(StreetNumber)}: {StreetNumber}, {nameof(PostalCode)}: {PostalCode}, {nameof(CityName)}: {CityName}, {nameof(MyCountry)}: ({MyCountry})"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/_Shared/Country.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/_Shared/Country.verified.cs deleted file mode 100644 index ebb42fc5..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Contracts/_Shared/Country.verified.cs +++ /dev/null @@ -1,33 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Contracts; - -/// -/// Country. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class Country -{ - [Required] - public string Name { get; set; } - - [Required] - [MinLength(2)] - [MaxLength(2)] - [RegularExpression("^[A-Za-z]{2}$")] - public string Alpha2Code { get; set; } - - [Required] - [MinLength(3)] - [MaxLength(3)] - [RegularExpression("^[A-Za-z]{3}$")] - public string Alpha3Code { get; set; } - - /// - public override string ToString() - => $"{nameof(Name)}: {Name}, {nameof(Alpha2Code)}: {Alpha2Code}, {nameof(Alpha3Code)}: {Alpha3Code}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Accounts/Interfaces/ISetAccountNameEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Accounts/Interfaces/ISetAccountNameEndpoint.verified.cs deleted file mode 100644 index f62eae77..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Accounts/Interfaces/ISetAccountNameEndpoint.verified.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint. -/// Description: Set name of account. -/// Operation: SetAccountName. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface ISetAccountNameEndpoint -{ - /// - /// Execute method. - /// - /// The parameters. - /// The http client name. - /// The cancellation token. - Task ExecuteAsync( - SetAccountNameParameters parameters, - string httpClientName = "DemoSampleApi-ApiClient", - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Accounts/Interfaces/ISetAccountNameEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Accounts/Interfaces/ISetAccountNameEndpointResult.verified.cs deleted file mode 100644 index 0f9049cc..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Accounts/Interfaces/ISetAccountNameEndpointResult.verified.cs +++ /dev/null @@ -1,32 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint Result. -/// Description: Set name of account. -/// Operation: SetAccountName. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface ISetAccountNameEndpointResult : IEndpointResponse -{ - bool IsOk { get; } - - bool IsBadRequest { get; } - - bool IsUnauthorized { get; } - - bool IsForbidden { get; } - - bool IsInternalServerError { get; } - - string OkContent { get; } - - ValidationProblemDetails BadRequestContent { get; } - - string InternalServerErrorContent { get; } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Accounts/Interfaces/IUpdateAccountNameEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Accounts/Interfaces/IUpdateAccountNameEndpoint.verified.cs deleted file mode 100644 index 184c867f..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Accounts/Interfaces/IUpdateAccountNameEndpoint.verified.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint. -/// Description: Update name of account. -/// Operation: UpdateAccountName. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IUpdateAccountNameEndpoint -{ - /// - /// Execute method. - /// - /// The parameters. - /// The http client name. - /// The cancellation token. - Task ExecuteAsync( - UpdateAccountNameParameters parameters, - string httpClientName = "DemoSampleApi-ApiClient", - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Accounts/Interfaces/IUpdateAccountNameEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Accounts/Interfaces/IUpdateAccountNameEndpointResult.verified.cs deleted file mode 100644 index 95bb1962..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Accounts/Interfaces/IUpdateAccountNameEndpointResult.verified.cs +++ /dev/null @@ -1,32 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint Result. -/// Description: Update name of account. -/// Operation: UpdateAccountName. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IUpdateAccountNameEndpointResult : IEndpointResponse -{ - bool IsOk { get; } - - bool IsBadRequest { get; } - - bool IsUnauthorized { get; } - - bool IsForbidden { get; } - - bool IsInternalServerError { get; } - - string OkContent { get; } - - ValidationProblemDetails BadRequestContent { get; } - - string InternalServerErrorContent { get; } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Accounts/SetAccountNameEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Accounts/SetAccountNameEndpoint.verified.cs deleted file mode 100644 index da82a86e..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Accounts/SetAccountNameEndpoint.verified.cs +++ /dev/null @@ -1,51 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint. -/// Description: Set name of account. -/// Operation: SetAccountName. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class SetAccountNameEndpoint : ISetAccountNameEndpoint -{ - private readonly IHttpClientFactory factory; - private readonly IHttpMessageFactory httpMessageFactory; - - public SetAccountNameEndpoint( - IHttpClientFactory factory, - IHttpMessageFactory httpMessageFactory) - { - this.factory = factory; - this.httpMessageFactory = httpMessageFactory; - } - - public async Task ExecuteAsync( - SetAccountNameParameters parameters, - string httpClientName = "DemoSampleApi-ApiClient", - CancellationToken cancellationToken = default) - { - var client = factory.CreateClient(httpClientName); - - var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/accounts/{accountId}/name"); - requestBuilder.WithPathParameter("accountId", parameters.AccountId); - requestBuilder.WithBody(parameters.Request); - - using var requestMessage = requestBuilder.Build(HttpMethod.Post); - using var response = await client.SendAsync(requestMessage, cancellationToken); - - var responseBuilder = httpMessageFactory.FromResponse(response); - responseBuilder.AddSuccessResponse(HttpStatusCode.OK); - responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); - responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); - responseBuilder.AddErrorResponse(HttpStatusCode.Forbidden); - responseBuilder.AddErrorResponse(HttpStatusCode.InternalServerError); - - return await responseBuilder.BuildResponseAsync(x => new SetAccountNameEndpointResult(x), cancellationToken); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Accounts/SetAccountNameEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Accounts/SetAccountNameEndpointResult.verified.cs deleted file mode 100644 index a047c933..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Accounts/SetAccountNameEndpointResult.verified.cs +++ /dev/null @@ -1,51 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint result. -/// Description: Set name of account. -/// Operation: SetAccountName. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class SetAccountNameEndpointResult : EndpointResponse, ISetAccountNameEndpointResult -{ - public SetAccountNameEndpointResult(EndpointResponse response) - : base(response) - { - } - - public bool IsOk - => StatusCode == HttpStatusCode.OK; - - public bool IsBadRequest - => StatusCode == HttpStatusCode.BadRequest; - - public bool IsUnauthorized - => StatusCode == HttpStatusCode.Unauthorized; - - public bool IsForbidden - => StatusCode == HttpStatusCode.Forbidden; - - public bool IsInternalServerError - => StatusCode == HttpStatusCode.InternalServerError; - - public string OkContent - => IsOk && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); - - public ValidationProblemDetails BadRequestContent - => IsBadRequest && ContentObject is ValidationProblemDetails result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); - - public string InternalServerErrorContent - => IsInternalServerError && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsInternalServerError property first."); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Accounts/UpdateAccountNameEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Accounts/UpdateAccountNameEndpoint.verified.cs deleted file mode 100644 index c5a22f99..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Accounts/UpdateAccountNameEndpoint.verified.cs +++ /dev/null @@ -1,51 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint. -/// Description: Update name of account. -/// Operation: UpdateAccountName. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UpdateAccountNameEndpoint : IUpdateAccountNameEndpoint -{ - private readonly IHttpClientFactory factory; - private readonly IHttpMessageFactory httpMessageFactory; - - public UpdateAccountNameEndpoint( - IHttpClientFactory factory, - IHttpMessageFactory httpMessageFactory) - { - this.factory = factory; - this.httpMessageFactory = httpMessageFactory; - } - - public async Task ExecuteAsync( - UpdateAccountNameParameters parameters, - string httpClientName = "DemoSampleApi-ApiClient", - CancellationToken cancellationToken = default) - { - var client = factory.CreateClient(httpClientName); - - var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/accounts/{accountId}/name"); - requestBuilder.WithPathParameter("accountId", parameters.AccountId); - requestBuilder.WithHeaderParameter("name", parameters.Name); - - using var requestMessage = requestBuilder.Build(HttpMethod.Put); - using var response = await client.SendAsync(requestMessage, cancellationToken); - - var responseBuilder = httpMessageFactory.FromResponse(response); - responseBuilder.AddSuccessResponse(HttpStatusCode.OK); - responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); - responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); - responseBuilder.AddErrorResponse(HttpStatusCode.Forbidden); - responseBuilder.AddErrorResponse(HttpStatusCode.InternalServerError); - - return await responseBuilder.BuildResponseAsync(x => new UpdateAccountNameEndpointResult(x), cancellationToken); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Accounts/UpdateAccountNameEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Accounts/UpdateAccountNameEndpointResult.verified.cs deleted file mode 100644 index 74243973..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Accounts/UpdateAccountNameEndpointResult.verified.cs +++ /dev/null @@ -1,51 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint result. -/// Description: Update name of account. -/// Operation: UpdateAccountName. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UpdateAccountNameEndpointResult : EndpointResponse, IUpdateAccountNameEndpointResult -{ - public UpdateAccountNameEndpointResult(EndpointResponse response) - : base(response) - { - } - - public bool IsOk - => StatusCode == HttpStatusCode.OK; - - public bool IsBadRequest - => StatusCode == HttpStatusCode.BadRequest; - - public bool IsUnauthorized - => StatusCode == HttpStatusCode.Unauthorized; - - public bool IsForbidden - => StatusCode == HttpStatusCode.Forbidden; - - public bool IsInternalServerError - => StatusCode == HttpStatusCode.InternalServerError; - - public string OkContent - => IsOk && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); - - public ValidationProblemDetails BadRequestContent - => IsBadRequest && ContentObject is ValidationProblemDetails result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); - - public string InternalServerErrorContent - => IsInternalServerError && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsInternalServerError property first."); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Addresses/GetAddressesByPostalCodesEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Addresses/GetAddressesByPostalCodesEndpoint.verified.cs deleted file mode 100644 index 2347ae72..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Addresses/GetAddressesByPostalCodesEndpoint.verified.cs +++ /dev/null @@ -1,51 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint. -/// Description: Get addresses by postal code. -/// Operation: GetAddressesByPostalCodes. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetAddressesByPostalCodesEndpoint : IGetAddressesByPostalCodesEndpoint -{ - private readonly IHttpClientFactory factory; - private readonly IHttpMessageFactory httpMessageFactory; - - public GetAddressesByPostalCodesEndpoint( - IHttpClientFactory factory, - IHttpMessageFactory httpMessageFactory) - { - this.factory = factory; - this.httpMessageFactory = httpMessageFactory; - } - - public async Task ExecuteAsync( - GetAddressesByPostalCodesParameters parameters, - string httpClientName = "DemoSampleApi-ApiClient", - CancellationToken cancellationToken = default) - { - var client = factory.CreateClient(httpClientName); - - var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/addresses/{postalCode}"); - requestBuilder.WithPathParameter("postalCode", parameters.PostalCode); - - using var requestMessage = requestBuilder.Build(HttpMethod.Get); - using var response = await client.SendAsync(requestMessage, cancellationToken); - - var responseBuilder = httpMessageFactory.FromResponse(response); - responseBuilder.AddSuccessResponse>(HttpStatusCode.OK); - responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); - responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); - responseBuilder.AddErrorResponse(HttpStatusCode.Forbidden); - responseBuilder.AddErrorResponse(HttpStatusCode.NotFound); - responseBuilder.AddErrorResponse(HttpStatusCode.InternalServerError); - - return await responseBuilder.BuildResponseAsync(x => new GetAddressesByPostalCodesEndpointResult(x), cancellationToken); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Addresses/GetAddressesByPostalCodesEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Addresses/GetAddressesByPostalCodesEndpointResult.verified.cs deleted file mode 100644 index 9df5242d..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Addresses/GetAddressesByPostalCodesEndpointResult.verified.cs +++ /dev/null @@ -1,59 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint result. -/// Description: Get addresses by postal code. -/// Operation: GetAddressesByPostalCodes. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetAddressesByPostalCodesEndpointResult : EndpointResponse, IGetAddressesByPostalCodesEndpointResult -{ - public GetAddressesByPostalCodesEndpointResult(EndpointResponse response) - : base(response) - { - } - - public bool IsOk - => StatusCode == HttpStatusCode.OK; - - public bool IsBadRequest - => StatusCode == HttpStatusCode.BadRequest; - - public bool IsUnauthorized - => StatusCode == HttpStatusCode.Unauthorized; - - public bool IsForbidden - => StatusCode == HttpStatusCode.Forbidden; - - public bool IsNotFound - => StatusCode == HttpStatusCode.NotFound; - - public bool IsInternalServerError - => StatusCode == HttpStatusCode.InternalServerError; - - public List
OkContent - => IsOk && ContentObject is List
result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); - - public ValidationProblemDetails BadRequestContent - => IsBadRequest && ContentObject is ValidationProblemDetails result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); - - public string NotFoundContent - => IsNotFound && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsNotFound property first."); - - public string InternalServerErrorContent - => IsInternalServerError && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsInternalServerError property first."); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Addresses/Interfaces/IGetAddressesByPostalCodesEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Addresses/Interfaces/IGetAddressesByPostalCodesEndpoint.verified.cs deleted file mode 100644 index 22fcd978..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Addresses/Interfaces/IGetAddressesByPostalCodesEndpoint.verified.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint. -/// Description: Get addresses by postal code. -/// Operation: GetAddressesByPostalCodes. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetAddressesByPostalCodesEndpoint -{ - /// - /// Execute method. - /// - /// The parameters. - /// The http client name. - /// The cancellation token. - Task ExecuteAsync( - GetAddressesByPostalCodesParameters parameters, - string httpClientName = "DemoSampleApi-ApiClient", - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Addresses/Interfaces/IGetAddressesByPostalCodesEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Addresses/Interfaces/IGetAddressesByPostalCodesEndpointResult.verified.cs deleted file mode 100644 index 53ac6be9..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Addresses/Interfaces/IGetAddressesByPostalCodesEndpointResult.verified.cs +++ /dev/null @@ -1,36 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint Result. -/// Description: Get addresses by postal code. -/// Operation: GetAddressesByPostalCodes. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetAddressesByPostalCodesEndpointResult : IEndpointResponse -{ - bool IsOk { get; } - - bool IsBadRequest { get; } - - bool IsUnauthorized { get; } - - bool IsForbidden { get; } - - bool IsNotFound { get; } - - bool IsInternalServerError { get; } - - List
OkContent { get; } - - ValidationProblemDetails BadRequestContent { get; } - - string NotFoundContent { get; } - - string InternalServerErrorContent { get; } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/EventArgs/GetEventArgByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/EventArgs/GetEventArgByIdEndpoint.verified.cs deleted file mode 100644 index a1d4068b..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/EventArgs/GetEventArgByIdEndpoint.verified.cs +++ /dev/null @@ -1,51 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint. -/// Description: Get EventArgs By Id. -/// Operation: GetEventArgById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetEventArgByIdEndpoint : IGetEventArgByIdEndpoint -{ - private readonly IHttpClientFactory factory; - private readonly IHttpMessageFactory httpMessageFactory; - - public GetEventArgByIdEndpoint( - IHttpClientFactory factory, - IHttpMessageFactory httpMessageFactory) - { - this.factory = factory; - this.httpMessageFactory = httpMessageFactory; - } - - public async Task ExecuteAsync( - GetEventArgByIdParameters parameters, - string httpClientName = "DemoSampleApi-ApiClient", - CancellationToken cancellationToken = default) - { - var client = factory.CreateClient(httpClientName); - - var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/eventArgs/{id}"); - requestBuilder.WithPathParameter("id", parameters.Id); - - using var requestMessage = requestBuilder.Build(HttpMethod.Get); - using var response = await client.SendAsync(requestMessage, cancellationToken); - - var responseBuilder = httpMessageFactory.FromResponse(response); - responseBuilder.AddSuccessResponse(HttpStatusCode.OK); - responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); - responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); - responseBuilder.AddErrorResponse(HttpStatusCode.Forbidden); - responseBuilder.AddErrorResponse(HttpStatusCode.NotFound); - responseBuilder.AddErrorResponse(HttpStatusCode.InternalServerError); - - return await responseBuilder.BuildResponseAsync(x => new GetEventArgByIdEndpointResult(x), cancellationToken); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/EventArgs/GetEventArgByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/EventArgs/GetEventArgByIdEndpointResult.verified.cs deleted file mode 100644 index da720c77..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/EventArgs/GetEventArgByIdEndpointResult.verified.cs +++ /dev/null @@ -1,59 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint result. -/// Description: Get EventArgs By Id. -/// Operation: GetEventArgById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetEventArgByIdEndpointResult : EndpointResponse, IGetEventArgByIdEndpointResult -{ - public GetEventArgByIdEndpointResult(EndpointResponse response) - : base(response) - { - } - - public bool IsOk - => StatusCode == HttpStatusCode.OK; - - public bool IsBadRequest - => StatusCode == HttpStatusCode.BadRequest; - - public bool IsUnauthorized - => StatusCode == HttpStatusCode.Unauthorized; - - public bool IsForbidden - => StatusCode == HttpStatusCode.Forbidden; - - public bool IsNotFound - => StatusCode == HttpStatusCode.NotFound; - - public bool IsInternalServerError - => StatusCode == HttpStatusCode.InternalServerError; - - public Contracts.EventArgs OkContent - => IsOk && ContentObject is Contracts.EventArgs result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); - - public ValidationProblemDetails BadRequestContent - => IsBadRequest && ContentObject is ValidationProblemDetails result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); - - public string NotFoundContent - => IsNotFound && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsNotFound property first."); - - public string InternalServerErrorContent - => IsInternalServerError && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsInternalServerError property first."); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/EventArgs/GetEventArgsEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/EventArgs/GetEventArgsEndpoint.verified.cs deleted file mode 100644 index e9491dd8..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/EventArgs/GetEventArgsEndpoint.verified.cs +++ /dev/null @@ -1,47 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint. -/// Description: Get EventArgs List. -/// Operation: GetEventArgs. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetEventArgsEndpoint : IGetEventArgsEndpoint -{ - private readonly IHttpClientFactory factory; - private readonly IHttpMessageFactory httpMessageFactory; - - public GetEventArgsEndpoint( - IHttpClientFactory factory, - IHttpMessageFactory httpMessageFactory) - { - this.factory = factory; - this.httpMessageFactory = httpMessageFactory; - } - - public async Task ExecuteAsync( - string httpClientName = "DemoSampleApi-ApiClient", - CancellationToken cancellationToken = default) - { - var client = factory.CreateClient(httpClientName); - - var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/eventArgs"); - - using var requestMessage = requestBuilder.Build(HttpMethod.Get); - using var response = await client.SendAsync(requestMessage, cancellationToken); - - var responseBuilder = httpMessageFactory.FromResponse(response); - responseBuilder.AddSuccessResponse>(HttpStatusCode.OK); - responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); - responseBuilder.AddErrorResponse(HttpStatusCode.Forbidden); - responseBuilder.AddErrorResponse(HttpStatusCode.InternalServerError); - - return await responseBuilder.BuildResponseAsync(x => new GetEventArgsEndpointResult(x), cancellationToken); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/EventArgs/GetEventArgsEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/EventArgs/GetEventArgsEndpointResult.verified.cs deleted file mode 100644 index 1a3ec31e..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/EventArgs/GetEventArgsEndpointResult.verified.cs +++ /dev/null @@ -1,43 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint result. -/// Description: Get EventArgs List. -/// Operation: GetEventArgs. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetEventArgsEndpointResult : EndpointResponse, IGetEventArgsEndpointResult -{ - public GetEventArgsEndpointResult(EndpointResponse response) - : base(response) - { - } - - public bool IsOk - => StatusCode == HttpStatusCode.OK; - - public bool IsUnauthorized - => StatusCode == HttpStatusCode.Unauthorized; - - public bool IsForbidden - => StatusCode == HttpStatusCode.Forbidden; - - public bool IsInternalServerError - => StatusCode == HttpStatusCode.InternalServerError; - - public List OkContent - => IsOk && ContentObject is List result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); - - public string InternalServerErrorContent - => IsInternalServerError && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsInternalServerError property first."); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgByIdEndpoint.verified.cs deleted file mode 100644 index 21001ece..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgByIdEndpoint.verified.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint. -/// Description: Get EventArgs By Id. -/// Operation: GetEventArgById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetEventArgByIdEndpoint -{ - /// - /// Execute method. - /// - /// The parameters. - /// The http client name. - /// The cancellation token. - Task ExecuteAsync( - GetEventArgByIdParameters parameters, - string httpClientName = "DemoSampleApi-ApiClient", - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgByIdEndpointResult.verified.cs deleted file mode 100644 index 31ba0b26..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgByIdEndpointResult.verified.cs +++ /dev/null @@ -1,36 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint Result. -/// Description: Get EventArgs By Id. -/// Operation: GetEventArgById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetEventArgByIdEndpointResult : IEndpointResponse -{ - bool IsOk { get; } - - bool IsBadRequest { get; } - - bool IsUnauthorized { get; } - - bool IsForbidden { get; } - - bool IsNotFound { get; } - - bool IsInternalServerError { get; } - - Contracts.EventArgs OkContent { get; } - - ValidationProblemDetails BadRequestContent { get; } - - string NotFoundContent { get; } - - string InternalServerErrorContent { get; } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgsEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgsEndpoint.verified.cs deleted file mode 100644 index 51e092b6..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgsEndpoint.verified.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint. -/// Description: Get EventArgs List. -/// Operation: GetEventArgs. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetEventArgsEndpoint -{ - /// - /// Execute method. - /// - /// The http client name. - /// The cancellation token. - Task ExecuteAsync( - string httpClientName = "DemoSampleApi-ApiClient", - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgsEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgsEndpointResult.verified.cs deleted file mode 100644 index 73465290..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgsEndpointResult.verified.cs +++ /dev/null @@ -1,28 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint Result. -/// Description: Get EventArgs List. -/// Operation: GetEventArgs. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetEventArgsEndpointResult : IEndpointResponse -{ - bool IsOk { get; } - - bool IsUnauthorized { get; } - - bool IsForbidden { get; } - - bool IsInternalServerError { get; } - - List OkContent { get; } - - string InternalServerErrorContent { get; } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/GetFileByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/GetFileByIdEndpoint.verified.cs deleted file mode 100644 index 3f8644cd..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/GetFileByIdEndpoint.verified.cs +++ /dev/null @@ -1,51 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint. -/// Description: Get File By Id. -/// Operation: GetFileById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetFileByIdEndpoint : IGetFileByIdEndpoint -{ - private readonly IHttpClientFactory factory; - private readonly IHttpMessageFactory httpMessageFactory; - - public GetFileByIdEndpoint( - IHttpClientFactory factory, - IHttpMessageFactory httpMessageFactory) - { - this.factory = factory; - this.httpMessageFactory = httpMessageFactory; - } - - public async Task ExecuteAsync( - GetFileByIdParameters parameters, - string httpClientName = "DemoSampleApi-ApiClient", - CancellationToken cancellationToken = default) - { - var client = factory.CreateClient(httpClientName); - - var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/files/{id}"); - requestBuilder.WithPathParameter("id", parameters.Id); - - using var requestMessage = requestBuilder.Build(HttpMethod.Get); - using var response = await client.SendAsync(requestMessage, cancellationToken); - - var responseBuilder = httpMessageFactory.FromResponse(response); - responseBuilder.AddSuccessResponse(HttpStatusCode.OK); - responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); - responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); - responseBuilder.AddErrorResponse(HttpStatusCode.Forbidden); - responseBuilder.AddErrorResponse(HttpStatusCode.NotFound); - responseBuilder.AddErrorResponse(HttpStatusCode.InternalServerError); - - return await responseBuilder.BuildResponseAsync(x => new GetFileByIdEndpointResult(x), cancellationToken); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/GetFileByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/GetFileByIdEndpointResult.verified.cs deleted file mode 100644 index f0255596..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/GetFileByIdEndpointResult.verified.cs +++ /dev/null @@ -1,59 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint result. -/// Description: Get File By Id. -/// Operation: GetFileById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetFileByIdEndpointResult : EndpointResponse, IGetFileByIdEndpointResult -{ - public GetFileByIdEndpointResult(EndpointResponse response) - : base(response) - { - } - - public bool IsOk - => StatusCode == HttpStatusCode.OK; - - public bool IsBadRequest - => StatusCode == HttpStatusCode.BadRequest; - - public bool IsUnauthorized - => StatusCode == HttpStatusCode.Unauthorized; - - public bool IsForbidden - => StatusCode == HttpStatusCode.Forbidden; - - public bool IsNotFound - => StatusCode == HttpStatusCode.NotFound; - - public bool IsInternalServerError - => StatusCode == HttpStatusCode.InternalServerError; - - public string OkContent - => IsOk && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); - - public ValidationProblemDetails BadRequestContent - => IsBadRequest && ContentObject is ValidationProblemDetails result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); - - public string NotFoundContent - => IsNotFound && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsNotFound property first."); - - public string InternalServerErrorContent - => IsInternalServerError && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsInternalServerError property first."); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/Interfaces/IGetFileByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/Interfaces/IGetFileByIdEndpoint.verified.cs deleted file mode 100644 index 46691b87..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/Interfaces/IGetFileByIdEndpoint.verified.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint. -/// Description: Get File By Id. -/// Operation: GetFileById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetFileByIdEndpoint -{ - /// - /// Execute method. - /// - /// The parameters. - /// The http client name. - /// The cancellation token. - Task ExecuteAsync( - GetFileByIdParameters parameters, - string httpClientName = "DemoSampleApi-ApiClient", - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/Interfaces/IGetFileByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/Interfaces/IGetFileByIdEndpointResult.verified.cs deleted file mode 100644 index 0d505158..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/Interfaces/IGetFileByIdEndpointResult.verified.cs +++ /dev/null @@ -1,36 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint Result. -/// Description: Get File By Id. -/// Operation: GetFileById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetFileByIdEndpointResult : IEndpointResponse -{ - bool IsOk { get; } - - bool IsBadRequest { get; } - - bool IsUnauthorized { get; } - - bool IsForbidden { get; } - - bool IsNotFound { get; } - - bool IsInternalServerError { get; } - - string OkContent { get; } - - ValidationProblemDetails BadRequestContent { get; } - - string NotFoundContent { get; } - - string InternalServerErrorContent { get; } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadMultiFilesAsFormDataEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadMultiFilesAsFormDataEndpoint.verified.cs deleted file mode 100644 index bcded602..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadMultiFilesAsFormDataEndpoint.verified.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint. -/// Description: Upload multi files as form data. -/// Operation: UploadMultiFilesAsFormData. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IUploadMultiFilesAsFormDataEndpoint -{ - /// - /// Execute method. - /// - /// The parameters. - /// The http client name. - /// The cancellation token. - Task ExecuteAsync( - UploadMultiFilesAsFormDataParameters parameters, - string httpClientName = "DemoSampleApi-ApiClient", - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadMultiFilesAsFormDataEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadMultiFilesAsFormDataEndpointResult.verified.cs deleted file mode 100644 index 812a54b9..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadMultiFilesAsFormDataEndpointResult.verified.cs +++ /dev/null @@ -1,32 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint Result. -/// Description: Upload multi files as form data. -/// Operation: UploadMultiFilesAsFormData. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IUploadMultiFilesAsFormDataEndpointResult : IEndpointResponse -{ - bool IsOk { get; } - - bool IsBadRequest { get; } - - bool IsUnauthorized { get; } - - bool IsForbidden { get; } - - bool IsInternalServerError { get; } - - string OkContent { get; } - - ValidationProblemDetails BadRequestContent { get; } - - string InternalServerErrorContent { get; } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadSingleFileAsFormDataEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadSingleFileAsFormDataEndpoint.verified.cs deleted file mode 100644 index c501dabe..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadSingleFileAsFormDataEndpoint.verified.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint. -/// Description: Upload a file as OctetStream. -/// Operation: UploadSingleFileAsFormData. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IUploadSingleFileAsFormDataEndpoint -{ - /// - /// Execute method. - /// - /// The parameters. - /// The http client name. - /// The cancellation token. - Task ExecuteAsync( - UploadSingleFileAsFormDataParameters parameters, - string httpClientName = "DemoSampleApi-ApiClient", - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadSingleFileAsFormDataEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadSingleFileAsFormDataEndpointResult.verified.cs deleted file mode 100644 index becff300..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadSingleFileAsFormDataEndpointResult.verified.cs +++ /dev/null @@ -1,32 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint Result. -/// Description: Upload a file as OctetStream. -/// Operation: UploadSingleFileAsFormData. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IUploadSingleFileAsFormDataEndpointResult : IEndpointResponse -{ - bool IsOk { get; } - - bool IsBadRequest { get; } - - bool IsUnauthorized { get; } - - bool IsForbidden { get; } - - bool IsInternalServerError { get; } - - string OkContent { get; } - - ValidationProblemDetails BadRequestContent { get; } - - string InternalServerErrorContent { get; } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadSingleObjectWithFileAsFormDataEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadSingleObjectWithFileAsFormDataEndpoint.verified.cs deleted file mode 100644 index e4ff3d17..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadSingleObjectWithFileAsFormDataEndpoint.verified.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint. -/// Description: Upload a file as FormData. -/// Operation: UploadSingleObjectWithFileAsFormData. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IUploadSingleObjectWithFileAsFormDataEndpoint -{ - /// - /// Execute method. - /// - /// The parameters. - /// The http client name. - /// The cancellation token. - Task ExecuteAsync( - UploadSingleObjectWithFileAsFormDataParameters parameters, - string httpClientName = "DemoSampleApi-ApiClient", - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadSingleObjectWithFileAsFormDataEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadSingleObjectWithFileAsFormDataEndpointResult.verified.cs deleted file mode 100644 index 1c9834a0..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadSingleObjectWithFileAsFormDataEndpointResult.verified.cs +++ /dev/null @@ -1,32 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint Result. -/// Description: Upload a file as FormData. -/// Operation: UploadSingleObjectWithFileAsFormData. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IUploadSingleObjectWithFileAsFormDataEndpointResult : IEndpointResponse -{ - bool IsOk { get; } - - bool IsBadRequest { get; } - - bool IsUnauthorized { get; } - - bool IsForbidden { get; } - - bool IsInternalServerError { get; } - - string OkContent { get; } - - ValidationProblemDetails BadRequestContent { get; } - - string InternalServerErrorContent { get; } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadSingleObjectWithFilesAsFormDataEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadSingleObjectWithFilesAsFormDataEndpoint.verified.cs deleted file mode 100644 index 432047ba..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadSingleObjectWithFilesAsFormDataEndpoint.verified.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint. -/// Description: Upload files as FormData. -/// Operation: UploadSingleObjectWithFilesAsFormData. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IUploadSingleObjectWithFilesAsFormDataEndpoint -{ - /// - /// Execute method. - /// - /// The parameters. - /// The http client name. - /// The cancellation token. - Task ExecuteAsync( - UploadSingleObjectWithFilesAsFormDataParameters parameters, - string httpClientName = "DemoSampleApi-ApiClient", - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadSingleObjectWithFilesAsFormDataEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadSingleObjectWithFilesAsFormDataEndpointResult.verified.cs deleted file mode 100644 index c51ab6dc..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadSingleObjectWithFilesAsFormDataEndpointResult.verified.cs +++ /dev/null @@ -1,32 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint Result. -/// Description: Upload files as FormData. -/// Operation: UploadSingleObjectWithFilesAsFormData. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IUploadSingleObjectWithFilesAsFormDataEndpointResult : IEndpointResponse -{ - bool IsOk { get; } - - bool IsBadRequest { get; } - - bool IsUnauthorized { get; } - - bool IsForbidden { get; } - - bool IsInternalServerError { get; } - - string OkContent { get; } - - ValidationProblemDetails BadRequestContent { get; } - - string InternalServerErrorContent { get; } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/UploadMultiFilesAsFormDataEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/UploadMultiFilesAsFormDataEndpoint.verified.cs deleted file mode 100644 index 9c544e6f..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/UploadMultiFilesAsFormDataEndpoint.verified.cs +++ /dev/null @@ -1,50 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint. -/// Description: Upload multi files as form data. -/// Operation: UploadMultiFilesAsFormData. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UploadMultiFilesAsFormDataEndpoint : IUploadMultiFilesAsFormDataEndpoint -{ - private readonly IHttpClientFactory factory; - private readonly IHttpMessageFactory httpMessageFactory; - - public UploadMultiFilesAsFormDataEndpoint( - IHttpClientFactory factory, - IHttpMessageFactory httpMessageFactory) - { - this.factory = factory; - this.httpMessageFactory = httpMessageFactory; - } - - public async Task ExecuteAsync( - UploadMultiFilesAsFormDataParameters parameters, - string httpClientName = "DemoSampleApi-ApiClient", - CancellationToken cancellationToken = default) - { - var client = factory.CreateClient(httpClientName); - - var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/files/form-data/multiFile"); - // TODO: Imp. With-Form - - using var requestMessage = requestBuilder.Build(HttpMethod.Post); - using var response = await client.SendAsync(requestMessage, cancellationToken); - - var responseBuilder = httpMessageFactory.FromResponse(response); - responseBuilder.AddSuccessResponse(HttpStatusCode.OK); - responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); - responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); - responseBuilder.AddErrorResponse(HttpStatusCode.Forbidden); - responseBuilder.AddErrorResponse(HttpStatusCode.InternalServerError); - - return await responseBuilder.BuildResponseAsync(x => new UploadMultiFilesAsFormDataEndpointResult(x), cancellationToken); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/UploadMultiFilesAsFormDataEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/UploadMultiFilesAsFormDataEndpointResult.verified.cs deleted file mode 100644 index 977fc877..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/UploadMultiFilesAsFormDataEndpointResult.verified.cs +++ /dev/null @@ -1,51 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint result. -/// Description: Upload multi files as form data. -/// Operation: UploadMultiFilesAsFormData. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UploadMultiFilesAsFormDataEndpointResult : EndpointResponse, IUploadMultiFilesAsFormDataEndpointResult -{ - public UploadMultiFilesAsFormDataEndpointResult(EndpointResponse response) - : base(response) - { - } - - public bool IsOk - => StatusCode == HttpStatusCode.OK; - - public bool IsBadRequest - => StatusCode == HttpStatusCode.BadRequest; - - public bool IsUnauthorized - => StatusCode == HttpStatusCode.Unauthorized; - - public bool IsForbidden - => StatusCode == HttpStatusCode.Forbidden; - - public bool IsInternalServerError - => StatusCode == HttpStatusCode.InternalServerError; - - public string OkContent - => IsOk && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); - - public ValidationProblemDetails BadRequestContent - => IsBadRequest && ContentObject is ValidationProblemDetails result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); - - public string InternalServerErrorContent - => IsInternalServerError && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsInternalServerError property first."); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/UploadSingleFileAsFormDataEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/UploadSingleFileAsFormDataEndpoint.verified.cs deleted file mode 100644 index f689a25b..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/UploadSingleFileAsFormDataEndpoint.verified.cs +++ /dev/null @@ -1,50 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint. -/// Description: Upload a file as OctetStream. -/// Operation: UploadSingleFileAsFormData. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UploadSingleFileAsFormDataEndpoint : IUploadSingleFileAsFormDataEndpoint -{ - private readonly IHttpClientFactory factory; - private readonly IHttpMessageFactory httpMessageFactory; - - public UploadSingleFileAsFormDataEndpoint( - IHttpClientFactory factory, - IHttpMessageFactory httpMessageFactory) - { - this.factory = factory; - this.httpMessageFactory = httpMessageFactory; - } - - public async Task ExecuteAsync( - UploadSingleFileAsFormDataParameters parameters, - string httpClientName = "DemoSampleApi-ApiClient", - CancellationToken cancellationToken = default) - { - var client = factory.CreateClient(httpClientName); - - var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/files/form-data/singleFile"); - requestBuilder.WithBody(parameters.Request); - - using var requestMessage = requestBuilder.Build(HttpMethod.Post); - using var response = await client.SendAsync(requestMessage, cancellationToken); - - var responseBuilder = httpMessageFactory.FromResponse(response); - responseBuilder.AddSuccessResponse(HttpStatusCode.OK); - responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); - responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); - responseBuilder.AddErrorResponse(HttpStatusCode.Forbidden); - responseBuilder.AddErrorResponse(HttpStatusCode.InternalServerError); - - return await responseBuilder.BuildResponseAsync(x => new UploadSingleFileAsFormDataEndpointResult(x), cancellationToken); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/UploadSingleFileAsFormDataEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/UploadSingleFileAsFormDataEndpointResult.verified.cs deleted file mode 100644 index 8725c21a..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/UploadSingleFileAsFormDataEndpointResult.verified.cs +++ /dev/null @@ -1,51 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint result. -/// Description: Upload a file as OctetStream. -/// Operation: UploadSingleFileAsFormData. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UploadSingleFileAsFormDataEndpointResult : EndpointResponse, IUploadSingleFileAsFormDataEndpointResult -{ - public UploadSingleFileAsFormDataEndpointResult(EndpointResponse response) - : base(response) - { - } - - public bool IsOk - => StatusCode == HttpStatusCode.OK; - - public bool IsBadRequest - => StatusCode == HttpStatusCode.BadRequest; - - public bool IsUnauthorized - => StatusCode == HttpStatusCode.Unauthorized; - - public bool IsForbidden - => StatusCode == HttpStatusCode.Forbidden; - - public bool IsInternalServerError - => StatusCode == HttpStatusCode.InternalServerError; - - public string OkContent - => IsOk && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); - - public ValidationProblemDetails BadRequestContent - => IsBadRequest && ContentObject is ValidationProblemDetails result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); - - public string InternalServerErrorContent - => IsInternalServerError && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsInternalServerError property first."); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/UploadSingleObjectWithFileAsFormDataEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/UploadSingleObjectWithFileAsFormDataEndpoint.verified.cs deleted file mode 100644 index 3bbecac6..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/UploadSingleObjectWithFileAsFormDataEndpoint.verified.cs +++ /dev/null @@ -1,50 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint. -/// Description: Upload a file as FormData. -/// Operation: UploadSingleObjectWithFileAsFormData. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UploadSingleObjectWithFileAsFormDataEndpoint : IUploadSingleObjectWithFileAsFormDataEndpoint -{ - private readonly IHttpClientFactory factory; - private readonly IHttpMessageFactory httpMessageFactory; - - public UploadSingleObjectWithFileAsFormDataEndpoint( - IHttpClientFactory factory, - IHttpMessageFactory httpMessageFactory) - { - this.factory = factory; - this.httpMessageFactory = httpMessageFactory; - } - - public async Task ExecuteAsync( - UploadSingleObjectWithFileAsFormDataParameters parameters, - string httpClientName = "DemoSampleApi-ApiClient", - CancellationToken cancellationToken = default) - { - var client = factory.CreateClient(httpClientName); - - var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/files/form-data/singleObject"); - // TODO: Imp. With-Form - - using var requestMessage = requestBuilder.Build(HttpMethod.Post); - using var response = await client.SendAsync(requestMessage, cancellationToken); - - var responseBuilder = httpMessageFactory.FromResponse(response); - responseBuilder.AddSuccessResponse(HttpStatusCode.OK); - responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); - responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); - responseBuilder.AddErrorResponse(HttpStatusCode.Forbidden); - responseBuilder.AddErrorResponse(HttpStatusCode.InternalServerError); - - return await responseBuilder.BuildResponseAsync(x => new UploadSingleObjectWithFileAsFormDataEndpointResult(x), cancellationToken); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/UploadSingleObjectWithFileAsFormDataEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/UploadSingleObjectWithFileAsFormDataEndpointResult.verified.cs deleted file mode 100644 index d9d98fda..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/UploadSingleObjectWithFileAsFormDataEndpointResult.verified.cs +++ /dev/null @@ -1,51 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint result. -/// Description: Upload a file as FormData. -/// Operation: UploadSingleObjectWithFileAsFormData. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UploadSingleObjectWithFileAsFormDataEndpointResult : EndpointResponse, IUploadSingleObjectWithFileAsFormDataEndpointResult -{ - public UploadSingleObjectWithFileAsFormDataEndpointResult(EndpointResponse response) - : base(response) - { - } - - public bool IsOk - => StatusCode == HttpStatusCode.OK; - - public bool IsBadRequest - => StatusCode == HttpStatusCode.BadRequest; - - public bool IsUnauthorized - => StatusCode == HttpStatusCode.Unauthorized; - - public bool IsForbidden - => StatusCode == HttpStatusCode.Forbidden; - - public bool IsInternalServerError - => StatusCode == HttpStatusCode.InternalServerError; - - public string OkContent - => IsOk && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); - - public ValidationProblemDetails BadRequestContent - => IsBadRequest && ContentObject is ValidationProblemDetails result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); - - public string InternalServerErrorContent - => IsInternalServerError && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsInternalServerError property first."); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/UploadSingleObjectWithFilesAsFormDataEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/UploadSingleObjectWithFilesAsFormDataEndpoint.verified.cs deleted file mode 100644 index 08097ff5..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/UploadSingleObjectWithFilesAsFormDataEndpoint.verified.cs +++ /dev/null @@ -1,50 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint. -/// Description: Upload files as FormData. -/// Operation: UploadSingleObjectWithFilesAsFormData. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UploadSingleObjectWithFilesAsFormDataEndpoint : IUploadSingleObjectWithFilesAsFormDataEndpoint -{ - private readonly IHttpClientFactory factory; - private readonly IHttpMessageFactory httpMessageFactory; - - public UploadSingleObjectWithFilesAsFormDataEndpoint( - IHttpClientFactory factory, - IHttpMessageFactory httpMessageFactory) - { - this.factory = factory; - this.httpMessageFactory = httpMessageFactory; - } - - public async Task ExecuteAsync( - UploadSingleObjectWithFilesAsFormDataParameters parameters, - string httpClientName = "DemoSampleApi-ApiClient", - CancellationToken cancellationToken = default) - { - var client = factory.CreateClient(httpClientName); - - var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/files/form-data/singleObjectMultiFile"); - // TODO: Imp. With-Form - - using var requestMessage = requestBuilder.Build(HttpMethod.Post); - using var response = await client.SendAsync(requestMessage, cancellationToken); - - var responseBuilder = httpMessageFactory.FromResponse(response); - responseBuilder.AddSuccessResponse(HttpStatusCode.OK); - responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); - responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); - responseBuilder.AddErrorResponse(HttpStatusCode.Forbidden); - responseBuilder.AddErrorResponse(HttpStatusCode.InternalServerError); - - return await responseBuilder.BuildResponseAsync(x => new UploadSingleObjectWithFilesAsFormDataEndpointResult(x), cancellationToken); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/UploadSingleObjectWithFilesAsFormDataEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/UploadSingleObjectWithFilesAsFormDataEndpointResult.verified.cs deleted file mode 100644 index 3447e0e0..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Files/UploadSingleObjectWithFilesAsFormDataEndpointResult.verified.cs +++ /dev/null @@ -1,51 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint result. -/// Description: Upload files as FormData. -/// Operation: UploadSingleObjectWithFilesAsFormData. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UploadSingleObjectWithFilesAsFormDataEndpointResult : EndpointResponse, IUploadSingleObjectWithFilesAsFormDataEndpointResult -{ - public UploadSingleObjectWithFilesAsFormDataEndpointResult(EndpointResponse response) - : base(response) - { - } - - public bool IsOk - => StatusCode == HttpStatusCode.OK; - - public bool IsBadRequest - => StatusCode == HttpStatusCode.BadRequest; - - public bool IsUnauthorized - => StatusCode == HttpStatusCode.Unauthorized; - - public bool IsForbidden - => StatusCode == HttpStatusCode.Forbidden; - - public bool IsInternalServerError - => StatusCode == HttpStatusCode.InternalServerError; - - public string OkContent - => IsOk && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); - - public ValidationProblemDetails BadRequestContent - => IsBadRequest && ContentObject is ValidationProblemDetails result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); - - public string InternalServerErrorContent - => IsInternalServerError && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsInternalServerError property first."); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Items/CreateItemEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Items/CreateItemEndpoint.verified.cs deleted file mode 100644 index 893e81ba..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Items/CreateItemEndpoint.verified.cs +++ /dev/null @@ -1,50 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint. -/// Description: Create a new item. -/// Operation: CreateItem. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class CreateItemEndpoint : ICreateItemEndpoint -{ - private readonly IHttpClientFactory factory; - private readonly IHttpMessageFactory httpMessageFactory; - - public CreateItemEndpoint( - IHttpClientFactory factory, - IHttpMessageFactory httpMessageFactory) - { - this.factory = factory; - this.httpMessageFactory = httpMessageFactory; - } - - public async Task ExecuteAsync( - CreateItemParameters parameters, - string httpClientName = "DemoSampleApi-ApiClient", - CancellationToken cancellationToken = default) - { - var client = factory.CreateClient(httpClientName); - - var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/items"); - requestBuilder.WithBody(parameters.Request); - - using var requestMessage = requestBuilder.Build(HttpMethod.Post); - using var response = await client.SendAsync(requestMessage, cancellationToken); - - var responseBuilder = httpMessageFactory.FromResponse(response); - responseBuilder.AddSuccessResponse(HttpStatusCode.OK); - responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); - responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); - responseBuilder.AddErrorResponse(HttpStatusCode.Forbidden); - responseBuilder.AddErrorResponse(HttpStatusCode.InternalServerError); - - return await responseBuilder.BuildResponseAsync(x => new CreateItemEndpointResult(x), cancellationToken); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Items/CreateItemEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Items/CreateItemEndpointResult.verified.cs deleted file mode 100644 index 22850762..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Items/CreateItemEndpointResult.verified.cs +++ /dev/null @@ -1,51 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint result. -/// Description: Create a new item. -/// Operation: CreateItem. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class CreateItemEndpointResult : EndpointResponse, ICreateItemEndpointResult -{ - public CreateItemEndpointResult(EndpointResponse response) - : base(response) - { - } - - public bool IsOk - => StatusCode == HttpStatusCode.OK; - - public bool IsBadRequest - => StatusCode == HttpStatusCode.BadRequest; - - public bool IsUnauthorized - => StatusCode == HttpStatusCode.Unauthorized; - - public bool IsForbidden - => StatusCode == HttpStatusCode.Forbidden; - - public bool IsInternalServerError - => StatusCode == HttpStatusCode.InternalServerError; - - public string OkContent - => IsOk && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); - - public ValidationProblemDetails BadRequestContent - => IsBadRequest && ContentObject is ValidationProblemDetails result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); - - public string InternalServerErrorContent - => IsInternalServerError && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsInternalServerError property first."); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Items/Interfaces/ICreateItemEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Items/Interfaces/ICreateItemEndpoint.verified.cs deleted file mode 100644 index 477be0cb..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Items/Interfaces/ICreateItemEndpoint.verified.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint. -/// Description: Create a new item. -/// Operation: CreateItem. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface ICreateItemEndpoint -{ - /// - /// Execute method. - /// - /// The parameters. - /// The http client name. - /// The cancellation token. - Task ExecuteAsync( - CreateItemParameters parameters, - string httpClientName = "DemoSampleApi-ApiClient", - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Items/Interfaces/ICreateItemEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Items/Interfaces/ICreateItemEndpointResult.verified.cs deleted file mode 100644 index 4efed2f0..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Items/Interfaces/ICreateItemEndpointResult.verified.cs +++ /dev/null @@ -1,32 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint Result. -/// Description: Create a new item. -/// Operation: CreateItem. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface ICreateItemEndpointResult : IEndpointResponse -{ - bool IsOk { get; } - - bool IsBadRequest { get; } - - bool IsUnauthorized { get; } - - bool IsForbidden { get; } - - bool IsInternalServerError { get; } - - string OkContent { get; } - - ValidationProblemDetails BadRequestContent { get; } - - string InternalServerErrorContent { get; } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Items/Interfaces/IUpdateItemEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Items/Interfaces/IUpdateItemEndpoint.verified.cs deleted file mode 100644 index 547d3900..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Items/Interfaces/IUpdateItemEndpoint.verified.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint. -/// Description: Updates an item. -/// Operation: UpdateItem. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IUpdateItemEndpoint -{ - /// - /// Execute method. - /// - /// The parameters. - /// The http client name. - /// The cancellation token. - Task ExecuteAsync( - UpdateItemParameters parameters, - string httpClientName = "DemoSampleApi-ApiClient", - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Items/Interfaces/IUpdateItemEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Items/Interfaces/IUpdateItemEndpointResult.verified.cs deleted file mode 100644 index 80f047ad..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Items/Interfaces/IUpdateItemEndpointResult.verified.cs +++ /dev/null @@ -1,32 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint Result. -/// Description: Updates an item. -/// Operation: UpdateItem. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IUpdateItemEndpointResult : IEndpointResponse -{ - bool IsOk { get; } - - bool IsBadRequest { get; } - - bool IsUnauthorized { get; } - - bool IsForbidden { get; } - - bool IsInternalServerError { get; } - - Guid OkContent { get; } - - ValidationProblemDetails BadRequestContent { get; } - - string InternalServerErrorContent { get; } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Items/UpdateItemEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Items/UpdateItemEndpoint.verified.cs deleted file mode 100644 index f9135bb5..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Items/UpdateItemEndpoint.verified.cs +++ /dev/null @@ -1,51 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint. -/// Description: Updates an item. -/// Operation: UpdateItem. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UpdateItemEndpoint : IUpdateItemEndpoint -{ - private readonly IHttpClientFactory factory; - private readonly IHttpMessageFactory httpMessageFactory; - - public UpdateItemEndpoint( - IHttpClientFactory factory, - IHttpMessageFactory httpMessageFactory) - { - this.factory = factory; - this.httpMessageFactory = httpMessageFactory; - } - - public async Task ExecuteAsync( - UpdateItemParameters parameters, - string httpClientName = "DemoSampleApi-ApiClient", - CancellationToken cancellationToken = default) - { - var client = factory.CreateClient(httpClientName); - - var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/items/{id}"); - requestBuilder.WithPathParameter("id", parameters.Id); - requestBuilder.WithBody(parameters.Request); - - using var requestMessage = requestBuilder.Build(HttpMethod.Put); - using var response = await client.SendAsync(requestMessage, cancellationToken); - - var responseBuilder = httpMessageFactory.FromResponse(response); - responseBuilder.AddSuccessResponse(HttpStatusCode.OK); - responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); - responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); - responseBuilder.AddErrorResponse(HttpStatusCode.Forbidden); - responseBuilder.AddErrorResponse(HttpStatusCode.InternalServerError); - - return await responseBuilder.BuildResponseAsync(x => new UpdateItemEndpointResult(x), cancellationToken); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Items/UpdateItemEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Items/UpdateItemEndpointResult.verified.cs deleted file mode 100644 index 0ecd311d..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Items/UpdateItemEndpointResult.verified.cs +++ /dev/null @@ -1,51 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint result. -/// Description: Updates an item. -/// Operation: UpdateItem. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UpdateItemEndpointResult : EndpointResponse, IUpdateItemEndpointResult -{ - public UpdateItemEndpointResult(EndpointResponse response) - : base(response) - { - } - - public bool IsOk - => StatusCode == HttpStatusCode.OK; - - public bool IsBadRequest - => StatusCode == HttpStatusCode.BadRequest; - - public bool IsUnauthorized - => StatusCode == HttpStatusCode.Unauthorized; - - public bool IsForbidden - => StatusCode == HttpStatusCode.Forbidden; - - public bool IsInternalServerError - => StatusCode == HttpStatusCode.InternalServerError; - - public Guid OkContent - => IsOk && ContentObject is Guid result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); - - public ValidationProblemDetails BadRequestContent - => IsBadRequest && ContentObject is ValidationProblemDetails result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); - - public string InternalServerErrorContent - => IsInternalServerError && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsInternalServerError property first."); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Orders/GetOrderByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Orders/GetOrderByIdEndpoint.verified.cs deleted file mode 100644 index a74f1b6c..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Orders/GetOrderByIdEndpoint.verified.cs +++ /dev/null @@ -1,52 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint. -/// Description: Get order by id. -/// Operation: GetOrderById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetOrderByIdEndpoint : IGetOrderByIdEndpoint -{ - private readonly IHttpClientFactory factory; - private readonly IHttpMessageFactory httpMessageFactory; - - public GetOrderByIdEndpoint( - IHttpClientFactory factory, - IHttpMessageFactory httpMessageFactory) - { - this.factory = factory; - this.httpMessageFactory = httpMessageFactory; - } - - public async Task ExecuteAsync( - GetOrderByIdParameters parameters, - string httpClientName = "DemoSampleApi-ApiClient", - CancellationToken cancellationToken = default) - { - var client = factory.CreateClient(httpClientName); - - var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/orders/{id}"); - requestBuilder.WithPathParameter("id", parameters.Id); - requestBuilder.WithQueryParameter("myEmail", parameters.MyEmail); - - using var requestMessage = requestBuilder.Build(HttpMethod.Get); - using var response = await client.SendAsync(requestMessage, cancellationToken); - - var responseBuilder = httpMessageFactory.FromResponse(response); - responseBuilder.AddSuccessResponse(HttpStatusCode.OK); - responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); - responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); - responseBuilder.AddErrorResponse(HttpStatusCode.Forbidden); - responseBuilder.AddErrorResponse(HttpStatusCode.NotFound); - responseBuilder.AddErrorResponse(HttpStatusCode.InternalServerError); - - return await responseBuilder.BuildResponseAsync(x => new GetOrderByIdEndpointResult(x), cancellationToken); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Orders/GetOrderByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Orders/GetOrderByIdEndpointResult.verified.cs deleted file mode 100644 index c0c88c51..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Orders/GetOrderByIdEndpointResult.verified.cs +++ /dev/null @@ -1,59 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint result. -/// Description: Get order by id. -/// Operation: GetOrderById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetOrderByIdEndpointResult : EndpointResponse, IGetOrderByIdEndpointResult -{ - public GetOrderByIdEndpointResult(EndpointResponse response) - : base(response) - { - } - - public bool IsOk - => StatusCode == HttpStatusCode.OK; - - public bool IsBadRequest - => StatusCode == HttpStatusCode.BadRequest; - - public bool IsUnauthorized - => StatusCode == HttpStatusCode.Unauthorized; - - public bool IsForbidden - => StatusCode == HttpStatusCode.Forbidden; - - public bool IsNotFound - => StatusCode == HttpStatusCode.NotFound; - - public bool IsInternalServerError - => StatusCode == HttpStatusCode.InternalServerError; - - public Order OkContent - => IsOk && ContentObject is Order result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); - - public ValidationProblemDetails BadRequestContent - => IsBadRequest && ContentObject is ValidationProblemDetails result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); - - public string NotFoundContent - => IsNotFound && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsNotFound property first."); - - public string InternalServerErrorContent - => IsInternalServerError && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsInternalServerError property first."); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Orders/GetOrdersEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Orders/GetOrdersEndpoint.verified.cs deleted file mode 100644 index 04abd65b..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Orders/GetOrdersEndpoint.verified.cs +++ /dev/null @@ -1,59 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint. -/// Description: Get orders. -/// Operation: GetOrders. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetOrdersEndpoint : IGetOrdersEndpoint -{ - private readonly IHttpClientFactory factory; - private readonly IHttpMessageFactory httpMessageFactory; - - public GetOrdersEndpoint( - IHttpClientFactory factory, - IHttpMessageFactory httpMessageFactory) - { - this.factory = factory; - this.httpMessageFactory = httpMessageFactory; - } - - public async Task ExecuteAsync( - GetOrdersParameters parameters, - string httpClientName = "DemoSampleApi-ApiClient", - CancellationToken cancellationToken = default) - { - var client = factory.CreateClient(httpClientName); - - var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/orders"); - requestBuilder.WithQueryParameter("pageSize", parameters.PageSize); - requestBuilder.WithQueryParameter("pageIndex", parameters.PageIndex); - requestBuilder.WithQueryParameter("queryString", parameters.QueryString); - if (parameters.QueryStringArray.Any()) - { - requestBuilder.WithQueryParameter("queryStringArray", parameters.QueryStringArray); - } - - requestBuilder.WithQueryParameter("continuationToken", parameters.ContinuationToken); - - using var requestMessage = requestBuilder.Build(HttpMethod.Get); - using var response = await client.SendAsync(requestMessage, cancellationToken); - - var responseBuilder = httpMessageFactory.FromResponse(response); - responseBuilder.AddSuccessResponse(HttpStatusCode.OK); - responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); - responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); - responseBuilder.AddErrorResponse(HttpStatusCode.Forbidden); - responseBuilder.AddErrorResponse(HttpStatusCode.NotFound); - responseBuilder.AddErrorResponse(HttpStatusCode.InternalServerError); - - return await responseBuilder.BuildResponseAsync(x => new GetOrdersEndpointResult(x), cancellationToken); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Orders/GetOrdersEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Orders/GetOrdersEndpointResult.verified.cs deleted file mode 100644 index 2728a85e..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Orders/GetOrdersEndpointResult.verified.cs +++ /dev/null @@ -1,59 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint result. -/// Description: Get orders. -/// Operation: GetOrders. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetOrdersEndpointResult : EndpointResponse, IGetOrdersEndpointResult -{ - public GetOrdersEndpointResult(EndpointResponse response) - : base(response) - { - } - - public bool IsOk - => StatusCode == HttpStatusCode.OK; - - public bool IsBadRequest - => StatusCode == HttpStatusCode.BadRequest; - - public bool IsUnauthorized - => StatusCode == HttpStatusCode.Unauthorized; - - public bool IsForbidden - => StatusCode == HttpStatusCode.Forbidden; - - public bool IsNotFound - => StatusCode == HttpStatusCode.NotFound; - - public bool IsInternalServerError - => StatusCode == HttpStatusCode.InternalServerError; - - public Order OkContent - => IsOk && ContentObject is Order result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); - - public ValidationProblemDetails BadRequestContent - => IsBadRequest && ContentObject is ValidationProblemDetails result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); - - public string NotFoundContent - => IsNotFound && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsNotFound property first."); - - public string InternalServerErrorContent - => IsInternalServerError && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsInternalServerError property first."); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrderByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrderByIdEndpoint.verified.cs deleted file mode 100644 index b1bd1816..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrderByIdEndpoint.verified.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint. -/// Description: Get order by id. -/// Operation: GetOrderById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetOrderByIdEndpoint -{ - /// - /// Execute method. - /// - /// The parameters. - /// The http client name. - /// The cancellation token. - Task ExecuteAsync( - GetOrderByIdParameters parameters, - string httpClientName = "DemoSampleApi-ApiClient", - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrderByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrderByIdEndpointResult.verified.cs deleted file mode 100644 index cba491cb..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrderByIdEndpointResult.verified.cs +++ /dev/null @@ -1,36 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint Result. -/// Description: Get order by id. -/// Operation: GetOrderById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetOrderByIdEndpointResult : IEndpointResponse -{ - bool IsOk { get; } - - bool IsBadRequest { get; } - - bool IsUnauthorized { get; } - - bool IsForbidden { get; } - - bool IsNotFound { get; } - - bool IsInternalServerError { get; } - - Order OkContent { get; } - - ValidationProblemDetails BadRequestContent { get; } - - string NotFoundContent { get; } - - string InternalServerErrorContent { get; } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrdersEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrdersEndpoint.verified.cs deleted file mode 100644 index 7ca7517d..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrdersEndpoint.verified.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint. -/// Description: Get orders. -/// Operation: GetOrders. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetOrdersEndpoint -{ - /// - /// Execute method. - /// - /// The parameters. - /// The http client name. - /// The cancellation token. - Task ExecuteAsync( - GetOrdersParameters parameters, - string httpClientName = "DemoSampleApi-ApiClient", - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrdersEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrdersEndpointResult.verified.cs deleted file mode 100644 index a68ebc9c..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrdersEndpointResult.verified.cs +++ /dev/null @@ -1,36 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint Result. -/// Description: Get orders. -/// Operation: GetOrders. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetOrdersEndpointResult : IEndpointResponse -{ - bool IsOk { get; } - - bool IsBadRequest { get; } - - bool IsUnauthorized { get; } - - bool IsForbidden { get; } - - bool IsNotFound { get; } - - bool IsInternalServerError { get; } - - Order OkContent { get; } - - ValidationProblemDetails BadRequestContent { get; } - - string NotFoundContent { get; } - - string InternalServerErrorContent { get; } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Orders/Interfaces/IPatchOrdersIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Orders/Interfaces/IPatchOrdersIdEndpoint.verified.cs deleted file mode 100644 index 2d380522..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Orders/Interfaces/IPatchOrdersIdEndpoint.verified.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint. -/// Description: Update part of order by id. -/// Operation: PatchOrdersId. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IPatchOrdersIdEndpoint -{ - /// - /// Execute method. - /// - /// The parameters. - /// The http client name. - /// The cancellation token. - Task ExecuteAsync( - PatchOrdersIdParameters parameters, - string httpClientName = "DemoSampleApi-ApiClient", - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Orders/Interfaces/IPatchOrdersIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Orders/Interfaces/IPatchOrdersIdEndpointResult.verified.cs deleted file mode 100644 index 264c6464..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Orders/Interfaces/IPatchOrdersIdEndpointResult.verified.cs +++ /dev/null @@ -1,44 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint Result. -/// Description: Update part of order by id. -/// Operation: PatchOrdersId. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IPatchOrdersIdEndpointResult : IEndpointResponse -{ - bool IsOk { get; } - - bool IsBadRequest { get; } - - bool IsUnauthorized { get; } - - bool IsForbidden { get; } - - bool IsNotFound { get; } - - bool IsConflict { get; } - - bool IsInternalServerError { get; } - - bool IsBadGateway { get; } - - string OkContent { get; } - - ValidationProblemDetails BadRequestContent { get; } - - string NotFoundContent { get; } - - string ConflictContent { get; } - - string InternalServerErrorContent { get; } - - string BadGatewayContent { get; } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Orders/PatchOrdersIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Orders/PatchOrdersIdEndpoint.verified.cs deleted file mode 100644 index 46804e15..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Orders/PatchOrdersIdEndpoint.verified.cs +++ /dev/null @@ -1,58 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint. -/// Description: Update part of order by id. -/// Operation: PatchOrdersId. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class PatchOrdersIdEndpoint : IPatchOrdersIdEndpoint -{ - private readonly IHttpClientFactory factory; - private readonly IHttpMessageFactory httpMessageFactory; - - public PatchOrdersIdEndpoint( - IHttpClientFactory factory, - IHttpMessageFactory httpMessageFactory) - { - this.factory = factory; - this.httpMessageFactory = httpMessageFactory; - } - - public async Task ExecuteAsync( - PatchOrdersIdParameters parameters, - string httpClientName = "DemoSampleApi-ApiClient", - CancellationToken cancellationToken = default) - { - var client = factory.CreateClient(httpClientName); - - var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/orders/{id}"); - requestBuilder.WithPathParameter("id", parameters.Id); - requestBuilder.WithHeaderParameter("myTestHeader", parameters.MyTestHeader); - requestBuilder.WithHeaderParameter("myTestHeaderBool", parameters.MyTestHeaderBool); - requestBuilder.WithHeaderParameter("myTestHeaderInt", parameters.MyTestHeaderInt); - requestBuilder.WithHeaderParameter("x-correlation-id", parameters.CorrelationId); - requestBuilder.WithBody(parameters.Request); - - using var requestMessage = requestBuilder.Build(HttpMethod.Patch); - using var response = await client.SendAsync(requestMessage, cancellationToken); - - var responseBuilder = httpMessageFactory.FromResponse(response); - responseBuilder.AddSuccessResponse(HttpStatusCode.OK); - responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); - responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); - responseBuilder.AddErrorResponse(HttpStatusCode.Forbidden); - responseBuilder.AddErrorResponse(HttpStatusCode.NotFound); - responseBuilder.AddErrorResponse(HttpStatusCode.Conflict); - responseBuilder.AddErrorResponse(HttpStatusCode.InternalServerError); - responseBuilder.AddErrorResponse(HttpStatusCode.BadGateway); - - return await responseBuilder.BuildResponseAsync(x => new PatchOrdersIdEndpointResult(x), cancellationToken); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Orders/PatchOrdersIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Orders/PatchOrdersIdEndpointResult.verified.cs deleted file mode 100644 index 713c0b46..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Orders/PatchOrdersIdEndpointResult.verified.cs +++ /dev/null @@ -1,75 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint result. -/// Description: Update part of order by id. -/// Operation: PatchOrdersId. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class PatchOrdersIdEndpointResult : EndpointResponse, IPatchOrdersIdEndpointResult -{ - public PatchOrdersIdEndpointResult(EndpointResponse response) - : base(response) - { - } - - public bool IsOk - => StatusCode == HttpStatusCode.OK; - - public bool IsBadRequest - => StatusCode == HttpStatusCode.BadRequest; - - public bool IsUnauthorized - => StatusCode == HttpStatusCode.Unauthorized; - - public bool IsForbidden - => StatusCode == HttpStatusCode.Forbidden; - - public bool IsNotFound - => StatusCode == HttpStatusCode.NotFound; - - public bool IsConflict - => StatusCode == HttpStatusCode.Conflict; - - public bool IsInternalServerError - => StatusCode == HttpStatusCode.InternalServerError; - - public bool IsBadGateway - => StatusCode == HttpStatusCode.BadGateway; - - public string OkContent - => IsOk && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); - - public ValidationProblemDetails BadRequestContent - => IsBadRequest && ContentObject is ValidationProblemDetails result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); - - public string NotFoundContent - => IsNotFound && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsNotFound property first."); - - public string ConflictContent - => IsConflict && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsConflict property first."); - - public string InternalServerErrorContent - => IsInternalServerError && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsInternalServerError property first."); - - public string BadGatewayContent - => IsBadGateway && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsBadGateway property first."); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/RouteWithDash/GetRouteWithDashEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/RouteWithDash/GetRouteWithDashEndpoint.verified.cs deleted file mode 100644 index 438684eb..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/RouteWithDash/GetRouteWithDashEndpoint.verified.cs +++ /dev/null @@ -1,47 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint. -/// Description: Your GET endpoint. -/// Operation: GetRouteWithDash. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetRouteWithDashEndpoint : IGetRouteWithDashEndpoint -{ - private readonly IHttpClientFactory factory; - private readonly IHttpMessageFactory httpMessageFactory; - - public GetRouteWithDashEndpoint( - IHttpClientFactory factory, - IHttpMessageFactory httpMessageFactory) - { - this.factory = factory; - this.httpMessageFactory = httpMessageFactory; - } - - public async Task ExecuteAsync( - string httpClientName = "DemoSampleApi-ApiClient", - CancellationToken cancellationToken = default) - { - var client = factory.CreateClient(httpClientName); - - var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/route-with-dash"); - - using var requestMessage = requestBuilder.Build(HttpMethod.Get); - using var response = await client.SendAsync(requestMessage, cancellationToken); - - var responseBuilder = httpMessageFactory.FromResponse(response); - responseBuilder.AddSuccessResponse(HttpStatusCode.OK); - responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); - responseBuilder.AddErrorResponse(HttpStatusCode.Forbidden); - responseBuilder.AddErrorResponse(HttpStatusCode.InternalServerError); - - return await responseBuilder.BuildResponseAsync(x => new GetRouteWithDashEndpointResult(x), cancellationToken); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/RouteWithDash/GetRouteWithDashEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/RouteWithDash/GetRouteWithDashEndpointResult.verified.cs deleted file mode 100644 index 577cfec0..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/RouteWithDash/GetRouteWithDashEndpointResult.verified.cs +++ /dev/null @@ -1,43 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint result. -/// Description: Your GET endpoint. -/// Operation: GetRouteWithDash. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetRouteWithDashEndpointResult : EndpointResponse, IGetRouteWithDashEndpointResult -{ - public GetRouteWithDashEndpointResult(EndpointResponse response) - : base(response) - { - } - - public bool IsOk - => StatusCode == HttpStatusCode.OK; - - public bool IsUnauthorized - => StatusCode == HttpStatusCode.Unauthorized; - - public bool IsForbidden - => StatusCode == HttpStatusCode.Forbidden; - - public bool IsInternalServerError - => StatusCode == HttpStatusCode.InternalServerError; - - public string OkContent - => IsOk && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); - - public string InternalServerErrorContent - => IsInternalServerError && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsInternalServerError property first."); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/RouteWithDash/Interfaces/IGetRouteWithDashEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/RouteWithDash/Interfaces/IGetRouteWithDashEndpoint.verified.cs deleted file mode 100644 index da4c01ad..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/RouteWithDash/Interfaces/IGetRouteWithDashEndpoint.verified.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint. -/// Description: Your GET endpoint. -/// Operation: GetRouteWithDash. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetRouteWithDashEndpoint -{ - /// - /// Execute method. - /// - /// The http client name. - /// The cancellation token. - Task ExecuteAsync( - string httpClientName = "DemoSampleApi-ApiClient", - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/RouteWithDash/Interfaces/IGetRouteWithDashEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/RouteWithDash/Interfaces/IGetRouteWithDashEndpointResult.verified.cs deleted file mode 100644 index c090ddf6..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/RouteWithDash/Interfaces/IGetRouteWithDashEndpointResult.verified.cs +++ /dev/null @@ -1,28 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint Result. -/// Description: Your GET endpoint. -/// Operation: GetRouteWithDash. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetRouteWithDashEndpointResult : IEndpointResponse -{ - bool IsOk { get; } - - bool IsUnauthorized { get; } - - bool IsForbidden { get; } - - bool IsInternalServerError { get; } - - string OkContent { get; } - - string InternalServerErrorContent { get; } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Tasks/GetTasksEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Tasks/GetTasksEndpoint.verified.cs deleted file mode 100644 index 0470c72c..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Tasks/GetTasksEndpoint.verified.cs +++ /dev/null @@ -1,47 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint. -/// Description: Returns tasks. -/// Operation: GetTasks. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetTasksEndpoint : IGetTasksEndpoint -{ - private readonly IHttpClientFactory factory; - private readonly IHttpMessageFactory httpMessageFactory; - - public GetTasksEndpoint( - IHttpClientFactory factory, - IHttpMessageFactory httpMessageFactory) - { - this.factory = factory; - this.httpMessageFactory = httpMessageFactory; - } - - public async Task ExecuteAsync( - string httpClientName = "DemoSampleApi-ApiClient", - CancellationToken cancellationToken = default) - { - var client = factory.CreateClient(httpClientName); - - var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/tasks"); - - using var requestMessage = requestBuilder.Build(HttpMethod.Get); - using var response = await client.SendAsync(requestMessage, cancellationToken); - - var responseBuilder = httpMessageFactory.FromResponse(response); - responseBuilder.AddSuccessResponse>(HttpStatusCode.OK); - responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); - responseBuilder.AddErrorResponse(HttpStatusCode.Forbidden); - responseBuilder.AddErrorResponse(HttpStatusCode.InternalServerError); - - return await responseBuilder.BuildResponseAsync(x => new GetTasksEndpointResult(x), cancellationToken); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Tasks/GetTasksEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Tasks/GetTasksEndpointResult.verified.cs deleted file mode 100644 index b73b3879..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Tasks/GetTasksEndpointResult.verified.cs +++ /dev/null @@ -1,43 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint result. -/// Description: Returns tasks. -/// Operation: GetTasks. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetTasksEndpointResult : EndpointResponse, IGetTasksEndpointResult -{ - public GetTasksEndpointResult(EndpointResponse response) - : base(response) - { - } - - public bool IsOk - => StatusCode == HttpStatusCode.OK; - - public bool IsUnauthorized - => StatusCode == HttpStatusCode.Unauthorized; - - public bool IsForbidden - => StatusCode == HttpStatusCode.Forbidden; - - public bool IsInternalServerError - => StatusCode == HttpStatusCode.InternalServerError; - - public List OkContent - => IsOk && ContentObject is List result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); - - public string InternalServerErrorContent - => IsInternalServerError && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsInternalServerError property first."); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Tasks/Interfaces/IGetTasksEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Tasks/Interfaces/IGetTasksEndpoint.verified.cs deleted file mode 100644 index 6e2591da..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Tasks/Interfaces/IGetTasksEndpoint.verified.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint. -/// Description: Returns tasks. -/// Operation: GetTasks. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetTasksEndpoint -{ - /// - /// Execute method. - /// - /// The http client name. - /// The cancellation token. - Task ExecuteAsync( - string httpClientName = "DemoSampleApi-ApiClient", - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Tasks/Interfaces/IGetTasksEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Tasks/Interfaces/IGetTasksEndpointResult.verified.cs deleted file mode 100644 index 34abdebb..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Tasks/Interfaces/IGetTasksEndpointResult.verified.cs +++ /dev/null @@ -1,28 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint Result. -/// Description: Returns tasks. -/// Operation: GetTasks. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetTasksEndpointResult : IEndpointResponse -{ - bool IsOk { get; } - - bool IsUnauthorized { get; } - - bool IsForbidden { get; } - - bool IsInternalServerError { get; } - - List OkContent { get; } - - string InternalServerErrorContent { get; } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/DeleteUserByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/DeleteUserByIdEndpoint.verified.cs deleted file mode 100644 index 0076aa3a..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/DeleteUserByIdEndpoint.verified.cs +++ /dev/null @@ -1,52 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint. -/// Description: Delete user by id. -/// Operation: DeleteUserById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class DeleteUserByIdEndpoint : IDeleteUserByIdEndpoint -{ - private readonly IHttpClientFactory factory; - private readonly IHttpMessageFactory httpMessageFactory; - - public DeleteUserByIdEndpoint( - IHttpClientFactory factory, - IHttpMessageFactory httpMessageFactory) - { - this.factory = factory; - this.httpMessageFactory = httpMessageFactory; - } - - public async Task ExecuteAsync( - DeleteUserByIdParameters parameters, - string httpClientName = "DemoSampleApi-ApiClient", - CancellationToken cancellationToken = default) - { - var client = factory.CreateClient(httpClientName); - - var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/users/{id}"); - requestBuilder.WithPathParameter("id", parameters.Id); - - using var requestMessage = requestBuilder.Build(HttpMethod.Delete); - using var response = await client.SendAsync(requestMessage, cancellationToken); - - var responseBuilder = httpMessageFactory.FromResponse(response); - responseBuilder.AddSuccessResponse(HttpStatusCode.OK); - responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); - responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); - responseBuilder.AddErrorResponse(HttpStatusCode.Forbidden); - responseBuilder.AddErrorResponse(HttpStatusCode.NotFound); - responseBuilder.AddErrorResponse(HttpStatusCode.Conflict); - responseBuilder.AddErrorResponse(HttpStatusCode.InternalServerError); - - return await responseBuilder.BuildResponseAsync(x => new DeleteUserByIdEndpointResult(x), cancellationToken); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/DeleteUserByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/DeleteUserByIdEndpointResult.verified.cs deleted file mode 100644 index c3876666..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/DeleteUserByIdEndpointResult.verified.cs +++ /dev/null @@ -1,67 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint result. -/// Description: Delete user by id. -/// Operation: DeleteUserById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class DeleteUserByIdEndpointResult : EndpointResponse, IDeleteUserByIdEndpointResult -{ - public DeleteUserByIdEndpointResult(EndpointResponse response) - : base(response) - { - } - - public bool IsOk - => StatusCode == HttpStatusCode.OK; - - public bool IsBadRequest - => StatusCode == HttpStatusCode.BadRequest; - - public bool IsUnauthorized - => StatusCode == HttpStatusCode.Unauthorized; - - public bool IsForbidden - => StatusCode == HttpStatusCode.Forbidden; - - public bool IsNotFound - => StatusCode == HttpStatusCode.NotFound; - - public bool IsConflict - => StatusCode == HttpStatusCode.Conflict; - - public bool IsInternalServerError - => StatusCode == HttpStatusCode.InternalServerError; - - public string OkContent - => IsOk && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); - - public ValidationProblemDetails BadRequestContent - => IsBadRequest && ContentObject is ValidationProblemDetails result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); - - public string NotFoundContent - => IsNotFound && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsNotFound property first."); - - public string ConflictContent - => IsConflict && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsConflict property first."); - - public string InternalServerErrorContent - => IsInternalServerError && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsInternalServerError property first."); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/GetUserByEmailEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/GetUserByEmailEndpoint.verified.cs deleted file mode 100644 index 03817ca7..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/GetUserByEmailEndpoint.verified.cs +++ /dev/null @@ -1,52 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint. -/// Description: Get user by email. -/// Operation: GetUserByEmail. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetUserByEmailEndpoint : IGetUserByEmailEndpoint -{ - private readonly IHttpClientFactory factory; - private readonly IHttpMessageFactory httpMessageFactory; - - public GetUserByEmailEndpoint( - IHttpClientFactory factory, - IHttpMessageFactory httpMessageFactory) - { - this.factory = factory; - this.httpMessageFactory = httpMessageFactory; - } - - public async Task ExecuteAsync( - GetUserByEmailParameters parameters, - string httpClientName = "DemoSampleApi-ApiClient", - CancellationToken cancellationToken = default) - { - var client = factory.CreateClient(httpClientName); - - var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/users/email"); - requestBuilder.WithQueryParameter("email", parameters.Email); - - using var requestMessage = requestBuilder.Build(HttpMethod.Get); - using var response = await client.SendAsync(requestMessage, cancellationToken); - - var responseBuilder = httpMessageFactory.FromResponse(response); - responseBuilder.AddSuccessResponse(HttpStatusCode.OK); - responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); - responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); - responseBuilder.AddErrorResponse(HttpStatusCode.Forbidden); - responseBuilder.AddErrorResponse(HttpStatusCode.NotFound); - responseBuilder.AddErrorResponse(HttpStatusCode.Conflict); - responseBuilder.AddErrorResponse(HttpStatusCode.InternalServerError); - - return await responseBuilder.BuildResponseAsync(x => new GetUserByEmailEndpointResult(x), cancellationToken); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/GetUserByEmailEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/GetUserByEmailEndpointResult.verified.cs deleted file mode 100644 index c8571f47..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/GetUserByEmailEndpointResult.verified.cs +++ /dev/null @@ -1,67 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint result. -/// Description: Get user by email. -/// Operation: GetUserByEmail. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetUserByEmailEndpointResult : EndpointResponse, IGetUserByEmailEndpointResult -{ - public GetUserByEmailEndpointResult(EndpointResponse response) - : base(response) - { - } - - public bool IsOk - => StatusCode == HttpStatusCode.OK; - - public bool IsBadRequest - => StatusCode == HttpStatusCode.BadRequest; - - public bool IsUnauthorized - => StatusCode == HttpStatusCode.Unauthorized; - - public bool IsForbidden - => StatusCode == HttpStatusCode.Forbidden; - - public bool IsNotFound - => StatusCode == HttpStatusCode.NotFound; - - public bool IsConflict - => StatusCode == HttpStatusCode.Conflict; - - public bool IsInternalServerError - => StatusCode == HttpStatusCode.InternalServerError; - - public User OkContent - => IsOk && ContentObject is User result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); - - public ValidationProblemDetails BadRequestContent - => IsBadRequest && ContentObject is ValidationProblemDetails result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); - - public string NotFoundContent - => IsNotFound && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsNotFound property first."); - - public string ConflictContent - => IsConflict && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsConflict property first."); - - public string InternalServerErrorContent - => IsInternalServerError && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsInternalServerError property first."); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/GetUserByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/GetUserByIdEndpoint.verified.cs deleted file mode 100644 index 490ac398..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/GetUserByIdEndpoint.verified.cs +++ /dev/null @@ -1,52 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint. -/// Description: Get user by id. -/// Operation: GetUserById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetUserByIdEndpoint : IGetUserByIdEndpoint -{ - private readonly IHttpClientFactory factory; - private readonly IHttpMessageFactory httpMessageFactory; - - public GetUserByIdEndpoint( - IHttpClientFactory factory, - IHttpMessageFactory httpMessageFactory) - { - this.factory = factory; - this.httpMessageFactory = httpMessageFactory; - } - - public async Task ExecuteAsync( - GetUserByIdParameters parameters, - string httpClientName = "DemoSampleApi-ApiClient", - CancellationToken cancellationToken = default) - { - var client = factory.CreateClient(httpClientName); - - var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/users/{id}"); - requestBuilder.WithPathParameter("id", parameters.Id); - - using var requestMessage = requestBuilder.Build(HttpMethod.Get); - using var response = await client.SendAsync(requestMessage, cancellationToken); - - var responseBuilder = httpMessageFactory.FromResponse(response); - responseBuilder.AddSuccessResponse(HttpStatusCode.OK); - responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); - responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); - responseBuilder.AddErrorResponse(HttpStatusCode.Forbidden); - responseBuilder.AddErrorResponse(HttpStatusCode.NotFound); - responseBuilder.AddErrorResponse(HttpStatusCode.Conflict); - responseBuilder.AddErrorResponse(HttpStatusCode.InternalServerError); - - return await responseBuilder.BuildResponseAsync(x => new GetUserByIdEndpointResult(x), cancellationToken); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/GetUserByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/GetUserByIdEndpointResult.verified.cs deleted file mode 100644 index c3c51473..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/GetUserByIdEndpointResult.verified.cs +++ /dev/null @@ -1,67 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint result. -/// Description: Get user by id. -/// Operation: GetUserById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetUserByIdEndpointResult : EndpointResponse, IGetUserByIdEndpointResult -{ - public GetUserByIdEndpointResult(EndpointResponse response) - : base(response) - { - } - - public bool IsOk - => StatusCode == HttpStatusCode.OK; - - public bool IsBadRequest - => StatusCode == HttpStatusCode.BadRequest; - - public bool IsUnauthorized - => StatusCode == HttpStatusCode.Unauthorized; - - public bool IsForbidden - => StatusCode == HttpStatusCode.Forbidden; - - public bool IsNotFound - => StatusCode == HttpStatusCode.NotFound; - - public bool IsConflict - => StatusCode == HttpStatusCode.Conflict; - - public bool IsInternalServerError - => StatusCode == HttpStatusCode.InternalServerError; - - public User OkContent - => IsOk && ContentObject is User result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); - - public ValidationProblemDetails BadRequestContent - => IsBadRequest && ContentObject is ValidationProblemDetails result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); - - public string NotFoundContent - => IsNotFound && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsNotFound property first."); - - public string ConflictContent - => IsConflict && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsConflict property first."); - - public string InternalServerErrorContent - => IsInternalServerError && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsInternalServerError property first."); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/GetUsersEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/GetUsersEndpoint.verified.cs deleted file mode 100644 index c19f3780..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/GetUsersEndpoint.verified.cs +++ /dev/null @@ -1,48 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint. -/// Description: Get all users. -/// Operation: GetUsers. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetUsersEndpoint : IGetUsersEndpoint -{ - private readonly IHttpClientFactory factory; - private readonly IHttpMessageFactory httpMessageFactory; - - public GetUsersEndpoint( - IHttpClientFactory factory, - IHttpMessageFactory httpMessageFactory) - { - this.factory = factory; - this.httpMessageFactory = httpMessageFactory; - } - - public async Task ExecuteAsync( - string httpClientName = "DemoSampleApi-ApiClient", - CancellationToken cancellationToken = default) - { - var client = factory.CreateClient(httpClientName); - - var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/users"); - - using var requestMessage = requestBuilder.Build(HttpMethod.Get); - using var response = await client.SendAsync(requestMessage, cancellationToken); - - var responseBuilder = httpMessageFactory.FromResponse(response); - responseBuilder.AddSuccessResponse>(HttpStatusCode.OK); - responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); - responseBuilder.AddErrorResponse(HttpStatusCode.Forbidden); - responseBuilder.AddErrorResponse(HttpStatusCode.Conflict); - responseBuilder.AddErrorResponse(HttpStatusCode.InternalServerError); - - return await responseBuilder.BuildResponseAsync(x => new GetUsersEndpointResult(x), cancellationToken); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/GetUsersEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/GetUsersEndpointResult.verified.cs deleted file mode 100644 index 74193344..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/GetUsersEndpointResult.verified.cs +++ /dev/null @@ -1,51 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint result. -/// Description: Get all users. -/// Operation: GetUsers. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetUsersEndpointResult : EndpointResponse, IGetUsersEndpointResult -{ - public GetUsersEndpointResult(EndpointResponse response) - : base(response) - { - } - - public bool IsOk - => StatusCode == HttpStatusCode.OK; - - public bool IsUnauthorized - => StatusCode == HttpStatusCode.Unauthorized; - - public bool IsForbidden - => StatusCode == HttpStatusCode.Forbidden; - - public bool IsConflict - => StatusCode == HttpStatusCode.Conflict; - - public bool IsInternalServerError - => StatusCode == HttpStatusCode.InternalServerError; - - public List OkContent - => IsOk && ContentObject is List result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); - - public string ConflictContent - => IsConflict && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsConflict property first."); - - public string InternalServerErrorContent - => IsInternalServerError && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsInternalServerError property first."); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/Interfaces/IDeleteUserByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/Interfaces/IDeleteUserByIdEndpoint.verified.cs deleted file mode 100644 index 6e20e4a1..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/Interfaces/IDeleteUserByIdEndpoint.verified.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint. -/// Description: Delete user by id. -/// Operation: DeleteUserById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IDeleteUserByIdEndpoint -{ - /// - /// Execute method. - /// - /// The parameters. - /// The http client name. - /// The cancellation token. - Task ExecuteAsync( - DeleteUserByIdParameters parameters, - string httpClientName = "DemoSampleApi-ApiClient", - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/Interfaces/IDeleteUserByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/Interfaces/IDeleteUserByIdEndpointResult.verified.cs deleted file mode 100644 index 8c1ab4a6..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/Interfaces/IDeleteUserByIdEndpointResult.verified.cs +++ /dev/null @@ -1,40 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint Result. -/// Description: Delete user by id. -/// Operation: DeleteUserById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IDeleteUserByIdEndpointResult : IEndpointResponse -{ - bool IsOk { get; } - - bool IsBadRequest { get; } - - bool IsUnauthorized { get; } - - bool IsForbidden { get; } - - bool IsNotFound { get; } - - bool IsConflict { get; } - - bool IsInternalServerError { get; } - - string OkContent { get; } - - ValidationProblemDetails BadRequestContent { get; } - - string NotFoundContent { get; } - - string ConflictContent { get; } - - string InternalServerErrorContent { get; } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUserByEmailEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUserByEmailEndpoint.verified.cs deleted file mode 100644 index 4539b724..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUserByEmailEndpoint.verified.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint. -/// Description: Get user by email. -/// Operation: GetUserByEmail. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetUserByEmailEndpoint -{ - /// - /// Execute method. - /// - /// The parameters. - /// The http client name. - /// The cancellation token. - Task ExecuteAsync( - GetUserByEmailParameters parameters, - string httpClientName = "DemoSampleApi-ApiClient", - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUserByEmailEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUserByEmailEndpointResult.verified.cs deleted file mode 100644 index 0ca3bb4f..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUserByEmailEndpointResult.verified.cs +++ /dev/null @@ -1,40 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint Result. -/// Description: Get user by email. -/// Operation: GetUserByEmail. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetUserByEmailEndpointResult : IEndpointResponse -{ - bool IsOk { get; } - - bool IsBadRequest { get; } - - bool IsUnauthorized { get; } - - bool IsForbidden { get; } - - bool IsNotFound { get; } - - bool IsConflict { get; } - - bool IsInternalServerError { get; } - - User OkContent { get; } - - ValidationProblemDetails BadRequestContent { get; } - - string NotFoundContent { get; } - - string ConflictContent { get; } - - string InternalServerErrorContent { get; } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUserByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUserByIdEndpoint.verified.cs deleted file mode 100644 index 06b75c94..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUserByIdEndpoint.verified.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint. -/// Description: Get user by id. -/// Operation: GetUserById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetUserByIdEndpoint -{ - /// - /// Execute method. - /// - /// The parameters. - /// The http client name. - /// The cancellation token. - Task ExecuteAsync( - GetUserByIdParameters parameters, - string httpClientName = "DemoSampleApi-ApiClient", - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUserByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUserByIdEndpointResult.verified.cs deleted file mode 100644 index e92d13c8..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUserByIdEndpointResult.verified.cs +++ /dev/null @@ -1,40 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint Result. -/// Description: Get user by id. -/// Operation: GetUserById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetUserByIdEndpointResult : IEndpointResponse -{ - bool IsOk { get; } - - bool IsBadRequest { get; } - - bool IsUnauthorized { get; } - - bool IsForbidden { get; } - - bool IsNotFound { get; } - - bool IsConflict { get; } - - bool IsInternalServerError { get; } - - User OkContent { get; } - - ValidationProblemDetails BadRequestContent { get; } - - string NotFoundContent { get; } - - string ConflictContent { get; } - - string InternalServerErrorContent { get; } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUsersEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUsersEndpoint.verified.cs deleted file mode 100644 index 51a90115..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUsersEndpoint.verified.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint. -/// Description: Get all users. -/// Operation: GetUsers. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetUsersEndpoint -{ - /// - /// Execute method. - /// - /// The http client name. - /// The cancellation token. - Task ExecuteAsync( - string httpClientName = "DemoSampleApi-ApiClient", - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUsersEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUsersEndpointResult.verified.cs deleted file mode 100644 index 5e100663..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUsersEndpointResult.verified.cs +++ /dev/null @@ -1,32 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint Result. -/// Description: Get all users. -/// Operation: GetUsers. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetUsersEndpointResult : IEndpointResponse -{ - bool IsOk { get; } - - bool IsUnauthorized { get; } - - bool IsForbidden { get; } - - bool IsConflict { get; } - - bool IsInternalServerError { get; } - - List OkContent { get; } - - string ConflictContent { get; } - - string InternalServerErrorContent { get; } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/Interfaces/IPostUserEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/Interfaces/IPostUserEndpoint.verified.cs deleted file mode 100644 index c800b896..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/Interfaces/IPostUserEndpoint.verified.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint. -/// Description: Create a new user. -/// Operation: PostUser. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IPostUserEndpoint -{ - /// - /// Execute method. - /// - /// The parameters. - /// The http client name. - /// The cancellation token. - Task ExecuteAsync( - PostUserParameters parameters, - string httpClientName = "DemoSampleApi-ApiClient", - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/Interfaces/IPostUserEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/Interfaces/IPostUserEndpointResult.verified.cs deleted file mode 100644 index b7fb84ed..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/Interfaces/IPostUserEndpointResult.verified.cs +++ /dev/null @@ -1,36 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint Result. -/// Description: Create a new user. -/// Operation: PostUser. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IPostUserEndpointResult : IEndpointResponse -{ - bool IsOk { get; } - - bool IsBadRequest { get; } - - bool IsUnauthorized { get; } - - bool IsForbidden { get; } - - bool IsConflict { get; } - - bool IsInternalServerError { get; } - - string OkContent { get; } - - ValidationProblemDetails BadRequestContent { get; } - - string ConflictContent { get; } - - string InternalServerErrorContent { get; } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/Interfaces/IUpdateMyTestGenderEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/Interfaces/IUpdateMyTestGenderEndpoint.verified.cs deleted file mode 100644 index ac5a4fe1..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/Interfaces/IUpdateMyTestGenderEndpoint.verified.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint. -/// Description: Update gender on a user. -/// Operation: UpdateMyTestGender. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IUpdateMyTestGenderEndpoint -{ - /// - /// Execute method. - /// - /// The parameters. - /// The http client name. - /// The cancellation token. - Task ExecuteAsync( - UpdateMyTestGenderParameters parameters, - string httpClientName = "DemoSampleApi-ApiClient", - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/Interfaces/IUpdateMyTestGenderEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/Interfaces/IUpdateMyTestGenderEndpointResult.verified.cs deleted file mode 100644 index b6b67d24..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/Interfaces/IUpdateMyTestGenderEndpointResult.verified.cs +++ /dev/null @@ -1,40 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint Result. -/// Description: Update gender on a user. -/// Operation: UpdateMyTestGender. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IUpdateMyTestGenderEndpointResult : IEndpointResponse -{ - bool IsOk { get; } - - bool IsBadRequest { get; } - - bool IsUnauthorized { get; } - - bool IsForbidden { get; } - - bool IsNotFound { get; } - - bool IsConflict { get; } - - bool IsInternalServerError { get; } - - string OkContent { get; } - - ValidationProblemDetails BadRequestContent { get; } - - string NotFoundContent { get; } - - string ConflictContent { get; } - - string InternalServerErrorContent { get; } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/Interfaces/IUpdateUserByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/Interfaces/IUpdateUserByIdEndpoint.verified.cs deleted file mode 100644 index 8c932a6d..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/Interfaces/IUpdateUserByIdEndpoint.verified.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint. -/// Description: Update user by id. -/// Operation: UpdateUserById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IUpdateUserByIdEndpoint -{ - /// - /// Execute method. - /// - /// The parameters. - /// The http client name. - /// The cancellation token. - Task ExecuteAsync( - UpdateUserByIdParameters parameters, - string httpClientName = "DemoSampleApi-ApiClient", - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/Interfaces/IUpdateUserByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/Interfaces/IUpdateUserByIdEndpointResult.verified.cs deleted file mode 100644 index 6809bfbe..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/Interfaces/IUpdateUserByIdEndpointResult.verified.cs +++ /dev/null @@ -1,40 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint Result. -/// Description: Update user by id. -/// Operation: UpdateUserById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IUpdateUserByIdEndpointResult : IEndpointResponse -{ - bool IsOk { get; } - - bool IsBadRequest { get; } - - bool IsUnauthorized { get; } - - bool IsForbidden { get; } - - bool IsNotFound { get; } - - bool IsConflict { get; } - - bool IsInternalServerError { get; } - - string OkContent { get; } - - ValidationProblemDetails BadRequestContent { get; } - - string NotFoundContent { get; } - - string ConflictContent { get; } - - string InternalServerErrorContent { get; } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/PostUserEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/PostUserEndpoint.verified.cs deleted file mode 100644 index 187475d0..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/PostUserEndpoint.verified.cs +++ /dev/null @@ -1,51 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint. -/// Description: Create a new user. -/// Operation: PostUser. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class PostUserEndpoint : IPostUserEndpoint -{ - private readonly IHttpClientFactory factory; - private readonly IHttpMessageFactory httpMessageFactory; - - public PostUserEndpoint( - IHttpClientFactory factory, - IHttpMessageFactory httpMessageFactory) - { - this.factory = factory; - this.httpMessageFactory = httpMessageFactory; - } - - public async Task ExecuteAsync( - PostUserParameters parameters, - string httpClientName = "DemoSampleApi-ApiClient", - CancellationToken cancellationToken = default) - { - var client = factory.CreateClient(httpClientName); - - var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/users"); - requestBuilder.WithBody(parameters.Request); - - using var requestMessage = requestBuilder.Build(HttpMethod.Post); - using var response = await client.SendAsync(requestMessage, cancellationToken); - - var responseBuilder = httpMessageFactory.FromResponse(response); - responseBuilder.AddSuccessResponse(HttpStatusCode.Created); - responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); - responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); - responseBuilder.AddErrorResponse(HttpStatusCode.Forbidden); - responseBuilder.AddErrorResponse(HttpStatusCode.Conflict); - responseBuilder.AddErrorResponse(HttpStatusCode.InternalServerError); - - return await responseBuilder.BuildResponseAsync(x => new PostUserEndpointResult(x), cancellationToken); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/PostUserEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/PostUserEndpointResult.verified.cs deleted file mode 100644 index 511abc7f..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/PostUserEndpointResult.verified.cs +++ /dev/null @@ -1,59 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint result. -/// Description: Create a new user. -/// Operation: PostUser. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class PostUserEndpointResult : EndpointResponse, IPostUserEndpointResult -{ - public PostUserEndpointResult(EndpointResponse response) - : base(response) - { - } - - public bool IsOk - => StatusCode == HttpStatusCode.OK; - - public bool IsBadRequest - => StatusCode == HttpStatusCode.BadRequest; - - public bool IsUnauthorized - => StatusCode == HttpStatusCode.Unauthorized; - - public bool IsForbidden - => StatusCode == HttpStatusCode.Forbidden; - - public bool IsConflict - => StatusCode == HttpStatusCode.Conflict; - - public bool IsInternalServerError - => StatusCode == HttpStatusCode.InternalServerError; - - public string OkContent - => IsOk && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); - - public ValidationProblemDetails BadRequestContent - => IsBadRequest && ContentObject is ValidationProblemDetails result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); - - public string ConflictContent - => IsConflict && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsConflict property first."); - - public string InternalServerErrorContent - => IsInternalServerError && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsInternalServerError property first."); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/UpdateMyTestGenderEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/UpdateMyTestGenderEndpoint.verified.cs deleted file mode 100644 index 38f74cb6..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/UpdateMyTestGenderEndpoint.verified.cs +++ /dev/null @@ -1,54 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint. -/// Description: Update gender on a user. -/// Operation: UpdateMyTestGender. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UpdateMyTestGenderEndpoint : IUpdateMyTestGenderEndpoint -{ - private readonly IHttpClientFactory factory; - private readonly IHttpMessageFactory httpMessageFactory; - - public UpdateMyTestGenderEndpoint( - IHttpClientFactory factory, - IHttpMessageFactory httpMessageFactory) - { - this.factory = factory; - this.httpMessageFactory = httpMessageFactory; - } - - public async Task ExecuteAsync( - UpdateMyTestGenderParameters parameters, - string httpClientName = "DemoSampleApi-ApiClient", - CancellationToken cancellationToken = default) - { - var client = factory.CreateClient(httpClientName); - - var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/users/{id}/gender"); - requestBuilder.WithPathParameter("id", parameters.Id); - requestBuilder.WithQueryParameter("genderParam", parameters.GenderParam); - requestBuilder.WithBody(parameters.Request); - - using var requestMessage = requestBuilder.Build(HttpMethod.Put); - using var response = await client.SendAsync(requestMessage, cancellationToken); - - var responseBuilder = httpMessageFactory.FromResponse(response); - responseBuilder.AddSuccessResponse(HttpStatusCode.OK); - responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); - responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); - responseBuilder.AddErrorResponse(HttpStatusCode.Forbidden); - responseBuilder.AddErrorResponse(HttpStatusCode.NotFound); - responseBuilder.AddErrorResponse(HttpStatusCode.Conflict); - responseBuilder.AddErrorResponse(HttpStatusCode.InternalServerError); - - return await responseBuilder.BuildResponseAsync(x => new UpdateMyTestGenderEndpointResult(x), cancellationToken); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/UpdateMyTestGenderEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/UpdateMyTestGenderEndpointResult.verified.cs deleted file mode 100644 index ccaea4ea..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/UpdateMyTestGenderEndpointResult.verified.cs +++ /dev/null @@ -1,67 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint result. -/// Description: Update gender on a user. -/// Operation: UpdateMyTestGender. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UpdateMyTestGenderEndpointResult : EndpointResponse, IUpdateMyTestGenderEndpointResult -{ - public UpdateMyTestGenderEndpointResult(EndpointResponse response) - : base(response) - { - } - - public bool IsOk - => StatusCode == HttpStatusCode.OK; - - public bool IsBadRequest - => StatusCode == HttpStatusCode.BadRequest; - - public bool IsUnauthorized - => StatusCode == HttpStatusCode.Unauthorized; - - public bool IsForbidden - => StatusCode == HttpStatusCode.Forbidden; - - public bool IsNotFound - => StatusCode == HttpStatusCode.NotFound; - - public bool IsConflict - => StatusCode == HttpStatusCode.Conflict; - - public bool IsInternalServerError - => StatusCode == HttpStatusCode.InternalServerError; - - public string OkContent - => IsOk && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); - - public ValidationProblemDetails BadRequestContent - => IsBadRequest && ContentObject is ValidationProblemDetails result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); - - public string NotFoundContent - => IsNotFound && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsNotFound property first."); - - public string ConflictContent - => IsConflict && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsConflict property first."); - - public string InternalServerErrorContent - => IsInternalServerError && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsInternalServerError property first."); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/UpdateUserByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/UpdateUserByIdEndpoint.verified.cs deleted file mode 100644 index 4d356a02..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/UpdateUserByIdEndpoint.verified.cs +++ /dev/null @@ -1,53 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint. -/// Description: Update user by id. -/// Operation: UpdateUserById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UpdateUserByIdEndpoint : IUpdateUserByIdEndpoint -{ - private readonly IHttpClientFactory factory; - private readonly IHttpMessageFactory httpMessageFactory; - - public UpdateUserByIdEndpoint( - IHttpClientFactory factory, - IHttpMessageFactory httpMessageFactory) - { - this.factory = factory; - this.httpMessageFactory = httpMessageFactory; - } - - public async Task ExecuteAsync( - UpdateUserByIdParameters parameters, - string httpClientName = "DemoSampleApi-ApiClient", - CancellationToken cancellationToken = default) - { - var client = factory.CreateClient(httpClientName); - - var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/users/{id}"); - requestBuilder.WithPathParameter("id", parameters.Id); - requestBuilder.WithBody(parameters.Request); - - using var requestMessage = requestBuilder.Build(HttpMethod.Put); - using var response = await client.SendAsync(requestMessage, cancellationToken); - - var responseBuilder = httpMessageFactory.FromResponse(response); - responseBuilder.AddSuccessResponse(HttpStatusCode.OK); - responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); - responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); - responseBuilder.AddErrorResponse(HttpStatusCode.Forbidden); - responseBuilder.AddErrorResponse(HttpStatusCode.NotFound); - responseBuilder.AddErrorResponse(HttpStatusCode.Conflict); - responseBuilder.AddErrorResponse(HttpStatusCode.InternalServerError); - - return await responseBuilder.BuildResponseAsync(x => new UpdateUserByIdEndpointResult(x), cancellationToken); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/UpdateUserByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/UpdateUserByIdEndpointResult.verified.cs deleted file mode 100644 index fbc48ebf..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/Endpoints/Users/UpdateUserByIdEndpointResult.verified.cs +++ /dev/null @@ -1,67 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint result. -/// Description: Update user by id. -/// Operation: UpdateUserById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UpdateUserByIdEndpointResult : EndpointResponse, IUpdateUserByIdEndpointResult -{ - public UpdateUserByIdEndpointResult(EndpointResponse response) - : base(response) - { - } - - public bool IsOk - => StatusCode == HttpStatusCode.OK; - - public bool IsBadRequest - => StatusCode == HttpStatusCode.BadRequest; - - public bool IsUnauthorized - => StatusCode == HttpStatusCode.Unauthorized; - - public bool IsForbidden - => StatusCode == HttpStatusCode.Forbidden; - - public bool IsNotFound - => StatusCode == HttpStatusCode.NotFound; - - public bool IsConflict - => StatusCode == HttpStatusCode.Conflict; - - public bool IsInternalServerError - => StatusCode == HttpStatusCode.InternalServerError; - - public string OkContent - => IsOk && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); - - public ValidationProblemDetails BadRequestContent - => IsBadRequest && ContentObject is ValidationProblemDetails result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); - - public string NotFoundContent - => IsNotFound && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsNotFound property first."); - - public string ConflictContent - => IsConflict && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsConflict property first."); - - public string InternalServerErrorContent - => IsInternalServerError && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsInternalServerError property first."); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/GlobalUsings.verified.cs deleted file mode 100644 index 6cdde7cb..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyClientCSharp/src/DemoSampleApi.ApiClient.Generated/GlobalUsings.verified.cs +++ /dev/null @@ -1,11 +0,0 @@ -global using System.CodeDom.Compiler; -global using System.ComponentModel.DataAnnotations; -global using System.Net; - -global using Atc.Rest.Client; -global using Atc.Rest.Client.Builder; - -global using DemoSampleApi.ApiClient.Generated.Contracts; - -global using Microsoft.AspNetCore.Http; -global using Microsoft.AspNetCore.Mvc; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/ApiRegistration.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/ApiRegistration.verified.cs deleted file mode 100644 index b4956eb1..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/ApiRegistration.verified.cs +++ /dev/null @@ -1,12 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class ApiRegistration -{ -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Accounts/Interfaces/ISetAccountNameHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Accounts/Interfaces/ISetAccountNameHandler.verified.cs deleted file mode 100644 index 07d26bbc..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Accounts/Interfaces/ISetAccountNameHandler.verified.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Accounts; - -/// -/// Domain Interface for RequestHandler. -/// Description: Set name of account. -/// Operation: SetAccountName. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface ISetAccountNameHandler -{ - /// - /// Execute method. - /// - /// The parameters. - /// The cancellation token. - Task ExecuteAsync( - SetAccountNameParameters parameters, - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Accounts/Interfaces/IUpdateAccountNameHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Accounts/Interfaces/IUpdateAccountNameHandler.verified.cs deleted file mode 100644 index 5266e7d0..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Accounts/Interfaces/IUpdateAccountNameHandler.verified.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Accounts; - -/// -/// Domain Interface for RequestHandler. -/// Description: Update name of account. -/// Operation: UpdateAccountName. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IUpdateAccountNameHandler -{ - /// - /// Execute method. - /// - /// The parameters. - /// The cancellation token. - Task ExecuteAsync( - UpdateAccountNameParameters parameters, - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Accounts/Models/UpdateAccountRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Accounts/Models/UpdateAccountRequest.verified.cs deleted file mode 100644 index c2cbd4dd..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Accounts/Models/UpdateAccountRequest.verified.cs +++ /dev/null @@ -1,20 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Accounts; - -/// -/// UpdateAccountRequest. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UpdateAccountRequest -{ - public string Name { get; set; } - - /// - public override string ToString() - => $"{nameof(Name)}: {Name}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Accounts/Parameters/SetAccountNameParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Accounts/Parameters/SetAccountNameParameters.verified.cs deleted file mode 100644 index 1b932f1c..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Accounts/Parameters/SetAccountNameParameters.verified.cs +++ /dev/null @@ -1,34 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Accounts; - -/// -/// Parameters for operation request. -/// Description: Set name of account. -/// Operation: SetAccountName. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class SetAccountNameParameters -{ - /// - /// The accountId. - /// - [FromRoute(Name = "accountId")] - [Required] - public Guid AccountId { get; set; } - - /// - /// UpdateAccountRequest. - /// - [FromBody] - [Required] - public UpdateAccountRequest Request { get; set; } - - /// - public override string ToString() - => $"{nameof(AccountId)}: {AccountId}, {nameof(Request)}: ({Request})"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Accounts/Parameters/UpdateAccountNameParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Accounts/Parameters/UpdateAccountNameParameters.verified.cs deleted file mode 100644 index ea09fd8b..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Accounts/Parameters/UpdateAccountNameParameters.verified.cs +++ /dev/null @@ -1,33 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Accounts; - -/// -/// Parameters for operation request. -/// Description: Update name of account. -/// Operation: UpdateAccountName. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UpdateAccountNameParameters -{ - /// - /// The accountId. - /// - [FromRoute(Name = "accountId")] - [Required] - public Guid AccountId { get; set; } - - /// - /// The account name. - /// - [FromHeader(Name = "name")] - public string? Name { get; set; } - - /// - public override string ToString() - => $"{nameof(AccountId)}: {AccountId}, {nameof(Name)}: {Name}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Accounts/Results/SetAccountNameResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Accounts/Results/SetAccountNameResult.verified.cs deleted file mode 100644 index 0c28c389..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Accounts/Results/SetAccountNameResult.verified.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Accounts; - -/// -/// Results for operation request. -/// Description: Set name of account. -/// Operation: SetAccountName. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class SetAccountNameResult : ResultBase -{ - private SetAccountNameResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static SetAccountNameResult Ok(string? message = null) - => new SetAccountNameResult(new OkObjectResult(message)); - - /// - /// Performs an implicit conversion from SetAccountNameResult to ActionResult. - /// - public static implicit operator SetAccountNameResult(string response) - => Ok(response); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Accounts/Results/UpdateAccountNameResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Accounts/Results/UpdateAccountNameResult.verified.cs deleted file mode 100644 index dd2f5a36..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Accounts/Results/UpdateAccountNameResult.verified.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Accounts; - -/// -/// Results for operation request. -/// Description: Update name of account. -/// Operation: UpdateAccountName. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UpdateAccountNameResult : ResultBase -{ - private UpdateAccountNameResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static UpdateAccountNameResult Ok(string? message = null) - => new UpdateAccountNameResult(new OkObjectResult(message)); - - /// - /// Performs an implicit conversion from UpdateAccountNameResult to ActionResult. - /// - public static implicit operator UpdateAccountNameResult(string response) - => Ok(response); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Addresses/Interfaces/IGetAddressesByPostalCodesHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Addresses/Interfaces/IGetAddressesByPostalCodesHandler.verified.cs deleted file mode 100644 index eb702f4b..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Addresses/Interfaces/IGetAddressesByPostalCodesHandler.verified.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Addresses; - -/// -/// Domain Interface for RequestHandler. -/// Description: Get addresses by postal code. -/// Operation: GetAddressesByPostalCodes. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetAddressesByPostalCodesHandler -{ - /// - /// Execute method. - /// - /// The parameters. - /// The cancellation token. - Task ExecuteAsync( - GetAddressesByPostalCodesParameters parameters, - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Addresses/Parameters/GetAddressesByPostalCodesParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Addresses/Parameters/GetAddressesByPostalCodesParameters.verified.cs deleted file mode 100644 index 40b61b44..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Addresses/Parameters/GetAddressesByPostalCodesParameters.verified.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Addresses; - -/// -/// Parameters for operation request. -/// Description: Get addresses by postal code. -/// Operation: GetAddressesByPostalCodes. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetAddressesByPostalCodesParameters -{ - /// - /// The postalCode to limit addresses on. - /// - [FromRoute(Name = "postalCode")] - [Required] - public string PostalCode { get; set; } - - /// - public override string ToString() - => $"{nameof(PostalCode)}: {PostalCode}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Addresses/Results/GetAddressesByPostalCodesResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Addresses/Results/GetAddressesByPostalCodesResult.verified.cs deleted file mode 100644 index 7fa26d49..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Addresses/Results/GetAddressesByPostalCodesResult.verified.cs +++ /dev/null @@ -1,36 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Addresses; - -/// -/// Results for operation request. -/// Description: Get addresses by postal code. -/// Operation: GetAddressesByPostalCodes. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetAddressesByPostalCodesResult : ResultBase -{ - private GetAddressesByPostalCodesResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static GetAddressesByPostalCodesResult Ok(IEnumerable
response) - => new GetAddressesByPostalCodesResult(new OkObjectResult(response ?? Enumerable.Empty
())); - - /// - /// 404 - NotFound response. - /// - public static GetAddressesByPostalCodesResult NotFound(string? message = null) - => new GetAddressesByPostalCodesResult(new NotFoundObjectResult(message)); - - /// - /// Performs an implicit conversion from GetAddressesByPostalCodesResult to ActionResult. - /// - public static implicit operator GetAddressesByPostalCodesResult(List
response) - => Ok(response); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/EventArgs/Interfaces/IGetEventArgByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/EventArgs/Interfaces/IGetEventArgByIdHandler.verified.cs deleted file mode 100644 index 835a3a37..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/EventArgs/Interfaces/IGetEventArgByIdHandler.verified.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.EventArgs; - -/// -/// Domain Interface for RequestHandler. -/// Description: Get EventArgs By Id. -/// Operation: GetEventArgById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetEventArgByIdHandler -{ - /// - /// Execute method. - /// - /// The parameters. - /// The cancellation token. - Task ExecuteAsync( - GetEventArgByIdParameters parameters, - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/EventArgs/Interfaces/IGetEventArgsHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/EventArgs/Interfaces/IGetEventArgsHandler.verified.cs deleted file mode 100644 index 7dd1d64a..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/EventArgs/Interfaces/IGetEventArgsHandler.verified.cs +++ /dev/null @@ -1,23 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.EventArgs; - -/// -/// Domain Interface for RequestHandler. -/// Description: Get EventArgs List. -/// Operation: GetEventArgs. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetEventArgsHandler -{ - /// - /// Execute method. - /// - /// The cancellation token. - Task ExecuteAsync( - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/EventArgs/Models/EventArgs.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/EventArgs/Models/EventArgs.verified.cs deleted file mode 100644 index b7c1f306..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/EventArgs/Models/EventArgs.verified.cs +++ /dev/null @@ -1,22 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.EventArgs; - -/// -/// EventArgs. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class EventArgs -{ - public Guid Id { get; set; } - - public string EventName { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}, {nameof(EventName)}: {EventName}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/EventArgs/Parameters/GetEventArgByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/EventArgs/Parameters/GetEventArgByIdParameters.verified.cs deleted file mode 100644 index 3c4baa50..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/EventArgs/Parameters/GetEventArgByIdParameters.verified.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.EventArgs; - -/// -/// Parameters for operation request. -/// Description: Get EventArgs By Id. -/// Operation: GetEventArgById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetEventArgByIdParameters -{ - /// - /// The id of the eventArgs. - /// - [FromRoute(Name = "id")] - [Required] - public string Id { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/EventArgs/Results/GetEventArgByIdResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/EventArgs/Results/GetEventArgByIdResult.verified.cs deleted file mode 100644 index 02b5a687..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/EventArgs/Results/GetEventArgByIdResult.verified.cs +++ /dev/null @@ -1,36 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.EventArgs; - -/// -/// Results for operation request. -/// Description: Get EventArgs By Id. -/// Operation: GetEventArgById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetEventArgByIdResult : ResultBase -{ - private GetEventArgByIdResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static GetEventArgByIdResult Ok(EventArgs response) - => new GetEventArgByIdResult(new OkObjectResult(response)); - - /// - /// 404 - NotFound response. - /// - public static GetEventArgByIdResult NotFound(string? message = null) - => new GetEventArgByIdResult(new NotFoundObjectResult(message)); - - /// - /// Performs an implicit conversion from GetEventArgByIdResult to ActionResult. - /// - public static implicit operator GetEventArgByIdResult(EventArgs response) - => Ok(response); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/EventArgs/Results/GetEventArgsResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/EventArgs/Results/GetEventArgsResult.verified.cs deleted file mode 100644 index ef40e3b6..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/EventArgs/Results/GetEventArgsResult.verified.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.EventArgs; - -/// -/// Results for operation request. -/// Description: Get EventArgs List. -/// Operation: GetEventArgs. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetEventArgsResult : ResultBase -{ - private GetEventArgsResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static GetEventArgsResult Ok(IEnumerable response) - => new GetEventArgsResult(new OkObjectResult(response ?? Enumerable.Empty())); - - /// - /// Performs an implicit conversion from GetEventArgsResult to ActionResult. - /// - public static implicit operator GetEventArgsResult(List response) - => Ok(response); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Files/Interfaces/IGetFileByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Files/Interfaces/IGetFileByIdHandler.verified.cs deleted file mode 100644 index f8810108..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Files/Interfaces/IGetFileByIdHandler.verified.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Files; - -/// -/// Domain Interface for RequestHandler. -/// Description: Get File By Id. -/// Operation: GetFileById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetFileByIdHandler -{ - /// - /// Execute method. - /// - /// The parameters. - /// The cancellation token. - Task ExecuteAsync( - GetFileByIdParameters parameters, - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Files/Interfaces/IUploadMultiFilesAsFormDataHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Files/Interfaces/IUploadMultiFilesAsFormDataHandler.verified.cs deleted file mode 100644 index b8b8edc5..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Files/Interfaces/IUploadMultiFilesAsFormDataHandler.verified.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Files; - -/// -/// Domain Interface for RequestHandler. -/// Description: Upload multi files as form data. -/// Operation: UploadMultiFilesAsFormData. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IUploadMultiFilesAsFormDataHandler -{ - /// - /// Execute method. - /// - /// The parameters. - /// The cancellation token. - Task ExecuteAsync( - UploadMultiFilesAsFormDataParameters parameters, - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Files/Interfaces/IUploadSingleFileAsFormDataHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Files/Interfaces/IUploadSingleFileAsFormDataHandler.verified.cs deleted file mode 100644 index 0771e1d0..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Files/Interfaces/IUploadSingleFileAsFormDataHandler.verified.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Files; - -/// -/// Domain Interface for RequestHandler. -/// Description: Upload a file as OctetStream. -/// Operation: UploadSingleFileAsFormData. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IUploadSingleFileAsFormDataHandler -{ - /// - /// Execute method. - /// - /// The parameters. - /// The cancellation token. - Task ExecuteAsync( - UploadSingleFileAsFormDataParameters parameters, - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Files/Interfaces/IUploadSingleObjectWithFileAsFormDataHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Files/Interfaces/IUploadSingleObjectWithFileAsFormDataHandler.verified.cs deleted file mode 100644 index 1fd3cf0a..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Files/Interfaces/IUploadSingleObjectWithFileAsFormDataHandler.verified.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Files; - -/// -/// Domain Interface for RequestHandler. -/// Description: Upload a file as FormData. -/// Operation: UploadSingleObjectWithFileAsFormData. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IUploadSingleObjectWithFileAsFormDataHandler -{ - /// - /// Execute method. - /// - /// The parameters. - /// The cancellation token. - Task ExecuteAsync( - UploadSingleObjectWithFileAsFormDataParameters parameters, - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Files/Interfaces/IUploadSingleObjectWithFilesAsFormDataHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Files/Interfaces/IUploadSingleObjectWithFilesAsFormDataHandler.verified.cs deleted file mode 100644 index ef14aa0e..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Files/Interfaces/IUploadSingleObjectWithFilesAsFormDataHandler.verified.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Files; - -/// -/// Domain Interface for RequestHandler. -/// Description: Upload files as FormData. -/// Operation: UploadSingleObjectWithFilesAsFormData. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IUploadSingleObjectWithFilesAsFormDataHandler -{ - /// - /// Execute method. - /// - /// The parameters. - /// The cancellation token. - Task ExecuteAsync( - UploadSingleObjectWithFilesAsFormDataParameters parameters, - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Files/Models/FileAsFormDataRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Files/Models/FileAsFormDataRequest.verified.cs deleted file mode 100644 index cea9786c..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Files/Models/FileAsFormDataRequest.verified.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Files; - -/// -/// FileAsFormDataRequest. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class FileAsFormDataRequest -{ - [Required] - public string ItemName { get; set; } - - public IFormFile? File { get; set; } - - [Required] - public List Items { get; set; } - - /// - public override string ToString() - => $"{nameof(ItemName)}: {ItemName}, {nameof(File)}: {File}, {nameof(Items)}.Count: {Items?.Count ?? 0}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Files/Models/FilesAsFormDataRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Files/Models/FilesAsFormDataRequest.verified.cs deleted file mode 100644 index 0bba825e..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Files/Models/FilesAsFormDataRequest.verified.cs +++ /dev/null @@ -1,23 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Files; - -/// -/// FilesAsFormDataRequest. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class FilesAsFormDataRequest -{ - /// - /// A list of File(s). - /// - public List Files { get; set; } = new List(); - - /// - public override string ToString() - => $"{nameof(Files)}.Count: {Files?.Count ?? 0}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Files/Parameters/GetFileByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Files/Parameters/GetFileByIdParameters.verified.cs deleted file mode 100644 index 1408e032..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Files/Parameters/GetFileByIdParameters.verified.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Files; - -/// -/// Parameters for operation request. -/// Description: Get File By Id. -/// Operation: GetFileById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetFileByIdParameters -{ - /// - /// The file id. - /// - [FromRoute(Name = "id")] - [Required] - public string Id { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Files/Parameters/UploadMultiFilesAsFormDataParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Files/Parameters/UploadMultiFilesAsFormDataParameters.verified.cs deleted file mode 100644 index 6407dfd3..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Files/Parameters/UploadMultiFilesAsFormDataParameters.verified.cs +++ /dev/null @@ -1,24 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Files; - -/// -/// Parameters for operation request. -/// Description: Upload multi files as form data. -/// Operation: UploadMultiFilesAsFormData. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UploadMultiFilesAsFormDataParameters -{ - [FromForm] - [Required] - public List Request { get; set; } = new List(); - - /// - public override string ToString() - => $"{nameof(Request)}.Count: {Request?.Count ?? 0}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Files/Parameters/UploadSingleFileAsFormDataParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Files/Parameters/UploadSingleFileAsFormDataParameters.verified.cs deleted file mode 100644 index cb11f201..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Files/Parameters/UploadSingleFileAsFormDataParameters.verified.cs +++ /dev/null @@ -1,24 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Files; - -/// -/// Parameters for operation request. -/// Description: Upload a file as OctetStream. -/// Operation: UploadSingleFileAsFormData. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UploadSingleFileAsFormDataParameters -{ - [FromBody] - [Required] - public IFormFile Request { get; set; } - - /// - public override string ToString() - => $"{nameof(Request)}: ({Request})"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Files/Parameters/UploadSingleObjectWithFileAsFormDataParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Files/Parameters/UploadSingleObjectWithFileAsFormDataParameters.verified.cs deleted file mode 100644 index a97086ee..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Files/Parameters/UploadSingleObjectWithFileAsFormDataParameters.verified.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Files; - -/// -/// Parameters for operation request. -/// Description: Upload a file as FormData. -/// Operation: UploadSingleObjectWithFileAsFormData. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UploadSingleObjectWithFileAsFormDataParameters -{ - /// - /// FileAsFormDataRequest. - /// - [FromForm] - [Required] - public FileAsFormDataRequest Request { get; set; } - - /// - public override string ToString() - => $"{nameof(Request)}: ({Request})"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Files/Parameters/UploadSingleObjectWithFilesAsFormDataParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Files/Parameters/UploadSingleObjectWithFilesAsFormDataParameters.verified.cs deleted file mode 100644 index e7b2ea4d..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Files/Parameters/UploadSingleObjectWithFilesAsFormDataParameters.verified.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Files; - -/// -/// Parameters for operation request. -/// Description: Upload files as FormData. -/// Operation: UploadSingleObjectWithFilesAsFormData. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UploadSingleObjectWithFilesAsFormDataParameters -{ - /// - /// FilesAsFormDataRequest. - /// - [FromForm] - [Required] - public FilesAsFormDataRequest Request { get; set; } - - /// - public override string ToString() - => $"{nameof(Request)}: ({Request})"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Files/Results/GetFileByIdResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Files/Results/GetFileByIdResult.verified.cs deleted file mode 100644 index 224b92af..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Files/Results/GetFileByIdResult.verified.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Files; - -/// -/// Results for operation request. -/// Description: Get File By Id. -/// Operation: GetFileById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetFileByIdResult : ResultBase -{ - private GetFileByIdResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static GetFileByIdResult Ok(byte[] bytes, string fileName) - => new GetFileByIdResult(ResultFactory.CreateFileContentResult(bytes, fileName)); - - /// - /// 404 - NotFound response. - /// - public static GetFileByIdResult NotFound(string? message = null) - => new GetFileByIdResult(new NotFoundObjectResult(message)); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Files/Results/UploadMultiFilesAsFormDataResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Files/Results/UploadMultiFilesAsFormDataResult.verified.cs deleted file mode 100644 index 2d5af83d..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Files/Results/UploadMultiFilesAsFormDataResult.verified.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Files; - -/// -/// Results for operation request. -/// Description: Upload multi files as form data. -/// Operation: UploadMultiFilesAsFormData. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UploadMultiFilesAsFormDataResult : ResultBase -{ - private UploadMultiFilesAsFormDataResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static UploadMultiFilesAsFormDataResult Ok(string? message = null) - => new UploadMultiFilesAsFormDataResult(new OkObjectResult(message)); - - /// - /// Performs an implicit conversion from UploadMultiFilesAsFormDataResult to ActionResult. - /// - public static implicit operator UploadMultiFilesAsFormDataResult(string response) - => Ok(response); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Files/Results/UploadSingleFileAsFormDataResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Files/Results/UploadSingleFileAsFormDataResult.verified.cs deleted file mode 100644 index 6e7d954a..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Files/Results/UploadSingleFileAsFormDataResult.verified.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Files; - -/// -/// Results for operation request. -/// Description: Upload a file as OctetStream. -/// Operation: UploadSingleFileAsFormData. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UploadSingleFileAsFormDataResult : ResultBase -{ - private UploadSingleFileAsFormDataResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static UploadSingleFileAsFormDataResult Ok(string? message = null) - => new UploadSingleFileAsFormDataResult(new OkObjectResult(message)); - - /// - /// Performs an implicit conversion from UploadSingleFileAsFormDataResult to ActionResult. - /// - public static implicit operator UploadSingleFileAsFormDataResult(string response) - => Ok(response); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Files/Results/UploadSingleObjectWithFileAsFormDataResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Files/Results/UploadSingleObjectWithFileAsFormDataResult.verified.cs deleted file mode 100644 index dd356589..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Files/Results/UploadSingleObjectWithFileAsFormDataResult.verified.cs +++ /dev/null @@ -1,36 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Files; - -/// -/// Results for operation request. -/// Description: Upload a file as FormData. -/// Operation: UploadSingleObjectWithFileAsFormData. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UploadSingleObjectWithFileAsFormDataResult : ResultBase -{ - private UploadSingleObjectWithFileAsFormDataResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static UploadSingleObjectWithFileAsFormDataResult Ok(string? message = null) - => new UploadSingleObjectWithFileAsFormDataResult(new OkObjectResult(message)); - - /// - /// 400 - BadRequest response. - /// - public static UploadSingleObjectWithFileAsFormDataResult BadRequest(string message) - => new UploadSingleObjectWithFileAsFormDataResult(new BadRequestObjectResult(message)); - - /// - /// Performs an implicit conversion from UploadSingleObjectWithFileAsFormDataResult to ActionResult. - /// - public static implicit operator UploadSingleObjectWithFileAsFormDataResult(string response) - => Ok(response); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Files/Results/UploadSingleObjectWithFilesAsFormDataResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Files/Results/UploadSingleObjectWithFilesAsFormDataResult.verified.cs deleted file mode 100644 index 30c329d8..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Files/Results/UploadSingleObjectWithFilesAsFormDataResult.verified.cs +++ /dev/null @@ -1,36 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Files; - -/// -/// Results for operation request. -/// Description: Upload files as FormData. -/// Operation: UploadSingleObjectWithFilesAsFormData. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UploadSingleObjectWithFilesAsFormDataResult : ResultBase -{ - private UploadSingleObjectWithFilesAsFormDataResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static UploadSingleObjectWithFilesAsFormDataResult Ok(string? message = null) - => new UploadSingleObjectWithFilesAsFormDataResult(new OkObjectResult(message)); - - /// - /// 400 - BadRequest response. - /// - public static UploadSingleObjectWithFilesAsFormDataResult BadRequest(string message) - => new UploadSingleObjectWithFilesAsFormDataResult(new BadRequestObjectResult(message)); - - /// - /// Performs an implicit conversion from UploadSingleObjectWithFilesAsFormDataResult to ActionResult. - /// - public static implicit operator UploadSingleObjectWithFilesAsFormDataResult(string response) - => Ok(response); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Items/Interfaces/ICreateItemHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Items/Interfaces/ICreateItemHandler.verified.cs deleted file mode 100644 index f4c325cf..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Items/Interfaces/ICreateItemHandler.verified.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Items; - -/// -/// Domain Interface for RequestHandler. -/// Description: Create a new item. -/// Operation: CreateItem. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface ICreateItemHandler -{ - /// - /// Execute method. - /// - /// The parameters. - /// The cancellation token. - Task ExecuteAsync( - CreateItemParameters parameters, - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Items/Interfaces/IUpdateItemHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Items/Interfaces/IUpdateItemHandler.verified.cs deleted file mode 100644 index 995f0d0d..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Items/Interfaces/IUpdateItemHandler.verified.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Items; - -/// -/// Domain Interface for RequestHandler. -/// Description: Updates an item. -/// Operation: UpdateItem. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IUpdateItemHandler -{ - /// - /// Execute method. - /// - /// The parameters. - /// The cancellation token. - Task ExecuteAsync( - UpdateItemParameters parameters, - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Items/Models/CreateItemRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Items/Models/CreateItemRequest.verified.cs deleted file mode 100644 index 9a4e02b9..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Items/Models/CreateItemRequest.verified.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Items; - -/// -/// CreateItemRequest. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class CreateItemRequest -{ - /// - /// Item. - /// - [Required] - public Item Item { get; set; } - - /// - /// A list of Item. - /// - [Required] - public List MyItems { get; set; } - - /// - public override string ToString() - => $"{nameof(Item)}: ({Item}), {nameof(MyItems)}.Count: {MyItems?.Count ?? 0}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Items/Models/Item.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Items/Models/Item.verified.cs deleted file mode 100644 index 55cb89e1..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Items/Models/Item.verified.cs +++ /dev/null @@ -1,21 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Items; - -/// -/// Item. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class Item -{ - [Required] - public string Name { get; set; } - - /// - public override string ToString() - => $"{nameof(Name)}: {Name}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Items/Models/UpdateItemRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Items/Models/UpdateItemRequest.verified.cs deleted file mode 100644 index 04791f6f..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Items/Models/UpdateItemRequest.verified.cs +++ /dev/null @@ -1,24 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Items; - -/// -/// UpdateItemRequest. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UpdateItemRequest -{ - /// - /// Item. - /// - [Required] - public Item Item { get; set; } - - /// - public override string ToString() - => $"{nameof(Item)}: ({Item})"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Items/Parameters/CreateItemParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Items/Parameters/CreateItemParameters.verified.cs deleted file mode 100644 index 34aff67f..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Items/Parameters/CreateItemParameters.verified.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Items; - -/// -/// Parameters for operation request. -/// Description: Create a new item. -/// Operation: CreateItem. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class CreateItemParameters -{ - /// - /// CreateItemRequest. - /// - [FromBody] - [Required] - public CreateItemRequest Request { get; set; } - - /// - public override string ToString() - => $"{nameof(Request)}: ({Request})"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Items/Parameters/UpdateItemParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Items/Parameters/UpdateItemParameters.verified.cs deleted file mode 100644 index 127ce53b..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Items/Parameters/UpdateItemParameters.verified.cs +++ /dev/null @@ -1,34 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Items; - -/// -/// Parameters for operation request. -/// Description: Updates an item. -/// Operation: UpdateItem. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UpdateItemParameters -{ - /// - /// The id of the order. - /// - [FromRoute(Name = "id")] - [Required] - public Guid Id { get; set; } - - /// - /// UpdateItemRequest. - /// - [FromBody] - [Required] - public UpdateItemRequest Request { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}, {nameof(Request)}: ({Request})"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Items/Results/CreateItemResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Items/Results/CreateItemResult.verified.cs deleted file mode 100644 index 207b9077..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Items/Results/CreateItemResult.verified.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Items; - -/// -/// Results for operation request. -/// Description: Create a new item. -/// Operation: CreateItem. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class CreateItemResult : ResultBase -{ - private CreateItemResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static CreateItemResult Ok(string? message = null) - => new CreateItemResult(new OkObjectResult(message)); - - /// - /// Performs an implicit conversion from CreateItemResult to ActionResult. - /// - public static implicit operator CreateItemResult(string response) - => Ok(response); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Items/Results/UpdateItemResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Items/Results/UpdateItemResult.verified.cs deleted file mode 100644 index 131ba285..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Items/Results/UpdateItemResult.verified.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Items; - -/// -/// Results for operation request. -/// Description: Updates an item. -/// Operation: UpdateItem. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UpdateItemResult : ResultBase -{ - private UpdateItemResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static UpdateItemResult Ok(Guid response) - => new UpdateItemResult(new OkObjectResult(response)); - - /// - /// Performs an implicit conversion from UpdateItemResult to ActionResult. - /// - public static implicit operator UpdateItemResult(Guid response) - => Ok(response); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Orders/Interfaces/IGetOrderByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Orders/Interfaces/IGetOrderByIdHandler.verified.cs deleted file mode 100644 index cabf14c2..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Orders/Interfaces/IGetOrderByIdHandler.verified.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Orders; - -/// -/// Domain Interface for RequestHandler. -/// Description: Get order by id. -/// Operation: GetOrderById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetOrderByIdHandler -{ - /// - /// Execute method. - /// - /// The parameters. - /// The cancellation token. - Task ExecuteAsync( - GetOrderByIdParameters parameters, - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Orders/Interfaces/IGetOrdersHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Orders/Interfaces/IGetOrdersHandler.verified.cs deleted file mode 100644 index ff707a6c..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Orders/Interfaces/IGetOrdersHandler.verified.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Orders; - -/// -/// Domain Interface for RequestHandler. -/// Description: Get orders. -/// Operation: GetOrders. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetOrdersHandler -{ - /// - /// Execute method. - /// - /// The parameters. - /// The cancellation token. - Task ExecuteAsync( - GetOrdersParameters parameters, - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Orders/Interfaces/IPatchOrdersIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Orders/Interfaces/IPatchOrdersIdHandler.verified.cs deleted file mode 100644 index 44730992..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Orders/Interfaces/IPatchOrdersIdHandler.verified.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Orders; - -/// -/// Domain Interface for RequestHandler. -/// Description: Update part of order by id. -/// Operation: PatchOrdersId. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IPatchOrdersIdHandler -{ - /// - /// Execute method. - /// - /// The parameters. - /// The cancellation token. - Task ExecuteAsync( - PatchOrdersIdParameters parameters, - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Orders/Models/Order.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Orders/Models/Order.verified.cs deleted file mode 100644 index d624d501..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Orders/Models/Order.verified.cs +++ /dev/null @@ -1,79 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Orders; - -/// -/// A single order. -/// Hallo description with multiline and no ending dot. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class Order -{ - public Guid Id { get; set; } - - public string Description { get; set; } - - public DateTimeOffset MyTime { get; set; } - - /// - /// Undefined description. - /// - /// - /// Email validation being enforced. - /// - [EmailAddress] - public string MyEmail { get; set; } = "a@a.com"; - - public DateTimeOffset? MyNullableDateTime { get; set; } - - public DateTimeOffset MyDateTime { get; set; } - - [Range(1.1, 20.2)] - public double MyNumber { get; set; } - - [Range(-2147483648, 50)] - public int MyInteger { get; set; } = 15; - - /// - /// MyBool is great. - /// - public bool MyBool { get; set; } - - /// - /// This is the good uri :-). - /// - /// - /// Url validation being enforced. - /// - [Uri] - public Uri MyUri { get; set; } - - /// - /// Undefined description. - /// - /// - /// This string should be base64-encoded. - /// - public string MyByte { get; set; } - - /// - /// Hallo myStringList desc :-). - /// - public List MyStringList { get; set; } = new List(); - - [Range(10, 2147483647)] - public long MyLong { get; set; } - - /// - /// Address. - /// - public Address DeliveryAddress { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}, {nameof(Description)}: {Description}, {nameof(MyTime)}: ({MyTime}), {nameof(MyEmail)}: {MyEmail}, {nameof(MyNullableDateTime)}: ({MyNullableDateTime}), {nameof(MyDateTime)}: ({MyDateTime}), {nameof(MyNumber)}: {MyNumber}, {nameof(MyInteger)}: {MyInteger}, {nameof(MyBool)}: {MyBool}, {nameof(MyUri)}: ({MyUri}), {nameof(MyByte)}: {MyByte}, {nameof(MyStringList)}.Count: {MyStringList?.Count ?? 0}, {nameof(MyLong)}: {MyLong}, {nameof(DeliveryAddress)}: ({DeliveryAddress})"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Orders/Models/UpdateOrderRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Orders/Models/UpdateOrderRequest.verified.cs deleted file mode 100644 index 4cc14cb6..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Orders/Models/UpdateOrderRequest.verified.cs +++ /dev/null @@ -1,28 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Orders; - -/// -/// Request to update an order. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UpdateOrderRequest -{ - /// - /// Undefined description. - /// - /// - /// Email validation being enforced. - /// - [Required] - [EmailAddress] - public string MyEmail { get; set; } - - /// - public override string ToString() - => $"{nameof(MyEmail)}: {MyEmail}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Orders/Parameters/GetOrderByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Orders/Parameters/GetOrderByIdParameters.verified.cs deleted file mode 100644 index 6fc6909a..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Orders/Parameters/GetOrderByIdParameters.verified.cs +++ /dev/null @@ -1,37 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Orders; - -/// -/// Parameters for operation request. -/// Description: Get order by id. -/// Operation: GetOrderById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetOrderByIdParameters -{ - /// - /// The id of the order. - /// - [FromRoute(Name = "id")] - [Required] - public Guid Id { get; set; } - - /// - /// The email for filter orders to retrieve. - /// - /// - /// Email validation being enforced. - /// - [FromQuery(Name = "myEmail")] - [EmailAddress] - public string? MyEmail { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}, {nameof(MyEmail)}: {MyEmail}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Orders/Parameters/GetOrdersParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Orders/Parameters/GetOrdersParameters.verified.cs deleted file mode 100644 index a571ce08..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Orders/Parameters/GetOrdersParameters.verified.cs +++ /dev/null @@ -1,53 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Orders; - -/// -/// Parameters for operation request. -/// Description: Get orders. -/// Operation: GetOrders. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetOrdersParameters -{ - /// - /// The numbers of items to return. - /// - [FromQuery(Name = "pageSize")] - [Required] - [Range(1, 100)] - public int PageSize { get; set; } = 10; - - /// - /// The number of items to skip before starting to collect the result set. - /// - [FromQuery(Name = "pageIndex")] - [Range(0, 2147483647)] - public int PageIndex { get; set; } = 0; - - /// - /// The query string. - /// - [FromQuery(Name = "queryString")] - public string? QueryString { get; set; } - - /// - /// The query array of string. - /// - [FromQuery(Name = "queryStringArray")] - public List QueryStringArray { get; set; } = new List(); - - /// - /// The continuation token. - /// - [FromQuery(Name = "continuationToken")] - public string? ContinuationToken { get; set; } - - /// - public override string ToString() - => $"{nameof(PageSize)}: {PageSize}, {nameof(PageIndex)}: {PageIndex}, {nameof(QueryString)}: {QueryString}, {nameof(QueryStringArray)}.Count: {QueryStringArray?.Count ?? 0}, {nameof(ContinuationToken)}: {ContinuationToken}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Orders/Parameters/PatchOrdersIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Orders/Parameters/PatchOrdersIdParameters.verified.cs deleted file mode 100644 index 96036a78..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Orders/Parameters/PatchOrdersIdParameters.verified.cs +++ /dev/null @@ -1,62 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Orders; - -/// -/// Parameters for operation request. -/// Description: Update part of order by id. -/// Operation: PatchOrdersId. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class PatchOrdersIdParameters -{ - /// - /// The id of the order. - /// - [FromRoute(Name = "id")] - [Required] - public Guid Id { get; set; } - - /// - /// The myTestHeader special key. - /// - [FromHeader(Name = "myTestHeader")] - [Required] - public string MyTestHeader { get; set; } - - /// - /// The myTestHeaderBool special key. - /// - [FromHeader(Name = "myTestHeaderBool")] - [Required] - public bool MyTestHeaderBool { get; set; } - - /// - /// The myTestHeaderInt special key. - /// - [FromHeader(Name = "myTestHeaderInt")] - [Required] - public int MyTestHeaderInt { get; set; } - - /// - /// The correlationId. - /// - [FromHeader(Name = "x-correlation-id")] - [Required] - public string CorrelationId { get; set; } - - /// - /// Request to update an order. - /// - [FromBody] - [Required] - public UpdateOrderRequest Request { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}, {nameof(MyTestHeader)}: {MyTestHeader}, {nameof(MyTestHeaderBool)}: {MyTestHeaderBool}, {nameof(MyTestHeaderInt)}: {MyTestHeaderInt}, {nameof(CorrelationId)}: {CorrelationId}, {nameof(Request)}: ({Request})"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Orders/Results/GetOrderByIdResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Orders/Results/GetOrderByIdResult.verified.cs deleted file mode 100644 index d5a8d5d7..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Orders/Results/GetOrderByIdResult.verified.cs +++ /dev/null @@ -1,36 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Orders; - -/// -/// Results for operation request. -/// Description: Get order by id. -/// Operation: GetOrderById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetOrderByIdResult : ResultBase -{ - private GetOrderByIdResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static GetOrderByIdResult Ok(Order response) - => new GetOrderByIdResult(new OkObjectResult(response)); - - /// - /// 404 - NotFound response. - /// - public static GetOrderByIdResult NotFound(string? message = null) - => new GetOrderByIdResult(new NotFoundObjectResult(message)); - - /// - /// Performs an implicit conversion from GetOrderByIdResult to ActionResult. - /// - public static implicit operator GetOrderByIdResult(Order response) - => Ok(response); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Orders/Results/GetOrdersResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Orders/Results/GetOrdersResult.verified.cs deleted file mode 100644 index 0045a935..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Orders/Results/GetOrdersResult.verified.cs +++ /dev/null @@ -1,36 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Orders; - -/// -/// Results for operation request. -/// Description: Get orders. -/// Operation: GetOrders. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetOrdersResult : ResultBase -{ - private GetOrdersResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static GetOrdersResult Ok(Pagination response) - => new GetOrdersResult(new OkObjectResult(response)); - - /// - /// 404 - NotFound response. - /// - public static GetOrdersResult NotFound(string? message = null) - => new GetOrdersResult(new NotFoundObjectResult(message)); - - /// - /// Performs an implicit conversion from GetOrdersResult to ActionResult. - /// - public static implicit operator GetOrdersResult(Pagination response) - => Ok(response); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Orders/Results/PatchOrdersIdResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Orders/Results/PatchOrdersIdResult.verified.cs deleted file mode 100644 index 38e13ca1..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Orders/Results/PatchOrdersIdResult.verified.cs +++ /dev/null @@ -1,48 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Orders; - -/// -/// Results for operation request. -/// Description: Update part of order by id. -/// Operation: PatchOrdersId. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class PatchOrdersIdResult : ResultBase -{ - private PatchOrdersIdResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static PatchOrdersIdResult Ok(string? message = null) - => new PatchOrdersIdResult(new OkObjectResult(message)); - - /// - /// 404 - NotFound response. - /// - public static PatchOrdersIdResult NotFound(string? message = null) - => new PatchOrdersIdResult(new NotFoundObjectResult(message)); - - /// - /// 409 - Conflict response. - /// - public static PatchOrdersIdResult Conflict(string? error = null) - => new PatchOrdersIdResult(new ConflictObjectResult(error)); - - /// - /// 502 - BadGateway response. - /// - public static PatchOrdersIdResult BadGateway(string? message = null) - => new PatchOrdersIdResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.BadGateway, message)); - - /// - /// Performs an implicit conversion from PatchOrdersIdResult to ActionResult. - /// - public static implicit operator PatchOrdersIdResult(string response) - => Ok(response); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/RouteWithDash/Interfaces/IGetRouteWithDashHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/RouteWithDash/Interfaces/IGetRouteWithDashHandler.verified.cs deleted file mode 100644 index a7a59522..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/RouteWithDash/Interfaces/IGetRouteWithDashHandler.verified.cs +++ /dev/null @@ -1,23 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.RouteWithDash; - -/// -/// Domain Interface for RequestHandler. -/// Description: Your GET endpoint. -/// Operation: GetRouteWithDash. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetRouteWithDashHandler -{ - /// - /// Execute method. - /// - /// The cancellation token. - Task ExecuteAsync( - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/RouteWithDash/Results/GetRouteWithDashResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/RouteWithDash/Results/GetRouteWithDashResult.verified.cs deleted file mode 100644 index d38dcf52..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/RouteWithDash/Results/GetRouteWithDashResult.verified.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.RouteWithDash; - -/// -/// Results for operation request. -/// Description: Your GET endpoint. -/// Operation: GetRouteWithDash. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetRouteWithDashResult : ResultBase -{ - private GetRouteWithDashResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static GetRouteWithDashResult Ok(string? message = null) - => new GetRouteWithDashResult(new OkObjectResult(message)); - - /// - /// Performs an implicit conversion from GetRouteWithDashResult to ActionResult. - /// - public static implicit operator GetRouteWithDashResult(string response) - => Ok(response); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Tasks/Interfaces/IGetTasksHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Tasks/Interfaces/IGetTasksHandler.verified.cs deleted file mode 100644 index b989cc2b..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Tasks/Interfaces/IGetTasksHandler.verified.cs +++ /dev/null @@ -1,23 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Tasks; - -/// -/// Domain Interface for RequestHandler. -/// Description: Returns tasks. -/// Operation: GetTasks. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetTasksHandler -{ - /// - /// Execute method. - /// - /// The cancellation token. - Task ExecuteAsync( - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Tasks/Models/Task.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Tasks/Models/Task.verified.cs deleted file mode 100644 index e3653985..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Tasks/Models/Task.verified.cs +++ /dev/null @@ -1,22 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Tasks; - -/// -/// Describes a single task. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class Task -{ - public Guid Id { get; set; } - - public string Name { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}, {nameof(Name)}: {Name}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Tasks/Models/Tasks.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Tasks/Models/Tasks.verified.cs deleted file mode 100644 index 46184142..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Tasks/Models/Tasks.verified.cs +++ /dev/null @@ -1,23 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Tasks; - -/// -/// Contains a list of Tasks. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class Tasks -{ - /// - /// A list of Task. - /// - public List TaskList { get; set; } = new List(); - - /// - public override string ToString() - => $"{nameof(TaskList)}.Count: {TaskList?.Count ?? 0}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Tasks/Results/GetTasksResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Tasks/Results/GetTasksResult.verified.cs deleted file mode 100644 index c52f3c91..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Tasks/Results/GetTasksResult.verified.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Tasks; - -/// -/// Results for operation request. -/// Description: Returns tasks. -/// Operation: GetTasks. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetTasksResult : ResultBase -{ - private GetTasksResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static GetTasksResult Ok(IEnumerable response) - => new GetTasksResult(new OkObjectResult(response ?? Enumerable.Empty())); - - /// - /// Performs an implicit conversion from GetTasksResult to ActionResult. - /// - public static implicit operator GetTasksResult(List response) - => Ok(response); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Interfaces/IDeleteUserByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Interfaces/IDeleteUserByIdHandler.verified.cs deleted file mode 100644 index 8e6dd99b..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Interfaces/IDeleteUserByIdHandler.verified.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Users; - -/// -/// Domain Interface for RequestHandler. -/// Description: Delete user by id. -/// Operation: DeleteUserById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IDeleteUserByIdHandler -{ - /// - /// Execute method. - /// - /// The parameters. - /// The cancellation token. - Task ExecuteAsync( - DeleteUserByIdParameters parameters, - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Interfaces/IGetUserByEmailHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Interfaces/IGetUserByEmailHandler.verified.cs deleted file mode 100644 index 1230cf6f..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Interfaces/IGetUserByEmailHandler.verified.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Users; - -/// -/// Domain Interface for RequestHandler. -/// Description: Get user by email. -/// Operation: GetUserByEmail. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetUserByEmailHandler -{ - /// - /// Execute method. - /// - /// The parameters. - /// The cancellation token. - Task ExecuteAsync( - GetUserByEmailParameters parameters, - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Interfaces/IGetUserByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Interfaces/IGetUserByIdHandler.verified.cs deleted file mode 100644 index 18a9b837..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Interfaces/IGetUserByIdHandler.verified.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Users; - -/// -/// Domain Interface for RequestHandler. -/// Description: Get user by id. -/// Operation: GetUserById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetUserByIdHandler -{ - /// - /// Execute method. - /// - /// The parameters. - /// The cancellation token. - Task ExecuteAsync( - GetUserByIdParameters parameters, - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Interfaces/IGetUsersHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Interfaces/IGetUsersHandler.verified.cs deleted file mode 100644 index 08e971b7..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Interfaces/IGetUsersHandler.verified.cs +++ /dev/null @@ -1,23 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Users; - -/// -/// Domain Interface for RequestHandler. -/// Description: Get all users. -/// Operation: GetUsers. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetUsersHandler -{ - /// - /// Execute method. - /// - /// The cancellation token. - Task ExecuteAsync( - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Interfaces/IPostUserHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Interfaces/IPostUserHandler.verified.cs deleted file mode 100644 index 8b463bfe..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Interfaces/IPostUserHandler.verified.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Users; - -/// -/// Domain Interface for RequestHandler. -/// Description: Create a new user. -/// Operation: PostUser. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IPostUserHandler -{ - /// - /// Execute method. - /// - /// The parameters. - /// The cancellation token. - Task ExecuteAsync( - PostUserParameters parameters, - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Interfaces/IUpdateMyTestGenderHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Interfaces/IUpdateMyTestGenderHandler.verified.cs deleted file mode 100644 index a7710589..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Interfaces/IUpdateMyTestGenderHandler.verified.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Users; - -/// -/// Domain Interface for RequestHandler. -/// Description: Update gender on a user. -/// Operation: UpdateMyTestGender. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IUpdateMyTestGenderHandler -{ - /// - /// Execute method. - /// - /// The parameters. - /// The cancellation token. - Task ExecuteAsync( - UpdateMyTestGenderParameters parameters, - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Interfaces/IUpdateUserByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Interfaces/IUpdateUserByIdHandler.verified.cs deleted file mode 100644 index 055125a4..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Interfaces/IUpdateUserByIdHandler.verified.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Users; - -/// -/// Domain Interface for RequestHandler. -/// Description: Update user by id. -/// Operation: UpdateUserById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IUpdateUserByIdHandler -{ - /// - /// Execute method. - /// - /// The parameters. - /// The cancellation token. - Task ExecuteAsync( - UpdateUserByIdParameters parameters, - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Models/CreateUserRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Models/CreateUserRequest.verified.cs deleted file mode 100644 index b2a29703..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Models/CreateUserRequest.verified.cs +++ /dev/null @@ -1,65 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Users; - -/// -/// Request to create a user. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class CreateUserRequest -{ - [Required] - public string FirstName { get; set; } - - [Required] - public string LastName { get; set; } - - public DateTimeOffset? MyNullableDateTime { get; set; } - - [Required] - public DateTimeOffset MyDateTime { get; set; } - - /// - /// Undefined description. - /// - /// - /// Email validation being enforced. - /// - [Required] - [EmailAddress] - public string Email { get; set; } - - /// - /// Undefined description. - /// - /// - /// Url validation being enforced. - /// - [Uri] - public Uri Homepage { get; set; } - - /// - /// GenderType. - /// - [Required] - public GenderType Gender { get; set; } - - public Address? MyNullableAddress { get; set; } - - [Required] - public Dictionary Tags { get; set; } - - public Dictionary DesiredProperties1 { get; set; } - - public Dictionary? DesiredProperties2 { get; set; } - - public Dictionary? DesiredProperties3 { get; set; } - - /// - public override string ToString() - => $"{nameof(FirstName)}: {FirstName}, {nameof(LastName)}: {LastName}, {nameof(MyNullableDateTime)}: ({MyNullableDateTime}), {nameof(MyDateTime)}: ({MyDateTime}), {nameof(Email)}: {Email}, {nameof(Homepage)}: ({Homepage}), {nameof(Gender)}: {Gender}, {nameof(MyNullableAddress)}: ({MyNullableAddress}), {nameof(Tags)}: ({Tags}), {nameof(DesiredProperties1)}: ({DesiredProperties1}), {nameof(DesiredProperties2)}: ({DesiredProperties2}), {nameof(DesiredProperties3)}: ({DesiredProperties3})"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Models/UpdateTestGenderRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Models/UpdateTestGenderRequest.verified.cs deleted file mode 100644 index 6868abb4..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Models/UpdateTestGenderRequest.verified.cs +++ /dev/null @@ -1,23 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Users; - -/// -/// Update test-gender Request. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UpdateTestGenderRequest -{ - /// - /// GenderType. - /// - public GenderType Gender { get; set; } - - /// - public override string ToString() - => $"{nameof(Gender)}: {Gender}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Models/UpdateUserRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Models/UpdateUserRequest.verified.cs deleted file mode 100644 index bffc1887..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Models/UpdateUserRequest.verified.cs +++ /dev/null @@ -1,36 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Users; - -/// -/// Request to update a user. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UpdateUserRequest -{ - public string FirstName { get; set; } - - public string LastName { get; set; } - - /// - /// Undefined description. - /// - /// - /// Email validation being enforced. - /// - [EmailAddress] - public string Email { get; set; } - - /// - /// GenderType. - /// - public GenderType Gender { get; set; } - - /// - public override string ToString() - => $"{nameof(FirstName)}: {FirstName}, {nameof(LastName)}: {LastName}, {nameof(Email)}: {Email}, {nameof(Gender)}: {Gender}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Models/User.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Models/User.verified.cs deleted file mode 100644 index 653fa8b1..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Models/User.verified.cs +++ /dev/null @@ -1,62 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Users; - -/// -/// A single user. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class User -{ - public Guid Id { get; set; } - - /// - /// GenderType. - /// - public GenderType Gender { get; set; } - - public string FirstName { get; set; } - - public string LastName { get; set; } - - /// - /// Undefined description. - /// - /// - /// Email validation being enforced. - /// - [EmailAddress] - public string Email { get; set; } - - /// - /// Undefined description. - /// - /// - /// Url validation being enforced. - /// - [Uri] - public Uri Homepage { get; set; } - - /// - /// ColorType. - /// - public ColorType Color { get; set; } - - /// - /// Address. - /// - public Address HomeAddress { get; set; } - - /// - /// Address. - /// - public Address CompanyAddress { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}, {nameof(Gender)}: {Gender}, {nameof(FirstName)}: {FirstName}, {nameof(LastName)}: {LastName}, {nameof(Email)}: {Email}, {nameof(Homepage)}: ({Homepage}), {nameof(Color)}: {Color}, {nameof(HomeAddress)}: ({HomeAddress}), {nameof(CompanyAddress)}: ({CompanyAddress})"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Models/Users.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Models/Users.verified.cs deleted file mode 100644 index 3d6a79f1..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Models/Users.verified.cs +++ /dev/null @@ -1,23 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Users; - -/// -/// A list of users. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class Users -{ - /// - /// A list of User. - /// - public List UserList { get; set; } = new List(); - - /// - public override string ToString() - => $"{nameof(UserList)}.Count: {UserList?.Count ?? 0}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Parameters/DeleteUserByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Parameters/DeleteUserByIdParameters.verified.cs deleted file mode 100644 index bd8d958f..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Parameters/DeleteUserByIdParameters.verified.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Users; - -/// -/// Parameters for operation request. -/// Description: Delete user by id. -/// Operation: DeleteUserById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class DeleteUserByIdParameters -{ - /// - /// Id of the user. - /// - [FromRoute(Name = "id")] - [Required] - public Guid Id { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Parameters/GetUserByEmailParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Parameters/GetUserByEmailParameters.verified.cs deleted file mode 100644 index f2212b68..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Parameters/GetUserByEmailParameters.verified.cs +++ /dev/null @@ -1,31 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Users; - -/// -/// Parameters for operation request. -/// Description: Get user by email. -/// Operation: GetUserByEmail. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetUserByEmailParameters -{ - /// - /// The email of the user to retrieve. - /// - /// - /// Email validation being enforced. - /// - [FromQuery(Name = "email")] - [Required] - [EmailAddress] - public string Email { get; set; } - - /// - public override string ToString() - => $"{nameof(Email)}: {Email}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Parameters/GetUserByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Parameters/GetUserByIdParameters.verified.cs deleted file mode 100644 index 23e4454c..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Parameters/GetUserByIdParameters.verified.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Users; - -/// -/// Parameters for operation request. -/// Description: Get user by id. -/// Operation: GetUserById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetUserByIdParameters -{ - /// - /// Id of the user. - /// - [FromRoute(Name = "id")] - [Required] - public Guid Id { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Parameters/PostUserParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Parameters/PostUserParameters.verified.cs deleted file mode 100644 index 5ca980ef..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Parameters/PostUserParameters.verified.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Users; - -/// -/// Parameters for operation request. -/// Description: Create a new user. -/// Operation: PostUser. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class PostUserParameters -{ - /// - /// Request to create a user. - /// - [FromBody] - [Required] - public CreateUserRequest Request { get; set; } - - /// - public override string ToString() - => $"{nameof(Request)}: ({Request})"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Parameters/UpdateMyTestGenderParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Parameters/UpdateMyTestGenderParameters.verified.cs deleted file mode 100644 index 2acb8e59..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Parameters/UpdateMyTestGenderParameters.verified.cs +++ /dev/null @@ -1,40 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Users; - -/// -/// Parameters for operation request. -/// Description: Update gender on a user. -/// Operation: UpdateMyTestGender. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UpdateMyTestGenderParameters -{ - /// - /// Id of the user. - /// - [FromRoute(Name = "id")] - [Required] - public Guid Id { get; set; } - - /// - /// The gender to set on the user. - /// - [FromQuery(Name = "genderParam")] - public GenderType? GenderParam { get; set; } - - /// - /// Update test-gender Request. - /// - [FromBody] - [Required] - public UpdateTestGenderRequest Request { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}, {nameof(GenderParam)}: {GenderParam}, {nameof(Request)}: ({Request})"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Parameters/UpdateUserByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Parameters/UpdateUserByIdParameters.verified.cs deleted file mode 100644 index d3903b57..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Parameters/UpdateUserByIdParameters.verified.cs +++ /dev/null @@ -1,34 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Users; - -/// -/// Parameters for operation request. -/// Description: Update user by id. -/// Operation: UpdateUserById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UpdateUserByIdParameters -{ - /// - /// Id of the user. - /// - [FromRoute(Name = "id")] - [Required] - public Guid Id { get; set; } - - /// - /// Request to update a user. - /// - [FromBody] - [Required] - public UpdateUserRequest Request { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}, {nameof(Request)}: ({Request})"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Results/DeleteUserByIdResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Results/DeleteUserByIdResult.verified.cs deleted file mode 100644 index df0012f1..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Results/DeleteUserByIdResult.verified.cs +++ /dev/null @@ -1,42 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Users; - -/// -/// Results for operation request. -/// Description: Delete user by id. -/// Operation: DeleteUserById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class DeleteUserByIdResult : ResultBase -{ - private DeleteUserByIdResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static DeleteUserByIdResult Ok(string? message = null) - => new DeleteUserByIdResult(new OkObjectResult(message)); - - /// - /// 404 - NotFound response. - /// - public static DeleteUserByIdResult NotFound(string? message = null) - => new DeleteUserByIdResult(new NotFoundObjectResult(message)); - - /// - /// 409 - Conflict response. - /// - public static DeleteUserByIdResult Conflict(string? error = null) - => new DeleteUserByIdResult(new ConflictObjectResult(error)); - - /// - /// Performs an implicit conversion from DeleteUserByIdResult to ActionResult. - /// - public static implicit operator DeleteUserByIdResult(string response) - => Ok(response); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Results/GetUserByEmailResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Results/GetUserByEmailResult.verified.cs deleted file mode 100644 index 20d0c4b6..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Results/GetUserByEmailResult.verified.cs +++ /dev/null @@ -1,48 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Users; - -/// -/// Results for operation request. -/// Description: Get user by email. -/// Operation: GetUserByEmail. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetUserByEmailResult : ResultBase -{ - private GetUserByEmailResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static GetUserByEmailResult Ok(User response) - => new GetUserByEmailResult(new OkObjectResult(response)); - - /// - /// 400 - BadRequest response. - /// - public static GetUserByEmailResult BadRequest(string message) - => new GetUserByEmailResult(new BadRequestObjectResult(message)); - - /// - /// 404 - NotFound response. - /// - public static GetUserByEmailResult NotFound(string? message = null) - => new GetUserByEmailResult(new NotFoundObjectResult(message)); - - /// - /// 409 - Conflict response. - /// - public static GetUserByEmailResult Conflict(string? error = null) - => new GetUserByEmailResult(new ConflictObjectResult(error)); - - /// - /// Performs an implicit conversion from GetUserByEmailResult to ActionResult. - /// - public static implicit operator GetUserByEmailResult(User response) - => Ok(response); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Results/GetUserByIdResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Results/GetUserByIdResult.verified.cs deleted file mode 100644 index acba4e4d..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Results/GetUserByIdResult.verified.cs +++ /dev/null @@ -1,42 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Users; - -/// -/// Results for operation request. -/// Description: Get user by id. -/// Operation: GetUserById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetUserByIdResult : ResultBase -{ - private GetUserByIdResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static GetUserByIdResult Ok(User response) - => new GetUserByIdResult(new OkObjectResult(response)); - - /// - /// 404 - NotFound response. - /// - public static GetUserByIdResult NotFound(string? message = null) - => new GetUserByIdResult(new NotFoundObjectResult(message)); - - /// - /// 409 - Conflict response. - /// - public static GetUserByIdResult Conflict(string? error = null) - => new GetUserByIdResult(new ConflictObjectResult(error)); - - /// - /// Performs an implicit conversion from GetUserByIdResult to ActionResult. - /// - public static implicit operator GetUserByIdResult(User response) - => Ok(response); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Results/GetUsersResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Results/GetUsersResult.verified.cs deleted file mode 100644 index 347e8b52..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Results/GetUsersResult.verified.cs +++ /dev/null @@ -1,36 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Users; - -/// -/// Results for operation request. -/// Description: Get all users. -/// Operation: GetUsers. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetUsersResult : ResultBase -{ - private GetUsersResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static GetUsersResult Ok(IEnumerable response) - => new GetUsersResult(new OkObjectResult(response ?? Enumerable.Empty())); - - /// - /// 409 - Conflict response. - /// - public static GetUsersResult Conflict(string? error = null) - => new GetUsersResult(new ConflictObjectResult(error)); - - /// - /// Performs an implicit conversion from GetUsersResult to ActionResult. - /// - public static implicit operator GetUsersResult(List response) - => Ok(response); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Results/PostUserResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Results/PostUserResult.verified.cs deleted file mode 100644 index 4e15f3c3..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Results/PostUserResult.verified.cs +++ /dev/null @@ -1,36 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Users; - -/// -/// Results for operation request. -/// Description: Create a new user. -/// Operation: PostUser. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class PostUserResult : ResultBase -{ - private PostUserResult(ActionResult result) : base(result) { } - - /// - /// 201 - Created response. - /// - public static PostUserResult Created() - => new PostUserResult(new StatusCodeResult(StatusCodes.Status201Created)); - - /// - /// 400 - BadRequest response. - /// - public static PostUserResult BadRequest(string message) - => new PostUserResult(new BadRequestObjectResult(message)); - - /// - /// 409 - Conflict response. - /// - public static PostUserResult Conflict(string? error = null) - => new PostUserResult(new ConflictObjectResult(error)); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Results/UpdateMyTestGenderResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Results/UpdateMyTestGenderResult.verified.cs deleted file mode 100644 index 040ae3a7..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Results/UpdateMyTestGenderResult.verified.cs +++ /dev/null @@ -1,48 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Users; - -/// -/// Results for operation request. -/// Description: Update gender on a user. -/// Operation: UpdateMyTestGender. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UpdateMyTestGenderResult : ResultBase -{ - private UpdateMyTestGenderResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static UpdateMyTestGenderResult Ok(string? message = null) - => new UpdateMyTestGenderResult(new OkObjectResult(message)); - - /// - /// 400 - BadRequest response. - /// - public static UpdateMyTestGenderResult BadRequest(string message) - => new UpdateMyTestGenderResult(new BadRequestObjectResult(message)); - - /// - /// 404 - NotFound response. - /// - public static UpdateMyTestGenderResult NotFound(string? message = null) - => new UpdateMyTestGenderResult(new NotFoundObjectResult(message)); - - /// - /// 409 - Conflict response. - /// - public static UpdateMyTestGenderResult Conflict(string? error = null) - => new UpdateMyTestGenderResult(new ConflictObjectResult(error)); - - /// - /// Performs an implicit conversion from UpdateMyTestGenderResult to ActionResult. - /// - public static implicit operator UpdateMyTestGenderResult(string response) - => Ok(response); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Results/UpdateUserByIdResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Results/UpdateUserByIdResult.verified.cs deleted file mode 100644 index efbc069b..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/Users/Results/UpdateUserByIdResult.verified.cs +++ /dev/null @@ -1,48 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts.Users; - -/// -/// Results for operation request. -/// Description: Update user by id. -/// Operation: UpdateUserById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UpdateUserByIdResult : ResultBase -{ - private UpdateUserByIdResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static UpdateUserByIdResult Ok(string? message = null) - => new UpdateUserByIdResult(new OkObjectResult(message)); - - /// - /// 400 - BadRequest response. - /// - public static UpdateUserByIdResult BadRequest(string message) - => new UpdateUserByIdResult(new BadRequestObjectResult(message)); - - /// - /// 404 - NotFound response. - /// - public static UpdateUserByIdResult NotFound(string? message = null) - => new UpdateUserByIdResult(new NotFoundObjectResult(message)); - - /// - /// 409 - Conflict response. - /// - public static UpdateUserByIdResult Conflict(string? error = null) - => new UpdateUserByIdResult(new ConflictObjectResult(error)); - - /// - /// Performs an implicit conversion from UpdateUserByIdResult to ActionResult. - /// - public static implicit operator UpdateUserByIdResult(string response) - => Ok(response); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/_EnumerationTypes/ColorType.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/_EnumerationTypes/ColorType.verified.cs deleted file mode 100644 index 642a07ad..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/_EnumerationTypes/ColorType.verified.cs +++ /dev/null @@ -1,21 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts; - -/// -/// Enumeration: ColorType. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -[Flags] -public enum ColorType -{ - None = 0, - Black = 1, - White = 2, - Yellow = 4, - Red = 8, -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/_EnumerationTypes/GenderType.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/_EnumerationTypes/GenderType.verified.cs deleted file mode 100644 index db686d89..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/_EnumerationTypes/GenderType.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts; - -/// -/// Enumeration: GenderType. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public enum GenderType -{ - None, - NonBinary, - Male, - Female, -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/_Shared/Address.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/_Shared/Address.verified.cs deleted file mode 100644 index 8a2e7969..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/_Shared/Address.verified.cs +++ /dev/null @@ -1,32 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts; - -/// -/// Address. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class Address -{ - [StringLength(255)] - public string StreetName { get; set; } - - public string StreetNumber { get; set; } - - public string PostalCode { get; set; } - - public string CityName { get; set; } - - /// - /// Country. - /// - public Country MyCountry { get; set; } - - /// - public override string ToString() - => $"{nameof(StreetName)}: {StreetName}, {nameof(StreetNumber)}: {StreetNumber}, {nameof(PostalCode)}: {PostalCode}, {nameof(CityName)}: {CityName}, {nameof(MyCountry)}: ({MyCountry})"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/_Shared/Country.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/_Shared/Country.verified.cs deleted file mode 100644 index d60f8846..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Contracts/_Shared/Country.verified.cs +++ /dev/null @@ -1,33 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Contracts; - -/// -/// Country. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class Country -{ - [Required] - public string Name { get; set; } - - [Required] - [MinLength(2)] - [MaxLength(2)] - [RegularExpression("^[A-Za-z]{2}$")] - public string Alpha2Code { get; set; } - - [Required] - [MinLength(3)] - [MaxLength(3)] - [RegularExpression("^[A-Za-z]{3}$")] - public string Alpha3Code { get; set; } - - /// - public override string ToString() - => $"{nameof(Name)}: {Name}, {nameof(Alpha2Code)}: {Alpha2Code}, {nameof(Alpha3Code)}: {Alpha3Code}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Endpoints/AccountsController.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Endpoints/AccountsController.verified.cs deleted file mode 100644 index 3da0b1d1..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Endpoints/AccountsController.verified.cs +++ /dev/null @@ -1,47 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Endpoints; - -/// -/// Endpoint definitions. -/// -[Authorize] -[ApiController] -[Route("/api/v1/accounts")] -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class AccountsController : ControllerBase -{ - /// - /// Description: Update name of account. - /// Operation: UpdateAccountName. - /// - [HttpPut("{accountId}/name")] - [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(StatusCodes.Status401Unauthorized)] - [ProducesResponseType(StatusCodes.Status403Forbidden)] - public async Task UpdateAccountName( - UpdateAccountNameParameters parameters, - [FromServices] IUpdateAccountNameHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(parameters, cancellationToken); - - /// - /// Description: Set name of account. - /// Operation: SetAccountName. - /// - [HttpPost("{accountId}/name")] - [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(StatusCodes.Status401Unauthorized)] - [ProducesResponseType(StatusCodes.Status403Forbidden)] - public async Task SetAccountName( - SetAccountNameParameters parameters, - [FromServices] ISetAccountNameHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(parameters, cancellationToken); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Endpoints/AddressesController.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Endpoints/AddressesController.verified.cs deleted file mode 100644 index 64942c8a..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Endpoints/AddressesController.verified.cs +++ /dev/null @@ -1,32 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Endpoints; - -/// -/// Endpoint definitions. -/// -[Authorize] -[ApiController] -[Route("/api/v1/addresses")] -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class AddressesController : ControllerBase -{ - /// - /// Description: Get addresses by postal code. - /// Operation: GetAddressesByPostalCodes. - /// - [HttpGet("{postalCode}")] - [ProducesResponseType(typeof(List
), StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status401Unauthorized)] - [ProducesResponseType(StatusCodes.Status403Forbidden)] - [ProducesResponseType(typeof(string), StatusCodes.Status404NotFound)] - public async Task GetAddressesByPostalCodes( - GetAddressesByPostalCodesParameters parameters, - [FromServices] IGetAddressesByPostalCodesHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(parameters, cancellationToken); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Endpoints/EventArgsController.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Endpoints/EventArgsController.verified.cs deleted file mode 100644 index 7b353edc..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Endpoints/EventArgsController.verified.cs +++ /dev/null @@ -1,45 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Endpoints; - -/// -/// Endpoint definitions. -/// -[Authorize] -[ApiController] -[Route("/api/v1/eventArgs")] -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class EventArgsController : ControllerBase -{ - /// - /// Description: Get EventArgs List. - /// Operation: GetEventArgs. - /// - [HttpGet] - [ProducesResponseType(typeof(List), StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status401Unauthorized)] - [ProducesResponseType(StatusCodes.Status403Forbidden)] - public async Task GetEventArgs( - [FromServices] IGetEventArgsHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(cancellationToken); - - /// - /// Description: Get EventArgs By Id. - /// Operation: GetEventArgById. - /// - [HttpGet("{id}")] - [ProducesResponseType(typeof(DemoSampleApi.Api.Generated.Contracts.EventArgs.EventArgs), StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status401Unauthorized)] - [ProducesResponseType(StatusCodes.Status403Forbidden)] - [ProducesResponseType(typeof(string), StatusCodes.Status404NotFound)] - public async Task GetEventArgById( - GetEventArgByIdParameters parameters, - [FromServices] IGetEventArgByIdHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(parameters, cancellationToken); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Endpoints/FilesController.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Endpoints/FilesController.verified.cs deleted file mode 100644 index a2e4d670..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Endpoints/FilesController.verified.cs +++ /dev/null @@ -1,96 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Endpoints; - -/// -/// Endpoint definitions. -/// -[Authorize] -[ApiController] -[Route("/api/v1/files")] -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class FilesController : ControllerBase -{ - /// - /// Description: Upload multi files as form data. - /// Operation: UploadMultiFilesAsFormData. - /// - [HttpPost("form-data/multiFile")] - [RequestFormLimits(MultipartBodyLengthLimit = long.MaxValue)] - [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(StatusCodes.Status401Unauthorized)] - [ProducesResponseType(StatusCodes.Status403Forbidden)] - public async Task UploadMultiFilesAsFormData( - UploadMultiFilesAsFormDataParameters parameters, - [FromServices] IUploadMultiFilesAsFormDataHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(parameters, cancellationToken); - - /// - /// Description: Upload a file as OctetStream. - /// Operation: UploadSingleFileAsFormData. - /// - [HttpPost("form-data/singleFile")] - [RequestFormLimits(MultipartBodyLengthLimit = long.MaxValue)] - [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(StatusCodes.Status401Unauthorized)] - [ProducesResponseType(StatusCodes.Status403Forbidden)] - public async Task UploadSingleFileAsFormData( - UploadSingleFileAsFormDataParameters parameters, - [FromServices] IUploadSingleFileAsFormDataHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(parameters, cancellationToken); - - /// - /// Description: Upload a file as FormData. - /// Operation: UploadSingleObjectWithFileAsFormData. - /// - [HttpPost("form-data/singleObject")] - [RequestFormLimits(MultipartBodyLengthLimit = long.MaxValue)] - [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(StatusCodes.Status401Unauthorized)] - [ProducesResponseType(StatusCodes.Status403Forbidden)] - public async Task UploadSingleObjectWithFileAsFormData( - UploadSingleObjectWithFileAsFormDataParameters parameters, - [FromServices] IUploadSingleObjectWithFileAsFormDataHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(parameters, cancellationToken); - - /// - /// Description: Upload files as FormData. - /// Operation: UploadSingleObjectWithFilesAsFormData. - /// - [HttpPost("form-data/singleObjectMultiFile")] - [RequestFormLimits(MultipartBodyLengthLimit = long.MaxValue)] - [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(StatusCodes.Status401Unauthorized)] - [ProducesResponseType(StatusCodes.Status403Forbidden)] - public async Task UploadSingleObjectWithFilesAsFormData( - UploadSingleObjectWithFilesAsFormDataParameters parameters, - [FromServices] IUploadSingleObjectWithFilesAsFormDataHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(parameters, cancellationToken); - - /// - /// Description: Get File By Id. - /// Operation: GetFileById. - /// - [HttpGet("{id}")] - [ProducesResponseType(typeof(byte[]), StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status401Unauthorized)] - [ProducesResponseType(StatusCodes.Status403Forbidden)] - [ProducesResponseType(typeof(string), StatusCodes.Status404NotFound)] - public async Task GetFileById( - GetFileByIdParameters parameters, - [FromServices] IGetFileByIdHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(parameters, cancellationToken); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Endpoints/ItemsController.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Endpoints/ItemsController.verified.cs deleted file mode 100644 index 1c2c17db..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Endpoints/ItemsController.verified.cs +++ /dev/null @@ -1,47 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Endpoints; - -/// -/// Endpoint definitions. -/// -[Authorize] -[ApiController] -[Route("/api/v1/items")] -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class ItemsController : ControllerBase -{ - /// - /// Description: Create a new item. - /// Operation: CreateItem. - /// - [HttpPost] - [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(StatusCodes.Status401Unauthorized)] - [ProducesResponseType(StatusCodes.Status403Forbidden)] - public async Task CreateItem( - CreateItemParameters parameters, - [FromServices] ICreateItemHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(parameters, cancellationToken); - - /// - /// Description: Updates an item. - /// Operation: UpdateItem. - /// - [HttpPut("{id}")] - [ProducesResponseType(typeof(Guid), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(StatusCodes.Status401Unauthorized)] - [ProducesResponseType(StatusCodes.Status403Forbidden)] - public async Task UpdateItem( - UpdateItemParameters parameters, - [FromServices] IUpdateItemHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(parameters, cancellationToken); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Endpoints/OrdersController.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Endpoints/OrdersController.verified.cs deleted file mode 100644 index a2c8a6a2..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Endpoints/OrdersController.verified.cs +++ /dev/null @@ -1,68 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Endpoints; - -/// -/// Endpoint definitions. -/// -[Authorize] -[ApiController] -[Route("/api/v1/orders")] -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class OrdersController : ControllerBase -{ - /// - /// Description: Get orders. - /// Operation: GetOrders. - /// - [Authorize] - [HttpGet] - [ProducesResponseType(typeof(Pagination), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(StatusCodes.Status401Unauthorized)] - [ProducesResponseType(StatusCodes.Status403Forbidden)] - [ProducesResponseType(typeof(string), StatusCodes.Status404NotFound)] - public async Task GetOrders( - GetOrdersParameters parameters, - [FromServices] IGetOrdersHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(parameters, cancellationToken); - - /// - /// Description: Get order by id. - /// Operation: GetOrderById. - /// - [AllowAnonymous] - [HttpGet("{id}")] - [ProducesResponseType(typeof(Order), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(typeof(string), StatusCodes.Status404NotFound)] - public async Task GetOrderById( - GetOrderByIdParameters parameters, - [FromServices] IGetOrderByIdHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(parameters, cancellationToken); - - /// - /// Description: Update part of order by id. - /// Operation: PatchOrdersId. - /// - [Authorize(Roles = "admin,operator")] - [HttpPatch("{id}")] - [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(StatusCodes.Status401Unauthorized)] - [ProducesResponseType(StatusCodes.Status403Forbidden)] - [ProducesResponseType(typeof(string), StatusCodes.Status404NotFound)] - [ProducesResponseType(typeof(string), StatusCodes.Status409Conflict)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status502BadGateway)] - public async Task PatchOrdersId( - PatchOrdersIdParameters parameters, - [FromServices] IPatchOrdersIdHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(parameters, cancellationToken); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Endpoints/RouteWithDashController.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Endpoints/RouteWithDashController.verified.cs deleted file mode 100644 index 6591c078..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Endpoints/RouteWithDashController.verified.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Endpoints; - -/// -/// Endpoint definitions. -/// -[Authorize] -[ApiController] -[Route("/api/v1/route-with-dash")] -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class RouteWithDashController : ControllerBase -{ - /// - /// Description: Your GET endpoint. - /// Operation: GetRouteWithDash. - /// - [HttpGet] - [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status401Unauthorized)] - [ProducesResponseType(StatusCodes.Status403Forbidden)] - public async Task GetRouteWithDash( - [FromServices] IGetRouteWithDashHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(cancellationToken); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Endpoints/TasksController.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Endpoints/TasksController.verified.cs deleted file mode 100644 index 33a72c93..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Endpoints/TasksController.verified.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Endpoints; - -/// -/// Endpoint definitions. -/// -[Authorize] -[ApiController] -[Route("/api/v1/tasks")] -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class TasksController : ControllerBase -{ - /// - /// Description: Returns tasks. - /// Operation: GetTasks. - /// - [HttpGet] - [ProducesResponseType(typeof(List), StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status401Unauthorized)] - [ProducesResponseType(StatusCodes.Status403Forbidden)] - public async Task GetTasks( - [FromServices] IGetTasksHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(cancellationToken); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Endpoints/UsersController.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Endpoints/UsersController.verified.cs deleted file mode 100644 index 89d07e65..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/Endpoints/UsersController.verified.cs +++ /dev/null @@ -1,130 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Generated.Endpoints; - -/// -/// Endpoint definitions. -/// -[Authorize] -[ApiController] -[Route("/api/v1/users")] -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UsersController : ControllerBase -{ - /// - /// Description: Get all users. - /// Operation: GetUsers. - /// - [HttpGet] - [ProducesResponseType(typeof(List), StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status401Unauthorized)] - [ProducesResponseType(StatusCodes.Status403Forbidden)] - [ProducesResponseType(typeof(string), StatusCodes.Status409Conflict)] - public async Task GetUsers( - [FromServices] IGetUsersHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(cancellationToken); - - /// - /// Description: Create a new user. - /// Operation: PostUser. - /// - [HttpPost] - [ProducesResponseType(typeof(string), StatusCodes.Status201Created)] - [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(StatusCodes.Status401Unauthorized)] - [ProducesResponseType(StatusCodes.Status403Forbidden)] - [ProducesResponseType(typeof(string), StatusCodes.Status409Conflict)] - public async Task PostUser( - PostUserParameters parameters, - [FromServices] IPostUserHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(parameters, cancellationToken); - - /// - /// Description: Get user by email. - /// Operation: GetUserByEmail. - /// - [HttpGet("email")] - [ProducesResponseType(typeof(User), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(StatusCodes.Status401Unauthorized)] - [ProducesResponseType(StatusCodes.Status403Forbidden)] - [ProducesResponseType(typeof(string), StatusCodes.Status404NotFound)] - [ProducesResponseType(typeof(string), StatusCodes.Status409Conflict)] - public async Task GetUserByEmail( - GetUserByEmailParameters parameters, - [FromServices] IGetUserByEmailHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(parameters, cancellationToken); - - /// - /// Description: Get user by id. - /// Operation: GetUserById. - /// - [HttpGet("{id}")] - [ProducesResponseType(typeof(User), StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status401Unauthorized)] - [ProducesResponseType(StatusCodes.Status403Forbidden)] - [ProducesResponseType(typeof(string), StatusCodes.Status404NotFound)] - [ProducesResponseType(typeof(string), StatusCodes.Status409Conflict)] - public async Task GetUserById( - GetUserByIdParameters parameters, - [FromServices] IGetUserByIdHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(parameters, cancellationToken); - - /// - /// Description: Update user by id. - /// Operation: UpdateUserById. - /// - [HttpPut("{id}")] - [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(StatusCodes.Status401Unauthorized)] - [ProducesResponseType(StatusCodes.Status403Forbidden)] - [ProducesResponseType(typeof(string), StatusCodes.Status404NotFound)] - [ProducesResponseType(typeof(string), StatusCodes.Status409Conflict)] - public async Task UpdateUserById( - UpdateUserByIdParameters parameters, - [FromServices] IUpdateUserByIdHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(parameters, cancellationToken); - - /// - /// Description: Delete user by id. - /// Operation: DeleteUserById. - /// - [HttpDelete("{id}")] - [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status401Unauthorized)] - [ProducesResponseType(StatusCodes.Status403Forbidden)] - [ProducesResponseType(typeof(string), StatusCodes.Status404NotFound)] - [ProducesResponseType(typeof(string), StatusCodes.Status409Conflict)] - public async Task DeleteUserById( - DeleteUserByIdParameters parameters, - [FromServices] IDeleteUserByIdHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(parameters, cancellationToken); - - /// - /// Description: Update gender on a user. - /// Operation: UpdateMyTestGender. - /// - [HttpPut("{id}/gender")] - [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(StatusCodes.Status401Unauthorized)] - [ProducesResponseType(StatusCodes.Status403Forbidden)] - [ProducesResponseType(typeof(string), StatusCodes.Status404NotFound)] - [ProducesResponseType(typeof(string), StatusCodes.Status409Conflict)] - public async Task UpdateMyTestGender( - UpdateMyTestGenderParameters parameters, - [FromServices] IUpdateMyTestGenderHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(parameters, cancellationToken); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/GlobalUsings.verified.cs deleted file mode 100644 index 5b7b9c82..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api.Generated/GlobalUsings.verified.cs +++ /dev/null @@ -1,20 +0,0 @@ -global using System.CodeDom.Compiler; -global using System.ComponentModel.DataAnnotations; -global using System.Net; - -global using Atc.Rest.Results; - -global using DemoSampleApi.Api.Generated.Contracts; -global using DemoSampleApi.Api.Generated.Contracts.Accounts; -global using DemoSampleApi.Api.Generated.Contracts.Addresses; -global using DemoSampleApi.Api.Generated.Contracts.EventArgs; -global using DemoSampleApi.Api.Generated.Contracts.Files; -global using DemoSampleApi.Api.Generated.Contracts.Items; -global using DemoSampleApi.Api.Generated.Contracts.Orders; -global using DemoSampleApi.Api.Generated.Contracts.RouteWithDash; -global using DemoSampleApi.Api.Generated.Contracts.Tasks; -global using DemoSampleApi.Api.Generated.Contracts.Users; - -global using Microsoft.AspNetCore.Authorization; -global using Microsoft.AspNetCore.Http; -global using Microsoft.AspNetCore.Mvc; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api/ConfigureSwaggerDocOptions.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api/ConfigureSwaggerDocOptions.verified.cs deleted file mode 100644 index 7001cf7c..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api/ConfigureSwaggerDocOptions.verified.cs +++ /dev/null @@ -1,39 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class ConfigureSwaggerDocOptions : IConfigureOptions -{ - private readonly IApiVersionDescriptionProvider provider; - - public ConfigureSwaggerDocOptions( - IApiVersionDescriptionProvider provider) - => this.provider = provider; - - public void Configure( - SwaggerGenOptions options) - { - foreach (var version in provider.ApiVersionDescriptions) - { - options.SwaggerDoc( - version.GroupName, - new OpenApiInfo - { - Version = "1.0", - Title = "Demo Sample Api", - Description = @"Demo Sample Api - SingleFileVersion", - Contact = new OpenApiContact - { - Name = "atc-net A/S", - }, - }); - } - - options.IncludeXmlComments(Path.ChangeExtension(GetType().Assembly.Location, "xml")); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api/GlobalUsings.verified.cs deleted file mode 100644 index 7e4d6ee4..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api/GlobalUsings.verified.cs +++ /dev/null @@ -1,13 +0,0 @@ -global using System.CodeDom.Compiler; -global using System.Reflection; - -global using Atc.Rest.Extended.Options; - -global using DemoSampleApi.Api.Generated; -global using DemoSampleApi.Domain; - -global using Microsoft.AspNetCore.Mvc.ApiExplorer; -global using Microsoft.Extensions.Options; -global using Microsoft.OpenApi.Models; - -global using Swashbuckle.AspNetCore.SwaggerGen; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api/Program.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api/Program.verified.cs deleted file mode 100644 index 6db4c2c9..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api/Program.verified.cs +++ /dev/null @@ -1,23 +0,0 @@ -namespace DemoSampleApi.Api; - -public static class Program -{ - public static void Main(string[] args) - { - CreateHostBuilder(args) - .Build() - .Run(); - } - - public static IHostBuilder CreateHostBuilder(string[] args) - { - var builder = Host - .CreateDefaultBuilder(args) - .ConfigureWebHostDefaults(webBuilder => - { - webBuilder.UseStartup(); - }); - - return builder; - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api/Startup.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api/Startup.verified.cs deleted file mode 100644 index f66f711a..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Api/Startup.verified.cs +++ /dev/null @@ -1,38 +0,0 @@ -namespace DemoSampleApi.Api; - -public class Startup -{ - private readonly RestApiExtendedOptions restApiOptions; - - public Startup( - IConfiguration configuration) - { - Configuration = configuration; - restApiOptions = new RestApiExtendedOptions - { - // TODO: Remove/out-comment/set to false this for production scenarios! - AllowAnonymousAccessForDevelopment = true, - }; - - restApiOptions.AddAssemblyPairs( - Assembly.GetAssembly(typeof(ApiRegistration)), - Assembly.GetAssembly(typeof(DomainRegistration))); - } - - public IConfiguration Configuration { get; } - - public void ConfigureServices( - IServiceCollection services) - { - services.ConfigureOptions(); - - services.AddRestApi(restApiOptions, Configuration); - } - - public void Configure( - IApplicationBuilder app, - IWebHostEnvironment env) - { - app.ConfigureRestApi(env, restApiOptions); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/DomainRegistration.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/DomainRegistration.verified.cs deleted file mode 100644 index d2c61a07..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/DomainRegistration.verified.cs +++ /dev/null @@ -1,12 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Domain; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class DomainRegistration -{ -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/GlobalUsings.verified.cs deleted file mode 100644 index 6d6d7afc..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/GlobalUsings.verified.cs +++ /dev/null @@ -1,11 +0,0 @@ -global using System.CodeDom.Compiler; - -global using DemoSampleApi.Api.Generated.Contracts.Accounts; -global using DemoSampleApi.Api.Generated.Contracts.Addresses; -global using DemoSampleApi.Api.Generated.Contracts.EventArgs; -global using DemoSampleApi.Api.Generated.Contracts.Files; -global using DemoSampleApi.Api.Generated.Contracts.Items; -global using DemoSampleApi.Api.Generated.Contracts.Orders; -global using DemoSampleApi.Api.Generated.Contracts.RouteWithDash; -global using DemoSampleApi.Api.Generated.Contracts.Tasks; -global using DemoSampleApi.Api.Generated.Contracts.Users; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Accounts/SetAccountNameHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Accounts/SetAccountNameHandler.verified.cs deleted file mode 100644 index c347df3e..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Accounts/SetAccountNameHandler.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace DemoSampleApi.Domain.Handlers.Accounts; - -/// -/// Handler for operation request. -/// Description: Set name of account. -/// Operation: SetAccountName. -/// -public class SetAccountNameHandler : ISetAccountNameHandler -{ - public Task ExecuteAsync( - SetAccountNameParameters parameters, - CancellationToken cancellationToken = default) - { - ArgumentNullException.ThrowIfNull(parameters); - - throw new NotImplementedException("Add logic here for SetAccountNameHandler"); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Accounts/UpdateAccountNameHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Accounts/UpdateAccountNameHandler.verified.cs deleted file mode 100644 index f149c1e9..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Accounts/UpdateAccountNameHandler.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace DemoSampleApi.Domain.Handlers.Accounts; - -/// -/// Handler for operation request. -/// Description: Update name of account. -/// Operation: UpdateAccountName. -/// -public class UpdateAccountNameHandler : IUpdateAccountNameHandler -{ - public Task ExecuteAsync( - UpdateAccountNameParameters parameters, - CancellationToken cancellationToken = default) - { - ArgumentNullException.ThrowIfNull(parameters); - - throw new NotImplementedException("Add logic here for UpdateAccountNameHandler"); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Addresses/GetAddressesByPostalCodesHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Addresses/GetAddressesByPostalCodesHandler.verified.cs deleted file mode 100644 index 14794a66..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Addresses/GetAddressesByPostalCodesHandler.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace DemoSampleApi.Domain.Handlers.Addresses; - -/// -/// Handler for operation request. -/// Description: Get addresses by postal code. -/// Operation: GetAddressesByPostalCodes. -/// -public class GetAddressesByPostalCodesHandler : IGetAddressesByPostalCodesHandler -{ - public Task ExecuteAsync( - GetAddressesByPostalCodesParameters parameters, - CancellationToken cancellationToken = default) - { - ArgumentNullException.ThrowIfNull(parameters); - - throw new NotImplementedException("Add logic here for GetAddressesByPostalCodesHandler"); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/EventArgs/GetEventArgByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/EventArgs/GetEventArgByIdHandler.verified.cs deleted file mode 100644 index e1f95504..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/EventArgs/GetEventArgByIdHandler.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace DemoSampleApi.Domain.Handlers.EventArgs; - -/// -/// Handler for operation request. -/// Description: Get EventArgs By Id. -/// Operation: GetEventArgById. -/// -public class GetEventArgByIdHandler : IGetEventArgByIdHandler -{ - public Task ExecuteAsync( - GetEventArgByIdParameters parameters, - CancellationToken cancellationToken = default) - { - ArgumentNullException.ThrowIfNull(parameters); - - throw new NotImplementedException("Add logic here for GetEventArgByIdHandler"); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/EventArgs/GetEventArgsHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/EventArgs/GetEventArgsHandler.verified.cs deleted file mode 100644 index afe62031..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/EventArgs/GetEventArgsHandler.verified.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace DemoSampleApi.Domain.Handlers.EventArgs; - -/// -/// Handler for operation request. -/// Description: Get EventArgs List. -/// Operation: GetEventArgs. -/// -public class GetEventArgsHandler : IGetEventArgsHandler -{ - public Task ExecuteAsync( - CancellationToken cancellationToken = default) - { - throw new NotImplementedException("Add logic here for GetEventArgsHandler"); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Files/GetFileByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Files/GetFileByIdHandler.verified.cs deleted file mode 100644 index 7a8fc51e..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Files/GetFileByIdHandler.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace DemoSampleApi.Domain.Handlers.Files; - -/// -/// Handler for operation request. -/// Description: Get File By Id. -/// Operation: GetFileById. -/// -public class GetFileByIdHandler : IGetFileByIdHandler -{ - public Task ExecuteAsync( - GetFileByIdParameters parameters, - CancellationToken cancellationToken = default) - { - ArgumentNullException.ThrowIfNull(parameters); - - throw new NotImplementedException("Add logic here for GetFileByIdHandler"); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Files/UploadMultiFilesAsFormDataHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Files/UploadMultiFilesAsFormDataHandler.verified.cs deleted file mode 100644 index 16f0ccfd..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Files/UploadMultiFilesAsFormDataHandler.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace DemoSampleApi.Domain.Handlers.Files; - -/// -/// Handler for operation request. -/// Description: Upload multi files as form data. -/// Operation: UploadMultiFilesAsFormData. -/// -public class UploadMultiFilesAsFormDataHandler : IUploadMultiFilesAsFormDataHandler -{ - public Task ExecuteAsync( - UploadMultiFilesAsFormDataParameters parameters, - CancellationToken cancellationToken = default) - { - ArgumentNullException.ThrowIfNull(parameters); - - throw new NotImplementedException("Add logic here for UploadMultiFilesAsFormDataHandler"); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Files/UploadSingleFileAsFormDataHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Files/UploadSingleFileAsFormDataHandler.verified.cs deleted file mode 100644 index c52f8477..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Files/UploadSingleFileAsFormDataHandler.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace DemoSampleApi.Domain.Handlers.Files; - -/// -/// Handler for operation request. -/// Description: Upload a file as OctetStream. -/// Operation: UploadSingleFileAsFormData. -/// -public class UploadSingleFileAsFormDataHandler : IUploadSingleFileAsFormDataHandler -{ - public Task ExecuteAsync( - UploadSingleFileAsFormDataParameters parameters, - CancellationToken cancellationToken = default) - { - ArgumentNullException.ThrowIfNull(parameters); - - throw new NotImplementedException("Add logic here for UploadSingleFileAsFormDataHandler"); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Files/UploadSingleObjectWithFileAsFormDataHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Files/UploadSingleObjectWithFileAsFormDataHandler.verified.cs deleted file mode 100644 index 37051709..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Files/UploadSingleObjectWithFileAsFormDataHandler.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace DemoSampleApi.Domain.Handlers.Files; - -/// -/// Handler for operation request. -/// Description: Upload a file as FormData. -/// Operation: UploadSingleObjectWithFileAsFormData. -/// -public class UploadSingleObjectWithFileAsFormDataHandler : IUploadSingleObjectWithFileAsFormDataHandler -{ - public Task ExecuteAsync( - UploadSingleObjectWithFileAsFormDataParameters parameters, - CancellationToken cancellationToken = default) - { - ArgumentNullException.ThrowIfNull(parameters); - - throw new NotImplementedException("Add logic here for UploadSingleObjectWithFileAsFormDataHandler"); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Files/UploadSingleObjectWithFilesAsFormDataHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Files/UploadSingleObjectWithFilesAsFormDataHandler.verified.cs deleted file mode 100644 index 377e3836..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Files/UploadSingleObjectWithFilesAsFormDataHandler.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace DemoSampleApi.Domain.Handlers.Files; - -/// -/// Handler for operation request. -/// Description: Upload files as FormData. -/// Operation: UploadSingleObjectWithFilesAsFormData. -/// -public class UploadSingleObjectWithFilesAsFormDataHandler : IUploadSingleObjectWithFilesAsFormDataHandler -{ - public Task ExecuteAsync( - UploadSingleObjectWithFilesAsFormDataParameters parameters, - CancellationToken cancellationToken = default) - { - ArgumentNullException.ThrowIfNull(parameters); - - throw new NotImplementedException("Add logic here for UploadSingleObjectWithFilesAsFormDataHandler"); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Items/CreateItemHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Items/CreateItemHandler.verified.cs deleted file mode 100644 index 1fb4e716..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Items/CreateItemHandler.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace DemoSampleApi.Domain.Handlers.Items; - -/// -/// Handler for operation request. -/// Description: Create a new item. -/// Operation: CreateItem. -/// -public class CreateItemHandler : ICreateItemHandler -{ - public Task ExecuteAsync( - CreateItemParameters parameters, - CancellationToken cancellationToken = default) - { - ArgumentNullException.ThrowIfNull(parameters); - - throw new NotImplementedException("Add logic here for CreateItemHandler"); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Items/UpdateItemHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Items/UpdateItemHandler.verified.cs deleted file mode 100644 index 95d43ebf..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Items/UpdateItemHandler.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace DemoSampleApi.Domain.Handlers.Items; - -/// -/// Handler for operation request. -/// Description: Updates an item. -/// Operation: UpdateItem. -/// -public class UpdateItemHandler : IUpdateItemHandler -{ - public Task ExecuteAsync( - UpdateItemParameters parameters, - CancellationToken cancellationToken = default) - { - ArgumentNullException.ThrowIfNull(parameters); - - throw new NotImplementedException("Add logic here for UpdateItemHandler"); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Orders/GetOrderByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Orders/GetOrderByIdHandler.verified.cs deleted file mode 100644 index 2d323629..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Orders/GetOrderByIdHandler.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace DemoSampleApi.Domain.Handlers.Orders; - -/// -/// Handler for operation request. -/// Description: Get order by id. -/// Operation: GetOrderById. -/// -public class GetOrderByIdHandler : IGetOrderByIdHandler -{ - public Task ExecuteAsync( - GetOrderByIdParameters parameters, - CancellationToken cancellationToken = default) - { - ArgumentNullException.ThrowIfNull(parameters); - - throw new NotImplementedException("Add logic here for GetOrderByIdHandler"); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Orders/GetOrdersHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Orders/GetOrdersHandler.verified.cs deleted file mode 100644 index 8c0a83b4..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Orders/GetOrdersHandler.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace DemoSampleApi.Domain.Handlers.Orders; - -/// -/// Handler for operation request. -/// Description: Get orders. -/// Operation: GetOrders. -/// -public class GetOrdersHandler : IGetOrdersHandler -{ - public Task ExecuteAsync( - GetOrdersParameters parameters, - CancellationToken cancellationToken = default) - { - ArgumentNullException.ThrowIfNull(parameters); - - throw new NotImplementedException("Add logic here for GetOrdersHandler"); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Orders/PatchOrdersIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Orders/PatchOrdersIdHandler.verified.cs deleted file mode 100644 index 6c8f08b3..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Orders/PatchOrdersIdHandler.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace DemoSampleApi.Domain.Handlers.Orders; - -/// -/// Handler for operation request. -/// Description: Update part of order by id. -/// Operation: PatchOrdersId. -/// -public class PatchOrdersIdHandler : IPatchOrdersIdHandler -{ - public Task ExecuteAsync( - PatchOrdersIdParameters parameters, - CancellationToken cancellationToken = default) - { - ArgumentNullException.ThrowIfNull(parameters); - - throw new NotImplementedException("Add logic here for PatchOrdersIdHandler"); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/RouteWithDash/GetRouteWithDashHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/RouteWithDash/GetRouteWithDashHandler.verified.cs deleted file mode 100644 index c0350df9..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/RouteWithDash/GetRouteWithDashHandler.verified.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace DemoSampleApi.Domain.Handlers.RouteWithDash; - -/// -/// Handler for operation request. -/// Description: Your GET endpoint. -/// Operation: GetRouteWithDash. -/// -public class GetRouteWithDashHandler : IGetRouteWithDashHandler -{ - public Task ExecuteAsync( - CancellationToken cancellationToken = default) - { - throw new NotImplementedException("Add logic here for GetRouteWithDashHandler"); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Tasks/GetTasksHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Tasks/GetTasksHandler.verified.cs deleted file mode 100644 index c6209d9d..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Tasks/GetTasksHandler.verified.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace DemoSampleApi.Domain.Handlers.Tasks; - -/// -/// Handler for operation request. -/// Description: Returns tasks. -/// Operation: GetTasks. -/// -public class GetTasksHandler : IGetTasksHandler -{ - public Task ExecuteAsync( - CancellationToken cancellationToken = default) - { - throw new NotImplementedException("Add logic here for GetTasksHandler"); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Users/DeleteUserByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Users/DeleteUserByIdHandler.verified.cs deleted file mode 100644 index 9ba8ffed..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Users/DeleteUserByIdHandler.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace DemoSampleApi.Domain.Handlers.Users; - -/// -/// Handler for operation request. -/// Description: Delete user by id. -/// Operation: DeleteUserById. -/// -public class DeleteUserByIdHandler : IDeleteUserByIdHandler -{ - public Task ExecuteAsync( - DeleteUserByIdParameters parameters, - CancellationToken cancellationToken = default) - { - ArgumentNullException.ThrowIfNull(parameters); - - throw new NotImplementedException("Add logic here for DeleteUserByIdHandler"); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Users/GetUserByEmailHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Users/GetUserByEmailHandler.verified.cs deleted file mode 100644 index e2d28942..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Users/GetUserByEmailHandler.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace DemoSampleApi.Domain.Handlers.Users; - -/// -/// Handler for operation request. -/// Description: Get user by email. -/// Operation: GetUserByEmail. -/// -public class GetUserByEmailHandler : IGetUserByEmailHandler -{ - public Task ExecuteAsync( - GetUserByEmailParameters parameters, - CancellationToken cancellationToken = default) - { - ArgumentNullException.ThrowIfNull(parameters); - - throw new NotImplementedException("Add logic here for GetUserByEmailHandler"); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Users/GetUserByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Users/GetUserByIdHandler.verified.cs deleted file mode 100644 index 98064d82..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Users/GetUserByIdHandler.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace DemoSampleApi.Domain.Handlers.Users; - -/// -/// Handler for operation request. -/// Description: Get user by id. -/// Operation: GetUserById. -/// -public class GetUserByIdHandler : IGetUserByIdHandler -{ - public Task ExecuteAsync( - GetUserByIdParameters parameters, - CancellationToken cancellationToken = default) - { - ArgumentNullException.ThrowIfNull(parameters); - - throw new NotImplementedException("Add logic here for GetUserByIdHandler"); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Users/GetUsersHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Users/GetUsersHandler.verified.cs deleted file mode 100644 index 3d0443a3..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Users/GetUsersHandler.verified.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace DemoSampleApi.Domain.Handlers.Users; - -/// -/// Handler for operation request. -/// Description: Get all users. -/// Operation: GetUsers. -/// -public class GetUsersHandler : IGetUsersHandler -{ - public Task ExecuteAsync( - CancellationToken cancellationToken = default) - { - throw new NotImplementedException("Add logic here for GetUsersHandler"); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Users/PostUserHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Users/PostUserHandler.verified.cs deleted file mode 100644 index 7418abc5..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Users/PostUserHandler.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace DemoSampleApi.Domain.Handlers.Users; - -/// -/// Handler for operation request. -/// Description: Create a new user. -/// Operation: PostUser. -/// -public class PostUserHandler : IPostUserHandler -{ - public Task ExecuteAsync( - PostUserParameters parameters, - CancellationToken cancellationToken = default) - { - ArgumentNullException.ThrowIfNull(parameters); - - throw new NotImplementedException("Add logic here for PostUserHandler"); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Users/UpdateMyTestGenderHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Users/UpdateMyTestGenderHandler.verified.cs deleted file mode 100644 index 58f04e05..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Users/UpdateMyTestGenderHandler.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace DemoSampleApi.Domain.Handlers.Users; - -/// -/// Handler for operation request. -/// Description: Update gender on a user. -/// Operation: UpdateMyTestGender. -/// -public class UpdateMyTestGenderHandler : IUpdateMyTestGenderHandler -{ - public Task ExecuteAsync( - UpdateMyTestGenderParameters parameters, - CancellationToken cancellationToken = default) - { - ArgumentNullException.ThrowIfNull(parameters); - - throw new NotImplementedException("Add logic here for UpdateMyTestGenderHandler"); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Users/UpdateUserByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Users/UpdateUserByIdHandler.verified.cs deleted file mode 100644 index 1a8e3db3..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/src/DemoSampleApi.Domain/Handlers/Users/UpdateUserByIdHandler.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace DemoSampleApi.Domain.Handlers.Users; - -/// -/// Handler for operation request. -/// Description: Update user by id. -/// Operation: UpdateUserById. -/// -public class UpdateUserByIdHandler : IUpdateUserByIdHandler -{ - public Task ExecuteAsync( - UpdateUserByIdParameters parameters, - CancellationToken cancellationToken = default) - { - ArgumentNullException.ThrowIfNull(parameters); - - throw new NotImplementedException("Add logic here for UpdateUserByIdHandler"); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Accounts/SetAccountNameHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Accounts/SetAccountNameHandlerStub.verified.cs deleted file mode 100644 index ac352eef..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Accounts/SetAccountNameHandlerStub.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Tests.Endpoints.Accounts; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class SetAccountNameHandlerStub : ISetAccountNameHandler -{ - public Task ExecuteAsync( - SetAccountNameParameters parameters, - CancellationToken cancellationToken = default) - { - return Task.FromResult(SetAccountNameResult.Ok("Hallo world")); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Accounts/SetAccountNameTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Accounts/SetAccountNameTests.verified.cs deleted file mode 100644 index b121a0e1..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Accounts/SetAccountNameTests.verified.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace DemoSampleApi.Api.Tests.Endpoints.Accounts; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class SetAccountNameTests : WebApiControllerBaseTest -{ - public SetAccountNameTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Accounts/UpdateAccountNameHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Accounts/UpdateAccountNameHandlerStub.verified.cs deleted file mode 100644 index 087eef46..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Accounts/UpdateAccountNameHandlerStub.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Tests.Endpoints.Accounts; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UpdateAccountNameHandlerStub : IUpdateAccountNameHandler -{ - public Task ExecuteAsync( - UpdateAccountNameParameters parameters, - CancellationToken cancellationToken = default) - { - return Task.FromResult(UpdateAccountNameResult.Ok("Hallo world")); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Accounts/UpdateAccountNameTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Accounts/UpdateAccountNameTests.verified.cs deleted file mode 100644 index 4eaf33e7..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Accounts/UpdateAccountNameTests.verified.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace DemoSampleApi.Api.Tests.Endpoints.Accounts; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class UpdateAccountNameTests : WebApiControllerBaseTest -{ - public UpdateAccountNameTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Addresses/GetAddressesByPostalCodesHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Addresses/GetAddressesByPostalCodesHandlerStub.verified.cs deleted file mode 100644 index 531d7bf8..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Addresses/GetAddressesByPostalCodesHandlerStub.verified.cs +++ /dev/null @@ -1,20 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Tests.Endpoints.Addresses; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetAddressesByPostalCodesHandlerStub : IGetAddressesByPostalCodesHandler -{ - public Task ExecuteAsync( - GetAddressesByPostalCodesParameters parameters, - CancellationToken cancellationToken = default) - { - var data = new Fixture().Create>(); - - return Task.FromResult(GetAddressesByPostalCodesResult.Ok(data)); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Addresses/GetAddressesByPostalCodesTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Addresses/GetAddressesByPostalCodesTests.verified.cs deleted file mode 100644 index 205273ec..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Addresses/GetAddressesByPostalCodesTests.verified.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace DemoSampleApi.Api.Tests.Endpoints.Addresses; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class GetAddressesByPostalCodesTests : WebApiControllerBaseTest -{ - public GetAddressesByPostalCodesTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/EventArgs/GetEventArgByIdHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/EventArgs/GetEventArgByIdHandlerStub.verified.cs deleted file mode 100644 index a0902b93..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/EventArgs/GetEventArgByIdHandlerStub.verified.cs +++ /dev/null @@ -1,20 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Tests.Endpoints.EventArgs; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetEventArgByIdHandlerStub : IGetEventArgByIdHandler -{ - public Task ExecuteAsync( - GetEventArgByIdParameters parameters, - CancellationToken cancellationToken = default) - { - var data = new Fixture().Create(); - - return Task.FromResult(GetEventArgByIdResult.Ok(data)); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/EventArgs/GetEventArgByIdTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/EventArgs/GetEventArgByIdTests.verified.cs deleted file mode 100644 index d598e727..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/EventArgs/GetEventArgByIdTests.verified.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace DemoSampleApi.Api.Tests.Endpoints.EventArgs; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class GetEventArgByIdTests : WebApiControllerBaseTest -{ - public GetEventArgByIdTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/EventArgs/GetEventArgsHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/EventArgs/GetEventArgsHandlerStub.verified.cs deleted file mode 100644 index 2f526d30..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/EventArgs/GetEventArgsHandlerStub.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Tests.Endpoints.EventArgs; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetEventArgsHandlerStub : IGetEventArgsHandler -{ - public Task ExecuteAsync( - CancellationToken cancellationToken = default) - { - var data = new Fixture().Create>(); - - return Task.FromResult(GetEventArgsResult.Ok(data)); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/EventArgs/GetEventArgsTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/EventArgs/GetEventArgsTests.verified.cs deleted file mode 100644 index 449d1bd1..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/EventArgs/GetEventArgsTests.verified.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace DemoSampleApi.Api.Tests.Endpoints.EventArgs; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class GetEventArgsTests : WebApiControllerBaseTest -{ - public GetEventArgsTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Files/GetFileByIdHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Files/GetFileByIdHandlerStub.verified.cs deleted file mode 100644 index b5a611cb..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Files/GetFileByIdHandlerStub.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Tests.Endpoints.Files; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetFileByIdHandlerStub : IGetFileByIdHandler -{ - public Task ExecuteAsync( - GetFileByIdParameters parameters, - CancellationToken cancellationToken = default) - { - var bytes = Encoding.UTF8.GetBytes("Hello World"); - return Task.FromResult(GetFileByIdResult.Ok(bytes, "dummy.txt")); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Files/GetFileByIdTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Files/GetFileByIdTests.verified.cs deleted file mode 100644 index cb95bcf5..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Files/GetFileByIdTests.verified.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace DemoSampleApi.Api.Tests.Endpoints.Files; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class GetFileByIdTests : WebApiControllerBaseTest -{ - public GetFileByIdTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Files/UploadMultiFilesAsFormDataHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Files/UploadMultiFilesAsFormDataHandlerStub.verified.cs deleted file mode 100644 index a5f0604d..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Files/UploadMultiFilesAsFormDataHandlerStub.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Tests.Endpoints.Files; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UploadMultiFilesAsFormDataHandlerStub : IUploadMultiFilesAsFormDataHandler -{ - public Task ExecuteAsync( - UploadMultiFilesAsFormDataParameters parameters, - CancellationToken cancellationToken = default) - { - return Task.FromResult(UploadMultiFilesAsFormDataResult.Ok("Hallo world")); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Files/UploadMultiFilesAsFormDataTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Files/UploadMultiFilesAsFormDataTests.verified.cs deleted file mode 100644 index 2d9f5ae0..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Files/UploadMultiFilesAsFormDataTests.verified.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace DemoSampleApi.Api.Tests.Endpoints.Files; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class UploadMultiFilesAsFormDataTests : WebApiControllerBaseTest -{ - public UploadMultiFilesAsFormDataTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Files/UploadSingleFileAsFormDataHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Files/UploadSingleFileAsFormDataHandlerStub.verified.cs deleted file mode 100644 index e2fb5418..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Files/UploadSingleFileAsFormDataHandlerStub.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Tests.Endpoints.Files; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UploadSingleFileAsFormDataHandlerStub : IUploadSingleFileAsFormDataHandler -{ - public Task ExecuteAsync( - UploadSingleFileAsFormDataParameters parameters, - CancellationToken cancellationToken = default) - { - return Task.FromResult(UploadSingleFileAsFormDataResult.Ok("Hallo world")); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Files/UploadSingleFileAsFormDataTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Files/UploadSingleFileAsFormDataTests.verified.cs deleted file mode 100644 index fd4e5280..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Files/UploadSingleFileAsFormDataTests.verified.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace DemoSampleApi.Api.Tests.Endpoints.Files; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class UploadSingleFileAsFormDataTests : WebApiControllerBaseTest -{ - public UploadSingleFileAsFormDataTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Files/UploadSingleObjectWithFileAsFormDataHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Files/UploadSingleObjectWithFileAsFormDataHandlerStub.verified.cs deleted file mode 100644 index 0469c6b2..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Files/UploadSingleObjectWithFileAsFormDataHandlerStub.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Tests.Endpoints.Files; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UploadSingleObjectWithFileAsFormDataHandlerStub : IUploadSingleObjectWithFileAsFormDataHandler -{ - public Task ExecuteAsync( - UploadSingleObjectWithFileAsFormDataParameters parameters, - CancellationToken cancellationToken = default) - { - return Task.FromResult(UploadSingleObjectWithFileAsFormDataResult.Ok("Hallo world")); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Files/UploadSingleObjectWithFileAsFormDataTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Files/UploadSingleObjectWithFileAsFormDataTests.verified.cs deleted file mode 100644 index e8a0d21b..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Files/UploadSingleObjectWithFileAsFormDataTests.verified.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace DemoSampleApi.Api.Tests.Endpoints.Files; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class UploadSingleObjectWithFileAsFormDataTests : WebApiControllerBaseTest -{ - public UploadSingleObjectWithFileAsFormDataTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Files/UploadSingleObjectWithFilesAsFormDataHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Files/UploadSingleObjectWithFilesAsFormDataHandlerStub.verified.cs deleted file mode 100644 index b8333798..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Files/UploadSingleObjectWithFilesAsFormDataHandlerStub.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Tests.Endpoints.Files; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UploadSingleObjectWithFilesAsFormDataHandlerStub : IUploadSingleObjectWithFilesAsFormDataHandler -{ - public Task ExecuteAsync( - UploadSingleObjectWithFilesAsFormDataParameters parameters, - CancellationToken cancellationToken = default) - { - return Task.FromResult(UploadSingleObjectWithFilesAsFormDataResult.Ok("Hallo world")); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Files/UploadSingleObjectWithFilesAsFormDataTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Files/UploadSingleObjectWithFilesAsFormDataTests.verified.cs deleted file mode 100644 index d156f7db..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Files/UploadSingleObjectWithFilesAsFormDataTests.verified.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace DemoSampleApi.Api.Tests.Endpoints.Files; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class UploadSingleObjectWithFilesAsFormDataTests : WebApiControllerBaseTest -{ - public UploadSingleObjectWithFilesAsFormDataTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Items/CreateItemHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Items/CreateItemHandlerStub.verified.cs deleted file mode 100644 index 9a369d36..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Items/CreateItemHandlerStub.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Tests.Endpoints.Items; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class CreateItemHandlerStub : ICreateItemHandler -{ - public Task ExecuteAsync( - CreateItemParameters parameters, - CancellationToken cancellationToken = default) - { - return Task.FromResult(CreateItemResult.Ok("Hallo world")); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Items/CreateItemTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Items/CreateItemTests.verified.cs deleted file mode 100644 index 6e8a8538..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Items/CreateItemTests.verified.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace DemoSampleApi.Api.Tests.Endpoints.Items; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class CreateItemTests : WebApiControllerBaseTest -{ - public CreateItemTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Items/UpdateItemHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Items/UpdateItemHandlerStub.verified.cs deleted file mode 100644 index 935695f5..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Items/UpdateItemHandlerStub.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Tests.Endpoints.Items; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UpdateItemHandlerStub : IUpdateItemHandler -{ - public Task ExecuteAsync( - UpdateItemParameters parameters, - CancellationToken cancellationToken = default) - { - return Task.FromResult(UpdateItemResult.Ok(Guid.NewGuid())); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Items/UpdateItemTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Items/UpdateItemTests.verified.cs deleted file mode 100644 index a0274e4c..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Items/UpdateItemTests.verified.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace DemoSampleApi.Api.Tests.Endpoints.Items; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class UpdateItemTests : WebApiControllerBaseTest -{ - public UpdateItemTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Orders/GetOrderByIdHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Orders/GetOrderByIdHandlerStub.verified.cs deleted file mode 100644 index 4bc76e54..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Orders/GetOrderByIdHandlerStub.verified.cs +++ /dev/null @@ -1,20 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Tests.Endpoints.Orders; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetOrderByIdHandlerStub : IGetOrderByIdHandler -{ - public Task ExecuteAsync( - GetOrderByIdParameters parameters, - CancellationToken cancellationToken = default) - { - var data = new Fixture().Create(); - - return Task.FromResult(GetOrderByIdResult.Ok(data)); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Orders/GetOrderByIdTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Orders/GetOrderByIdTests.verified.cs deleted file mode 100644 index 880d6bbd..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Orders/GetOrderByIdTests.verified.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace DemoSampleApi.Api.Tests.Endpoints.Orders; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class GetOrderByIdTests : WebApiControllerBaseTest -{ - public GetOrderByIdTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Orders/GetOrdersHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Orders/GetOrdersHandlerStub.verified.cs deleted file mode 100644 index 252ecf87..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Orders/GetOrdersHandlerStub.verified.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Tests.Endpoints.Orders; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetOrdersHandlerStub : IGetOrdersHandler -{ - public Task ExecuteAsync( - GetOrdersParameters parameters, - CancellationToken cancellationToken = default) - { - var data = new Fixture().Create>(); - - var paginationData = new Pagination( - data, - parameters.PageSize, - parameters.QueryString, - parameters.ContinuationToken); - - return Task.FromResult(GetOrdersResult.Ok(paginationData)); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Orders/GetOrdersTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Orders/GetOrdersTests.verified.cs deleted file mode 100644 index 50dc86ad..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Orders/GetOrdersTests.verified.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace DemoSampleApi.Api.Tests.Endpoints.Orders; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class GetOrdersTests : WebApiControllerBaseTest -{ - public GetOrdersTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Orders/PatchOrdersIdHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Orders/PatchOrdersIdHandlerStub.verified.cs deleted file mode 100644 index b1a8d509..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Orders/PatchOrdersIdHandlerStub.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Tests.Endpoints.Orders; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class PatchOrdersIdHandlerStub : IPatchOrdersIdHandler -{ - public Task ExecuteAsync( - PatchOrdersIdParameters parameters, - CancellationToken cancellationToken = default) - { - return Task.FromResult(PatchOrdersIdResult.Ok("Hallo world")); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Orders/PatchOrdersIdTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Orders/PatchOrdersIdTests.verified.cs deleted file mode 100644 index 7f2af27b..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Orders/PatchOrdersIdTests.verified.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace DemoSampleApi.Api.Tests.Endpoints.Orders; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class PatchOrdersIdTests : WebApiControllerBaseTest -{ - public PatchOrdersIdTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/RouteWithDash/GetRouteWithDashHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/RouteWithDash/GetRouteWithDashHandlerStub.verified.cs deleted file mode 100644 index 3d28abc1..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/RouteWithDash/GetRouteWithDashHandlerStub.verified.cs +++ /dev/null @@ -1,17 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Tests.Endpoints.RouteWithDash; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetRouteWithDashHandlerStub : IGetRouteWithDashHandler -{ - public Task ExecuteAsync( - CancellationToken cancellationToken = default) - { - return Task.FromResult(GetRouteWithDashResult.Ok("Hallo world")); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/RouteWithDash/GetRouteWithDashTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/RouteWithDash/GetRouteWithDashTests.verified.cs deleted file mode 100644 index 7025a08f..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/RouteWithDash/GetRouteWithDashTests.verified.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace DemoSampleApi.Api.Tests.Endpoints.RouteWithDash; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class GetRouteWithDashTests : WebApiControllerBaseTest -{ - public GetRouteWithDashTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Tasks/GetTasksHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Tasks/GetTasksHandlerStub.verified.cs deleted file mode 100644 index 8cfee14f..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Tasks/GetTasksHandlerStub.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Tests.Endpoints.Tasks; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetTasksHandlerStub : DemoSampleApi.Api.Generated.Contracts.Tasks.IGetTasksHandler -{ - public Task ExecuteAsync( - CancellationToken cancellationToken = default) - { - var data = new Fixture().Create>(); - - return Task.FromResult(DemoSampleApi.Api.Generated.Contracts.Tasks.GetTasksResult.Ok(data)); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Tasks/GetTasksTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Tasks/GetTasksTests.verified.cs deleted file mode 100644 index ebeed557..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Tasks/GetTasksTests.verified.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace DemoSampleApi.Api.Tests.Endpoints.Tasks; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class GetTasksTests : WebApiControllerBaseTest -{ - public GetTasksTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Users/DeleteUserByIdHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Users/DeleteUserByIdHandlerStub.verified.cs deleted file mode 100644 index a88ef7f7..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Users/DeleteUserByIdHandlerStub.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Tests.Endpoints.Users; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class DeleteUserByIdHandlerStub : IDeleteUserByIdHandler -{ - public Task ExecuteAsync( - DeleteUserByIdParameters parameters, - CancellationToken cancellationToken = default) - { - return Task.FromResult(DeleteUserByIdResult.Ok("Hallo world")); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Users/DeleteUserByIdTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Users/DeleteUserByIdTests.verified.cs deleted file mode 100644 index d21dba84..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Users/DeleteUserByIdTests.verified.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace DemoSampleApi.Api.Tests.Endpoints.Users; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class DeleteUserByIdTests : WebApiControllerBaseTest -{ - public DeleteUserByIdTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Users/GetUserByEmailHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Users/GetUserByEmailHandlerStub.verified.cs deleted file mode 100644 index f1a22cbf..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Users/GetUserByEmailHandlerStub.verified.cs +++ /dev/null @@ -1,20 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Tests.Endpoints.Users; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetUserByEmailHandlerStub : IGetUserByEmailHandler -{ - public Task ExecuteAsync( - GetUserByEmailParameters parameters, - CancellationToken cancellationToken = default) - { - var data = new Fixture().Create(); - - return Task.FromResult(GetUserByEmailResult.Ok(data)); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Users/GetUserByEmailTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Users/GetUserByEmailTests.verified.cs deleted file mode 100644 index 0f5c17a5..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Users/GetUserByEmailTests.verified.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace DemoSampleApi.Api.Tests.Endpoints.Users; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class GetUserByEmailTests : WebApiControllerBaseTest -{ - public GetUserByEmailTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Users/GetUserByIdHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Users/GetUserByIdHandlerStub.verified.cs deleted file mode 100644 index 04d9d6e8..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Users/GetUserByIdHandlerStub.verified.cs +++ /dev/null @@ -1,20 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Tests.Endpoints.Users; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetUserByIdHandlerStub : IGetUserByIdHandler -{ - public Task ExecuteAsync( - GetUserByIdParameters parameters, - CancellationToken cancellationToken = default) - { - var data = new Fixture().Create(); - - return Task.FromResult(GetUserByIdResult.Ok(data)); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Users/GetUserByIdTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Users/GetUserByIdTests.verified.cs deleted file mode 100644 index 640815f8..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Users/GetUserByIdTests.verified.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace DemoSampleApi.Api.Tests.Endpoints.Users; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class GetUserByIdTests : WebApiControllerBaseTest -{ - public GetUserByIdTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Users/GetUsersHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Users/GetUsersHandlerStub.verified.cs deleted file mode 100644 index 5d6143c0..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Users/GetUsersHandlerStub.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Tests.Endpoints.Users; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetUsersHandlerStub : IGetUsersHandler -{ - public Task ExecuteAsync( - CancellationToken cancellationToken = default) - { - var data = new Fixture().Create>(); - - return Task.FromResult(GetUsersResult.Ok(data)); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Users/GetUsersTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Users/GetUsersTests.verified.cs deleted file mode 100644 index 24d7cf69..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Users/GetUsersTests.verified.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace DemoSampleApi.Api.Tests.Endpoints.Users; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class GetUsersTests : WebApiControllerBaseTest -{ - public GetUsersTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Users/PostUserHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Users/PostUserHandlerStub.verified.cs deleted file mode 100644 index a291cb32..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Users/PostUserHandlerStub.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Tests.Endpoints.Users; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class PostUserHandlerStub : IPostUserHandler -{ - public Task ExecuteAsync( - PostUserParameters parameters, - CancellationToken cancellationToken = default) - { - return Task.FromResult(PostUserResult.Created()); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Users/PostUserTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Users/PostUserTests.verified.cs deleted file mode 100644 index f974f1ab..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Users/PostUserTests.verified.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace DemoSampleApi.Api.Tests.Endpoints.Users; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class PostUserTests : WebApiControllerBaseTest -{ - public PostUserTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Users/UpdateMyTestGenderHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Users/UpdateMyTestGenderHandlerStub.verified.cs deleted file mode 100644 index 6bc2886d..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Users/UpdateMyTestGenderHandlerStub.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Tests.Endpoints.Users; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UpdateMyTestGenderHandlerStub : IUpdateMyTestGenderHandler -{ - public Task ExecuteAsync( - UpdateMyTestGenderParameters parameters, - CancellationToken cancellationToken = default) - { - return Task.FromResult(UpdateMyTestGenderResult.Ok("Hallo world")); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Users/UpdateMyTestGenderTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Users/UpdateMyTestGenderTests.verified.cs deleted file mode 100644 index 811f0d70..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Users/UpdateMyTestGenderTests.verified.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace DemoSampleApi.Api.Tests.Endpoints.Users; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class UpdateMyTestGenderTests : WebApiControllerBaseTest -{ - public UpdateMyTestGenderTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Users/UpdateUserByIdHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Users/UpdateUserByIdHandlerStub.verified.cs deleted file mode 100644 index 91b8d1ce..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Users/UpdateUserByIdHandlerStub.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Tests.Endpoints.Users; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UpdateUserByIdHandlerStub : IUpdateUserByIdHandler -{ - public Task ExecuteAsync( - UpdateUserByIdParameters parameters, - CancellationToken cancellationToken = default) - { - return Task.FromResult(UpdateUserByIdResult.Ok("Hallo world")); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Users/UpdateUserByIdTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Users/UpdateUserByIdTests.verified.cs deleted file mode 100644 index 586be830..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/Endpoints/Users/UpdateUserByIdTests.verified.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace DemoSampleApi.Api.Tests.Endpoints.Users; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class UpdateUserByIdTests : WebApiControllerBaseTest -{ - public UpdateUserByIdTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/GlobalUsings.verified.cs deleted file mode 100644 index a67226e4..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/GlobalUsings.verified.cs +++ /dev/null @@ -1,27 +0,0 @@ -global using System.CodeDom.Compiler; -global using System.Reflection; -global using System.Text; -global using System.Text.Json; -global using System.Text.Json.Serialization; - -global using Atc.Rest.Options; -global using Atc.Rest.Results; -global using Atc.XUnit; - -global using DemoSampleApi.Api.Generated; -global using DemoSampleApi.Api.Generated.Contracts; -global using DemoSampleApi.Api.Generated.Contracts.Accounts; -global using DemoSampleApi.Api.Generated.Contracts.Addresses; -global using DemoSampleApi.Api.Generated.Contracts.EventArgs; -global using DemoSampleApi.Api.Generated.Contracts.Files; -global using DemoSampleApi.Api.Generated.Contracts.Items; -global using DemoSampleApi.Api.Generated.Contracts.Orders; -global using DemoSampleApi.Api.Generated.Contracts.RouteWithDash; -global using DemoSampleApi.Api.Generated.Contracts.Users; - -global using Microsoft.AspNetCore.Hosting; -global using Microsoft.AspNetCore.Http; -global using Microsoft.AspNetCore.Mvc.Testing; -global using Microsoft.AspNetCore.TestHost; -global using Microsoft.Extensions.Configuration; -global using Microsoft.Extensions.DependencyInjection; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/WebApiControllerBaseTest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/WebApiControllerBaseTest.verified.cs deleted file mode 100644 index eb502dd7..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/WebApiControllerBaseTest.verified.cs +++ /dev/null @@ -1,56 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Tests; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public abstract class WebApiControllerBaseTest : IClassFixture -{ - protected readonly WebApiStartupFactory Factory; - - protected readonly HttpClient HttpClient; - - protected readonly IConfiguration Configuration; - - protected static JsonSerializerOptions? JsonSerializerOptions; - - protected WebApiControllerBaseTest(WebApiStartupFactory fixture) - { - this.Factory = fixture; - this.HttpClient = this.Factory.CreateClient(); - this.Configuration = new ConfigurationBuilder().Build(); - JsonSerializerOptions = new JsonSerializerOptions - { - PropertyNameCaseInsensitive = true, - Converters = - { - new JsonStringEnumConverter() - }, - }; - } - - protected static StringContent ToJson(object data) - => new(JsonSerializer.Serialize(data, JsonSerializerOptions), Encoding.UTF8, "application/json"); - - protected static StringContent Json(string data) - => new(data, Encoding.UTF8, "application/json"); - - protected static IFormFile GetTestFile() - { - var bytes = Encoding.UTF8.GetBytes("Hello World"); - var stream = new MemoryStream(bytes); - var formFile = new FormFile(stream, 0, stream.Length, "dummy", "dummy.txt") - { - Headers = new HeaderDictionary(), - ContentType = "application/octet-stream", - }; - - return formFile; - } - - protected static List GetTestFiles() - => new() { GetTestFile(), GetTestFile() }; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/WebApiStartupFactory.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/WebApiStartupFactory.verified.cs deleted file mode 100644 index d5bb9e42..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Api.Tests/WebApiStartupFactory.verified.cs +++ /dev/null @@ -1,40 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoSampleApi.Api.Tests; - -/// -/// Factory for bootstrapping in memory tests. -/// Includes options to override configuration and service collection using a partial class. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public partial class WebApiStartupFactory : WebApplicationFactory -{ - protected override void ConfigureWebHost(IWebHostBuilder builder) - { - builder.ConfigureAppConfiguration(config => - { - ModifyConfiguration(config); - var integrationConfig = new ConfigurationBuilder() - .AddJsonFile("appsettings.integrationtest.json") - .Build(); - config.AddConfiguration(integrationConfig); - }); - - builder.ConfigureTestServices(services => - { - ModifyServices(services); - services.AddSingleton(); - services.AutoRegistrateServices( - Assembly.GetAssembly(typeof(ApiRegistration))!, - Assembly.GetAssembly(typeof(WebApiStartupFactory))!); - }); - } - - partial void ModifyConfiguration(IConfigurationBuilder config); - - partial void ModifyServices(IServiceCollection services); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Accounts/SetAccountNameHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Accounts/SetAccountNameHandlerTests.verified.cs deleted file mode 100644 index 0b2f702e..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Accounts/SetAccountNameHandlerTests.verified.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace DemoSampleApi.Domain.Tests.Handlers.Accounts; - -public class SetAccountNameHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Accounts/UpdateAccountNameHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Accounts/UpdateAccountNameHandlerTests.verified.cs deleted file mode 100644 index f5c907ca..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Accounts/UpdateAccountNameHandlerTests.verified.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace DemoSampleApi.Domain.Tests.Handlers.Accounts; - -public class UpdateAccountNameHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Addresses/GetAddressesByPostalCodesHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Addresses/GetAddressesByPostalCodesHandlerTests.verified.cs deleted file mode 100644 index d63ce00a..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Addresses/GetAddressesByPostalCodesHandlerTests.verified.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace DemoSampleApi.Domain.Tests.Handlers.Addresses; - -public class GetAddressesByPostalCodesHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/EventArgs/GetEventArgByIdHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/EventArgs/GetEventArgByIdHandlerTests.verified.cs deleted file mode 100644 index 510e6597..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/EventArgs/GetEventArgByIdHandlerTests.verified.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace DemoSampleApi.Domain.Tests.Handlers.EventArgs; - -public class GetEventArgByIdHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/EventArgs/GetEventArgsHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/EventArgs/GetEventArgsHandlerTests.verified.cs deleted file mode 100644 index 2811a9d2..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/EventArgs/GetEventArgsHandlerTests.verified.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace DemoSampleApi.Domain.Tests.Handlers.EventArgs; - -public class GetEventArgsHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Files/GetFileByIdHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Files/GetFileByIdHandlerTests.verified.cs deleted file mode 100644 index bb1fa8ab..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Files/GetFileByIdHandlerTests.verified.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace DemoSampleApi.Domain.Tests.Handlers.Files; - -public class GetFileByIdHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Files/UploadMultiFilesAsFormDataHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Files/UploadMultiFilesAsFormDataHandlerTests.verified.cs deleted file mode 100644 index d3a21e36..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Files/UploadMultiFilesAsFormDataHandlerTests.verified.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace DemoSampleApi.Domain.Tests.Handlers.Files; - -public class UploadMultiFilesAsFormDataHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Files/UploadSingleFileAsFormDataHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Files/UploadSingleFileAsFormDataHandlerTests.verified.cs deleted file mode 100644 index c8f71005..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Files/UploadSingleFileAsFormDataHandlerTests.verified.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace DemoSampleApi.Domain.Tests.Handlers.Files; - -public class UploadSingleFileAsFormDataHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Files/UploadSingleObjectWithFileAsFormDataHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Files/UploadSingleObjectWithFileAsFormDataHandlerTests.verified.cs deleted file mode 100644 index ffffd981..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Files/UploadSingleObjectWithFileAsFormDataHandlerTests.verified.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace DemoSampleApi.Domain.Tests.Handlers.Files; - -public class UploadSingleObjectWithFileAsFormDataHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Files/UploadSingleObjectWithFilesAsFormDataHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Files/UploadSingleObjectWithFilesAsFormDataHandlerTests.verified.cs deleted file mode 100644 index af20d9eb..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Files/UploadSingleObjectWithFilesAsFormDataHandlerTests.verified.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace DemoSampleApi.Domain.Tests.Handlers.Files; - -public class UploadSingleObjectWithFilesAsFormDataHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Items/CreateItemHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Items/CreateItemHandlerTests.verified.cs deleted file mode 100644 index bf3f6be4..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Items/CreateItemHandlerTests.verified.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace DemoSampleApi.Domain.Tests.Handlers.Items; - -public class CreateItemHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Items/UpdateItemHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Items/UpdateItemHandlerTests.verified.cs deleted file mode 100644 index 5217d8d5..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Items/UpdateItemHandlerTests.verified.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace DemoSampleApi.Domain.Tests.Handlers.Items; - -public class UpdateItemHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Orders/GetOrderByIdHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Orders/GetOrderByIdHandlerTests.verified.cs deleted file mode 100644 index 3ec86e85..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Orders/GetOrderByIdHandlerTests.verified.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace DemoSampleApi.Domain.Tests.Handlers.Orders; - -public class GetOrderByIdHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Orders/GetOrdersHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Orders/GetOrdersHandlerTests.verified.cs deleted file mode 100644 index 7ea992fb..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Orders/GetOrdersHandlerTests.verified.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace DemoSampleApi.Domain.Tests.Handlers.Orders; - -public class GetOrdersHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Orders/PatchOrdersIdHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Orders/PatchOrdersIdHandlerTests.verified.cs deleted file mode 100644 index 3ccc2d26..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Orders/PatchOrdersIdHandlerTests.verified.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace DemoSampleApi.Domain.Tests.Handlers.Orders; - -public class PatchOrdersIdHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/RouteWithDash/GetRouteWithDashHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/RouteWithDash/GetRouteWithDashHandlerTests.verified.cs deleted file mode 100644 index 704fff6c..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/RouteWithDash/GetRouteWithDashHandlerTests.verified.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace DemoSampleApi.Domain.Tests.Handlers.RouteWithDash; - -public class GetRouteWithDashHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Tasks/GetTasksHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Tasks/GetTasksHandlerTests.verified.cs deleted file mode 100644 index 57fed80b..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Tasks/GetTasksHandlerTests.verified.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace DemoSampleApi.Domain.Tests.Handlers.Tasks; - -public class GetTasksHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Users/DeleteUserByIdHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Users/DeleteUserByIdHandlerTests.verified.cs deleted file mode 100644 index aaf8cdf2..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Users/DeleteUserByIdHandlerTests.verified.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace DemoSampleApi.Domain.Tests.Handlers.Users; - -public class DeleteUserByIdHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Users/GetUserByEmailHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Users/GetUserByEmailHandlerTests.verified.cs deleted file mode 100644 index 74774070..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Users/GetUserByEmailHandlerTests.verified.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace DemoSampleApi.Domain.Tests.Handlers.Users; - -public class GetUserByEmailHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Users/GetUserByIdHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Users/GetUserByIdHandlerTests.verified.cs deleted file mode 100644 index dcd1449e..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Users/GetUserByIdHandlerTests.verified.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace DemoSampleApi.Domain.Tests.Handlers.Users; - -public class GetUserByIdHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Users/GetUsersHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Users/GetUsersHandlerTests.verified.cs deleted file mode 100644 index b88e6546..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Users/GetUsersHandlerTests.verified.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace DemoSampleApi.Domain.Tests.Handlers.Users; - -public class GetUsersHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Users/PostUserHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Users/PostUserHandlerTests.verified.cs deleted file mode 100644 index 4e4bf08e..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Users/PostUserHandlerTests.verified.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace DemoSampleApi.Domain.Tests.Handlers.Users; - -public class PostUserHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Users/UpdateMyTestGenderHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Users/UpdateMyTestGenderHandlerTests.verified.cs deleted file mode 100644 index 7383a2af..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Users/UpdateMyTestGenderHandlerTests.verified.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace DemoSampleApi.Domain.Tests.Handlers.Users; - -public class UpdateMyTestGenderHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Users/UpdateUserByIdHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Users/UpdateUserByIdHandlerTests.verified.cs deleted file mode 100644 index 535e47df..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/VerifyServerAll/test/DemoSampleApi.Domain.Tests/Handlers/Users/UpdateUserByIdHandlerTests.verified.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace DemoSampleApi.Domain.Tests.Handlers.Users; - -public class UpdateUserByIdHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Contracts/Users/Models/Address.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Contracts/Users/Models/Address.verified.cs deleted file mode 100644 index 5768b844..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Contracts/Users/Models/Address.verified.cs +++ /dev/null @@ -1,32 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.ApiClient.Generated.Contracts; - -/// -/// Address. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class Address -{ - [StringLength(255)] - public string StreetName { get; set; } - - public string StreetNumber { get; set; } - - public string PostalCode { get; set; } - - public string CityName { get; set; } - - /// - /// Country. - /// - public Country MyCountry { get; set; } - - /// - public override string ToString() - => $"{nameof(StreetName)}: {StreetName}, {nameof(StreetNumber)}: {StreetNumber}, {nameof(PostalCode)}: {PostalCode}, {nameof(CityName)}: {CityName}, {nameof(MyCountry)}: ({MyCountry})"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Contracts/Users/Models/Country.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Contracts/Users/Models/Country.verified.cs deleted file mode 100644 index db869f11..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Contracts/Users/Models/Country.verified.cs +++ /dev/null @@ -1,33 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.ApiClient.Generated.Contracts; - -/// -/// Country. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class Country -{ - [Required] - public string Name { get; set; } - - [Required] - [MinLength(2)] - [MaxLength(2)] - [RegularExpression("^[A-Za-z]{2}$")] - public string Alpha2Code { get; set; } - - [Required] - [MinLength(3)] - [MaxLength(3)] - [RegularExpression("^[A-Za-z]{3}$")] - public string Alpha3Code { get; set; } - - /// - public override string ToString() - => $"{nameof(Name)}: {Name}, {nameof(Alpha2Code)}: {Alpha2Code}, {nameof(Alpha3Code)}: {Alpha3Code}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Contracts/Users/Models/User.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Contracts/Users/Models/User.verified.cs deleted file mode 100644 index b103b491..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Contracts/Users/Models/User.verified.cs +++ /dev/null @@ -1,57 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.ApiClient.Generated.Contracts; - -/// -/// A single user. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class User -{ - public Guid Id { get; set; } - - /// - /// GenderType. - /// - public GenderType Gender { get; set; } - - public string FirstName { get; set; } - - public string LastName { get; set; } - - /// - /// Undefined description. - /// - /// - /// Email validation being enforced. - /// - [EmailAddress] - public string Email { get; set; } - - /// - /// Undefined description. - /// - /// - /// Url validation being enforced. - /// - [Uri] - public Uri Homepage { get; set; } - - /// - /// Address. - /// - public Address HomeAddress { get; set; } - - /// - /// Address. - /// - public Address CompanyAddress { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}, {nameof(Gender)}: {Gender}, {nameof(FirstName)}: {FirstName}, {nameof(LastName)}: {LastName}, {nameof(Email)}: {Email}, {nameof(Homepage)}: ({Homepage}), {nameof(HomeAddress)}: ({HomeAddress}), {nameof(CompanyAddress)}: ({CompanyAddress})"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Contracts/Users/Models/Users.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Contracts/Users/Models/Users.verified.cs deleted file mode 100644 index 51c30aea..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Contracts/Users/Models/Users.verified.cs +++ /dev/null @@ -1,23 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.ApiClient.Generated.Contracts; - -/// -/// A list of users. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class Users -{ - /// - /// A list of User. - /// - public List UserList { get; set; } = new List(); - - /// - public override string ToString() - => $"{nameof(UserList)}.Count: {UserList?.Count ?? 0}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Contracts/Users/RequestParameters/CreateUserRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Contracts/Users/RequestParameters/CreateUserRequest.verified.cs deleted file mode 100644 index 2e73ee6c..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Contracts/Users/RequestParameters/CreateUserRequest.verified.cs +++ /dev/null @@ -1,56 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.ApiClient.Generated.Contracts; - -/// -/// Request to create a user. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class CreateUserRequest -{ - [Required] - public string FirstName { get; set; } - - [Required] - public string LastName { get; set; } - - public DateTimeOffset? MyNullableDateTime { get; set; } - - [Required] - public DateTimeOffset MyDateTime { get; set; } - - /// - /// Undefined description. - /// - /// - /// Email validation being enforced. - /// - [Required] - [EmailAddress] - public string Email { get; set; } - - /// - /// Undefined description. - /// - /// - /// Url validation being enforced. - /// - [Uri] - public Uri Homepage { get; set; } - - /// - /// GenderType. - /// - [Required] - public GenderType Gender { get; set; } - - public Address? MyNullableAddress { get; set; } - - /// - public override string ToString() - => $"{nameof(FirstName)}: {FirstName}, {nameof(LastName)}: {LastName}, {nameof(MyNullableDateTime)}: ({MyNullableDateTime}), {nameof(MyDateTime)}: ({MyDateTime}), {nameof(Email)}: {Email}, {nameof(Homepage)}: ({Homepage}), {nameof(Gender)}: {Gender}, {nameof(MyNullableAddress)}: ({MyNullableAddress})"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Contracts/Users/RequestParameters/DeleteUserByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Contracts/Users/RequestParameters/DeleteUserByIdParameters.verified.cs deleted file mode 100644 index 058d9bd6..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Contracts/Users/RequestParameters/DeleteUserByIdParameters.verified.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.ApiClient.Generated.Contracts; - -/// -/// Parameters for operation request. -/// Description: Delete user by id. -/// Operation: DeleteUserById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class DeleteUserByIdParameters -{ - /// - /// Id of the user. - /// - [Required] - public Guid Id { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Contracts/Users/RequestParameters/GetUserByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Contracts/Users/RequestParameters/GetUserByIdParameters.verified.cs deleted file mode 100644 index 334ec9ab..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Contracts/Users/RequestParameters/GetUserByIdParameters.verified.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.ApiClient.Generated.Contracts; - -/// -/// Parameters for operation request. -/// Description: Get user by id. -/// Operation: GetUserById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetUserByIdParameters -{ - /// - /// Id of the user. - /// - [Required] - public Guid Id { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Contracts/Users/RequestParameters/PostUserParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Contracts/Users/RequestParameters/PostUserParameters.verified.cs deleted file mode 100644 index 22f9f4dc..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Contracts/Users/RequestParameters/PostUserParameters.verified.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.ApiClient.Generated.Contracts; - -/// -/// Parameters for operation request. -/// Description: Create a new user. -/// Operation: PostUser. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class PostUserParameters -{ - /// - /// Request to create a user. - /// - [Required] - public CreateUserRequest Request { get; set; } - - /// - public override string ToString() - => $"{nameof(Request)}: ({Request})"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Contracts/Users/RequestParameters/UpdateUserByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Contracts/Users/RequestParameters/UpdateUserByIdParameters.verified.cs deleted file mode 100644 index 88e31de9..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Contracts/Users/RequestParameters/UpdateUserByIdParameters.verified.cs +++ /dev/null @@ -1,32 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.ApiClient.Generated.Contracts; - -/// -/// Parameters for operation request. -/// Description: Update user by id. -/// Operation: UpdateUserById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UpdateUserByIdParameters -{ - /// - /// Id of the user. - /// - [Required] - public Guid Id { get; set; } - - /// - /// Request to update a user. - /// - [Required] - public UpdateUserRequest Request { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}, {nameof(Request)}: ({Request})"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Contracts/Users/RequestParameters/UpdateUserRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Contracts/Users/RequestParameters/UpdateUserRequest.verified.cs deleted file mode 100644 index cc7955d7..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Contracts/Users/RequestParameters/UpdateUserRequest.verified.cs +++ /dev/null @@ -1,36 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.ApiClient.Generated.Contracts; - -/// -/// Request to update a user. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UpdateUserRequest -{ - public string FirstName { get; set; } - - public string LastName { get; set; } - - /// - /// Undefined description. - /// - /// - /// Email validation being enforced. - /// - [EmailAddress] - public string Email { get; set; } - - /// - /// GenderType. - /// - public GenderType Gender { get; set; } - - /// - public override string ToString() - => $"{nameof(FirstName)}: {FirstName}, {nameof(LastName)}: {LastName}, {nameof(Email)}: {Email}, {nameof(Gender)}: {Gender}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Contracts/_EnumerationTypes/GenderType.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Contracts/_EnumerationTypes/GenderType.verified.cs deleted file mode 100644 index da2d2349..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Contracts/_EnumerationTypes/GenderType.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.ApiClient.Generated.Contracts; - -/// -/// Enumeration: GenderType. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public enum GenderType -{ - None, - NonBinary, - Male, - Female, -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/DeleteUserByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/DeleteUserByIdEndpoint.verified.cs deleted file mode 100644 index 88180d36..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/DeleteUserByIdEndpoint.verified.cs +++ /dev/null @@ -1,52 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint. -/// Description: Delete user by id. -/// Operation: DeleteUserById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class DeleteUserByIdEndpoint : IDeleteUserByIdEndpoint -{ - private readonly IHttpClientFactory factory; - private readonly IHttpMessageFactory httpMessageFactory; - - public DeleteUserByIdEndpoint( - IHttpClientFactory factory, - IHttpMessageFactory httpMessageFactory) - { - this.factory = factory; - this.httpMessageFactory = httpMessageFactory; - } - - public async Task ExecuteAsync( - DeleteUserByIdParameters parameters, - string httpClientName = "DemoUsersApi-ApiClient", - CancellationToken cancellationToken = default) - { - var client = factory.CreateClient(httpClientName); - - var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/users/{id}"); - requestBuilder.WithPathParameter("id", parameters.Id); - - using var requestMessage = requestBuilder.Build(HttpMethod.Delete); - using var response = await client.SendAsync(requestMessage, cancellationToken); - - var responseBuilder = httpMessageFactory.FromResponse(response); - responseBuilder.AddSuccessResponse(HttpStatusCode.OK); - responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); - responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); - responseBuilder.AddErrorResponse(HttpStatusCode.Forbidden); - responseBuilder.AddErrorResponse(HttpStatusCode.NotFound); - responseBuilder.AddErrorResponse(HttpStatusCode.Conflict); - responseBuilder.AddErrorResponse(HttpStatusCode.InternalServerError); - - return await responseBuilder.BuildResponseAsync(x => new DeleteUserByIdEndpointResult(x), cancellationToken); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/DeleteUserByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/DeleteUserByIdEndpointResult.verified.cs deleted file mode 100644 index 4f83859b..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/DeleteUserByIdEndpointResult.verified.cs +++ /dev/null @@ -1,67 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint result. -/// Description: Delete user by id. -/// Operation: DeleteUserById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class DeleteUserByIdEndpointResult : EndpointResponse, IDeleteUserByIdEndpointResult -{ - public DeleteUserByIdEndpointResult(EndpointResponse response) - : base(response) - { - } - - public bool IsOk - => StatusCode == HttpStatusCode.OK; - - public bool IsBadRequest - => StatusCode == HttpStatusCode.BadRequest; - - public bool IsUnauthorized - => StatusCode == HttpStatusCode.Unauthorized; - - public bool IsForbidden - => StatusCode == HttpStatusCode.Forbidden; - - public bool IsNotFound - => StatusCode == HttpStatusCode.NotFound; - - public bool IsConflict - => StatusCode == HttpStatusCode.Conflict; - - public bool IsInternalServerError - => StatusCode == HttpStatusCode.InternalServerError; - - public string OkContent - => IsOk && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); - - public ValidationProblemDetails BadRequestContent - => IsBadRequest && ContentObject is ValidationProblemDetails result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); - - public string NotFoundContent - => IsNotFound && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsNotFound property first."); - - public string ConflictContent - => IsConflict && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsConflict property first."); - - public string InternalServerErrorContent - => IsInternalServerError && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsInternalServerError property first."); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/GetUserByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/GetUserByIdEndpoint.verified.cs deleted file mode 100644 index 410b3540..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/GetUserByIdEndpoint.verified.cs +++ /dev/null @@ -1,52 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint. -/// Description: Get user by id. -/// Operation: GetUserById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetUserByIdEndpoint : IGetUserByIdEndpoint -{ - private readonly IHttpClientFactory factory; - private readonly IHttpMessageFactory httpMessageFactory; - - public GetUserByIdEndpoint( - IHttpClientFactory factory, - IHttpMessageFactory httpMessageFactory) - { - this.factory = factory; - this.httpMessageFactory = httpMessageFactory; - } - - public async Task ExecuteAsync( - GetUserByIdParameters parameters, - string httpClientName = "DemoUsersApi-ApiClient", - CancellationToken cancellationToken = default) - { - var client = factory.CreateClient(httpClientName); - - var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/users/{id}"); - requestBuilder.WithPathParameter("id", parameters.Id); - - using var requestMessage = requestBuilder.Build(HttpMethod.Get); - using var response = await client.SendAsync(requestMessage, cancellationToken); - - var responseBuilder = httpMessageFactory.FromResponse(response); - responseBuilder.AddSuccessResponse(HttpStatusCode.OK); - responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); - responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); - responseBuilder.AddErrorResponse(HttpStatusCode.Forbidden); - responseBuilder.AddErrorResponse(HttpStatusCode.NotFound); - responseBuilder.AddErrorResponse(HttpStatusCode.Conflict); - responseBuilder.AddErrorResponse(HttpStatusCode.InternalServerError); - - return await responseBuilder.BuildResponseAsync(x => new GetUserByIdEndpointResult(x), cancellationToken); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/GetUserByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/GetUserByIdEndpointResult.verified.cs deleted file mode 100644 index b416a0c9..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/GetUserByIdEndpointResult.verified.cs +++ /dev/null @@ -1,67 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint result. -/// Description: Get user by id. -/// Operation: GetUserById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetUserByIdEndpointResult : EndpointResponse, IGetUserByIdEndpointResult -{ - public GetUserByIdEndpointResult(EndpointResponse response) - : base(response) - { - } - - public bool IsOk - => StatusCode == HttpStatusCode.OK; - - public bool IsBadRequest - => StatusCode == HttpStatusCode.BadRequest; - - public bool IsUnauthorized - => StatusCode == HttpStatusCode.Unauthorized; - - public bool IsForbidden - => StatusCode == HttpStatusCode.Forbidden; - - public bool IsNotFound - => StatusCode == HttpStatusCode.NotFound; - - public bool IsConflict - => StatusCode == HttpStatusCode.Conflict; - - public bool IsInternalServerError - => StatusCode == HttpStatusCode.InternalServerError; - - public User OkContent - => IsOk && ContentObject is User result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); - - public ValidationProblemDetails BadRequestContent - => IsBadRequest && ContentObject is ValidationProblemDetails result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); - - public string NotFoundContent - => IsNotFound && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsNotFound property first."); - - public string ConflictContent - => IsConflict && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsConflict property first."); - - public string InternalServerErrorContent - => IsInternalServerError && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsInternalServerError property first."); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/GetUsersEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/GetUsersEndpoint.verified.cs deleted file mode 100644 index 63b6dd91..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/GetUsersEndpoint.verified.cs +++ /dev/null @@ -1,48 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint. -/// Description: Get all users. -/// Operation: GetUsers. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetUsersEndpoint : IGetUsersEndpoint -{ - private readonly IHttpClientFactory factory; - private readonly IHttpMessageFactory httpMessageFactory; - - public GetUsersEndpoint( - IHttpClientFactory factory, - IHttpMessageFactory httpMessageFactory) - { - this.factory = factory; - this.httpMessageFactory = httpMessageFactory; - } - - public async Task ExecuteAsync( - string httpClientName = "DemoUsersApi-ApiClient", - CancellationToken cancellationToken = default) - { - var client = factory.CreateClient(httpClientName); - - var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/users"); - - using var requestMessage = requestBuilder.Build(HttpMethod.Get); - using var response = await client.SendAsync(requestMessage, cancellationToken); - - var responseBuilder = httpMessageFactory.FromResponse(response); - responseBuilder.AddSuccessResponse>(HttpStatusCode.OK); - responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); - responseBuilder.AddErrorResponse(HttpStatusCode.Forbidden); - responseBuilder.AddErrorResponse(HttpStatusCode.Conflict); - responseBuilder.AddErrorResponse(HttpStatusCode.InternalServerError); - - return await responseBuilder.BuildResponseAsync(x => new GetUsersEndpointResult(x), cancellationToken); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/GetUsersEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/GetUsersEndpointResult.verified.cs deleted file mode 100644 index 9e5e386b..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/GetUsersEndpointResult.verified.cs +++ /dev/null @@ -1,51 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint result. -/// Description: Get all users. -/// Operation: GetUsers. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetUsersEndpointResult : EndpointResponse, IGetUsersEndpointResult -{ - public GetUsersEndpointResult(EndpointResponse response) - : base(response) - { - } - - public bool IsOk - => StatusCode == HttpStatusCode.OK; - - public bool IsUnauthorized - => StatusCode == HttpStatusCode.Unauthorized; - - public bool IsForbidden - => StatusCode == HttpStatusCode.Forbidden; - - public bool IsConflict - => StatusCode == HttpStatusCode.Conflict; - - public bool IsInternalServerError - => StatusCode == HttpStatusCode.InternalServerError; - - public List OkContent - => IsOk && ContentObject is List result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); - - public string ConflictContent - => IsConflict && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsConflict property first."); - - public string InternalServerErrorContent - => IsInternalServerError && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsInternalServerError property first."); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/Interfaces/IDeleteUserByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/Interfaces/IDeleteUserByIdEndpoint.verified.cs deleted file mode 100644 index 3ab11300..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/Interfaces/IDeleteUserByIdEndpoint.verified.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint. -/// Description: Delete user by id. -/// Operation: DeleteUserById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IDeleteUserByIdEndpoint -{ - /// - /// Execute method. - /// - /// The parameters. - /// The http client name. - /// The cancellation token. - Task ExecuteAsync( - DeleteUserByIdParameters parameters, - string httpClientName = "DemoUsersApi-ApiClient", - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/Interfaces/IDeleteUserByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/Interfaces/IDeleteUserByIdEndpointResult.verified.cs deleted file mode 100644 index eb61eba6..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/Interfaces/IDeleteUserByIdEndpointResult.verified.cs +++ /dev/null @@ -1,40 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint Result. -/// Description: Delete user by id. -/// Operation: DeleteUserById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IDeleteUserByIdEndpointResult : IEndpointResponse -{ - bool IsOk { get; } - - bool IsBadRequest { get; } - - bool IsUnauthorized { get; } - - bool IsForbidden { get; } - - bool IsNotFound { get; } - - bool IsConflict { get; } - - bool IsInternalServerError { get; } - - string OkContent { get; } - - ValidationProblemDetails BadRequestContent { get; } - - string NotFoundContent { get; } - - string ConflictContent { get; } - - string InternalServerErrorContent { get; } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUserByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUserByIdEndpoint.verified.cs deleted file mode 100644 index 2e9c99cd..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUserByIdEndpoint.verified.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint. -/// Description: Get user by id. -/// Operation: GetUserById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetUserByIdEndpoint -{ - /// - /// Execute method. - /// - /// The parameters. - /// The http client name. - /// The cancellation token. - Task ExecuteAsync( - GetUserByIdParameters parameters, - string httpClientName = "DemoUsersApi-ApiClient", - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUserByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUserByIdEndpointResult.verified.cs deleted file mode 100644 index 6f9ad42f..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUserByIdEndpointResult.verified.cs +++ /dev/null @@ -1,40 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint Result. -/// Description: Get user by id. -/// Operation: GetUserById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetUserByIdEndpointResult : IEndpointResponse -{ - bool IsOk { get; } - - bool IsBadRequest { get; } - - bool IsUnauthorized { get; } - - bool IsForbidden { get; } - - bool IsNotFound { get; } - - bool IsConflict { get; } - - bool IsInternalServerError { get; } - - User OkContent { get; } - - ValidationProblemDetails BadRequestContent { get; } - - string NotFoundContent { get; } - - string ConflictContent { get; } - - string InternalServerErrorContent { get; } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUsersEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUsersEndpoint.verified.cs deleted file mode 100644 index c897004e..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUsersEndpoint.verified.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint. -/// Description: Get all users. -/// Operation: GetUsers. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetUsersEndpoint -{ - /// - /// Execute method. - /// - /// The http client name. - /// The cancellation token. - Task ExecuteAsync( - string httpClientName = "DemoUsersApi-ApiClient", - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUsersEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUsersEndpointResult.verified.cs deleted file mode 100644 index d11d1b3f..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUsersEndpointResult.verified.cs +++ /dev/null @@ -1,32 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint Result. -/// Description: Get all users. -/// Operation: GetUsers. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetUsersEndpointResult : IEndpointResponse -{ - bool IsOk { get; } - - bool IsUnauthorized { get; } - - bool IsForbidden { get; } - - bool IsConflict { get; } - - bool IsInternalServerError { get; } - - List OkContent { get; } - - string ConflictContent { get; } - - string InternalServerErrorContent { get; } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/Interfaces/IPostUserEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/Interfaces/IPostUserEndpoint.verified.cs deleted file mode 100644 index e30bc95b..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/Interfaces/IPostUserEndpoint.verified.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint. -/// Description: Create a new user. -/// Operation: PostUser. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IPostUserEndpoint -{ - /// - /// Execute method. - /// - /// The parameters. - /// The http client name. - /// The cancellation token. - Task ExecuteAsync( - PostUserParameters parameters, - string httpClientName = "DemoUsersApi-ApiClient", - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/Interfaces/IPostUserEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/Interfaces/IPostUserEndpointResult.verified.cs deleted file mode 100644 index cb5eb31c..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/Interfaces/IPostUserEndpointResult.verified.cs +++ /dev/null @@ -1,36 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint Result. -/// Description: Create a new user. -/// Operation: PostUser. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IPostUserEndpointResult : IEndpointResponse -{ - bool IsOk { get; } - - bool IsBadRequest { get; } - - bool IsUnauthorized { get; } - - bool IsForbidden { get; } - - bool IsConflict { get; } - - bool IsInternalServerError { get; } - - string OkContent { get; } - - ValidationProblemDetails BadRequestContent { get; } - - string ConflictContent { get; } - - string InternalServerErrorContent { get; } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/Interfaces/IUpdateUserByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/Interfaces/IUpdateUserByIdEndpoint.verified.cs deleted file mode 100644 index d03ae392..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/Interfaces/IUpdateUserByIdEndpoint.verified.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint. -/// Description: Update user by id. -/// Operation: UpdateUserById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IUpdateUserByIdEndpoint -{ - /// - /// Execute method. - /// - /// The parameters. - /// The http client name. - /// The cancellation token. - Task ExecuteAsync( - UpdateUserByIdParameters parameters, - string httpClientName = "DemoUsersApi-ApiClient", - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/Interfaces/IUpdateUserByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/Interfaces/IUpdateUserByIdEndpointResult.verified.cs deleted file mode 100644 index f3e1e65a..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/Interfaces/IUpdateUserByIdEndpointResult.verified.cs +++ /dev/null @@ -1,40 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint Result. -/// Description: Update user by id. -/// Operation: UpdateUserById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IUpdateUserByIdEndpointResult : IEndpointResponse -{ - bool IsOk { get; } - - bool IsBadRequest { get; } - - bool IsUnauthorized { get; } - - bool IsForbidden { get; } - - bool IsNotFound { get; } - - bool IsConflict { get; } - - bool IsInternalServerError { get; } - - string OkContent { get; } - - ValidationProblemDetails BadRequestContent { get; } - - string NotFoundContent { get; } - - string ConflictContent { get; } - - string InternalServerErrorContent { get; } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/PostUserEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/PostUserEndpoint.verified.cs deleted file mode 100644 index f68a70e8..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/PostUserEndpoint.verified.cs +++ /dev/null @@ -1,51 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint. -/// Description: Create a new user. -/// Operation: PostUser. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class PostUserEndpoint : IPostUserEndpoint -{ - private readonly IHttpClientFactory factory; - private readonly IHttpMessageFactory httpMessageFactory; - - public PostUserEndpoint( - IHttpClientFactory factory, - IHttpMessageFactory httpMessageFactory) - { - this.factory = factory; - this.httpMessageFactory = httpMessageFactory; - } - - public async Task ExecuteAsync( - PostUserParameters parameters, - string httpClientName = "DemoUsersApi-ApiClient", - CancellationToken cancellationToken = default) - { - var client = factory.CreateClient(httpClientName); - - var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/users"); - requestBuilder.WithBody(parameters.Request); - - using var requestMessage = requestBuilder.Build(HttpMethod.Post); - using var response = await client.SendAsync(requestMessage, cancellationToken); - - var responseBuilder = httpMessageFactory.FromResponse(response); - responseBuilder.AddSuccessResponse(HttpStatusCode.Created); - responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); - responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); - responseBuilder.AddErrorResponse(HttpStatusCode.Forbidden); - responseBuilder.AddErrorResponse(HttpStatusCode.Conflict); - responseBuilder.AddErrorResponse(HttpStatusCode.InternalServerError); - - return await responseBuilder.BuildResponseAsync(x => new PostUserEndpointResult(x), cancellationToken); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/PostUserEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/PostUserEndpointResult.verified.cs deleted file mode 100644 index 85b4c100..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/PostUserEndpointResult.verified.cs +++ /dev/null @@ -1,59 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint result. -/// Description: Create a new user. -/// Operation: PostUser. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class PostUserEndpointResult : EndpointResponse, IPostUserEndpointResult -{ - public PostUserEndpointResult(EndpointResponse response) - : base(response) - { - } - - public bool IsOk - => StatusCode == HttpStatusCode.OK; - - public bool IsBadRequest - => StatusCode == HttpStatusCode.BadRequest; - - public bool IsUnauthorized - => StatusCode == HttpStatusCode.Unauthorized; - - public bool IsForbidden - => StatusCode == HttpStatusCode.Forbidden; - - public bool IsConflict - => StatusCode == HttpStatusCode.Conflict; - - public bool IsInternalServerError - => StatusCode == HttpStatusCode.InternalServerError; - - public string OkContent - => IsOk && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); - - public ValidationProblemDetails BadRequestContent - => IsBadRequest && ContentObject is ValidationProblemDetails result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); - - public string ConflictContent - => IsConflict && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsConflict property first."); - - public string InternalServerErrorContent - => IsInternalServerError && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsInternalServerError property first."); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/UpdateUserByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/UpdateUserByIdEndpoint.verified.cs deleted file mode 100644 index fddd6db7..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/UpdateUserByIdEndpoint.verified.cs +++ /dev/null @@ -1,53 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint. -/// Description: Update user by id. -/// Operation: UpdateUserById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UpdateUserByIdEndpoint : IUpdateUserByIdEndpoint -{ - private readonly IHttpClientFactory factory; - private readonly IHttpMessageFactory httpMessageFactory; - - public UpdateUserByIdEndpoint( - IHttpClientFactory factory, - IHttpMessageFactory httpMessageFactory) - { - this.factory = factory; - this.httpMessageFactory = httpMessageFactory; - } - - public async Task ExecuteAsync( - UpdateUserByIdParameters parameters, - string httpClientName = "DemoUsersApi-ApiClient", - CancellationToken cancellationToken = default) - { - var client = factory.CreateClient(httpClientName); - - var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/users/{id}"); - requestBuilder.WithPathParameter("id", parameters.Id); - requestBuilder.WithBody(parameters.Request); - - using var requestMessage = requestBuilder.Build(HttpMethod.Put); - using var response = await client.SendAsync(requestMessage, cancellationToken); - - var responseBuilder = httpMessageFactory.FromResponse(response); - responseBuilder.AddSuccessResponse(HttpStatusCode.OK); - responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); - responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); - responseBuilder.AddErrorResponse(HttpStatusCode.Forbidden); - responseBuilder.AddErrorResponse(HttpStatusCode.NotFound); - responseBuilder.AddErrorResponse(HttpStatusCode.Conflict); - responseBuilder.AddErrorResponse(HttpStatusCode.InternalServerError); - - return await responseBuilder.BuildResponseAsync(x => new UpdateUserByIdEndpointResult(x), cancellationToken); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/UpdateUserByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/UpdateUserByIdEndpointResult.verified.cs deleted file mode 100644 index baf7faeb..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/Endpoints/Users/UpdateUserByIdEndpointResult.verified.cs +++ /dev/null @@ -1,67 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint result. -/// Description: Update user by id. -/// Operation: UpdateUserById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UpdateUserByIdEndpointResult : EndpointResponse, IUpdateUserByIdEndpointResult -{ - public UpdateUserByIdEndpointResult(EndpointResponse response) - : base(response) - { - } - - public bool IsOk - => StatusCode == HttpStatusCode.OK; - - public bool IsBadRequest - => StatusCode == HttpStatusCode.BadRequest; - - public bool IsUnauthorized - => StatusCode == HttpStatusCode.Unauthorized; - - public bool IsForbidden - => StatusCode == HttpStatusCode.Forbidden; - - public bool IsNotFound - => StatusCode == HttpStatusCode.NotFound; - - public bool IsConflict - => StatusCode == HttpStatusCode.Conflict; - - public bool IsInternalServerError - => StatusCode == HttpStatusCode.InternalServerError; - - public string OkContent - => IsOk && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); - - public ValidationProblemDetails BadRequestContent - => IsBadRequest && ContentObject is ValidationProblemDetails result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); - - public string NotFoundContent - => IsNotFound && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsNotFound property first."); - - public string ConflictContent - => IsConflict && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsConflict property first."); - - public string InternalServerErrorContent - => IsInternalServerError && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsInternalServerError property first."); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/GlobalUsings.verified.cs deleted file mode 100644 index ea895365..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyClientCSharp/src/DemoUsersApi.ApiClient.Generated/GlobalUsings.verified.cs +++ /dev/null @@ -1,10 +0,0 @@ -global using System.CodeDom.Compiler; -global using System.ComponentModel.DataAnnotations; -global using System.Net; - -global using Atc.Rest.Client; -global using Atc.Rest.Client.Builder; - -global using DemoUsersApi.ApiClient.Generated.Contracts; - -global using Microsoft.AspNetCore.Mvc; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/ApiRegistration.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/ApiRegistration.verified.cs deleted file mode 100644 index 7e876b67..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/ApiRegistration.verified.cs +++ /dev/null @@ -1,12 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.Api.Generated; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class ApiRegistration -{ -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Interfaces/IDeleteUserByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Interfaces/IDeleteUserByIdHandler.verified.cs deleted file mode 100644 index b28a63a3..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Interfaces/IDeleteUserByIdHandler.verified.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.Api.Generated.Contracts.Users; - -/// -/// Domain Interface for RequestHandler. -/// Description: Delete user by id. -/// Operation: DeleteUserById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IDeleteUserByIdHandler -{ - /// - /// Execute method. - /// - /// The parameters. - /// The cancellation token. - Task ExecuteAsync( - DeleteUserByIdParameters parameters, - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Interfaces/IGetUserByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Interfaces/IGetUserByIdHandler.verified.cs deleted file mode 100644 index ed3f4cbf..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Interfaces/IGetUserByIdHandler.verified.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.Api.Generated.Contracts.Users; - -/// -/// Domain Interface for RequestHandler. -/// Description: Get user by id. -/// Operation: GetUserById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetUserByIdHandler -{ - /// - /// Execute method. - /// - /// The parameters. - /// The cancellation token. - Task ExecuteAsync( - GetUserByIdParameters parameters, - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Interfaces/IGetUsersHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Interfaces/IGetUsersHandler.verified.cs deleted file mode 100644 index 0cdeaacd..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Interfaces/IGetUsersHandler.verified.cs +++ /dev/null @@ -1,23 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.Api.Generated.Contracts.Users; - -/// -/// Domain Interface for RequestHandler. -/// Description: Get all users. -/// Operation: GetUsers. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetUsersHandler -{ - /// - /// Execute method. - /// - /// The cancellation token. - Task ExecuteAsync( - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Interfaces/IPostUserHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Interfaces/IPostUserHandler.verified.cs deleted file mode 100644 index b00b9276..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Interfaces/IPostUserHandler.verified.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.Api.Generated.Contracts.Users; - -/// -/// Domain Interface for RequestHandler. -/// Description: Create a new user. -/// Operation: PostUser. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IPostUserHandler -{ - /// - /// Execute method. - /// - /// The parameters. - /// The cancellation token. - Task ExecuteAsync( - PostUserParameters parameters, - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Interfaces/IUpdateUserByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Interfaces/IUpdateUserByIdHandler.verified.cs deleted file mode 100644 index 918da0c8..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Interfaces/IUpdateUserByIdHandler.verified.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.Api.Generated.Contracts.Users; - -/// -/// Domain Interface for RequestHandler. -/// Description: Update user by id. -/// Operation: UpdateUserById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IUpdateUserByIdHandler -{ - /// - /// Execute method. - /// - /// The parameters. - /// The cancellation token. - Task ExecuteAsync( - UpdateUserByIdParameters parameters, - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Models/Address.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Models/Address.verified.cs deleted file mode 100644 index e7288e86..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Models/Address.verified.cs +++ /dev/null @@ -1,32 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.Api.Generated.Contracts.Users; - -/// -/// Address. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class Address -{ - [StringLength(255)] - public string StreetName { get; set; } - - public string StreetNumber { get; set; } - - public string PostalCode { get; set; } - - public string CityName { get; set; } - - /// - /// Country. - /// - public Country MyCountry { get; set; } - - /// - public override string ToString() - => $"{nameof(StreetName)}: {StreetName}, {nameof(StreetNumber)}: {StreetNumber}, {nameof(PostalCode)}: {PostalCode}, {nameof(CityName)}: {CityName}, {nameof(MyCountry)}: ({MyCountry})"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Models/Country.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Models/Country.verified.cs deleted file mode 100644 index a372048a..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Models/Country.verified.cs +++ /dev/null @@ -1,33 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.Api.Generated.Contracts.Users; - -/// -/// Country. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class Country -{ - [Required] - public string Name { get; set; } - - [Required] - [MinLength(2)] - [MaxLength(2)] - [RegularExpression("^[A-Za-z]{2}$")] - public string Alpha2Code { get; set; } - - [Required] - [MinLength(3)] - [MaxLength(3)] - [RegularExpression("^[A-Za-z]{3}$")] - public string Alpha3Code { get; set; } - - /// - public override string ToString() - => $"{nameof(Name)}: {Name}, {nameof(Alpha2Code)}: {Alpha2Code}, {nameof(Alpha3Code)}: {Alpha3Code}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Models/CreateUserRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Models/CreateUserRequest.verified.cs deleted file mode 100644 index b97098c4..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Models/CreateUserRequest.verified.cs +++ /dev/null @@ -1,56 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.Api.Generated.Contracts.Users; - -/// -/// Request to create a user. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class CreateUserRequest -{ - [Required] - public string FirstName { get; set; } - - [Required] - public string LastName { get; set; } - - public DateTimeOffset? MyNullableDateTime { get; set; } - - [Required] - public DateTimeOffset MyDateTime { get; set; } - - /// - /// Undefined description. - /// - /// - /// Email validation being enforced. - /// - [Required] - [EmailAddress] - public string Email { get; set; } - - /// - /// Undefined description. - /// - /// - /// Url validation being enforced. - /// - [Uri] - public Uri Homepage { get; set; } - - /// - /// GenderType. - /// - [Required] - public GenderType Gender { get; set; } - - public Address? MyNullableAddress { get; set; } - - /// - public override string ToString() - => $"{nameof(FirstName)}: {FirstName}, {nameof(LastName)}: {LastName}, {nameof(MyNullableDateTime)}: ({MyNullableDateTime}), {nameof(MyDateTime)}: ({MyDateTime}), {nameof(Email)}: {Email}, {nameof(Homepage)}: ({Homepage}), {nameof(Gender)}: {Gender}, {nameof(MyNullableAddress)}: ({MyNullableAddress})"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Models/UpdateUserRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Models/UpdateUserRequest.verified.cs deleted file mode 100644 index 85cb83a7..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Models/UpdateUserRequest.verified.cs +++ /dev/null @@ -1,36 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.Api.Generated.Contracts.Users; - -/// -/// Request to update a user. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UpdateUserRequest -{ - public string FirstName { get; set; } - - public string LastName { get; set; } - - /// - /// Undefined description. - /// - /// - /// Email validation being enforced. - /// - [EmailAddress] - public string Email { get; set; } - - /// - /// GenderType. - /// - public GenderType Gender { get; set; } - - /// - public override string ToString() - => $"{nameof(FirstName)}: {FirstName}, {nameof(LastName)}: {LastName}, {nameof(Email)}: {Email}, {nameof(Gender)}: {Gender}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Models/User.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Models/User.verified.cs deleted file mode 100644 index 77f3cfee..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Models/User.verified.cs +++ /dev/null @@ -1,57 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.Api.Generated.Contracts.Users; - -/// -/// A single user. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class User -{ - public Guid Id { get; set; } - - /// - /// GenderType. - /// - public GenderType Gender { get; set; } - - public string FirstName { get; set; } - - public string LastName { get; set; } - - /// - /// Undefined description. - /// - /// - /// Email validation being enforced. - /// - [EmailAddress] - public string Email { get; set; } - - /// - /// Undefined description. - /// - /// - /// Url validation being enforced. - /// - [Uri] - public Uri Homepage { get; set; } - - /// - /// Address. - /// - public Address HomeAddress { get; set; } - - /// - /// Address. - /// - public Address CompanyAddress { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}, {nameof(Gender)}: {Gender}, {nameof(FirstName)}: {FirstName}, {nameof(LastName)}: {LastName}, {nameof(Email)}: {Email}, {nameof(Homepage)}: ({Homepage}), {nameof(HomeAddress)}: ({HomeAddress}), {nameof(CompanyAddress)}: ({CompanyAddress})"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Models/Users.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Models/Users.verified.cs deleted file mode 100644 index d9d0d530..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Models/Users.verified.cs +++ /dev/null @@ -1,23 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.Api.Generated.Contracts.Users; - -/// -/// A list of users. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class Users -{ - /// - /// A list of User. - /// - public List UserList { get; set; } = new List(); - - /// - public override string ToString() - => $"{nameof(UserList)}.Count: {UserList?.Count ?? 0}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Parameters/DeleteUserByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Parameters/DeleteUserByIdParameters.verified.cs deleted file mode 100644 index 62a421d2..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Parameters/DeleteUserByIdParameters.verified.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.Api.Generated.Contracts.Users; - -/// -/// Parameters for operation request. -/// Description: Delete user by id. -/// Operation: DeleteUserById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class DeleteUserByIdParameters -{ - /// - /// Id of the user. - /// - [FromRoute(Name = "id")] - [Required] - public Guid Id { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Parameters/GetUserByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Parameters/GetUserByIdParameters.verified.cs deleted file mode 100644 index b04c9c16..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Parameters/GetUserByIdParameters.verified.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.Api.Generated.Contracts.Users; - -/// -/// Parameters for operation request. -/// Description: Get user by id. -/// Operation: GetUserById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetUserByIdParameters -{ - /// - /// Id of the user. - /// - [FromRoute(Name = "id")] - [Required] - public Guid Id { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Parameters/PostUserParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Parameters/PostUserParameters.verified.cs deleted file mode 100644 index da68fa96..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Parameters/PostUserParameters.verified.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.Api.Generated.Contracts.Users; - -/// -/// Parameters for operation request. -/// Description: Create a new user. -/// Operation: PostUser. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class PostUserParameters -{ - /// - /// Request to create a user. - /// - [FromBody] - [Required] - public CreateUserRequest Request { get; set; } - - /// - public override string ToString() - => $"{nameof(Request)}: ({Request})"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Parameters/UpdateUserByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Parameters/UpdateUserByIdParameters.verified.cs deleted file mode 100644 index abad2037..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Parameters/UpdateUserByIdParameters.verified.cs +++ /dev/null @@ -1,34 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.Api.Generated.Contracts.Users; - -/// -/// Parameters for operation request. -/// Description: Update user by id. -/// Operation: UpdateUserById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UpdateUserByIdParameters -{ - /// - /// Id of the user. - /// - [FromRoute(Name = "id")] - [Required] - public Guid Id { get; set; } - - /// - /// Request to update a user. - /// - [FromBody] - [Required] - public UpdateUserRequest Request { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}, {nameof(Request)}: ({Request})"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Results/DeleteUserByIdResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Results/DeleteUserByIdResult.verified.cs deleted file mode 100644 index 267b88dc..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Results/DeleteUserByIdResult.verified.cs +++ /dev/null @@ -1,42 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.Api.Generated.Contracts.Users; - -/// -/// Results for operation request. -/// Description: Delete user by id. -/// Operation: DeleteUserById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class DeleteUserByIdResult : ResultBase -{ - private DeleteUserByIdResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static DeleteUserByIdResult Ok(string? message = null) - => new DeleteUserByIdResult(new OkObjectResult(message)); - - /// - /// 404 - NotFound response. - /// - public static DeleteUserByIdResult NotFound(string? message = null) - => new DeleteUserByIdResult(new NotFoundObjectResult(message)); - - /// - /// 409 - Conflict response. - /// - public static DeleteUserByIdResult Conflict(string? error = null) - => new DeleteUserByIdResult(new ConflictObjectResult(error)); - - /// - /// Performs an implicit conversion from DeleteUserByIdResult to ActionResult. - /// - public static implicit operator DeleteUserByIdResult(string response) - => Ok(response); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Results/GetUserByIdResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Results/GetUserByIdResult.verified.cs deleted file mode 100644 index 8b7ccba8..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Results/GetUserByIdResult.verified.cs +++ /dev/null @@ -1,42 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.Api.Generated.Contracts.Users; - -/// -/// Results for operation request. -/// Description: Get user by id. -/// Operation: GetUserById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetUserByIdResult : ResultBase -{ - private GetUserByIdResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static GetUserByIdResult Ok(User response) - => new GetUserByIdResult(new OkObjectResult(response)); - - /// - /// 404 - NotFound response. - /// - public static GetUserByIdResult NotFound(string? message = null) - => new GetUserByIdResult(new NotFoundObjectResult(message)); - - /// - /// 409 - Conflict response. - /// - public static GetUserByIdResult Conflict(string? error = null) - => new GetUserByIdResult(new ConflictObjectResult(error)); - - /// - /// Performs an implicit conversion from GetUserByIdResult to ActionResult. - /// - public static implicit operator GetUserByIdResult(User response) - => Ok(response); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Results/GetUsersResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Results/GetUsersResult.verified.cs deleted file mode 100644 index c6565e5f..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Results/GetUsersResult.verified.cs +++ /dev/null @@ -1,36 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.Api.Generated.Contracts.Users; - -/// -/// Results for operation request. -/// Description: Get all users. -/// Operation: GetUsers. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetUsersResult : ResultBase -{ - private GetUsersResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static GetUsersResult Ok(IEnumerable response) - => new GetUsersResult(new OkObjectResult(response ?? Enumerable.Empty())); - - /// - /// 409 - Conflict response. - /// - public static GetUsersResult Conflict(string? error = null) - => new GetUsersResult(new ConflictObjectResult(error)); - - /// - /// Performs an implicit conversion from GetUsersResult to ActionResult. - /// - public static implicit operator GetUsersResult(List response) - => Ok(response); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Results/PostUserResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Results/PostUserResult.verified.cs deleted file mode 100644 index 83f6adb3..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Results/PostUserResult.verified.cs +++ /dev/null @@ -1,36 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.Api.Generated.Contracts.Users; - -/// -/// Results for operation request. -/// Description: Create a new user. -/// Operation: PostUser. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class PostUserResult : ResultBase -{ - private PostUserResult(ActionResult result) : base(result) { } - - /// - /// 201 - Created response. - /// - public static PostUserResult Created() - => new PostUserResult(new StatusCodeResult(StatusCodes.Status201Created)); - - /// - /// 400 - BadRequest response. - /// - public static PostUserResult BadRequest(string message) - => new PostUserResult(new BadRequestObjectResult(message)); - - /// - /// 409 - Conflict response. - /// - public static PostUserResult Conflict(string? error = null) - => new PostUserResult(new ConflictObjectResult(error)); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Results/UpdateUserByIdResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Results/UpdateUserByIdResult.verified.cs deleted file mode 100644 index d2e4313b..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/Users/Results/UpdateUserByIdResult.verified.cs +++ /dev/null @@ -1,48 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.Api.Generated.Contracts.Users; - -/// -/// Results for operation request. -/// Description: Update user by id. -/// Operation: UpdateUserById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UpdateUserByIdResult : ResultBase -{ - private UpdateUserByIdResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static UpdateUserByIdResult Ok(string? message = null) - => new UpdateUserByIdResult(new OkObjectResult(message)); - - /// - /// 400 - BadRequest response. - /// - public static UpdateUserByIdResult BadRequest(string message) - => new UpdateUserByIdResult(new BadRequestObjectResult(message)); - - /// - /// 404 - NotFound response. - /// - public static UpdateUserByIdResult NotFound(string? message = null) - => new UpdateUserByIdResult(new NotFoundObjectResult(message)); - - /// - /// 409 - Conflict response. - /// - public static UpdateUserByIdResult Conflict(string? error = null) - => new UpdateUserByIdResult(new ConflictObjectResult(error)); - - /// - /// Performs an implicit conversion from UpdateUserByIdResult to ActionResult. - /// - public static implicit operator UpdateUserByIdResult(string response) - => Ok(response); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/_EnumerationTypes/GenderType.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/_EnumerationTypes/GenderType.verified.cs deleted file mode 100644 index a8716a21..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Contracts/_EnumerationTypes/GenderType.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.Api.Generated.Contracts; - -/// -/// Enumeration: GenderType. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public enum GenderType -{ - None, - NonBinary, - Male, - Female, -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Endpoints/UsersController.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Endpoints/UsersController.verified.cs deleted file mode 100644 index 46abb956..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/Endpoints/UsersController.verified.cs +++ /dev/null @@ -1,98 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.Api.Generated.Endpoints; - -/// -/// Endpoint definitions. -/// -[Authorize] -[ApiController] -[Route("/api/v1/users")] -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UsersController : ControllerBase -{ - /// - /// Description: Get all users. - /// Operation: GetUsers. - /// - [Authorize] - [HttpGet] - [ProducesResponseType(typeof(List), StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status401Unauthorized)] - [ProducesResponseType(StatusCodes.Status403Forbidden)] - [ProducesResponseType(typeof(string), StatusCodes.Status409Conflict)] - public async Task GetUsers( - [FromServices] IGetUsersHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(cancellationToken); - - /// - /// Description: Create a new user. - /// Operation: PostUser. - /// - [Authorize] - [HttpPost] - [ProducesResponseType(typeof(string), StatusCodes.Status201Created)] - [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(StatusCodes.Status401Unauthorized)] - [ProducesResponseType(StatusCodes.Status403Forbidden)] - [ProducesResponseType(typeof(string), StatusCodes.Status409Conflict)] - public async Task PostUser( - PostUserParameters parameters, - [FromServices] IPostUserHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(parameters, cancellationToken); - - /// - /// Description: Get user by id. - /// Operation: GetUserById. - /// - [HttpGet("{id}")] - [ProducesResponseType(typeof(User), StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status401Unauthorized)] - [ProducesResponseType(StatusCodes.Status403Forbidden)] - [ProducesResponseType(typeof(string), StatusCodes.Status404NotFound)] - [ProducesResponseType(typeof(string), StatusCodes.Status409Conflict)] - public async Task GetUserById( - GetUserByIdParameters parameters, - [FromServices] IGetUserByIdHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(parameters, cancellationToken); - - /// - /// Description: Update user by id. - /// Operation: UpdateUserById. - /// - [HttpPut("{id}")] - [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(StatusCodes.Status401Unauthorized)] - [ProducesResponseType(StatusCodes.Status403Forbidden)] - [ProducesResponseType(typeof(string), StatusCodes.Status404NotFound)] - [ProducesResponseType(typeof(string), StatusCodes.Status409Conflict)] - public async Task UpdateUserById( - UpdateUserByIdParameters parameters, - [FromServices] IUpdateUserByIdHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(parameters, cancellationToken); - - /// - /// Description: Delete user by id. - /// Operation: DeleteUserById. - /// - [HttpDelete("{id}")] - [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status401Unauthorized)] - [ProducesResponseType(StatusCodes.Status403Forbidden)] - [ProducesResponseType(typeof(string), StatusCodes.Status404NotFound)] - [ProducesResponseType(typeof(string), StatusCodes.Status409Conflict)] - public async Task DeleteUserById( - DeleteUserByIdParameters parameters, - [FromServices] IDeleteUserByIdHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(parameters, cancellationToken); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/GlobalUsings.verified.cs deleted file mode 100644 index 1f53910f..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api.Generated/GlobalUsings.verified.cs +++ /dev/null @@ -1,12 +0,0 @@ -global using System.CodeDom.Compiler; -global using System.ComponentModel.DataAnnotations; -global using System.Net; - -global using Atc.Rest.Results; - -global using DemoUsersApi.Api.Generated.Contracts; -global using DemoUsersApi.Api.Generated.Contracts.Users; - -global using Microsoft.AspNetCore.Authorization; -global using Microsoft.AspNetCore.Http; -global using Microsoft.AspNetCore.Mvc; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api/ConfigureSwaggerDocOptions.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api/ConfigureSwaggerDocOptions.verified.cs deleted file mode 100644 index 2aac99fc..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api/ConfigureSwaggerDocOptions.verified.cs +++ /dev/null @@ -1,39 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.Api; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class ConfigureSwaggerDocOptions : IConfigureOptions -{ - private readonly IApiVersionDescriptionProvider provider; - - public ConfigureSwaggerDocOptions( - IApiVersionDescriptionProvider provider) - => this.provider = provider; - - public void Configure( - SwaggerGenOptions options) - { - foreach (var version in provider.ApiVersionDescriptions) - { - options.SwaggerDoc( - version.GroupName, - new OpenApiInfo - { - Version = "1.0", - Title = "Demo Users Api", - Description = @"Demo Users Api - SingleFileVersion", - Contact = new OpenApiContact - { - Name = "atc-net A/S", - }, - }); - } - - options.IncludeXmlComments(Path.ChangeExtension(GetType().Assembly.Location, "xml")); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api/GlobalUsings.verified.cs deleted file mode 100644 index 06005c25..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api/GlobalUsings.verified.cs +++ /dev/null @@ -1,13 +0,0 @@ -global using System.CodeDom.Compiler; -global using System.Reflection; - -global using Atc.Rest.Extended.Options; - -global using DemoUsersApi.Api.Generated; -global using DemoUsersApi.Domain; - -global using Microsoft.AspNetCore.Mvc.ApiExplorer; -global using Microsoft.Extensions.Options; -global using Microsoft.OpenApi.Models; - -global using Swashbuckle.AspNetCore.SwaggerGen; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api/Program.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api/Program.verified.cs deleted file mode 100644 index e0f06b76..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api/Program.verified.cs +++ /dev/null @@ -1,23 +0,0 @@ -namespace DemoUsersApi.Api; - -public static class Program -{ - public static void Main(string[] args) - { - CreateHostBuilder(args) - .Build() - .Run(); - } - - public static IHostBuilder CreateHostBuilder(string[] args) - { - var builder = Host - .CreateDefaultBuilder(args) - .ConfigureWebHostDefaults(webBuilder => - { - webBuilder.UseStartup(); - }); - - return builder; - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api/Startup.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api/Startup.verified.cs deleted file mode 100644 index 243733b8..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Api/Startup.verified.cs +++ /dev/null @@ -1,38 +0,0 @@ -namespace DemoUsersApi.Api; - -public class Startup -{ - private readonly RestApiExtendedOptions restApiOptions; - - public Startup( - IConfiguration configuration) - { - Configuration = configuration; - restApiOptions = new RestApiExtendedOptions - { - // TODO: Remove/out-comment/set to false this for production scenarios! - AllowAnonymousAccessForDevelopment = true, - }; - - restApiOptions.AddAssemblyPairs( - Assembly.GetAssembly(typeof(ApiRegistration)), - Assembly.GetAssembly(typeof(DomainRegistration))); - } - - public IConfiguration Configuration { get; } - - public void ConfigureServices( - IServiceCollection services) - { - services.ConfigureOptions(); - - services.AddRestApi(restApiOptions, Configuration); - } - - public void Configure( - IApplicationBuilder app, - IWebHostEnvironment env) - { - app.ConfigureRestApi(env, restApiOptions); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Domain/DomainRegistration.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Domain/DomainRegistration.verified.cs deleted file mode 100644 index b2c9988b..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Domain/DomainRegistration.verified.cs +++ /dev/null @@ -1,12 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.Domain; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class DomainRegistration -{ -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Domain/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Domain/GlobalUsings.verified.cs deleted file mode 100644 index 57f05f01..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Domain/GlobalUsings.verified.cs +++ /dev/null @@ -1,3 +0,0 @@ -global using System.CodeDom.Compiler; - -global using DemoUsersApi.Api.Generated.Contracts.Users; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Domain/Handlers/Users/DeleteUserByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Domain/Handlers/Users/DeleteUserByIdHandler.verified.cs deleted file mode 100644 index 79868739..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Domain/Handlers/Users/DeleteUserByIdHandler.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace DemoUsersApi.Domain.Handlers.Users; - -/// -/// Handler for operation request. -/// Description: Delete user by id. -/// Operation: DeleteUserById. -/// -public class DeleteUserByIdHandler : IDeleteUserByIdHandler -{ - public Task ExecuteAsync( - DeleteUserByIdParameters parameters, - CancellationToken cancellationToken = default) - { - ArgumentNullException.ThrowIfNull(parameters); - - throw new NotImplementedException("Add logic here for DeleteUserByIdHandler"); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Domain/Handlers/Users/GetUserByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Domain/Handlers/Users/GetUserByIdHandler.verified.cs deleted file mode 100644 index 73eab629..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Domain/Handlers/Users/GetUserByIdHandler.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace DemoUsersApi.Domain.Handlers.Users; - -/// -/// Handler for operation request. -/// Description: Get user by id. -/// Operation: GetUserById. -/// -public class GetUserByIdHandler : IGetUserByIdHandler -{ - public Task ExecuteAsync( - GetUserByIdParameters parameters, - CancellationToken cancellationToken = default) - { - ArgumentNullException.ThrowIfNull(parameters); - - throw new NotImplementedException("Add logic here for GetUserByIdHandler"); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Domain/Handlers/Users/GetUsersHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Domain/Handlers/Users/GetUsersHandler.verified.cs deleted file mode 100644 index af09abf5..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Domain/Handlers/Users/GetUsersHandler.verified.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace DemoUsersApi.Domain.Handlers.Users; - -/// -/// Handler for operation request. -/// Description: Get all users. -/// Operation: GetUsers. -/// -public class GetUsersHandler : IGetUsersHandler -{ - public Task ExecuteAsync( - CancellationToken cancellationToken = default) - { - throw new NotImplementedException("Add logic here for GetUsersHandler"); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Domain/Handlers/Users/PostUserHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Domain/Handlers/Users/PostUserHandler.verified.cs deleted file mode 100644 index 1be234e7..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Domain/Handlers/Users/PostUserHandler.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace DemoUsersApi.Domain.Handlers.Users; - -/// -/// Handler for operation request. -/// Description: Create a new user. -/// Operation: PostUser. -/// -public class PostUserHandler : IPostUserHandler -{ - public Task ExecuteAsync( - PostUserParameters parameters, - CancellationToken cancellationToken = default) - { - ArgumentNullException.ThrowIfNull(parameters); - - throw new NotImplementedException("Add logic here for PostUserHandler"); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Domain/Handlers/Users/UpdateUserByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Domain/Handlers/Users/UpdateUserByIdHandler.verified.cs deleted file mode 100644 index 74e7b4bf..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/src/DemoUsersApi.Domain/Handlers/Users/UpdateUserByIdHandler.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace DemoUsersApi.Domain.Handlers.Users; - -/// -/// Handler for operation request. -/// Description: Update user by id. -/// Operation: UpdateUserById. -/// -public class UpdateUserByIdHandler : IUpdateUserByIdHandler -{ - public Task ExecuteAsync( - UpdateUserByIdParameters parameters, - CancellationToken cancellationToken = default) - { - ArgumentNullException.ThrowIfNull(parameters); - - throw new NotImplementedException("Add logic here for UpdateUserByIdHandler"); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/test/DemoUsersApi.Api.Tests/Endpoints/Users/DeleteUserByIdHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/test/DemoUsersApi.Api.Tests/Endpoints/Users/DeleteUserByIdHandlerStub.verified.cs deleted file mode 100644 index a53a7ae8..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/test/DemoUsersApi.Api.Tests/Endpoints/Users/DeleteUserByIdHandlerStub.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.Api.Tests.Endpoints.Users; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class DeleteUserByIdHandlerStub : IDeleteUserByIdHandler -{ - public Task ExecuteAsync( - DeleteUserByIdParameters parameters, - CancellationToken cancellationToken = default) - { - return Task.FromResult(DeleteUserByIdResult.Ok("Hallo world")); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/test/DemoUsersApi.Api.Tests/Endpoints/Users/DeleteUserByIdTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/test/DemoUsersApi.Api.Tests/Endpoints/Users/DeleteUserByIdTests.verified.cs deleted file mode 100644 index 709c8a39..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/test/DemoUsersApi.Api.Tests/Endpoints/Users/DeleteUserByIdTests.verified.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace DemoUsersApi.Api.Tests.Endpoints.Users; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class DeleteUserByIdTests : WebApiControllerBaseTest -{ - public DeleteUserByIdTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/test/DemoUsersApi.Api.Tests/Endpoints/Users/GetUserByIdHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/test/DemoUsersApi.Api.Tests/Endpoints/Users/GetUserByIdHandlerStub.verified.cs deleted file mode 100644 index 824b3886..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/test/DemoUsersApi.Api.Tests/Endpoints/Users/GetUserByIdHandlerStub.verified.cs +++ /dev/null @@ -1,20 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.Api.Tests.Endpoints.Users; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetUserByIdHandlerStub : IGetUserByIdHandler -{ - public Task ExecuteAsync( - GetUserByIdParameters parameters, - CancellationToken cancellationToken = default) - { - var data = new Fixture().Create(); - - return Task.FromResult(GetUserByIdResult.Ok(data)); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/test/DemoUsersApi.Api.Tests/Endpoints/Users/GetUserByIdTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/test/DemoUsersApi.Api.Tests/Endpoints/Users/GetUserByIdTests.verified.cs deleted file mode 100644 index f64aaf9f..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/test/DemoUsersApi.Api.Tests/Endpoints/Users/GetUserByIdTests.verified.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace DemoUsersApi.Api.Tests.Endpoints.Users; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class GetUserByIdTests : WebApiControllerBaseTest -{ - public GetUserByIdTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/test/DemoUsersApi.Api.Tests/Endpoints/Users/GetUsersHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/test/DemoUsersApi.Api.Tests/Endpoints/Users/GetUsersHandlerStub.verified.cs deleted file mode 100644 index d0655766..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/test/DemoUsersApi.Api.Tests/Endpoints/Users/GetUsersHandlerStub.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.Api.Tests.Endpoints.Users; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetUsersHandlerStub : IGetUsersHandler -{ - public Task ExecuteAsync( - CancellationToken cancellationToken = default) - { - var data = new Fixture().Create>(); - - return Task.FromResult(GetUsersResult.Ok(data)); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/test/DemoUsersApi.Api.Tests/Endpoints/Users/GetUsersTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/test/DemoUsersApi.Api.Tests/Endpoints/Users/GetUsersTests.verified.cs deleted file mode 100644 index 08d1fdaa..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/test/DemoUsersApi.Api.Tests/Endpoints/Users/GetUsersTests.verified.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace DemoUsersApi.Api.Tests.Endpoints.Users; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class GetUsersTests : WebApiControllerBaseTest -{ - public GetUsersTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/test/DemoUsersApi.Api.Tests/Endpoints/Users/PostUserHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/test/DemoUsersApi.Api.Tests/Endpoints/Users/PostUserHandlerStub.verified.cs deleted file mode 100644 index 75149fa4..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/test/DemoUsersApi.Api.Tests/Endpoints/Users/PostUserHandlerStub.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.Api.Tests.Endpoints.Users; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class PostUserHandlerStub : IPostUserHandler -{ - public Task ExecuteAsync( - PostUserParameters parameters, - CancellationToken cancellationToken = default) - { - return Task.FromResult(PostUserResult.Created()); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/test/DemoUsersApi.Api.Tests/Endpoints/Users/PostUserTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/test/DemoUsersApi.Api.Tests/Endpoints/Users/PostUserTests.verified.cs deleted file mode 100644 index b6e0a28d..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/test/DemoUsersApi.Api.Tests/Endpoints/Users/PostUserTests.verified.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace DemoUsersApi.Api.Tests.Endpoints.Users; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class PostUserTests : WebApiControllerBaseTest -{ - public PostUserTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/test/DemoUsersApi.Api.Tests/Endpoints/Users/UpdateUserByIdHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/test/DemoUsersApi.Api.Tests/Endpoints/Users/UpdateUserByIdHandlerStub.verified.cs deleted file mode 100644 index de06e203..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/test/DemoUsersApi.Api.Tests/Endpoints/Users/UpdateUserByIdHandlerStub.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.Api.Tests.Endpoints.Users; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class UpdateUserByIdHandlerStub : IUpdateUserByIdHandler -{ - public Task ExecuteAsync( - UpdateUserByIdParameters parameters, - CancellationToken cancellationToken = default) - { - return Task.FromResult(UpdateUserByIdResult.Ok("Hallo world")); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/test/DemoUsersApi.Api.Tests/Endpoints/Users/UpdateUserByIdTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/test/DemoUsersApi.Api.Tests/Endpoints/Users/UpdateUserByIdTests.verified.cs deleted file mode 100644 index d324aac9..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/test/DemoUsersApi.Api.Tests/Endpoints/Users/UpdateUserByIdTests.verified.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace DemoUsersApi.Api.Tests.Endpoints.Users; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class UpdateUserByIdTests : WebApiControllerBaseTest -{ - public UpdateUserByIdTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/test/DemoUsersApi.Api.Tests/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/test/DemoUsersApi.Api.Tests/GlobalUsings.verified.cs deleted file mode 100644 index 2bf91ef3..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/test/DemoUsersApi.Api.Tests/GlobalUsings.verified.cs +++ /dev/null @@ -1,20 +0,0 @@ -global using System.CodeDom.Compiler; -global using System.Reflection; -global using System.Text; -global using System.Text.Json; -global using System.Text.Json.Serialization; - -global using Atc.Rest.Options; -global using Atc.Rest.Results; -global using Atc.XUnit; - -global using DemoUsersApi.Api.Generated; -global using DemoUsersApi.Api.Generated.Contracts; -global using DemoUsersApi.Api.Generated.Contracts.Users; - -global using Microsoft.AspNetCore.Hosting; -global using Microsoft.AspNetCore.Http; -global using Microsoft.AspNetCore.Mvc.Testing; -global using Microsoft.AspNetCore.TestHost; -global using Microsoft.Extensions.Configuration; -global using Microsoft.Extensions.DependencyInjection; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/test/DemoUsersApi.Api.Tests/WebApiControllerBaseTest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/test/DemoUsersApi.Api.Tests/WebApiControllerBaseTest.verified.cs deleted file mode 100644 index ec76c8a8..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/test/DemoUsersApi.Api.Tests/WebApiControllerBaseTest.verified.cs +++ /dev/null @@ -1,56 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.Api.Tests; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public abstract class WebApiControllerBaseTest : IClassFixture -{ - protected readonly WebApiStartupFactory Factory; - - protected readonly HttpClient HttpClient; - - protected readonly IConfiguration Configuration; - - protected static JsonSerializerOptions? JsonSerializerOptions; - - protected WebApiControllerBaseTest(WebApiStartupFactory fixture) - { - this.Factory = fixture; - this.HttpClient = this.Factory.CreateClient(); - this.Configuration = new ConfigurationBuilder().Build(); - JsonSerializerOptions = new JsonSerializerOptions - { - PropertyNameCaseInsensitive = true, - Converters = - { - new JsonStringEnumConverter() - }, - }; - } - - protected static StringContent ToJson(object data) - => new(JsonSerializer.Serialize(data, JsonSerializerOptions), Encoding.UTF8, "application/json"); - - protected static StringContent Json(string data) - => new(data, Encoding.UTF8, "application/json"); - - protected static IFormFile GetTestFile() - { - var bytes = Encoding.UTF8.GetBytes("Hello World"); - var stream = new MemoryStream(bytes); - var formFile = new FormFile(stream, 0, stream.Length, "dummy", "dummy.txt") - { - Headers = new HeaderDictionary(), - ContentType = "application/octet-stream", - }; - - return formFile; - } - - protected static List GetTestFiles() - => new() { GetTestFile(), GetTestFile() }; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/test/DemoUsersApi.Api.Tests/WebApiStartupFactory.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/test/DemoUsersApi.Api.Tests/WebApiStartupFactory.verified.cs deleted file mode 100644 index feee1c45..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/test/DemoUsersApi.Api.Tests/WebApiStartupFactory.verified.cs +++ /dev/null @@ -1,40 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace DemoUsersApi.Api.Tests; - -/// -/// Factory for bootstrapping in memory tests. -/// Includes options to override configuration and service collection using a partial class. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public partial class WebApiStartupFactory : WebApplicationFactory -{ - protected override void ConfigureWebHost(IWebHostBuilder builder) - { - builder.ConfigureAppConfiguration(config => - { - ModifyConfiguration(config); - var integrationConfig = new ConfigurationBuilder() - .AddJsonFile("appsettings.integrationtest.json") - .Build(); - config.AddConfiguration(integrationConfig); - }); - - builder.ConfigureTestServices(services => - { - ModifyServices(services); - services.AddSingleton(); - services.AutoRegistrateServices( - Assembly.GetAssembly(typeof(ApiRegistration))!, - Assembly.GetAssembly(typeof(WebApiStartupFactory))!); - }); - } - - partial void ModifyConfiguration(IConfigurationBuilder config); - - partial void ModifyServices(IServiceCollection services); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/test/DemoUsersApi.Domain.Tests/Handlers/Users/DeleteUserByIdHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/test/DemoUsersApi.Domain.Tests/Handlers/Users/DeleteUserByIdHandlerTests.verified.cs deleted file mode 100644 index 93c1c49f..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/test/DemoUsersApi.Domain.Tests/Handlers/Users/DeleteUserByIdHandlerTests.verified.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace DemoUsersApi.Domain.Tests.Handlers.Users; - -public class DeleteUserByIdHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/test/DemoUsersApi.Domain.Tests/Handlers/Users/GetUserByIdHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/test/DemoUsersApi.Domain.Tests/Handlers/Users/GetUserByIdHandlerTests.verified.cs deleted file mode 100644 index b04a8b1e..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/test/DemoUsersApi.Domain.Tests/Handlers/Users/GetUserByIdHandlerTests.verified.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace DemoUsersApi.Domain.Tests.Handlers.Users; - -public class GetUserByIdHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/test/DemoUsersApi.Domain.Tests/Handlers/Users/GetUsersHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/test/DemoUsersApi.Domain.Tests/Handlers/Users/GetUsersHandlerTests.verified.cs deleted file mode 100644 index 37b38f3c..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/test/DemoUsersApi.Domain.Tests/Handlers/Users/GetUsersHandlerTests.verified.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace DemoUsersApi.Domain.Tests.Handlers.Users; - -public class GetUsersHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/test/DemoUsersApi.Domain.Tests/Handlers/Users/PostUserHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/test/DemoUsersApi.Domain.Tests/Handlers/Users/PostUserHandlerTests.verified.cs deleted file mode 100644 index 059cacce..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/test/DemoUsersApi.Domain.Tests/Handlers/Users/PostUserHandlerTests.verified.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace DemoUsersApi.Domain.Tests.Handlers.Users; - -public class PostUserHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/test/DemoUsersApi.Domain.Tests/Handlers/Users/UpdateUserByIdHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/test/DemoUsersApi.Domain.Tests/Handlers/Users/UpdateUserByIdHandlerTests.verified.cs deleted file mode 100644 index f35680c2..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/VerifyServerAll/test/DemoUsersApi.Domain.Tests/Handlers/Users/UpdateUserByIdHandlerTests.verified.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace DemoUsersApi.Domain.Tests.Handlers.Users; - -public class UpdateUserByIdHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyClientCSharp/src/GenericPaginationApi.ApiClient.Generated/Contracts/Cats/Models/Cat.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyClientCSharp/src/GenericPaginationApi.ApiClient.Generated/Contracts/Cats/Models/Cat.verified.cs deleted file mode 100644 index ed4994aa..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyClientCSharp/src/GenericPaginationApi.ApiClient.Generated/Contracts/Cats/Models/Cat.verified.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace GenericPaginationApi.ApiClient.Generated.Contracts; - -/// -/// Cat. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class Cat -{ - public int Id { get; set; } - - public string Name { get; set; } - - public string ServantName { get; set; } - - public string FavoriteFish { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}, {nameof(Name)}: {Name}, {nameof(ServantName)}: {ServantName}, {nameof(FavoriteFish)}: {FavoriteFish}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyClientCSharp/src/GenericPaginationApi.ApiClient.Generated/Contracts/Cats/RequestParameters/GetCatsParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyClientCSharp/src/GenericPaginationApi.ApiClient.Generated/Contracts/Cats/RequestParameters/GetCatsParameters.verified.cs deleted file mode 100644 index 3efb1d84..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyClientCSharp/src/GenericPaginationApi.ApiClient.Generated/Contracts/Cats/RequestParameters/GetCatsParameters.verified.cs +++ /dev/null @@ -1,29 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace GenericPaginationApi.ApiClient.Generated.Contracts; - -/// -/// Parameters for operation request. -/// Description: Find all cats. -/// Operation: GetCats. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetCatsParameters -{ - [Required] - public int PageSize { get; set; } = 10; - - [Required] - public int PageIndex { get; set; } = 0; - - [Required] - public string QueryString { get; set; } - - /// - public override string ToString() - => $"{nameof(PageSize)}: {PageSize}, {nameof(PageIndex)}: {PageIndex}, {nameof(QueryString)}: {QueryString}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyClientCSharp/src/GenericPaginationApi.ApiClient.Generated/Contracts/Dogs/Models/Dog.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyClientCSharp/src/GenericPaginationApi.ApiClient.Generated/Contracts/Dogs/Models/Dog.verified.cs deleted file mode 100644 index a5264798..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyClientCSharp/src/GenericPaginationApi.ApiClient.Generated/Contracts/Dogs/Models/Dog.verified.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace GenericPaginationApi.ApiClient.Generated.Contracts; - -/// -/// Dog. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class Dog -{ - public int Id { get; set; } - - public string Name { get; set; } - - public string OwnerName { get; set; } - - public string FavoriteToy { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}, {nameof(Name)}: {Name}, {nameof(OwnerName)}: {OwnerName}, {nameof(FavoriteToy)}: {FavoriteToy}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyClientCSharp/src/GenericPaginationApi.ApiClient.Generated/Contracts/Dogs/RequestParameters/GetDogsParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyClientCSharp/src/GenericPaginationApi.ApiClient.Generated/Contracts/Dogs/RequestParameters/GetDogsParameters.verified.cs deleted file mode 100644 index 2cedea5b..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyClientCSharp/src/GenericPaginationApi.ApiClient.Generated/Contracts/Dogs/RequestParameters/GetDogsParameters.verified.cs +++ /dev/null @@ -1,29 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace GenericPaginationApi.ApiClient.Generated.Contracts; - -/// -/// Parameters for operation request. -/// Description: Find all dogs. -/// Operation: GetDogs. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetDogsParameters -{ - [Required] - public int PageSize { get; set; } = 10; - - [Required] - public int PageIndex { get; set; } = 0; - - [Required] - public string QueryString { get; set; } - - /// - public override string ToString() - => $"{nameof(PageSize)}: {PageSize}, {nameof(PageIndex)}: {PageIndex}, {nameof(QueryString)}: {QueryString}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyClientCSharp/src/GenericPaginationApi.ApiClient.Generated/Contracts/_Shared/PaginatedResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyClientCSharp/src/GenericPaginationApi.ApiClient.Generated/Contracts/_Shared/PaginatedResult.verified.cs deleted file mode 100644 index f0591883..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyClientCSharp/src/GenericPaginationApi.ApiClient.Generated/Contracts/_Shared/PaginatedResult.verified.cs +++ /dev/null @@ -1,32 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace GenericPaginationApi.ApiClient.Generated.Contracts; - -/// -/// PaginatedResult. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class PaginatedResult -{ - public int PageSize { get; set; } = 10; - - public int PageIndex { get; set; } - - public string? QueryString { get; set; } - - public string? ContinuationToken { get; set; } - - public int Count { get; set; } - - public int TotalCount { get; set; } - - public List Results { get; set; } = new List(); - - /// - public override string ToString() - => $"{nameof(PageSize)}: {PageSize}, {nameof(PageIndex)}: {PageIndex}, {nameof(QueryString)}: {QueryString}, {nameof(ContinuationToken)}: {ContinuationToken}, {nameof(Count)}: {Count}, {nameof(TotalCount)}: {TotalCount}, {nameof(Results)}.Count: {Results?.Count ?? 0}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyClientCSharp/src/GenericPaginationApi.ApiClient.Generated/Endpoints/Cats/GetCatsEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyClientCSharp/src/GenericPaginationApi.ApiClient.Generated/Endpoints/Cats/GetCatsEndpoint.verified.cs deleted file mode 100644 index 8f7f7220..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyClientCSharp/src/GenericPaginationApi.ApiClient.Generated/Endpoints/Cats/GetCatsEndpoint.verified.cs +++ /dev/null @@ -1,52 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace GenericPaginationApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint. -/// Description: Find all cats. -/// Operation: GetCats. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetCatsEndpoint : IGetCatsEndpoint -{ - private readonly IHttpClientFactory factory; - private readonly IHttpMessageFactory httpMessageFactory; - - public GetCatsEndpoint( - IHttpClientFactory factory, - IHttpMessageFactory httpMessageFactory) - { - this.factory = factory; - this.httpMessageFactory = httpMessageFactory; - } - - public async Task ExecuteAsync( - GetCatsParameters parameters, - string httpClientName = "GenericPaginationApi-ApiClient", - CancellationToken cancellationToken = default) - { - var client = factory.CreateClient(httpClientName); - - var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/cats"); - requestBuilder.WithQueryParameter("pageSize", parameters.PageSize); - requestBuilder.WithQueryParameter("pageIndex", parameters.PageIndex); - requestBuilder.WithQueryParameter("queryString", parameters.QueryString); - - using var requestMessage = requestBuilder.Build(HttpMethod.Get); - using var response = await client.SendAsync(requestMessage, cancellationToken); - - var responseBuilder = httpMessageFactory.FromResponse(response); - responseBuilder.AddSuccessResponse>(HttpStatusCode.OK); - responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); - responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); - responseBuilder.AddErrorResponse(HttpStatusCode.Forbidden); - responseBuilder.AddErrorResponse(HttpStatusCode.InternalServerError); - - return await responseBuilder.BuildResponseAsync(x => new GetCatsEndpointResult(x), cancellationToken); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyClientCSharp/src/GenericPaginationApi.ApiClient.Generated/Endpoints/Cats/GetCatsEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyClientCSharp/src/GenericPaginationApi.ApiClient.Generated/Endpoints/Cats/GetCatsEndpointResult.verified.cs deleted file mode 100644 index a1b0daf4..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyClientCSharp/src/GenericPaginationApi.ApiClient.Generated/Endpoints/Cats/GetCatsEndpointResult.verified.cs +++ /dev/null @@ -1,51 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace GenericPaginationApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint result. -/// Description: Find all cats. -/// Operation: GetCats. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetCatsEndpointResult : EndpointResponse, IGetCatsEndpointResult -{ - public GetCatsEndpointResult(EndpointResponse response) - : base(response) - { - } - - public bool IsOk - => StatusCode == HttpStatusCode.OK; - - public bool IsBadRequest - => StatusCode == HttpStatusCode.BadRequest; - - public bool IsUnauthorized - => StatusCode == HttpStatusCode.Unauthorized; - - public bool IsForbidden - => StatusCode == HttpStatusCode.Forbidden; - - public bool IsInternalServerError - => StatusCode == HttpStatusCode.InternalServerError; - - public PaginatedResult OkContent - => IsOk && ContentObject is PaginatedResult result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); - - public ValidationProblemDetails BadRequestContent - => IsBadRequest && ContentObject is ValidationProblemDetails result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); - - public string InternalServerErrorContent - => IsInternalServerError && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsInternalServerError property first."); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyClientCSharp/src/GenericPaginationApi.ApiClient.Generated/Endpoints/Cats/Interfaces/IGetCatsEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyClientCSharp/src/GenericPaginationApi.ApiClient.Generated/Endpoints/Cats/Interfaces/IGetCatsEndpoint.verified.cs deleted file mode 100644 index 791e75a7..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyClientCSharp/src/GenericPaginationApi.ApiClient.Generated/Endpoints/Cats/Interfaces/IGetCatsEndpoint.verified.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace GenericPaginationApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint. -/// Description: Find all cats. -/// Operation: GetCats. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetCatsEndpoint -{ - /// - /// Execute method. - /// - /// The parameters. - /// The http client name. - /// The cancellation token. - Task ExecuteAsync( - GetCatsParameters parameters, - string httpClientName = "GenericPaginationApi-ApiClient", - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyClientCSharp/src/GenericPaginationApi.ApiClient.Generated/Endpoints/Cats/Interfaces/IGetCatsEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyClientCSharp/src/GenericPaginationApi.ApiClient.Generated/Endpoints/Cats/Interfaces/IGetCatsEndpointResult.verified.cs deleted file mode 100644 index 128085f7..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyClientCSharp/src/GenericPaginationApi.ApiClient.Generated/Endpoints/Cats/Interfaces/IGetCatsEndpointResult.verified.cs +++ /dev/null @@ -1,32 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace GenericPaginationApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint Result. -/// Description: Find all cats. -/// Operation: GetCats. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetCatsEndpointResult : IEndpointResponse -{ - bool IsOk { get; } - - bool IsBadRequest { get; } - - bool IsUnauthorized { get; } - - bool IsForbidden { get; } - - bool IsInternalServerError { get; } - - PaginatedResult OkContent { get; } - - ValidationProblemDetails BadRequestContent { get; } - - string InternalServerErrorContent { get; } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyClientCSharp/src/GenericPaginationApi.ApiClient.Generated/Endpoints/Dogs/GetDogsEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyClientCSharp/src/GenericPaginationApi.ApiClient.Generated/Endpoints/Dogs/GetDogsEndpoint.verified.cs deleted file mode 100644 index 3aa7b5d6..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyClientCSharp/src/GenericPaginationApi.ApiClient.Generated/Endpoints/Dogs/GetDogsEndpoint.verified.cs +++ /dev/null @@ -1,52 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace GenericPaginationApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint. -/// Description: Find all dogs. -/// Operation: GetDogs. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetDogsEndpoint : IGetDogsEndpoint -{ - private readonly IHttpClientFactory factory; - private readonly IHttpMessageFactory httpMessageFactory; - - public GetDogsEndpoint( - IHttpClientFactory factory, - IHttpMessageFactory httpMessageFactory) - { - this.factory = factory; - this.httpMessageFactory = httpMessageFactory; - } - - public async Task ExecuteAsync( - GetDogsParameters parameters, - string httpClientName = "GenericPaginationApi-ApiClient", - CancellationToken cancellationToken = default) - { - var client = factory.CreateClient(httpClientName); - - var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/dogs"); - requestBuilder.WithQueryParameter("pageSize", parameters.PageSize); - requestBuilder.WithQueryParameter("pageIndex", parameters.PageIndex); - requestBuilder.WithQueryParameter("queryString", parameters.QueryString); - - using var requestMessage = requestBuilder.Build(HttpMethod.Get); - using var response = await client.SendAsync(requestMessage, cancellationToken); - - var responseBuilder = httpMessageFactory.FromResponse(response); - responseBuilder.AddSuccessResponse>(HttpStatusCode.OK); - responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); - responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); - responseBuilder.AddErrorResponse(HttpStatusCode.Forbidden); - responseBuilder.AddErrorResponse(HttpStatusCode.InternalServerError); - - return await responseBuilder.BuildResponseAsync(x => new GetDogsEndpointResult(x), cancellationToken); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyClientCSharp/src/GenericPaginationApi.ApiClient.Generated/Endpoints/Dogs/GetDogsEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyClientCSharp/src/GenericPaginationApi.ApiClient.Generated/Endpoints/Dogs/GetDogsEndpointResult.verified.cs deleted file mode 100644 index eb728842..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyClientCSharp/src/GenericPaginationApi.ApiClient.Generated/Endpoints/Dogs/GetDogsEndpointResult.verified.cs +++ /dev/null @@ -1,51 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace GenericPaginationApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint result. -/// Description: Find all dogs. -/// Operation: GetDogs. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetDogsEndpointResult : EndpointResponse, IGetDogsEndpointResult -{ - public GetDogsEndpointResult(EndpointResponse response) - : base(response) - { - } - - public bool IsOk - => StatusCode == HttpStatusCode.OK; - - public bool IsBadRequest - => StatusCode == HttpStatusCode.BadRequest; - - public bool IsUnauthorized - => StatusCode == HttpStatusCode.Unauthorized; - - public bool IsForbidden - => StatusCode == HttpStatusCode.Forbidden; - - public bool IsInternalServerError - => StatusCode == HttpStatusCode.InternalServerError; - - public PaginatedResult OkContent - => IsOk && ContentObject is PaginatedResult result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); - - public ValidationProblemDetails BadRequestContent - => IsBadRequest && ContentObject is ValidationProblemDetails result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); - - public string InternalServerErrorContent - => IsInternalServerError && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsInternalServerError property first."); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyClientCSharp/src/GenericPaginationApi.ApiClient.Generated/Endpoints/Dogs/Interfaces/IGetDogsEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyClientCSharp/src/GenericPaginationApi.ApiClient.Generated/Endpoints/Dogs/Interfaces/IGetDogsEndpoint.verified.cs deleted file mode 100644 index aaa7476e..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyClientCSharp/src/GenericPaginationApi.ApiClient.Generated/Endpoints/Dogs/Interfaces/IGetDogsEndpoint.verified.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace GenericPaginationApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint. -/// Description: Find all dogs. -/// Operation: GetDogs. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetDogsEndpoint -{ - /// - /// Execute method. - /// - /// The parameters. - /// The http client name. - /// The cancellation token. - Task ExecuteAsync( - GetDogsParameters parameters, - string httpClientName = "GenericPaginationApi-ApiClient", - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyClientCSharp/src/GenericPaginationApi.ApiClient.Generated/Endpoints/Dogs/Interfaces/IGetDogsEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyClientCSharp/src/GenericPaginationApi.ApiClient.Generated/Endpoints/Dogs/Interfaces/IGetDogsEndpointResult.verified.cs deleted file mode 100644 index 10373633..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyClientCSharp/src/GenericPaginationApi.ApiClient.Generated/Endpoints/Dogs/Interfaces/IGetDogsEndpointResult.verified.cs +++ /dev/null @@ -1,32 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace GenericPaginationApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint Result. -/// Description: Find all dogs. -/// Operation: GetDogs. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetDogsEndpointResult : IEndpointResponse -{ - bool IsOk { get; } - - bool IsBadRequest { get; } - - bool IsUnauthorized { get; } - - bool IsForbidden { get; } - - bool IsInternalServerError { get; } - - PaginatedResult OkContent { get; } - - ValidationProblemDetails BadRequestContent { get; } - - string InternalServerErrorContent { get; } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyClientCSharp/src/GenericPaginationApi.ApiClient.Generated/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyClientCSharp/src/GenericPaginationApi.ApiClient.Generated/GlobalUsings.verified.cs deleted file mode 100644 index 884d0b00..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyClientCSharp/src/GenericPaginationApi.ApiClient.Generated/GlobalUsings.verified.cs +++ /dev/null @@ -1,10 +0,0 @@ -global using System.CodeDom.Compiler; -global using System.ComponentModel.DataAnnotations; -global using System.Net; - -global using Atc.Rest.Client; -global using Atc.Rest.Client.Builder; - -global using GenericPaginationApi.ApiClient.Generated.Contracts; - -global using Microsoft.AspNetCore.Mvc; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Api.Generated/ApiRegistration.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Api.Generated/ApiRegistration.verified.cs deleted file mode 100644 index d8441b21..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Api.Generated/ApiRegistration.verified.cs +++ /dev/null @@ -1,12 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace GenericPaginationApi.Api.Generated; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class ApiRegistration -{ -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Api.Generated/Contracts/Cats/Interfaces/IGetCatsHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Api.Generated/Contracts/Cats/Interfaces/IGetCatsHandler.verified.cs deleted file mode 100644 index e6953a21..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Api.Generated/Contracts/Cats/Interfaces/IGetCatsHandler.verified.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace GenericPaginationApi.Api.Generated.Contracts.Cats; - -/// -/// Domain Interface for RequestHandler. -/// Description: Find all cats. -/// Operation: GetCats. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetCatsHandler -{ - /// - /// Execute method. - /// - /// The parameters. - /// The cancellation token. - Task ExecuteAsync( - GetCatsParameters parameters, - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Api.Generated/Contracts/Cats/Models/Cat.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Api.Generated/Contracts/Cats/Models/Cat.verified.cs deleted file mode 100644 index 6ccc2338..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Api.Generated/Contracts/Cats/Models/Cat.verified.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace GenericPaginationApi.Api.Generated.Contracts.Cats; - -/// -/// Cat. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class Cat -{ - public int Id { get; set; } - - public string Name { get; set; } - - public string ServantName { get; set; } - - public string FavoriteFish { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}, {nameof(Name)}: {Name}, {nameof(ServantName)}: {ServantName}, {nameof(FavoriteFish)}: {FavoriteFish}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Api.Generated/Contracts/Cats/Parameters/GetCatsParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Api.Generated/Contracts/Cats/Parameters/GetCatsParameters.verified.cs deleted file mode 100644 index 175b6063..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Api.Generated/Contracts/Cats/Parameters/GetCatsParameters.verified.cs +++ /dev/null @@ -1,32 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace GenericPaginationApi.Api.Generated.Contracts.Cats; - -/// -/// Parameters for operation request. -/// Description: Find all cats. -/// Operation: GetCats. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetCatsParameters -{ - [FromQuery(Name = "pageSize")] - [Required] - public int PageSize { get; set; } = 10; - - [FromQuery(Name = "pageIndex")] - [Required] - public int PageIndex { get; set; } = 0; - - [FromQuery(Name = "queryString")] - [Required] - public string QueryString { get; set; } - - /// - public override string ToString() - => $"{nameof(PageSize)}: {PageSize}, {nameof(PageIndex)}: {PageIndex}, {nameof(QueryString)}: {QueryString}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Api.Generated/Contracts/Cats/Results/GetCatsResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Api.Generated/Contracts/Cats/Results/GetCatsResult.verified.cs deleted file mode 100644 index 840d4160..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Api.Generated/Contracts/Cats/Results/GetCatsResult.verified.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace GenericPaginationApi.Api.Generated.Contracts.Cats; - -/// -/// Results for operation request. -/// Description: Find all cats. -/// Operation: GetCats. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetCatsResult : ResultBase -{ - private GetCatsResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static GetCatsResult Ok(PaginatedResult response) - => new GetCatsResult(new OkObjectResult(response)); - - /// - /// Performs an implicit conversion from GetCatsResult to ActionResult. - /// - public static implicit operator GetCatsResult(PaginatedResult response) - => Ok(response); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Api.Generated/Contracts/Dogs/Interfaces/IGetDogsHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Api.Generated/Contracts/Dogs/Interfaces/IGetDogsHandler.verified.cs deleted file mode 100644 index 74b365bb..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Api.Generated/Contracts/Dogs/Interfaces/IGetDogsHandler.verified.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace GenericPaginationApi.Api.Generated.Contracts.Dogs; - -/// -/// Domain Interface for RequestHandler. -/// Description: Find all dogs. -/// Operation: GetDogs. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetDogsHandler -{ - /// - /// Execute method. - /// - /// The parameters. - /// The cancellation token. - Task ExecuteAsync( - GetDogsParameters parameters, - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Api.Generated/Contracts/Dogs/Models/Dog.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Api.Generated/Contracts/Dogs/Models/Dog.verified.cs deleted file mode 100644 index 1764cb66..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Api.Generated/Contracts/Dogs/Models/Dog.verified.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace GenericPaginationApi.Api.Generated.Contracts.Dogs; - -/// -/// Dog. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class Dog -{ - public int Id { get; set; } - - public string Name { get; set; } - - public string OwnerName { get; set; } - - public string FavoriteToy { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}, {nameof(Name)}: {Name}, {nameof(OwnerName)}: {OwnerName}, {nameof(FavoriteToy)}: {FavoriteToy}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Api.Generated/Contracts/Dogs/Parameters/GetDogsParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Api.Generated/Contracts/Dogs/Parameters/GetDogsParameters.verified.cs deleted file mode 100644 index 57410071..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Api.Generated/Contracts/Dogs/Parameters/GetDogsParameters.verified.cs +++ /dev/null @@ -1,32 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace GenericPaginationApi.Api.Generated.Contracts.Dogs; - -/// -/// Parameters for operation request. -/// Description: Find all dogs. -/// Operation: GetDogs. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetDogsParameters -{ - [FromQuery(Name = "pageSize")] - [Required] - public int PageSize { get; set; } = 10; - - [FromQuery(Name = "pageIndex")] - [Required] - public int PageIndex { get; set; } = 0; - - [FromQuery(Name = "queryString")] - [Required] - public string QueryString { get; set; } - - /// - public override string ToString() - => $"{nameof(PageSize)}: {PageSize}, {nameof(PageIndex)}: {PageIndex}, {nameof(QueryString)}: {QueryString}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Api.Generated/Contracts/Dogs/Results/GetDogsResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Api.Generated/Contracts/Dogs/Results/GetDogsResult.verified.cs deleted file mode 100644 index 18606e0c..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Api.Generated/Contracts/Dogs/Results/GetDogsResult.verified.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace GenericPaginationApi.Api.Generated.Contracts.Dogs; - -/// -/// Results for operation request. -/// Description: Find all dogs. -/// Operation: GetDogs. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetDogsResult : ResultBase -{ - private GetDogsResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static GetDogsResult Ok(PaginatedResult response) - => new GetDogsResult(new OkObjectResult(response)); - - /// - /// Performs an implicit conversion from GetDogsResult to ActionResult. - /// - public static implicit operator GetDogsResult(PaginatedResult response) - => Ok(response); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Api.Generated/Contracts/_Shared/PaginatedResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Api.Generated/Contracts/_Shared/PaginatedResult.verified.cs deleted file mode 100644 index a43ece33..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Api.Generated/Contracts/_Shared/PaginatedResult.verified.cs +++ /dev/null @@ -1,32 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace GenericPaginationApi.Api.Generated.Contracts; - -/// -/// PaginatedResult. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class PaginatedResult -{ - public int PageSize { get; set; } = 10; - - public int PageIndex { get; set; } - - public string? QueryString { get; set; } - - public string? ContinuationToken { get; set; } - - public int Count { get; set; } - - public int TotalCount { get; set; } - - public List Results { get; set; } = new List(); - - /// - public override string ToString() - => $"{nameof(PageSize)}: {PageSize}, {nameof(PageIndex)}: {PageIndex}, {nameof(QueryString)}: {QueryString}, {nameof(ContinuationToken)}: {ContinuationToken}, {nameof(Count)}: {Count}, {nameof(TotalCount)}: {TotalCount}, {nameof(Results)}.Count: {Results?.Count ?? 0}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Api.Generated/Endpoints/CatsController.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Api.Generated/Endpoints/CatsController.verified.cs deleted file mode 100644 index 894303d5..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Api.Generated/Endpoints/CatsController.verified.cs +++ /dev/null @@ -1,32 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace GenericPaginationApi.Api.Generated.Endpoints; - -/// -/// Endpoint definitions. -/// -[Authorize] -[ApiController] -[Route("/api/v1/cats")] -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class CatsController : ControllerBase -{ - /// - /// Description: Find all cats. - /// Operation: GetCats. - /// - [HttpGet] - [ProducesResponseType(typeof(PaginatedResult), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(StatusCodes.Status401Unauthorized)] - [ProducesResponseType(StatusCodes.Status403Forbidden)] - public async Task GetCats( - GetCatsParameters parameters, - [FromServices] IGetCatsHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(parameters, cancellationToken); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Api.Generated/Endpoints/DogsController.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Api.Generated/Endpoints/DogsController.verified.cs deleted file mode 100644 index 580c4e1d..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Api.Generated/Endpoints/DogsController.verified.cs +++ /dev/null @@ -1,32 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace GenericPaginationApi.Api.Generated.Endpoints; - -/// -/// Endpoint definitions. -/// -[Authorize] -[ApiController] -[Route("/api/v1/dogs")] -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class DogsController : ControllerBase -{ - /// - /// Description: Find all dogs. - /// Operation: GetDogs. - /// - [HttpGet] - [ProducesResponseType(typeof(PaginatedResult), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(StatusCodes.Status401Unauthorized)] - [ProducesResponseType(StatusCodes.Status403Forbidden)] - public async Task GetDogs( - GetDogsParameters parameters, - [FromServices] IGetDogsHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(parameters, cancellationToken); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Api.Generated/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Api.Generated/GlobalUsings.verified.cs deleted file mode 100644 index 954338f7..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Api.Generated/GlobalUsings.verified.cs +++ /dev/null @@ -1,13 +0,0 @@ -global using System.CodeDom.Compiler; -global using System.ComponentModel.DataAnnotations; -global using System.Net; - -global using Atc.Rest.Results; - -global using GenericPaginationApi.Api.Generated.Contracts; -global using GenericPaginationApi.Api.Generated.Contracts.Cats; -global using GenericPaginationApi.Api.Generated.Contracts.Dogs; - -global using Microsoft.AspNetCore.Authorization; -global using Microsoft.AspNetCore.Http; -global using Microsoft.AspNetCore.Mvc; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Api/ConfigureSwaggerDocOptions.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Api/ConfigureSwaggerDocOptions.verified.cs deleted file mode 100644 index 01feeae1..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Api/ConfigureSwaggerDocOptions.verified.cs +++ /dev/null @@ -1,39 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace GenericPaginationApi.Api; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class ConfigureSwaggerDocOptions : IConfigureOptions -{ - private readonly IApiVersionDescriptionProvider provider; - - public ConfigureSwaggerDocOptions( - IApiVersionDescriptionProvider provider) - => this.provider = provider; - - public void Configure( - SwaggerGenOptions options) - { - foreach (var version in provider.ApiVersionDescriptions) - { - options.SwaggerDoc( - version.GroupName, - new OpenApiInfo - { - Version = "1.0", - Title = "Generic Pagination Api", - Description = @"Generic Pagination Api - SingleFileVersion", - Contact = new OpenApiContact - { - Name = "atc-net A/S", - }, - }); - } - - options.IncludeXmlComments(Path.ChangeExtension(GetType().Assembly.Location, "xml")); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Api/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Api/GlobalUsings.verified.cs deleted file mode 100644 index 02a1d8a3..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Api/GlobalUsings.verified.cs +++ /dev/null @@ -1,13 +0,0 @@ -global using System.CodeDom.Compiler; -global using System.Reflection; - -global using Atc.Rest.Extended.Options; - -global using GenericPaginationApi.Api.Generated; -global using GenericPaginationApi.Domain; - -global using Microsoft.AspNetCore.Mvc.ApiExplorer; -global using Microsoft.Extensions.Options; -global using Microsoft.OpenApi.Models; - -global using Swashbuckle.AspNetCore.SwaggerGen; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Api/Program.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Api/Program.verified.cs deleted file mode 100644 index 38b05fdd..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Api/Program.verified.cs +++ /dev/null @@ -1,23 +0,0 @@ -namespace GenericPaginationApi.Api; - -public static class Program -{ - public static void Main(string[] args) - { - CreateHostBuilder(args) - .Build() - .Run(); - } - - public static IHostBuilder CreateHostBuilder(string[] args) - { - var builder = Host - .CreateDefaultBuilder(args) - .ConfigureWebHostDefaults(webBuilder => - { - webBuilder.UseStartup(); - }); - - return builder; - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Api/Startup.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Api/Startup.verified.cs deleted file mode 100644 index b8894a59..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Api/Startup.verified.cs +++ /dev/null @@ -1,38 +0,0 @@ -namespace GenericPaginationApi.Api; - -public class Startup -{ - private readonly RestApiExtendedOptions restApiOptions; - - public Startup( - IConfiguration configuration) - { - Configuration = configuration; - restApiOptions = new RestApiExtendedOptions - { - // TODO: Remove/out-comment/set to false this for production scenarios! - AllowAnonymousAccessForDevelopment = true, - }; - - restApiOptions.AddAssemblyPairs( - Assembly.GetAssembly(typeof(ApiRegistration)), - Assembly.GetAssembly(typeof(DomainRegistration))); - } - - public IConfiguration Configuration { get; } - - public void ConfigureServices( - IServiceCollection services) - { - services.ConfigureOptions(); - - services.AddRestApi(restApiOptions, Configuration); - } - - public void Configure( - IApplicationBuilder app, - IWebHostEnvironment env) - { - app.ConfigureRestApi(env, restApiOptions); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Domain/DomainRegistration.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Domain/DomainRegistration.verified.cs deleted file mode 100644 index 197f510e..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Domain/DomainRegistration.verified.cs +++ /dev/null @@ -1,12 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace GenericPaginationApi.Domain; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class DomainRegistration -{ -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Domain/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Domain/GlobalUsings.verified.cs deleted file mode 100644 index 17611548..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Domain/GlobalUsings.verified.cs +++ /dev/null @@ -1,4 +0,0 @@ -global using System.CodeDom.Compiler; - -global using GenericPaginationApi.Api.Generated.Contracts.Cats; -global using GenericPaginationApi.Api.Generated.Contracts.Dogs; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Domain/Handlers/Cats/GetCatsHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Domain/Handlers/Cats/GetCatsHandler.verified.cs deleted file mode 100644 index 88aeff27..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Domain/Handlers/Cats/GetCatsHandler.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace GenericPaginationApi.Domain.Handlers.Cats; - -/// -/// Handler for operation request. -/// Description: Find all cats. -/// Operation: GetCats. -/// -public class GetCatsHandler : IGetCatsHandler -{ - public Task ExecuteAsync( - GetCatsParameters parameters, - CancellationToken cancellationToken = default) - { - ArgumentNullException.ThrowIfNull(parameters); - - throw new NotImplementedException("Add logic here for GetCatsHandler"); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Domain/Handlers/Dogs/GetDogsHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Domain/Handlers/Dogs/GetDogsHandler.verified.cs deleted file mode 100644 index 5005b85b..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/src/GenericPaginationApi.Domain/Handlers/Dogs/GetDogsHandler.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace GenericPaginationApi.Domain.Handlers.Dogs; - -/// -/// Handler for operation request. -/// Description: Find all dogs. -/// Operation: GetDogs. -/// -public class GetDogsHandler : IGetDogsHandler -{ - public Task ExecuteAsync( - GetDogsParameters parameters, - CancellationToken cancellationToken = default) - { - ArgumentNullException.ThrowIfNull(parameters); - - throw new NotImplementedException("Add logic here for GetDogsHandler"); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/test/GenericPaginationApi.Api.Tests/Endpoints/Cats/GetCatsHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/test/GenericPaginationApi.Api.Tests/Endpoints/Cats/GetCatsHandlerStub.verified.cs deleted file mode 100644 index 926881d1..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/test/GenericPaginationApi.Api.Tests/Endpoints/Cats/GetCatsHandlerStub.verified.cs +++ /dev/null @@ -1,22 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace GenericPaginationApi.Api.Tests.Endpoints.Cats; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetCatsHandlerStub : IGetCatsHandler -{ - public Task ExecuteAsync( - GetCatsParameters parameters, - CancellationToken cancellationToken = default) - { - var data = new Fixture().Create>(); - - var paginationData = new PaginatedResult(); - - return Task.FromResult(GetCatsResult.Ok(paginationData)); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/test/GenericPaginationApi.Api.Tests/Endpoints/Cats/GetCatsTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/test/GenericPaginationApi.Api.Tests/Endpoints/Cats/GetCatsTests.verified.cs deleted file mode 100644 index 9d8d26b2..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/test/GenericPaginationApi.Api.Tests/Endpoints/Cats/GetCatsTests.verified.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace GenericPaginationApi.Api.Tests.Endpoints.Cats; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class GetCatsTests : WebApiControllerBaseTest -{ - public GetCatsTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/test/GenericPaginationApi.Api.Tests/Endpoints/Dogs/GetDogsHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/test/GenericPaginationApi.Api.Tests/Endpoints/Dogs/GetDogsHandlerStub.verified.cs deleted file mode 100644 index b5db983b..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/test/GenericPaginationApi.Api.Tests/Endpoints/Dogs/GetDogsHandlerStub.verified.cs +++ /dev/null @@ -1,22 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace GenericPaginationApi.Api.Tests.Endpoints.Dogs; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetDogsHandlerStub : IGetDogsHandler -{ - public Task ExecuteAsync( - GetDogsParameters parameters, - CancellationToken cancellationToken = default) - { - var data = new Fixture().Create>(); - - var paginationData = new PaginatedResult(); - - return Task.FromResult(GetDogsResult.Ok(paginationData)); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/test/GenericPaginationApi.Api.Tests/Endpoints/Dogs/GetDogsTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/test/GenericPaginationApi.Api.Tests/Endpoints/Dogs/GetDogsTests.verified.cs deleted file mode 100644 index 22d5a986..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/test/GenericPaginationApi.Api.Tests/Endpoints/Dogs/GetDogsTests.verified.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace GenericPaginationApi.Api.Tests.Endpoints.Dogs; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class GetDogsTests : WebApiControllerBaseTest -{ - public GetDogsTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/test/GenericPaginationApi.Api.Tests/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/test/GenericPaginationApi.Api.Tests/GlobalUsings.verified.cs deleted file mode 100644 index 7feb979e..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/test/GenericPaginationApi.Api.Tests/GlobalUsings.verified.cs +++ /dev/null @@ -1,21 +0,0 @@ -global using System.CodeDom.Compiler; -global using System.Reflection; -global using System.Text; -global using System.Text.Json; -global using System.Text.Json.Serialization; - -global using Atc.Rest.Options; -global using Atc.Rest.Results; -global using Atc.XUnit; - -global using GenericPaginationApi.Api.Generated; -global using GenericPaginationApi.Api.Generated.Contracts; -global using GenericPaginationApi.Api.Generated.Contracts.Cats; -global using GenericPaginationApi.Api.Generated.Contracts.Dogs; - -global using Microsoft.AspNetCore.Hosting; -global using Microsoft.AspNetCore.Http; -global using Microsoft.AspNetCore.Mvc.Testing; -global using Microsoft.AspNetCore.TestHost; -global using Microsoft.Extensions.Configuration; -global using Microsoft.Extensions.DependencyInjection; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/test/GenericPaginationApi.Api.Tests/WebApiControllerBaseTest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/test/GenericPaginationApi.Api.Tests/WebApiControllerBaseTest.verified.cs deleted file mode 100644 index 0a86fb72..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/test/GenericPaginationApi.Api.Tests/WebApiControllerBaseTest.verified.cs +++ /dev/null @@ -1,56 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace GenericPaginationApi.Api.Tests; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public abstract class WebApiControllerBaseTest : IClassFixture -{ - protected readonly WebApiStartupFactory Factory; - - protected readonly HttpClient HttpClient; - - protected readonly IConfiguration Configuration; - - protected static JsonSerializerOptions? JsonSerializerOptions; - - protected WebApiControllerBaseTest(WebApiStartupFactory fixture) - { - this.Factory = fixture; - this.HttpClient = this.Factory.CreateClient(); - this.Configuration = new ConfigurationBuilder().Build(); - JsonSerializerOptions = new JsonSerializerOptions - { - PropertyNameCaseInsensitive = true, - Converters = - { - new JsonStringEnumConverter() - }, - }; - } - - protected static StringContent ToJson(object data) - => new(JsonSerializer.Serialize(data, JsonSerializerOptions), Encoding.UTF8, "application/json"); - - protected static StringContent Json(string data) - => new(data, Encoding.UTF8, "application/json"); - - protected static IFormFile GetTestFile() - { - var bytes = Encoding.UTF8.GetBytes("Hello World"); - var stream = new MemoryStream(bytes); - var formFile = new FormFile(stream, 0, stream.Length, "dummy", "dummy.txt") - { - Headers = new HeaderDictionary(), - ContentType = "application/octet-stream", - }; - - return formFile; - } - - protected static List GetTestFiles() - => new() { GetTestFile(), GetTestFile() }; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/test/GenericPaginationApi.Api.Tests/WebApiStartupFactory.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/test/GenericPaginationApi.Api.Tests/WebApiStartupFactory.verified.cs deleted file mode 100644 index 2753e224..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/test/GenericPaginationApi.Api.Tests/WebApiStartupFactory.verified.cs +++ /dev/null @@ -1,40 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace GenericPaginationApi.Api.Tests; - -/// -/// Factory for bootstrapping in memory tests. -/// Includes options to override configuration and service collection using a partial class. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public partial class WebApiStartupFactory : WebApplicationFactory -{ - protected override void ConfigureWebHost(IWebHostBuilder builder) - { - builder.ConfigureAppConfiguration(config => - { - ModifyConfiguration(config); - var integrationConfig = new ConfigurationBuilder() - .AddJsonFile("appsettings.integrationtest.json") - .Build(); - config.AddConfiguration(integrationConfig); - }); - - builder.ConfigureTestServices(services => - { - ModifyServices(services); - services.AddSingleton(); - services.AutoRegistrateServices( - Assembly.GetAssembly(typeof(ApiRegistration))!, - Assembly.GetAssembly(typeof(WebApiStartupFactory))!); - }); - } - - partial void ModifyConfiguration(IConfigurationBuilder config); - - partial void ModifyServices(IServiceCollection services); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/test/GenericPaginationApi.Domain.Tests/Handlers/Cats/GetCatsHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/test/GenericPaginationApi.Domain.Tests/Handlers/Cats/GetCatsHandlerTests.verified.cs deleted file mode 100644 index 3d1affe2..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/test/GenericPaginationApi.Domain.Tests/Handlers/Cats/GetCatsHandlerTests.verified.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace GenericPaginationApi.Domain.Tests.Handlers.Cats; - -public class GetCatsHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/test/GenericPaginationApi.Domain.Tests/Handlers/Dogs/GetDogsHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/test/GenericPaginationApi.Domain.Tests/Handlers/Dogs/GetDogsHandlerTests.verified.cs deleted file mode 100644 index 9d6d3596..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/VerifyServerAll/test/GenericPaginationApi.Domain.Tests/Handlers/Dogs/GetDogsHandlerTests.verified.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace GenericPaginationApi.Domain.Tests.Handlers.Dogs; - -public class GetDogsHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/GlobalUsings.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/GlobalUsings.cs index 59f42c8f..fbb90bd1 100644 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/GlobalUsings.cs +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/GlobalUsings.cs @@ -1,7 +1,11 @@ global using System.Diagnostics.CodeAnalysis; global using System.Reflection; +global using System.Text; global using System.Text.RegularExpressions; + global using Atc.DotNet; global using Atc.Helpers; +global using Atc.Rest.ApiGenerator.Contracts; global using Atc.XUnit; + global using Microsoft.Extensions.Logging.Abstractions; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyClientCSharp/src/PetStoreApi.ApiClient.Generated/Contracts/Pets/Models/Error.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyClientCSharp/src/PetStoreApi.ApiClient.Generated/Contracts/Pets/Models/Error.verified.cs deleted file mode 100644 index 6a6ee678..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyClientCSharp/src/PetStoreApi.ApiClient.Generated/Contracts/Pets/Models/Error.verified.cs +++ /dev/null @@ -1,24 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace PetStoreApi.ApiClient.Generated.Contracts; - -/// -/// Error. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class Error -{ - [Required] - public int Code { get; set; } - - [Required] - public string Message { get; set; } - - /// - public override string ToString() - => $"{nameof(Code)}: {Code}, {nameof(Message)}: {Message}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyClientCSharp/src/PetStoreApi.ApiClient.Generated/Contracts/Pets/Models/Pet.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyClientCSharp/src/PetStoreApi.ApiClient.Generated/Contracts/Pets/Models/Pet.verified.cs deleted file mode 100644 index b5f112d0..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyClientCSharp/src/PetStoreApi.ApiClient.Generated/Contracts/Pets/Models/Pet.verified.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace PetStoreApi.ApiClient.Generated.Contracts; - -/// -/// Pet. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class Pet -{ - [Required] - public long Id { get; set; } - - [Required] - public string Name { get; set; } - - public string Tag { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}, {nameof(Name)}: {Name}, {nameof(Tag)}: {Tag}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyClientCSharp/src/PetStoreApi.ApiClient.Generated/Contracts/Pets/Models/Pets.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyClientCSharp/src/PetStoreApi.ApiClient.Generated/Contracts/Pets/Models/Pets.verified.cs deleted file mode 100644 index f7d75788..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyClientCSharp/src/PetStoreApi.ApiClient.Generated/Contracts/Pets/Models/Pets.verified.cs +++ /dev/null @@ -1,23 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace PetStoreApi.ApiClient.Generated.Contracts; - -/// -/// Pets. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class Pets -{ - /// - /// A list of Pet. - /// - public List PetList { get; set; } = new List(); - - /// - public override string ToString() - => $"{nameof(PetList)}.Count: {PetList?.Count ?? 0}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyClientCSharp/src/PetStoreApi.ApiClient.Generated/Contracts/Pets/RequestParameters/ListPetsParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyClientCSharp/src/PetStoreApi.ApiClient.Generated/Contracts/Pets/RequestParameters/ListPetsParameters.verified.cs deleted file mode 100644 index b56fb7eb..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyClientCSharp/src/PetStoreApi.ApiClient.Generated/Contracts/Pets/RequestParameters/ListPetsParameters.verified.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace PetStoreApi.ApiClient.Generated.Contracts; - -/// -/// Parameters for operation request. -/// Description: List all pets. -/// Operation: ListPets. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class ListPetsParameters -{ - /// - /// How many items to return at one time (max 100). - /// - [Range(-2147483648, 100)] - public int Limit { get; set; } - - /// - public override string ToString() - => $"{nameof(Limit)}: {Limit}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyClientCSharp/src/PetStoreApi.ApiClient.Generated/Contracts/Pets/RequestParameters/ShowPetByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyClientCSharp/src/PetStoreApi.ApiClient.Generated/Contracts/Pets/RequestParameters/ShowPetByIdParameters.verified.cs deleted file mode 100644 index 5f0c0f70..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyClientCSharp/src/PetStoreApi.ApiClient.Generated/Contracts/Pets/RequestParameters/ShowPetByIdParameters.verified.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace PetStoreApi.ApiClient.Generated.Contracts; - -/// -/// Parameters for operation request. -/// Description: Info for a specific pet. -/// Operation: ShowPetById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class ShowPetByIdParameters -{ - /// - /// The id of the pet to retrieve. - /// - [Required] - public string PetId { get; set; } - - /// - public override string ToString() - => $"{nameof(PetId)}: {PetId}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyClientCSharp/src/PetStoreApi.ApiClient.Generated/Endpoints/Pets/CreatePetsEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyClientCSharp/src/PetStoreApi.ApiClient.Generated/Endpoints/Pets/CreatePetsEndpoint.verified.cs deleted file mode 100644 index a6f245e9..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyClientCSharp/src/PetStoreApi.ApiClient.Generated/Endpoints/Pets/CreatePetsEndpoint.verified.cs +++ /dev/null @@ -1,47 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace PetStoreApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint. -/// Description: Create a pet. -/// Operation: CreatePets. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class CreatePetsEndpoint : ICreatePetsEndpoint -{ - private readonly IHttpClientFactory factory; - private readonly IHttpMessageFactory httpMessageFactory; - - public CreatePetsEndpoint( - IHttpClientFactory factory, - IHttpMessageFactory httpMessageFactory) - { - this.factory = factory; - this.httpMessageFactory = httpMessageFactory; - } - - public async Task ExecuteAsync( - string httpClientName = "PetStoreApi-ApiClient", - CancellationToken cancellationToken = default) - { - var client = factory.CreateClient(httpClientName); - - var requestBuilder = httpMessageFactory.FromTemplate("/v1/pets"); - - using var requestMessage = requestBuilder.Build(HttpMethod.Post); - using var response = await client.SendAsync(requestMessage, cancellationToken); - - var responseBuilder = httpMessageFactory.FromResponse(response); - responseBuilder.AddSuccessResponse(HttpStatusCode.Created); - responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); - responseBuilder.AddErrorResponse(HttpStatusCode.Forbidden); - responseBuilder.AddErrorResponse(HttpStatusCode.InternalServerError); - - return await responseBuilder.BuildResponseAsync(x => new CreatePetsEndpointResult(x), cancellationToken); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyClientCSharp/src/PetStoreApi.ApiClient.Generated/Endpoints/Pets/CreatePetsEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyClientCSharp/src/PetStoreApi.ApiClient.Generated/Endpoints/Pets/CreatePetsEndpointResult.verified.cs deleted file mode 100644 index 9af06e05..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyClientCSharp/src/PetStoreApi.ApiClient.Generated/Endpoints/Pets/CreatePetsEndpointResult.verified.cs +++ /dev/null @@ -1,43 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace PetStoreApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint result. -/// Description: Create a pet. -/// Operation: CreatePets. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class CreatePetsEndpointResult : EndpointResponse, ICreatePetsEndpointResult -{ - public CreatePetsEndpointResult(EndpointResponse response) - : base(response) - { - } - - public bool IsOk - => StatusCode == HttpStatusCode.OK; - - public bool IsUnauthorized - => StatusCode == HttpStatusCode.Unauthorized; - - public bool IsForbidden - => StatusCode == HttpStatusCode.Forbidden; - - public bool IsInternalServerError - => StatusCode == HttpStatusCode.InternalServerError; - - public string OkContent - => IsOk && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); - - public string InternalServerErrorContent - => IsInternalServerError && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsInternalServerError property first."); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyClientCSharp/src/PetStoreApi.ApiClient.Generated/Endpoints/Pets/Interfaces/ICreatePetsEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyClientCSharp/src/PetStoreApi.ApiClient.Generated/Endpoints/Pets/Interfaces/ICreatePetsEndpoint.verified.cs deleted file mode 100644 index ef8ce8f6..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyClientCSharp/src/PetStoreApi.ApiClient.Generated/Endpoints/Pets/Interfaces/ICreatePetsEndpoint.verified.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace PetStoreApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint. -/// Description: Create a pet. -/// Operation: CreatePets. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface ICreatePetsEndpoint -{ - /// - /// Execute method. - /// - /// The http client name. - /// The cancellation token. - Task ExecuteAsync( - string httpClientName = "PetStoreApi-ApiClient", - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyClientCSharp/src/PetStoreApi.ApiClient.Generated/Endpoints/Pets/Interfaces/ICreatePetsEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyClientCSharp/src/PetStoreApi.ApiClient.Generated/Endpoints/Pets/Interfaces/ICreatePetsEndpointResult.verified.cs deleted file mode 100644 index 6c16850b..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyClientCSharp/src/PetStoreApi.ApiClient.Generated/Endpoints/Pets/Interfaces/ICreatePetsEndpointResult.verified.cs +++ /dev/null @@ -1,28 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace PetStoreApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint Result. -/// Description: Create a pet. -/// Operation: CreatePets. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface ICreatePetsEndpointResult : IEndpointResponse -{ - bool IsOk { get; } - - bool IsUnauthorized { get; } - - bool IsForbidden { get; } - - bool IsInternalServerError { get; } - - string OkContent { get; } - - string InternalServerErrorContent { get; } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyClientCSharp/src/PetStoreApi.ApiClient.Generated/Endpoints/Pets/Interfaces/IListPetsEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyClientCSharp/src/PetStoreApi.ApiClient.Generated/Endpoints/Pets/Interfaces/IListPetsEndpoint.verified.cs deleted file mode 100644 index fc4749a9..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyClientCSharp/src/PetStoreApi.ApiClient.Generated/Endpoints/Pets/Interfaces/IListPetsEndpoint.verified.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace PetStoreApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint. -/// Description: List all pets. -/// Operation: ListPets. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IListPetsEndpoint -{ - /// - /// Execute method. - /// - /// The parameters. - /// The http client name. - /// The cancellation token. - Task ExecuteAsync( - ListPetsParameters parameters, - string httpClientName = "PetStoreApi-ApiClient", - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyClientCSharp/src/PetStoreApi.ApiClient.Generated/Endpoints/Pets/Interfaces/IListPetsEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyClientCSharp/src/PetStoreApi.ApiClient.Generated/Endpoints/Pets/Interfaces/IListPetsEndpointResult.verified.cs deleted file mode 100644 index e35fb50a..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyClientCSharp/src/PetStoreApi.ApiClient.Generated/Endpoints/Pets/Interfaces/IListPetsEndpointResult.verified.cs +++ /dev/null @@ -1,32 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace PetStoreApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint Result. -/// Description: List all pets. -/// Operation: ListPets. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IListPetsEndpointResult : IEndpointResponse -{ - bool IsOk { get; } - - bool IsBadRequest { get; } - - bool IsUnauthorized { get; } - - bool IsForbidden { get; } - - bool IsInternalServerError { get; } - - List OkContent { get; } - - ValidationProblemDetails BadRequestContent { get; } - - string InternalServerErrorContent { get; } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyClientCSharp/src/PetStoreApi.ApiClient.Generated/Endpoints/Pets/Interfaces/IShowPetByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyClientCSharp/src/PetStoreApi.ApiClient.Generated/Endpoints/Pets/Interfaces/IShowPetByIdEndpoint.verified.cs deleted file mode 100644 index b37ace9d..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyClientCSharp/src/PetStoreApi.ApiClient.Generated/Endpoints/Pets/Interfaces/IShowPetByIdEndpoint.verified.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace PetStoreApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint. -/// Description: Info for a specific pet. -/// Operation: ShowPetById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IShowPetByIdEndpoint -{ - /// - /// Execute method. - /// - /// The parameters. - /// The http client name. - /// The cancellation token. - Task ExecuteAsync( - ShowPetByIdParameters parameters, - string httpClientName = "PetStoreApi-ApiClient", - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyClientCSharp/src/PetStoreApi.ApiClient.Generated/Endpoints/Pets/Interfaces/IShowPetByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyClientCSharp/src/PetStoreApi.ApiClient.Generated/Endpoints/Pets/Interfaces/IShowPetByIdEndpointResult.verified.cs deleted file mode 100644 index 6681a791..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyClientCSharp/src/PetStoreApi.ApiClient.Generated/Endpoints/Pets/Interfaces/IShowPetByIdEndpointResult.verified.cs +++ /dev/null @@ -1,32 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace PetStoreApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint Result. -/// Description: Info for a specific pet. -/// Operation: ShowPetById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IShowPetByIdEndpointResult : IEndpointResponse -{ - bool IsOk { get; } - - bool IsBadRequest { get; } - - bool IsUnauthorized { get; } - - bool IsForbidden { get; } - - bool IsInternalServerError { get; } - - Pet OkContent { get; } - - ValidationProblemDetails BadRequestContent { get; } - - string InternalServerErrorContent { get; } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyClientCSharp/src/PetStoreApi.ApiClient.Generated/Endpoints/Pets/ListPetsEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyClientCSharp/src/PetStoreApi.ApiClient.Generated/Endpoints/Pets/ListPetsEndpoint.verified.cs deleted file mode 100644 index 7c14be40..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyClientCSharp/src/PetStoreApi.ApiClient.Generated/Endpoints/Pets/ListPetsEndpoint.verified.cs +++ /dev/null @@ -1,50 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace PetStoreApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint. -/// Description: List all pets. -/// Operation: ListPets. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class ListPetsEndpoint : IListPetsEndpoint -{ - private readonly IHttpClientFactory factory; - private readonly IHttpMessageFactory httpMessageFactory; - - public ListPetsEndpoint( - IHttpClientFactory factory, - IHttpMessageFactory httpMessageFactory) - { - this.factory = factory; - this.httpMessageFactory = httpMessageFactory; - } - - public async Task ExecuteAsync( - ListPetsParameters parameters, - string httpClientName = "PetStoreApi-ApiClient", - CancellationToken cancellationToken = default) - { - var client = factory.CreateClient(httpClientName); - - var requestBuilder = httpMessageFactory.FromTemplate("/v1/pets"); - requestBuilder.WithQueryParameter("limit", parameters.Limit); - - using var requestMessage = requestBuilder.Build(HttpMethod.Get); - using var response = await client.SendAsync(requestMessage, cancellationToken); - - var responseBuilder = httpMessageFactory.FromResponse(response); - responseBuilder.AddSuccessResponse>(HttpStatusCode.OK); - responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); - responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); - responseBuilder.AddErrorResponse(HttpStatusCode.Forbidden); - responseBuilder.AddErrorResponse(HttpStatusCode.InternalServerError); - - return await responseBuilder.BuildResponseAsync(x => new ListPetsEndpointResult(x), cancellationToken); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyClientCSharp/src/PetStoreApi.ApiClient.Generated/Endpoints/Pets/ListPetsEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyClientCSharp/src/PetStoreApi.ApiClient.Generated/Endpoints/Pets/ListPetsEndpointResult.verified.cs deleted file mode 100644 index 8fbd0e52..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyClientCSharp/src/PetStoreApi.ApiClient.Generated/Endpoints/Pets/ListPetsEndpointResult.verified.cs +++ /dev/null @@ -1,51 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace PetStoreApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint result. -/// Description: List all pets. -/// Operation: ListPets. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class ListPetsEndpointResult : EndpointResponse, IListPetsEndpointResult -{ - public ListPetsEndpointResult(EndpointResponse response) - : base(response) - { - } - - public bool IsOk - => StatusCode == HttpStatusCode.OK; - - public bool IsBadRequest - => StatusCode == HttpStatusCode.BadRequest; - - public bool IsUnauthorized - => StatusCode == HttpStatusCode.Unauthorized; - - public bool IsForbidden - => StatusCode == HttpStatusCode.Forbidden; - - public bool IsInternalServerError - => StatusCode == HttpStatusCode.InternalServerError; - - public List OkContent - => IsOk && ContentObject is List result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); - - public ValidationProblemDetails BadRequestContent - => IsBadRequest && ContentObject is ValidationProblemDetails result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); - - public string InternalServerErrorContent - => IsInternalServerError && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsInternalServerError property first."); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyClientCSharp/src/PetStoreApi.ApiClient.Generated/Endpoints/Pets/ShowPetByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyClientCSharp/src/PetStoreApi.ApiClient.Generated/Endpoints/Pets/ShowPetByIdEndpoint.verified.cs deleted file mode 100644 index eabfa542..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyClientCSharp/src/PetStoreApi.ApiClient.Generated/Endpoints/Pets/ShowPetByIdEndpoint.verified.cs +++ /dev/null @@ -1,50 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace PetStoreApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint. -/// Description: Info for a specific pet. -/// Operation: ShowPetById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class ShowPetByIdEndpoint : IShowPetByIdEndpoint -{ - private readonly IHttpClientFactory factory; - private readonly IHttpMessageFactory httpMessageFactory; - - public ShowPetByIdEndpoint( - IHttpClientFactory factory, - IHttpMessageFactory httpMessageFactory) - { - this.factory = factory; - this.httpMessageFactory = httpMessageFactory; - } - - public async Task ExecuteAsync( - ShowPetByIdParameters parameters, - string httpClientName = "PetStoreApi-ApiClient", - CancellationToken cancellationToken = default) - { - var client = factory.CreateClient(httpClientName); - - var requestBuilder = httpMessageFactory.FromTemplate("/v1/pets/{petId}"); - requestBuilder.WithPathParameter("petId", parameters.PetId); - - using var requestMessage = requestBuilder.Build(HttpMethod.Get); - using var response = await client.SendAsync(requestMessage, cancellationToken); - - var responseBuilder = httpMessageFactory.FromResponse(response); - responseBuilder.AddSuccessResponse(HttpStatusCode.OK); - responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); - responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); - responseBuilder.AddErrorResponse(HttpStatusCode.Forbidden); - responseBuilder.AddErrorResponse(HttpStatusCode.InternalServerError); - - return await responseBuilder.BuildResponseAsync(x => new ShowPetByIdEndpointResult(x), cancellationToken); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyClientCSharp/src/PetStoreApi.ApiClient.Generated/Endpoints/Pets/ShowPetByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyClientCSharp/src/PetStoreApi.ApiClient.Generated/Endpoints/Pets/ShowPetByIdEndpointResult.verified.cs deleted file mode 100644 index 9fba435b..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyClientCSharp/src/PetStoreApi.ApiClient.Generated/Endpoints/Pets/ShowPetByIdEndpointResult.verified.cs +++ /dev/null @@ -1,51 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace PetStoreApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint result. -/// Description: Info for a specific pet. -/// Operation: ShowPetById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class ShowPetByIdEndpointResult : EndpointResponse, IShowPetByIdEndpointResult -{ - public ShowPetByIdEndpointResult(EndpointResponse response) - : base(response) - { - } - - public bool IsOk - => StatusCode == HttpStatusCode.OK; - - public bool IsBadRequest - => StatusCode == HttpStatusCode.BadRequest; - - public bool IsUnauthorized - => StatusCode == HttpStatusCode.Unauthorized; - - public bool IsForbidden - => StatusCode == HttpStatusCode.Forbidden; - - public bool IsInternalServerError - => StatusCode == HttpStatusCode.InternalServerError; - - public Pet OkContent - => IsOk && ContentObject is Pet result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); - - public ValidationProblemDetails BadRequestContent - => IsBadRequest && ContentObject is ValidationProblemDetails result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); - - public string InternalServerErrorContent - => IsInternalServerError && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsInternalServerError property first."); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyClientCSharp/src/PetStoreApi.ApiClient.Generated/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyClientCSharp/src/PetStoreApi.ApiClient.Generated/GlobalUsings.verified.cs deleted file mode 100644 index 35015a03..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyClientCSharp/src/PetStoreApi.ApiClient.Generated/GlobalUsings.verified.cs +++ /dev/null @@ -1,10 +0,0 @@ -global using System.CodeDom.Compiler; -global using System.ComponentModel.DataAnnotations; -global using System.Net; - -global using Atc.Rest.Client; -global using Atc.Rest.Client.Builder; - -global using Microsoft.AspNetCore.Mvc; - -global using PetStoreApi.ApiClient.Generated.Contracts; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Api.Generated/ApiRegistration.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Api.Generated/ApiRegistration.verified.cs deleted file mode 100644 index f6a8d03d..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Api.Generated/ApiRegistration.verified.cs +++ /dev/null @@ -1,12 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace PetStoreApi.Api.Generated; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class ApiRegistration -{ -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Api.Generated/Contracts/Pets/Interfaces/ICreatePetsHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Api.Generated/Contracts/Pets/Interfaces/ICreatePetsHandler.verified.cs deleted file mode 100644 index 43a7c35f..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Api.Generated/Contracts/Pets/Interfaces/ICreatePetsHandler.verified.cs +++ /dev/null @@ -1,23 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace PetStoreApi.Api.Generated.Contracts.Pets; - -/// -/// Domain Interface for RequestHandler. -/// Description: Create a pet. -/// Operation: CreatePets. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface ICreatePetsHandler -{ - /// - /// Execute method. - /// - /// The cancellation token. - Task ExecuteAsync( - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Api.Generated/Contracts/Pets/Interfaces/IListPetsHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Api.Generated/Contracts/Pets/Interfaces/IListPetsHandler.verified.cs deleted file mode 100644 index 24e5d2cc..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Api.Generated/Contracts/Pets/Interfaces/IListPetsHandler.verified.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace PetStoreApi.Api.Generated.Contracts.Pets; - -/// -/// Domain Interface for RequestHandler. -/// Description: List all pets. -/// Operation: ListPets. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IListPetsHandler -{ - /// - /// Execute method. - /// - /// The parameters. - /// The cancellation token. - Task ExecuteAsync( - ListPetsParameters parameters, - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Api.Generated/Contracts/Pets/Interfaces/IShowPetByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Api.Generated/Contracts/Pets/Interfaces/IShowPetByIdHandler.verified.cs deleted file mode 100644 index cb762ed3..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Api.Generated/Contracts/Pets/Interfaces/IShowPetByIdHandler.verified.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace PetStoreApi.Api.Generated.Contracts.Pets; - -/// -/// Domain Interface for RequestHandler. -/// Description: Info for a specific pet. -/// Operation: ShowPetById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IShowPetByIdHandler -{ - /// - /// Execute method. - /// - /// The parameters. - /// The cancellation token. - Task ExecuteAsync( - ShowPetByIdParameters parameters, - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Api.Generated/Contracts/Pets/Models/Error.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Api.Generated/Contracts/Pets/Models/Error.verified.cs deleted file mode 100644 index 6b6af513..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Api.Generated/Contracts/Pets/Models/Error.verified.cs +++ /dev/null @@ -1,24 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace PetStoreApi.Api.Generated.Contracts.Pets; - -/// -/// Error. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class Error -{ - [Required] - public int Code { get; set; } - - [Required] - public string Message { get; set; } - - /// - public override string ToString() - => $"{nameof(Code)}: {Code}, {nameof(Message)}: {Message}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Api.Generated/Contracts/Pets/Models/Pet.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Api.Generated/Contracts/Pets/Models/Pet.verified.cs deleted file mode 100644 index c2e35314..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Api.Generated/Contracts/Pets/Models/Pet.verified.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace PetStoreApi.Api.Generated.Contracts.Pets; - -/// -/// Pet. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class Pet -{ - [Required] - public long Id { get; set; } - - [Required] - public string Name { get; set; } - - public string Tag { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}, {nameof(Name)}: {Name}, {nameof(Tag)}: {Tag}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Api.Generated/Contracts/Pets/Models/Pets.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Api.Generated/Contracts/Pets/Models/Pets.verified.cs deleted file mode 100644 index 6de15e91..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Api.Generated/Contracts/Pets/Models/Pets.verified.cs +++ /dev/null @@ -1,23 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace PetStoreApi.Api.Generated.Contracts.Pets; - -/// -/// Pets. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class Pets -{ - /// - /// A list of Pet. - /// - public List PetList { get; set; } = new List(); - - /// - public override string ToString() - => $"{nameof(PetList)}.Count: {PetList?.Count ?? 0}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Api.Generated/Contracts/Pets/Parameters/ListPetsParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Api.Generated/Contracts/Pets/Parameters/ListPetsParameters.verified.cs deleted file mode 100644 index 7f45c10d..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Api.Generated/Contracts/Pets/Parameters/ListPetsParameters.verified.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace PetStoreApi.Api.Generated.Contracts.Pets; - -/// -/// Parameters for operation request. -/// Description: List all pets. -/// Operation: ListPets. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class ListPetsParameters -{ - /// - /// How many items to return at one time (max 100). - /// - [FromQuery(Name = "limit")] - [Range(-2147483648, 100)] - public int? Limit { get; set; } - - /// - public override string ToString() - => $"{nameof(Limit)}: {Limit}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Api.Generated/Contracts/Pets/Parameters/ShowPetByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Api.Generated/Contracts/Pets/Parameters/ShowPetByIdParameters.verified.cs deleted file mode 100644 index 725720e4..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Api.Generated/Contracts/Pets/Parameters/ShowPetByIdParameters.verified.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace PetStoreApi.Api.Generated.Contracts.Pets; - -/// -/// Parameters for operation request. -/// Description: Info for a specific pet. -/// Operation: ShowPetById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class ShowPetByIdParameters -{ - /// - /// The id of the pet to retrieve. - /// - [FromRoute(Name = "petId")] - [Required] - public string PetId { get; set; } - - /// - public override string ToString() - => $"{nameof(PetId)}: {PetId}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Api.Generated/Contracts/Pets/Results/CreatePetsResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Api.Generated/Contracts/Pets/Results/CreatePetsResult.verified.cs deleted file mode 100644 index 402af14e..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Api.Generated/Contracts/Pets/Results/CreatePetsResult.verified.cs +++ /dev/null @@ -1,24 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace PetStoreApi.Api.Generated.Contracts.Pets; - -/// -/// Results for operation request. -/// Description: Create a pet. -/// Operation: CreatePets. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class CreatePetsResult : ResultBase -{ - private CreatePetsResult(ActionResult result) : base(result) { } - - /// - /// 201 - Created response. - /// - public static CreatePetsResult Created() - => new CreatePetsResult(new StatusCodeResult(StatusCodes.Status201Created)); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Api.Generated/Contracts/Pets/Results/ListPetsResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Api.Generated/Contracts/Pets/Results/ListPetsResult.verified.cs deleted file mode 100644 index c934bf6b..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Api.Generated/Contracts/Pets/Results/ListPetsResult.verified.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace PetStoreApi.Api.Generated.Contracts.Pets; - -/// -/// Results for operation request. -/// Description: List all pets. -/// Operation: ListPets. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class ListPetsResult : ResultBase -{ - private ListPetsResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static ListPetsResult Ok(IEnumerable response) - => new ListPetsResult(new OkObjectResult(response ?? Enumerable.Empty())); - - /// - /// Performs an implicit conversion from ListPetsResult to ActionResult. - /// - public static implicit operator ListPetsResult(List response) - => Ok(response); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Api.Generated/Contracts/Pets/Results/ShowPetByIdResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Api.Generated/Contracts/Pets/Results/ShowPetByIdResult.verified.cs deleted file mode 100644 index e9fffce7..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Api.Generated/Contracts/Pets/Results/ShowPetByIdResult.verified.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace PetStoreApi.Api.Generated.Contracts.Pets; - -/// -/// Results for operation request. -/// Description: Info for a specific pet. -/// Operation: ShowPetById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class ShowPetByIdResult : ResultBase -{ - private ShowPetByIdResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static ShowPetByIdResult Ok(Pet response) - => new ShowPetByIdResult(new OkObjectResult(response)); - - /// - /// Performs an implicit conversion from ShowPetByIdResult to ActionResult. - /// - public static implicit operator ShowPetByIdResult(Pet response) - => Ok(response); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Api.Generated/Endpoints/PetsController.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Api.Generated/Endpoints/PetsController.verified.cs deleted file mode 100644 index c2e92dcd..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Api.Generated/Endpoints/PetsController.verified.cs +++ /dev/null @@ -1,60 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace PetStoreApi.Api.Generated.Endpoints; - -/// -/// Endpoint definitions. -/// -[Authorize] -[ApiController] -[Route("/v1/pets")] -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class PetsController : ControllerBase -{ - /// - /// Description: List all pets. - /// Operation: ListPets. - /// - [HttpGet] - [ProducesResponseType(typeof(List), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(StatusCodes.Status401Unauthorized)] - [ProducesResponseType(StatusCodes.Status403Forbidden)] - public async Task ListPets( - ListPetsParameters parameters, - [FromServices] IListPetsHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(parameters, cancellationToken); - - /// - /// Description: Create a pet. - /// Operation: CreatePets. - /// - [HttpPost] - [ProducesResponseType(typeof(string), StatusCodes.Status201Created)] - [ProducesResponseType(StatusCodes.Status401Unauthorized)] - [ProducesResponseType(StatusCodes.Status403Forbidden)] - public async Task CreatePets( - [FromServices] ICreatePetsHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(cancellationToken); - - /// - /// Description: Info for a specific pet. - /// Operation: ShowPetById. - /// - [HttpGet("{petId}")] - [ProducesResponseType(typeof(Pet), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(StatusCodes.Status401Unauthorized)] - [ProducesResponseType(StatusCodes.Status403Forbidden)] - public async Task ShowPetById( - ShowPetByIdParameters parameters, - [FromServices] IShowPetByIdHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(parameters, cancellationToken); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Api.Generated/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Api.Generated/GlobalUsings.verified.cs deleted file mode 100644 index de5ab535..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Api.Generated/GlobalUsings.verified.cs +++ /dev/null @@ -1,12 +0,0 @@ -global using System.CodeDom.Compiler; -global using System.ComponentModel.DataAnnotations; -global using System.Net; - -global using Atc.Rest.Results; - -global using Microsoft.AspNetCore.Authorization; -global using Microsoft.AspNetCore.Http; -global using Microsoft.AspNetCore.Mvc; - -global using PetStoreApi.Api.Generated.Contracts; -global using PetStoreApi.Api.Generated.Contracts.Pets; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Api/ConfigureSwaggerDocOptions.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Api/ConfigureSwaggerDocOptions.verified.cs deleted file mode 100644 index e8560d39..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Api/ConfigureSwaggerDocOptions.verified.cs +++ /dev/null @@ -1,38 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace PetStoreApi.Api; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class ConfigureSwaggerDocOptions : IConfigureOptions -{ - private readonly IApiVersionDescriptionProvider provider; - - public ConfigureSwaggerDocOptions( - IApiVersionDescriptionProvider provider) - => this.provider = provider; - - public void Configure( - SwaggerGenOptions options) - { - foreach (var version in provider.ApiVersionDescriptions) - { - options.SwaggerDoc( - version.GroupName, - new OpenApiInfo - { - Version = "1.0.0", - Title = "Swagger Petstore", - License = new OpenApiLicense - { - Name = "MIT", - }, - }); - } - - options.IncludeXmlComments(Path.ChangeExtension(GetType().Assembly.Location, "xml")); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Api/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Api/GlobalUsings.verified.cs deleted file mode 100644 index ddacff22..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Api/GlobalUsings.verified.cs +++ /dev/null @@ -1,13 +0,0 @@ -global using System.CodeDom.Compiler; -global using System.Reflection; - -global using Atc.Rest.Extended.Options; - -global using Microsoft.AspNetCore.Mvc.ApiExplorer; -global using Microsoft.Extensions.Options; -global using Microsoft.OpenApi.Models; - -global using PetStoreApi.Api.Generated; -global using PetStoreApi.Domain; - -global using Swashbuckle.AspNetCore.SwaggerGen; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Api/Program.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Api/Program.verified.cs deleted file mode 100644 index 730a9c81..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Api/Program.verified.cs +++ /dev/null @@ -1,23 +0,0 @@ -namespace PetStoreApi.Api; - -public static class Program -{ - public static void Main(string[] args) - { - CreateHostBuilder(args) - .Build() - .Run(); - } - - public static IHostBuilder CreateHostBuilder(string[] args) - { - var builder = Host - .CreateDefaultBuilder(args) - .ConfigureWebHostDefaults(webBuilder => - { - webBuilder.UseStartup(); - }); - - return builder; - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Api/Startup.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Api/Startup.verified.cs deleted file mode 100644 index 3a6be8f8..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Api/Startup.verified.cs +++ /dev/null @@ -1,38 +0,0 @@ -namespace PetStoreApi.Api; - -public class Startup -{ - private readonly RestApiExtendedOptions restApiOptions; - - public Startup( - IConfiguration configuration) - { - Configuration = configuration; - restApiOptions = new RestApiExtendedOptions - { - // TODO: Remove/out-comment/set to false this for production scenarios! - AllowAnonymousAccessForDevelopment = true, - }; - - restApiOptions.AddAssemblyPairs( - Assembly.GetAssembly(typeof(ApiRegistration)), - Assembly.GetAssembly(typeof(DomainRegistration))); - } - - public IConfiguration Configuration { get; } - - public void ConfigureServices( - IServiceCollection services) - { - services.ConfigureOptions(); - - services.AddRestApi(restApiOptions, Configuration); - } - - public void Configure( - IApplicationBuilder app, - IWebHostEnvironment env) - { - app.ConfigureRestApi(env, restApiOptions); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Domain/DomainRegistration.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Domain/DomainRegistration.verified.cs deleted file mode 100644 index 551c5a64..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Domain/DomainRegistration.verified.cs +++ /dev/null @@ -1,12 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace PetStoreApi.Domain; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class DomainRegistration -{ -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Domain/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Domain/GlobalUsings.verified.cs deleted file mode 100644 index 1e2f1e99..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Domain/GlobalUsings.verified.cs +++ /dev/null @@ -1,3 +0,0 @@ -global using System.CodeDom.Compiler; - -global using PetStoreApi.Api.Generated.Contracts.Pets; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Domain/Handlers/Pets/CreatePetsHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Domain/Handlers/Pets/CreatePetsHandler.verified.cs deleted file mode 100644 index f2c6114e..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Domain/Handlers/Pets/CreatePetsHandler.verified.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace PetStoreApi.Domain.Handlers.Pets; - -/// -/// Handler for operation request. -/// Description: Create a pet. -/// Operation: CreatePets. -/// -public class CreatePetsHandler : ICreatePetsHandler -{ - public Task ExecuteAsync( - CancellationToken cancellationToken = default) - { - throw new NotImplementedException("Add logic here for CreatePetsHandler"); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Domain/Handlers/Pets/ListPetsHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Domain/Handlers/Pets/ListPetsHandler.verified.cs deleted file mode 100644 index 1faa6174..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Domain/Handlers/Pets/ListPetsHandler.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace PetStoreApi.Domain.Handlers.Pets; - -/// -/// Handler for operation request. -/// Description: List all pets. -/// Operation: ListPets. -/// -public class ListPetsHandler : IListPetsHandler -{ - public Task ExecuteAsync( - ListPetsParameters parameters, - CancellationToken cancellationToken = default) - { - ArgumentNullException.ThrowIfNull(parameters); - - throw new NotImplementedException("Add logic here for ListPetsHandler"); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Domain/Handlers/Pets/ShowPetByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Domain/Handlers/Pets/ShowPetByIdHandler.verified.cs deleted file mode 100644 index 83ac4a75..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/src/PetStoreApi.Domain/Handlers/Pets/ShowPetByIdHandler.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace PetStoreApi.Domain.Handlers.Pets; - -/// -/// Handler for operation request. -/// Description: Info for a specific pet. -/// Operation: ShowPetById. -/// -public class ShowPetByIdHandler : IShowPetByIdHandler -{ - public Task ExecuteAsync( - ShowPetByIdParameters parameters, - CancellationToken cancellationToken = default) - { - ArgumentNullException.ThrowIfNull(parameters); - - throw new NotImplementedException("Add logic here for ShowPetByIdHandler"); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/test/PetStoreApi.Api.Tests/Endpoints/Pets/CreatePetsHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/test/PetStoreApi.Api.Tests/Endpoints/Pets/CreatePetsHandlerStub.verified.cs deleted file mode 100644 index 855df230..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/test/PetStoreApi.Api.Tests/Endpoints/Pets/CreatePetsHandlerStub.verified.cs +++ /dev/null @@ -1,17 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace PetStoreApi.Api.Tests.Endpoints.Pets; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class CreatePetsHandlerStub : ICreatePetsHandler -{ - public Task ExecuteAsync( - CancellationToken cancellationToken = default) - { - return Task.FromResult(CreatePetsResult.Created()); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/test/PetStoreApi.Api.Tests/Endpoints/Pets/CreatePetsTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/test/PetStoreApi.Api.Tests/Endpoints/Pets/CreatePetsTests.verified.cs deleted file mode 100644 index 34769230..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/test/PetStoreApi.Api.Tests/Endpoints/Pets/CreatePetsTests.verified.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace PetStoreApi.Api.Tests.Endpoints.Pets; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class CreatePetsTests : WebApiControllerBaseTest -{ - public CreatePetsTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/test/PetStoreApi.Api.Tests/Endpoints/Pets/ListPetsHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/test/PetStoreApi.Api.Tests/Endpoints/Pets/ListPetsHandlerStub.verified.cs deleted file mode 100644 index 94edc6dc..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/test/PetStoreApi.Api.Tests/Endpoints/Pets/ListPetsHandlerStub.verified.cs +++ /dev/null @@ -1,20 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace PetStoreApi.Api.Tests.Endpoints.Pets; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class ListPetsHandlerStub : IListPetsHandler -{ - public Task ExecuteAsync( - ListPetsParameters parameters, - CancellationToken cancellationToken = default) - { - var data = new Fixture().Create>(); - - return Task.FromResult(ListPetsResult.Ok(data)); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/test/PetStoreApi.Api.Tests/Endpoints/Pets/ListPetsTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/test/PetStoreApi.Api.Tests/Endpoints/Pets/ListPetsTests.verified.cs deleted file mode 100644 index 68bb6eee..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/test/PetStoreApi.Api.Tests/Endpoints/Pets/ListPetsTests.verified.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace PetStoreApi.Api.Tests.Endpoints.Pets; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class ListPetsTests : WebApiControllerBaseTest -{ - public ListPetsTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/test/PetStoreApi.Api.Tests/Endpoints/Pets/ShowPetByIdHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/test/PetStoreApi.Api.Tests/Endpoints/Pets/ShowPetByIdHandlerStub.verified.cs deleted file mode 100644 index 14488ace..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/test/PetStoreApi.Api.Tests/Endpoints/Pets/ShowPetByIdHandlerStub.verified.cs +++ /dev/null @@ -1,20 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace PetStoreApi.Api.Tests.Endpoints.Pets; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class ShowPetByIdHandlerStub : IShowPetByIdHandler -{ - public Task ExecuteAsync( - ShowPetByIdParameters parameters, - CancellationToken cancellationToken = default) - { - var data = new Fixture().Create(); - - return Task.FromResult(ShowPetByIdResult.Ok(data)); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/test/PetStoreApi.Api.Tests/Endpoints/Pets/ShowPetByIdTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/test/PetStoreApi.Api.Tests/Endpoints/Pets/ShowPetByIdTests.verified.cs deleted file mode 100644 index 463ab4a9..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/test/PetStoreApi.Api.Tests/Endpoints/Pets/ShowPetByIdTests.verified.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace PetStoreApi.Api.Tests.Endpoints.Pets; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class ShowPetByIdTests : WebApiControllerBaseTest -{ - public ShowPetByIdTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/test/PetStoreApi.Api.Tests/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/test/PetStoreApi.Api.Tests/GlobalUsings.verified.cs deleted file mode 100644 index 7129be37..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/test/PetStoreApi.Api.Tests/GlobalUsings.verified.cs +++ /dev/null @@ -1,20 +0,0 @@ -global using System.CodeDom.Compiler; -global using System.Reflection; -global using System.Text; -global using System.Text.Json; -global using System.Text.Json.Serialization; - -global using Atc.Rest.Options; -global using Atc.Rest.Results; -global using Atc.XUnit; - -global using Microsoft.AspNetCore.Hosting; -global using Microsoft.AspNetCore.Http; -global using Microsoft.AspNetCore.Mvc.Testing; -global using Microsoft.AspNetCore.TestHost; -global using Microsoft.Extensions.Configuration; -global using Microsoft.Extensions.DependencyInjection; - -global using PetStoreApi.Api.Generated; -global using PetStoreApi.Api.Generated.Contracts; -global using PetStoreApi.Api.Generated.Contracts.Pets; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/test/PetStoreApi.Api.Tests/WebApiControllerBaseTest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/test/PetStoreApi.Api.Tests/WebApiControllerBaseTest.verified.cs deleted file mode 100644 index 2e16d4dc..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/test/PetStoreApi.Api.Tests/WebApiControllerBaseTest.verified.cs +++ /dev/null @@ -1,56 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace PetStoreApi.Api.Tests; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public abstract class WebApiControllerBaseTest : IClassFixture -{ - protected readonly WebApiStartupFactory Factory; - - protected readonly HttpClient HttpClient; - - protected readonly IConfiguration Configuration; - - protected static JsonSerializerOptions? JsonSerializerOptions; - - protected WebApiControllerBaseTest(WebApiStartupFactory fixture) - { - this.Factory = fixture; - this.HttpClient = this.Factory.CreateClient(); - this.Configuration = new ConfigurationBuilder().Build(); - JsonSerializerOptions = new JsonSerializerOptions - { - PropertyNameCaseInsensitive = true, - Converters = - { - new JsonStringEnumConverter() - }, - }; - } - - protected static StringContent ToJson(object data) - => new(JsonSerializer.Serialize(data, JsonSerializerOptions), Encoding.UTF8, "application/json"); - - protected static StringContent Json(string data) - => new(data, Encoding.UTF8, "application/json"); - - protected static IFormFile GetTestFile() - { - var bytes = Encoding.UTF8.GetBytes("Hello World"); - var stream = new MemoryStream(bytes); - var formFile = new FormFile(stream, 0, stream.Length, "dummy", "dummy.txt") - { - Headers = new HeaderDictionary(), - ContentType = "application/octet-stream", - }; - - return formFile; - } - - protected static List GetTestFiles() - => new() { GetTestFile(), GetTestFile() }; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/test/PetStoreApi.Api.Tests/WebApiStartupFactory.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/test/PetStoreApi.Api.Tests/WebApiStartupFactory.verified.cs deleted file mode 100644 index 69bf3c0c..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/test/PetStoreApi.Api.Tests/WebApiStartupFactory.verified.cs +++ /dev/null @@ -1,40 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace PetStoreApi.Api.Tests; - -/// -/// Factory for bootstrapping in memory tests. -/// Includes options to override configuration and service collection using a partial class. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public partial class WebApiStartupFactory : WebApplicationFactory -{ - protected override void ConfigureWebHost(IWebHostBuilder builder) - { - builder.ConfigureAppConfiguration(config => - { - ModifyConfiguration(config); - var integrationConfig = new ConfigurationBuilder() - .AddJsonFile("appsettings.integrationtest.json") - .Build(); - config.AddConfiguration(integrationConfig); - }); - - builder.ConfigureTestServices(services => - { - ModifyServices(services); - services.AddSingleton(); - services.AutoRegistrateServices( - Assembly.GetAssembly(typeof(ApiRegistration))!, - Assembly.GetAssembly(typeof(WebApiStartupFactory))!); - }); - } - - partial void ModifyConfiguration(IConfigurationBuilder config); - - partial void ModifyServices(IServiceCollection services); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/test/PetStoreApi.Domain.Tests/Handlers/Pets/CreatePetsHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/test/PetStoreApi.Domain.Tests/Handlers/Pets/CreatePetsHandlerTests.verified.cs deleted file mode 100644 index a9a57b92..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/test/PetStoreApi.Domain.Tests/Handlers/Pets/CreatePetsHandlerTests.verified.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace PetStoreApi.Domain.Tests.Handlers.Pets; - -public class CreatePetsHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/test/PetStoreApi.Domain.Tests/Handlers/Pets/ListPetsHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/test/PetStoreApi.Domain.Tests/Handlers/Pets/ListPetsHandlerTests.verified.cs deleted file mode 100644 index 9b982fdb..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/test/PetStoreApi.Domain.Tests/Handlers/Pets/ListPetsHandlerTests.verified.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace PetStoreApi.Domain.Tests.Handlers.Pets; - -public class ListPetsHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/test/PetStoreApi.Domain.Tests/Handlers/Pets/ShowPetByIdHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/test/PetStoreApi.Domain.Tests/Handlers/Pets/ShowPetByIdHandlerTests.verified.cs deleted file mode 100644 index 57eb14f4..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/VerifyServerAll/test/PetStoreApi.Domain.Tests/Handlers/Pets/ShowPetByIdHandlerTests.verified.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace PetStoreApi.Domain.Tests.Handlers.Pets; - -public class ShowPetByIdHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/ScenarioIntegrationTestBase.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/ScenarioIntegrationTestBase.cs index e4e41a26..f43c6019 100644 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/ScenarioIntegrationTestBase.cs +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/ScenarioIntegrationTestBase.cs @@ -14,15 +14,13 @@ public static IEnumerable CollectScenarioPaths() testAssemblyName, StringSplitOptions.RemoveEmptyEntries)[0]); - var directories = Directory.GetDirectories(Path.Combine( - testBasePath.FullName, - "Atc.Rest.ApiGenerator.CLI.Tests")); - - return ( - from directory - in directories - where Directory.GetFiles(directory, "*.yaml").Length == 1 - select new DirectoryInfo(directory)) + var scenariosPath = Path.Combine( + testBasePath.FullName, + "Atc.Rest.ApiGenerator.CLI.Tests", + "Scenarios"); + + return FileHelper.GetFiles(scenariosPath, "*.yaml") + .Select(x => x.Directory!) .ToList(); } @@ -58,12 +56,29 @@ public static FileInfo GetYamlSpecificationPath( public static DirectoryInfo GetOutputPath( DirectoryInfo workingPath, - DirectoryInfo scenario) + DirectoryInfo scenario, + AspNetOutputType? aspNetOutputType, + bool useProblemDetailsAsDefaultResponseBody) { ArgumentNullException.ThrowIfNull(workingPath); ArgumentNullException.ThrowIfNull(scenario); - return new DirectoryInfo(Path.Combine(workingPath.FullName, scenario.Name)); + var suffix = useProblemDetailsAsDefaultResponseBody + ? "WithProblemDetails" + : "WithoutProblemDetails"; + + if (aspNetOutputType is null) + { + return new DirectoryInfo( + Path.Combine( + workingPath.FullName, + $"{scenario.Name}_Client_{suffix}")); + } + + return new DirectoryInfo( + Path.Combine( + workingPath.FullName, + $"{scenario.Name}_{aspNetOutputType}_{suffix}")); } public static VerifySettings GetVerifySettings( @@ -80,55 +95,31 @@ public static VerifySettings GetVerifySettings( return settings; } - public static FileInfo[] GetVerifyServerAllCsFilesForScenario( - FileSystemInfo scenarioDirectoryInfo) - => GetVerifyCsFilesForScenario(scenarioDirectoryInfo, "VerifyServerAll"); - - public static FileInfo[] GetVerifyClientCSharpCsFilesForScenario( - FileSystemInfo scenarioDirectoryInfo) - => GetVerifyCsFilesForScenario(scenarioDirectoryInfo, "VerifyClientCSharp"); - - public static FileInfo GetServerAllGeneratedFileForScenario( - FileSystemInfo scenarioDirectoryInfo, - FileInfo verifyFile, - DirectoryInfo outputPath) - => GetGeneratedFileForScenario(scenarioDirectoryInfo, verifyFile, outputPath, "VerifyServerAll"); - - public static FileInfo GetClientCSharpGeneratedFileForScenario( - FileSystemInfo scenarioDirectoryInfo, - FileInfo verifyFile, - DirectoryInfo outputPath) - => GetGeneratedFileForScenario(scenarioDirectoryInfo, verifyFile, outputPath, "VerifyClientCSharp"); - - private static FileInfo[] GetVerifyCsFilesForScenario( - FileSystemInfo scenarioDirectoryInfo, - string area) + public static FileInfo[] GetVerifyCsFilesForScenario( + DirectoryInfo verifyPath) { - ArgumentNullException.ThrowIfNull(scenarioDirectoryInfo); + ArgumentNullException.ThrowIfNull(verifyPath); - var verifyPath = Path.Combine(scenarioDirectoryInfo.FullName, area); var verifyCsFiles = Directory - .GetFiles(verifyPath, "*.verified.cs", SearchOption.AllDirectories) + .GetFiles(verifyPath.FullName, "*.verified.cs", SearchOption.AllDirectories) .Select(x => new FileInfo(x)) .ToArray(); return verifyCsFiles; } - private static FileInfo GetGeneratedFileForScenario( - FileSystemInfo scenarioDirectoryInfo, + public static FileInfo GetGeneratedFileForScenario( + DirectoryInfo verifyPath, FileInfo verifyFile, - DirectoryInfo outputPath, - string area) + DirectoryInfo outputPath) { - ArgumentNullException.ThrowIfNull(scenarioDirectoryInfo); + ArgumentNullException.ThrowIfNull(verifyPath); ArgumentNullException.ThrowIfNull(verifyFile); ArgumentNullException.ThrowIfNull(outputPath); - var verifyPath = Path.Combine(scenarioDirectoryInfo.FullName, area); var generatedFile = verifyFile .FullName .Replace(".verified", string.Empty, StringComparison.Ordinal) - .Replace(verifyPath, outputPath.FullName, StringComparison.Ordinal); + .Replace(verifyPath.FullName, outputPath.FullName, StringComparison.Ordinal); return new FileInfo(generatedFile); } } \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/DemoSampleApi.yaml b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/DemoSampleApi.yaml similarity index 100% rename from test/Atc.Rest.ApiGenerator.CLI.Tests/DemoSampleApi/DemoSampleApi.yaml rename to test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/DemoSampleApi.yaml diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Accounts/RequestParameters/SetAccountNameParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Accounts/RequestParameters/SetAccountNameParameters.verified.cs new file mode 100644 index 00000000..31ea3df5 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Accounts/RequestParameters/SetAccountNameParameters.verified.cs @@ -0,0 +1,32 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Accounts; + +/// +/// Parameters for operation request. +/// Description: Set name of account. +/// Operation: SetAccountName. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class SetAccountNameParameters +{ + /// + /// The accountId. + /// + [Required] + public Guid AccountId { get; set; } + + /// + /// UpdateAccountRequest. + /// + [Required] + public UpdateAccountRequest Request { get; set; } + + /// + public override string ToString() + => $"{nameof(AccountId)}: {AccountId}, {nameof(Request)}: ({Request})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Accounts/RequestParameters/UpdateAccountNameParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Accounts/RequestParameters/UpdateAccountNameParameters.verified.cs new file mode 100644 index 00000000..6c39c530 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Accounts/RequestParameters/UpdateAccountNameParameters.verified.cs @@ -0,0 +1,31 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Accounts; + +/// +/// Parameters for operation request. +/// Description: Update name of account. +/// Operation: UpdateAccountName. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateAccountNameParameters +{ + /// + /// The accountId. + /// + [Required] + public Guid AccountId { get; set; } + + /// + /// The account name. + /// + public string Name { get; set; } + + /// + public override string ToString() + => $"{nameof(AccountId)}: {AccountId}, {nameof(Name)}: {Name}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Accounts/UpdateAccountRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Accounts/UpdateAccountRequest.verified.cs new file mode 100644 index 00000000..163eeb73 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Accounts/UpdateAccountRequest.verified.cs @@ -0,0 +1,20 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Accounts; + +/// +/// UpdateAccountRequest. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateAccountRequest +{ + public string Name { get; set; } + + /// + public override string ToString() + => $"{nameof(Name)}: {Name}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Addresses/RequestParameters/GetAddressesByPostalCodesParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Addresses/RequestParameters/GetAddressesByPostalCodesParameters.verified.cs new file mode 100644 index 00000000..5aa0af72 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Addresses/RequestParameters/GetAddressesByPostalCodesParameters.verified.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Addresses; + +/// +/// Parameters for operation request. +/// Description: Get addresses by postal code. +/// Operation: GetAddressesByPostalCodes. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetAddressesByPostalCodesParameters +{ + /// + /// The postalCode to limit addresses on. + /// + [Required] + public string PostalCode { get; set; } + + /// + public override string ToString() + => $"{nameof(PostalCode)}: {PostalCode}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/EventArgs/EventArgs.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/EventArgs/EventArgs.verified.cs new file mode 100644 index 00000000..1454afa6 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/EventArgs/EventArgs.verified.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.EventArgs; + +/// +/// EventArgs. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class EventArgs +{ + public Guid Id { get; set; } + + public string EventName { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(EventName)}: {EventName}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/EventArgs/RequestParameters/GetEventArgByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/EventArgs/RequestParameters/GetEventArgByIdParameters.verified.cs new file mode 100644 index 00000000..b03cf8e9 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/EventArgs/RequestParameters/GetEventArgByIdParameters.verified.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.EventArgs; + +/// +/// Parameters for operation request. +/// Description: Get EventArgs By Id. +/// Operation: GetEventArgById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetEventArgByIdParameters +{ + /// + /// The id of the eventArgs. + /// + [Required] + public string Id { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Files/FileAsFormDataRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Files/FileAsFormDataRequest.verified.cs new file mode 100644 index 00000000..f20ba628 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Files/FileAsFormDataRequest.verified.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Files; + +/// +/// FileAsFormDataRequest. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class FileAsFormDataRequest +{ + [Required] + public string ItemName { get; set; } + + public IFormFile? File { get; set; } + + [Required] + public List Items { get; set; } + + /// + public override string ToString() + => $"{nameof(ItemName)}: {ItemName}, {nameof(File)}: {File}, {nameof(Items)}.Count: {Items?.Count ?? 0}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Files/FilesAsFormDataRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Files/FilesAsFormDataRequest.verified.cs new file mode 100644 index 00000000..b90e32ab --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Files/FilesAsFormDataRequest.verified.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Files; + +/// +/// FilesAsFormDataRequest. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class FilesAsFormDataRequest +{ + /// + /// A list of File(s). + /// + public List Files { get; set; } = new List(); + + /// + public override string ToString() + => $"{nameof(Files)}.Count: {Files?.Count ?? 0}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Files/RequestParameters/GetFileByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Files/RequestParameters/GetFileByIdParameters.verified.cs new file mode 100644 index 00000000..f97b2e7c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Files/RequestParameters/GetFileByIdParameters.verified.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Files; + +/// +/// Parameters for operation request. +/// Description: Get File By Id. +/// Operation: GetFileById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetFileByIdParameters +{ + /// + /// The file id. + /// + [Required] + public string Id { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Files/RequestParameters/UploadMultiFilesAsFormDataParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Files/RequestParameters/UploadMultiFilesAsFormDataParameters.verified.cs new file mode 100644 index 00000000..50defdf9 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Files/RequestParameters/UploadMultiFilesAsFormDataParameters.verified.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Files; + +/// +/// Parameters for operation request. +/// Description: Upload multi files as form data. +/// Operation: UploadMultiFilesAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UploadMultiFilesAsFormDataParameters +{ + [Required] + public List Request { get; set; } = new List(); + + /// + public override string ToString() + => $"{nameof(Request)}.Count: {Request?.Count ?? 0}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Files/RequestParameters/UploadSingleFileAsFormDataParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Files/RequestParameters/UploadSingleFileAsFormDataParameters.verified.cs new file mode 100644 index 00000000..ee44b8a5 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Files/RequestParameters/UploadSingleFileAsFormDataParameters.verified.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Files; + +/// +/// Parameters for operation request. +/// Description: Upload a file as OctetStream. +/// Operation: UploadSingleFileAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UploadSingleFileAsFormDataParameters +{ + [Required] + public IFormFile Request { get; set; } + + /// + public override string ToString() + => $"{nameof(Request)}: ({Request})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Files/RequestParameters/UploadSingleObjectWithFileAsFormDataParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Files/RequestParameters/UploadSingleObjectWithFileAsFormDataParameters.verified.cs new file mode 100644 index 00000000..5be9867b --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Files/RequestParameters/UploadSingleObjectWithFileAsFormDataParameters.verified.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Files; + +/// +/// Parameters for operation request. +/// Description: Upload a file as FormData. +/// Operation: UploadSingleObjectWithFileAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UploadSingleObjectWithFileAsFormDataParameters +{ + /// + /// FileAsFormDataRequest. + /// + [Required] + public FileAsFormDataRequest Request { get; set; } + + /// + public override string ToString() + => $"{nameof(Request)}: ({Request})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Files/RequestParameters/UploadSingleObjectWithFilesAsFormDataParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Files/RequestParameters/UploadSingleObjectWithFilesAsFormDataParameters.verified.cs new file mode 100644 index 00000000..629a8608 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Files/RequestParameters/UploadSingleObjectWithFilesAsFormDataParameters.verified.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Files; + +/// +/// Parameters for operation request. +/// Description: Upload files as FormData. +/// Operation: UploadSingleObjectWithFilesAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UploadSingleObjectWithFilesAsFormDataParameters +{ + /// + /// FilesAsFormDataRequest. + /// + [Required] + public FilesAsFormDataRequest Request { get; set; } + + /// + public override string ToString() + => $"{nameof(Request)}: ({Request})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Items/CreateItemRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Items/CreateItemRequest.verified.cs new file mode 100644 index 00000000..64c9e95e --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Items/CreateItemRequest.verified.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Items; + +/// +/// CreateItemRequest. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class CreateItemRequest +{ + /// + /// Item. + /// + [Required] + public Item Item { get; set; } + + /// + /// A list of Item. + /// + [Required] + public List MyItems { get; set; } + + /// + public override string ToString() + => $"{nameof(Item)}: ({Item}), {nameof(MyItems)}.Count: {MyItems?.Count ?? 0}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Items/Item.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Items/Item.verified.cs new file mode 100644 index 00000000..164a73c4 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Items/Item.verified.cs @@ -0,0 +1,21 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Items; + +/// +/// Item. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Item +{ + [Required] + public string Name { get; set; } + + /// + public override string ToString() + => $"{nameof(Name)}: {Name}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Items/RequestParameters/CreateItemParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Items/RequestParameters/CreateItemParameters.verified.cs new file mode 100644 index 00000000..9066fd24 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Items/RequestParameters/CreateItemParameters.verified.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Items; + +/// +/// Parameters for operation request. +/// Description: Create a new item. +/// Operation: CreateItem. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class CreateItemParameters +{ + /// + /// CreateItemRequest. + /// + [Required] + public CreateItemRequest Request { get; set; } + + /// + public override string ToString() + => $"{nameof(Request)}: ({Request})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Items/RequestParameters/UpdateItemParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Items/RequestParameters/UpdateItemParameters.verified.cs new file mode 100644 index 00000000..d8070629 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Items/RequestParameters/UpdateItemParameters.verified.cs @@ -0,0 +1,32 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Items; + +/// +/// Parameters for operation request. +/// Description: Updates an item. +/// Operation: UpdateItem. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateItemParameters +{ + /// + /// The id of the order. + /// + [Required] + public Guid Id { get; set; } + + /// + /// UpdateItemRequest. + /// + [Required] + public UpdateItemRequest Request { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(Request)}: ({Request})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Items/UpdateItemRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Items/UpdateItemRequest.verified.cs new file mode 100644 index 00000000..381c4829 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Items/UpdateItemRequest.verified.cs @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Items; + +/// +/// UpdateItemRequest. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateItemRequest +{ + /// + /// Item. + /// + [Required] + public Item Item { get; set; } + + /// + public override string ToString() + => $"{nameof(Item)}: ({Item})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Orders/Order.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Orders/Order.verified.cs new file mode 100644 index 00000000..69a922e9 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Orders/Order.verified.cs @@ -0,0 +1,79 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Orders; + +/// +/// A single order. +/// Hallo description with multiline and no ending dot. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Order +{ + public Guid Id { get; set; } + + public string Description { get; set; } + + public DateTimeOffset MyTime { get; set; } + + /// + /// Undefined description. + /// + /// + /// Email validation being enforced. + /// + [EmailAddress] + public string MyEmail { get; set; } = "a@a.com"; + + public DateTimeOffset? MyNullableDateTime { get; set; } + + public DateTimeOffset MyDateTime { get; set; } + + [Range(1.1, 20.2)] + public double MyNumber { get; set; } + + [Range(-2147483648, 50)] + public int MyInteger { get; set; } = 15; + + /// + /// MyBool is great. + /// + public bool MyBool { get; set; } + + /// + /// This is the good uri :-). + /// + /// + /// Url validation being enforced. + /// + [Uri] + public Uri MyUri { get; set; } + + /// + /// Undefined description. + /// + /// + /// This string should be base64-encoded. + /// + public string MyByte { get; set; } + + /// + /// Hallo myStringList desc :-). + /// + public List MyStringList { get; set; } = new List(); + + [Range(10, 2147483647)] + public long MyLong { get; set; } + + /// + /// Address. + /// + public Address DeliveryAddress { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(Description)}: {Description}, {nameof(MyTime)}: ({MyTime}), {nameof(MyEmail)}: {MyEmail}, {nameof(MyNullableDateTime)}: ({MyNullableDateTime}), {nameof(MyDateTime)}: ({MyDateTime}), {nameof(MyNumber)}: {MyNumber}, {nameof(MyInteger)}: {MyInteger}, {nameof(MyBool)}: {MyBool}, {nameof(MyUri)}: ({MyUri}), {nameof(MyByte)}: {MyByte}, {nameof(MyStringList)}.Count: {MyStringList?.Count ?? 0}, {nameof(MyLong)}: {MyLong}, {nameof(DeliveryAddress)}: ({DeliveryAddress})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Orders/RequestParameters/GetOrderByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Orders/RequestParameters/GetOrderByIdParameters.verified.cs new file mode 100644 index 00000000..230a5fa8 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Orders/RequestParameters/GetOrderByIdParameters.verified.cs @@ -0,0 +1,35 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Orders; + +/// +/// Parameters for operation request. +/// Description: Get order by id. +/// Operation: GetOrderById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetOrderByIdParameters +{ + /// + /// The id of the order. + /// + [Required] + public Guid Id { get; set; } + + /// + /// The email for filter orders to retrieve. + /// + /// + /// Email validation being enforced. + /// + [EmailAddress] + public string? MyEmail { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(MyEmail)}: {MyEmail}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Orders/RequestParameters/GetOrdersParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Orders/RequestParameters/GetOrdersParameters.verified.cs new file mode 100644 index 00000000..d69b071b --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Orders/RequestParameters/GetOrdersParameters.verified.cs @@ -0,0 +1,48 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Orders; + +/// +/// Parameters for operation request. +/// Description: Get orders. +/// Operation: GetOrders. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetOrdersParameters +{ + /// + /// The numbers of items to return. + /// + [Required] + [Range(1, 100)] + public int PageSize { get; set; } = 10; + + /// + /// The number of items to skip before starting to collect the result set. + /// + [Range(0, 2147483647)] + public int PageIndex { get; set; } = 0; + + /// + /// The query string. + /// + public string? QueryString { get; set; } + + /// + /// The query array of string. + /// + public List QueryStringArray { get; set; } = new List(); + + /// + /// The continuation token. + /// + public string? ContinuationToken { get; set; } + + /// + public override string ToString() + => $"{nameof(PageSize)}: {PageSize}, {nameof(PageIndex)}: {PageIndex}, {nameof(QueryString)}: {QueryString}, {nameof(QueryStringArray)}.Count: {QueryStringArray?.Count ?? 0}, {nameof(ContinuationToken)}: {ContinuationToken}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Orders/RequestParameters/PatchOrdersIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Orders/RequestParameters/PatchOrdersIdParameters.verified.cs new file mode 100644 index 00000000..d88c8869 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Orders/RequestParameters/PatchOrdersIdParameters.verified.cs @@ -0,0 +1,56 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Orders; + +/// +/// Parameters for operation request. +/// Description: Update part of order by id. +/// Operation: PatchOrdersId. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class PatchOrdersIdParameters +{ + /// + /// The id of the order. + /// + [Required] + public Guid Id { get; set; } + + /// + /// The myTestHeader special key. + /// + [Required] + public string MyTestHeader { get; set; } + + /// + /// The myTestHeaderBool special key. + /// + [Required] + public bool MyTestHeaderBool { get; set; } + + /// + /// The myTestHeaderInt special key. + /// + [Required] + public int MyTestHeaderInt { get; set; } + + /// + /// The correlationId. + /// + [Required] + public string CorrelationId { get; set; } + + /// + /// Request to update an order. + /// + [Required] + public UpdateOrderRequest Request { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(MyTestHeader)}: {MyTestHeader}, {nameof(MyTestHeaderBool)}: {MyTestHeaderBool}, {nameof(MyTestHeaderInt)}: {MyTestHeaderInt}, {nameof(CorrelationId)}: {CorrelationId}, {nameof(Request)}: ({Request})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Orders/UpdateOrderRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Orders/UpdateOrderRequest.verified.cs new file mode 100644 index 00000000..7575954b --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Orders/UpdateOrderRequest.verified.cs @@ -0,0 +1,28 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Orders; + +/// +/// Request to update an order. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateOrderRequest +{ + /// + /// Undefined description. + /// + /// + /// Email validation being enforced. + /// + [Required] + [EmailAddress] + public string MyEmail { get; set; } + + /// + public override string ToString() + => $"{nameof(MyEmail)}: {MyEmail}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Tasks/Task.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Tasks/Task.verified.cs new file mode 100644 index 00000000..5caa1907 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Tasks/Task.verified.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Tasks; + +/// +/// Describes a single task. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Task +{ + public Guid Id { get; set; } + + public string Name { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(Name)}: {Name}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Tasks/Tasks.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Tasks/Tasks.verified.cs new file mode 100644 index 00000000..9823d387 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Tasks/Tasks.verified.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Tasks; + +/// +/// Contains a list of Tasks. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Tasks +{ + /// + /// A list of Task. + /// + public List TaskList { get; set; } = new List(); + + /// + public override string ToString() + => $"{nameof(TaskList)}.Count: {TaskList?.Count ?? 0}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Users/CreateUserRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Users/CreateUserRequest.verified.cs new file mode 100644 index 00000000..b1e6b561 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Users/CreateUserRequest.verified.cs @@ -0,0 +1,65 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Users; + +/// +/// Request to create a user. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class CreateUserRequest +{ + [Required] + public string FirstName { get; set; } + + [Required] + public string LastName { get; set; } + + public DateTimeOffset? MyNullableDateTime { get; set; } + + [Required] + public DateTimeOffset MyDateTime { get; set; } + + /// + /// Undefined description. + /// + /// + /// Email validation being enforced. + /// + [Required] + [EmailAddress] + public string Email { get; set; } + + /// + /// Undefined description. + /// + /// + /// Url validation being enforced. + /// + [Uri] + public Uri Homepage { get; set; } + + /// + /// GenderType. + /// + [Required] + public GenderType Gender { get; set; } + + public Address? MyNullableAddress { get; set; } + + [Required] + public Dictionary Tags { get; set; } + + public Dictionary DesiredProperties1 { get; set; } + + public Dictionary? DesiredProperties2 { get; set; } + + public Dictionary? DesiredProperties3 { get; set; } + + /// + public override string ToString() + => $"{nameof(FirstName)}: {FirstName}, {nameof(LastName)}: {LastName}, {nameof(MyNullableDateTime)}: ({MyNullableDateTime}), {nameof(MyDateTime)}: ({MyDateTime}), {nameof(Email)}: {Email}, {nameof(Homepage)}: ({Homepage}), {nameof(Gender)}: {Gender}, {nameof(MyNullableAddress)}: ({MyNullableAddress}), {nameof(Tags)}: ({Tags}), {nameof(DesiredProperties1)}: ({DesiredProperties1}), {nameof(DesiredProperties2)}: ({DesiredProperties2}), {nameof(DesiredProperties3)}: ({DesiredProperties3})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Users/RequestParameters/DeleteUserByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Users/RequestParameters/DeleteUserByIdParameters.verified.cs new file mode 100644 index 00000000..f7240e4a --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Users/RequestParameters/DeleteUserByIdParameters.verified.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Users; + +/// +/// Parameters for operation request. +/// Description: Delete user by id. +/// Operation: DeleteUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class DeleteUserByIdParameters +{ + /// + /// Id of the user. + /// + [Required] + public Guid Id { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Users/RequestParameters/GetUserByEmailParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Users/RequestParameters/GetUserByEmailParameters.verified.cs new file mode 100644 index 00000000..577ad2dd --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Users/RequestParameters/GetUserByEmailParameters.verified.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Users; + +/// +/// Parameters for operation request. +/// Description: Get user by email. +/// Operation: GetUserByEmail. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetUserByEmailParameters +{ + /// + /// The email of the user to retrieve. + /// + /// + /// Email validation being enforced. + /// + [Required] + [EmailAddress] + public string Email { get; set; } + + /// + public override string ToString() + => $"{nameof(Email)}: {Email}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Users/RequestParameters/GetUserByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Users/RequestParameters/GetUserByIdParameters.verified.cs new file mode 100644 index 00000000..e1536897 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Users/RequestParameters/GetUserByIdParameters.verified.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Users; + +/// +/// Parameters for operation request. +/// Description: Get user by id. +/// Operation: GetUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetUserByIdParameters +{ + /// + /// Id of the user. + /// + [Required] + public Guid Id { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Users/RequestParameters/PostUserParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Users/RequestParameters/PostUserParameters.verified.cs new file mode 100644 index 00000000..56209cc4 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Users/RequestParameters/PostUserParameters.verified.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Users; + +/// +/// Parameters for operation request. +/// Description: Create a new user. +/// Operation: PostUser. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class PostUserParameters +{ + /// + /// Request to create a user. + /// + [Required] + public CreateUserRequest Request { get; set; } + + /// + public override string ToString() + => $"{nameof(Request)}: ({Request})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Users/RequestParameters/UpdateMyTestGenderParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Users/RequestParameters/UpdateMyTestGenderParameters.verified.cs new file mode 100644 index 00000000..430b3183 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Users/RequestParameters/UpdateMyTestGenderParameters.verified.cs @@ -0,0 +1,37 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Users; + +/// +/// Parameters for operation request. +/// Description: Update gender on a user. +/// Operation: UpdateMyTestGender. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateMyTestGenderParameters +{ + /// + /// Id of the user. + /// + [Required] + public Guid Id { get; set; } + + /// + /// The gender to set on the user. + /// + public GenderType? GenderParam { get; set; } + + /// + /// Update test-gender Request. + /// + [Required] + public UpdateTestGenderRequest Request { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(GenderParam)}: {GenderParam}, {nameof(Request)}: ({Request})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Users/RequestParameters/UpdateUserByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Users/RequestParameters/UpdateUserByIdParameters.verified.cs new file mode 100644 index 00000000..759dd1f9 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Users/RequestParameters/UpdateUserByIdParameters.verified.cs @@ -0,0 +1,32 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Users; + +/// +/// Parameters for operation request. +/// Description: Update user by id. +/// Operation: UpdateUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateUserByIdParameters +{ + /// + /// Id of the user. + /// + [Required] + public Guid Id { get; set; } + + /// + /// Request to update a user. + /// + [Required] + public UpdateUserRequest Request { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(Request)}: ({Request})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Users/UpdateTestGenderRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Users/UpdateTestGenderRequest.verified.cs new file mode 100644 index 00000000..7d125ba7 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Users/UpdateTestGenderRequest.verified.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Users; + +/// +/// Update test-gender Request. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateTestGenderRequest +{ + /// + /// GenderType. + /// + public GenderType Gender { get; set; } + + /// + public override string ToString() + => $"{nameof(Gender)}: {Gender}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Users/UpdateUserRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Users/UpdateUserRequest.verified.cs new file mode 100644 index 00000000..3fc46ab8 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Users/UpdateUserRequest.verified.cs @@ -0,0 +1,36 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Users; + +/// +/// Request to update a user. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateUserRequest +{ + public string FirstName { get; set; } + + public string LastName { get; set; } + + /// + /// Undefined description. + /// + /// + /// Email validation being enforced. + /// + [EmailAddress] + public string Email { get; set; } + + /// + /// GenderType. + /// + public GenderType Gender { get; set; } + + /// + public override string ToString() + => $"{nameof(FirstName)}: {FirstName}, {nameof(LastName)}: {LastName}, {nameof(Email)}: {Email}, {nameof(Gender)}: {Gender}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Users/User.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Users/User.verified.cs new file mode 100644 index 00000000..09abb259 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Users/User.verified.cs @@ -0,0 +1,62 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Users; + +/// +/// A single user. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class User +{ + public Guid Id { get; set; } + + /// + /// GenderType. + /// + public GenderType Gender { get; set; } + + public string FirstName { get; set; } + + public string LastName { get; set; } + + /// + /// Undefined description. + /// + /// + /// Email validation being enforced. + /// + [EmailAddress] + public string Email { get; set; } + + /// + /// Undefined description. + /// + /// + /// Url validation being enforced. + /// + [Uri] + public Uri Homepage { get; set; } + + /// + /// ColorType. + /// + public ColorType Color { get; set; } + + /// + /// Address. + /// + public Address HomeAddress { get; set; } + + /// + /// Address. + /// + public Address CompanyAddress { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(Gender)}: {Gender}, {nameof(FirstName)}: {FirstName}, {nameof(LastName)}: {LastName}, {nameof(Email)}: {Email}, {nameof(Homepage)}: ({Homepage}), {nameof(Color)}: {Color}, {nameof(HomeAddress)}: ({HomeAddress}), {nameof(CompanyAddress)}: ({CompanyAddress})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Users/Users.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Users/Users.verified.cs new file mode 100644 index 00000000..1e46aa8f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/Users/Users.verified.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Users; + +/// +/// A list of users. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Users +{ + /// + /// A list of User. + /// + public List UserList { get; set; } = new List(); + + /// + public override string ToString() + => $"{nameof(UserList)}.Count: {UserList?.Count ?? 0}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/_EnumerationTypes/ColorType.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/_EnumerationTypes/ColorType.verified.cs new file mode 100644 index 00000000..38ad2c32 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/_EnumerationTypes/ColorType.verified.cs @@ -0,0 +1,21 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts; + +/// +/// Enumeration: ColorType. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +[Flags] +public enum ColorType +{ + None = 0, + Black = 1, + White = 2, + Yellow = 4, + Red = 8, +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/_EnumerationTypes/GenderType.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/_EnumerationTypes/GenderType.verified.cs new file mode 100644 index 00000000..ad9d533f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/_EnumerationTypes/GenderType.verified.cs @@ -0,0 +1,19 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts; + +/// +/// Enumeration: GenderType. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public enum GenderType +{ + None, + NonBinary, + Male, + Female, +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/_Shared/Address.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/_Shared/Address.verified.cs new file mode 100644 index 00000000..89a16764 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/_Shared/Address.verified.cs @@ -0,0 +1,32 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts; + +/// +/// Address. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Address +{ + [StringLength(255)] + public string StreetName { get; set; } + + public string StreetNumber { get; set; } + + public string PostalCode { get; set; } + + public string CityName { get; set; } + + /// + /// Country. + /// + public Country MyCountry { get; set; } + + /// + public override string ToString() + => $"{nameof(StreetName)}: {StreetName}, {nameof(StreetNumber)}: {StreetNumber}, {nameof(PostalCode)}: {PostalCode}, {nameof(CityName)}: {CityName}, {nameof(MyCountry)}: ({MyCountry})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/_Shared/Country.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/_Shared/Country.verified.cs new file mode 100644 index 00000000..b73439e0 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Contracts/_Shared/Country.verified.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts; + +/// +/// Country. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Country +{ + [Required] + public string Name { get; set; } + + [Required] + [MinLength(2)] + [MaxLength(2)] + [RegularExpression("^[A-Za-z]{2}$")] + public string Alpha2Code { get; set; } + + [Required] + [MinLength(3)] + [MaxLength(3)] + [RegularExpression("^[A-Za-z]{3}$")] + public string Alpha3Code { get; set; } + + /// + public override string ToString() + => $"{nameof(Name)}: {Name}, {nameof(Alpha2Code)}: {Alpha2Code}, {nameof(Alpha3Code)}: {Alpha3Code}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Accounts/Interfaces/ISetAccountNameEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Accounts/Interfaces/ISetAccountNameEndpoint.verified.cs new file mode 100644 index 00000000..af9de0bd --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Accounts/Interfaces/ISetAccountNameEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Accounts.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Set name of account. +/// Operation: SetAccountName. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface ISetAccountNameEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + SetAccountNameParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Accounts/Interfaces/ISetAccountNameEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Accounts/Interfaces/ISetAccountNameEndpointResult.verified.cs new file mode 100644 index 00000000..264159b6 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Accounts/Interfaces/ISetAccountNameEndpointResult.verified.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Accounts.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Set name of account. +/// Operation: SetAccountName. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface ISetAccountNameEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + string? OkContent { get; } + + string? BadRequestContent { get; } + + string? UnauthorizedContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Accounts/Interfaces/IUpdateAccountNameEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Accounts/Interfaces/IUpdateAccountNameEndpoint.verified.cs new file mode 100644 index 00000000..de932999 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Accounts/Interfaces/IUpdateAccountNameEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Accounts.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Update name of account. +/// Operation: UpdateAccountName. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IUpdateAccountNameEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + UpdateAccountNameParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Accounts/Interfaces/IUpdateAccountNameEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Accounts/Interfaces/IUpdateAccountNameEndpointResult.verified.cs new file mode 100644 index 00000000..72f164a3 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Accounts/Interfaces/IUpdateAccountNameEndpointResult.verified.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Accounts.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Update name of account. +/// Operation: UpdateAccountName. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IUpdateAccountNameEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + string? OkContent { get; } + + string? BadRequestContent { get; } + + string? UnauthorizedContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Accounts/SetAccountNameEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Accounts/SetAccountNameEndpoint.verified.cs new file mode 100644 index 00000000..6def8c88 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Accounts/SetAccountNameEndpoint.verified.cs @@ -0,0 +1,48 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Accounts; + +/// +/// Client Endpoint. +/// Description: Set name of account. +/// Operation: SetAccountName. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class SetAccountNameEndpoint : ISetAccountNameEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public SetAccountNameEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + SetAccountNameParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/accounts/{accountId}/name"); + requestBuilder.WithPathParameter("accountId", parameters.AccountId); + requestBuilder.WithBody(parameters.Request); + + using var requestMessage = requestBuilder.Build(HttpMethod.Post); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + return await responseBuilder.BuildResponseAsync(x => new SetAccountNameEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Accounts/SetAccountNameEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Accounts/SetAccountNameEndpointResult.verified.cs new file mode 100644 index 00000000..6380a491 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Accounts/SetAccountNameEndpointResult.verified.cs @@ -0,0 +1,45 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Accounts; + +/// +/// Client Endpoint result. +/// Description: Set name of account. +/// Operation: SetAccountName. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class SetAccountNameEndpointResult : EndpointResponse, ISetAccountNameEndpointResult +{ + public SetAccountNameEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public string? OkContent + => IsOk && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public string? BadRequestContent + => IsBadRequest && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public string? UnauthorizedContent + => IsUnauthorized && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Accounts/UpdateAccountNameEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Accounts/UpdateAccountNameEndpoint.verified.cs new file mode 100644 index 00000000..075ba1ad --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Accounts/UpdateAccountNameEndpoint.verified.cs @@ -0,0 +1,48 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Accounts; + +/// +/// Client Endpoint. +/// Description: Update name of account. +/// Operation: UpdateAccountName. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateAccountNameEndpoint : IUpdateAccountNameEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public UpdateAccountNameEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + UpdateAccountNameParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/accounts/{accountId}/name"); + requestBuilder.WithPathParameter("accountId", parameters.AccountId); + requestBuilder.WithHeaderParameter("name", parameters.Name); + + using var requestMessage = requestBuilder.Build(HttpMethod.Put); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + return await responseBuilder.BuildResponseAsync(x => new UpdateAccountNameEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Accounts/UpdateAccountNameEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Accounts/UpdateAccountNameEndpointResult.verified.cs new file mode 100644 index 00000000..d5de9b2c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Accounts/UpdateAccountNameEndpointResult.verified.cs @@ -0,0 +1,45 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Accounts; + +/// +/// Client Endpoint result. +/// Description: Update name of account. +/// Operation: UpdateAccountName. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateAccountNameEndpointResult : EndpointResponse, IUpdateAccountNameEndpointResult +{ + public UpdateAccountNameEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public string? OkContent + => IsOk && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public string? BadRequestContent + => IsBadRequest && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public string? UnauthorizedContent + => IsUnauthorized && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Addresses/GetAddressesByPostalCodesEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Addresses/GetAddressesByPostalCodesEndpoint.verified.cs new file mode 100644 index 00000000..d581adaa --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Addresses/GetAddressesByPostalCodesEndpoint.verified.cs @@ -0,0 +1,48 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Addresses; + +/// +/// Client Endpoint. +/// Description: Get addresses by postal code. +/// Operation: GetAddressesByPostalCodes. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetAddressesByPostalCodesEndpoint : IGetAddressesByPostalCodesEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public GetAddressesByPostalCodesEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + GetAddressesByPostalCodesParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/addresses/{postalCode}"); + requestBuilder.WithPathParameter("postalCode", parameters.PostalCode); + + using var requestMessage = requestBuilder.Build(HttpMethod.Get); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse>(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + responseBuilder.AddErrorResponse(HttpStatusCode.NotFound); + return await responseBuilder.BuildResponseAsync(x => new GetAddressesByPostalCodesEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Addresses/GetAddressesByPostalCodesEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Addresses/GetAddressesByPostalCodesEndpointResult.verified.cs new file mode 100644 index 00000000..f04dc19d --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Addresses/GetAddressesByPostalCodesEndpointResult.verified.cs @@ -0,0 +1,53 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Addresses; + +/// +/// Client Endpoint result. +/// Description: Get addresses by postal code. +/// Operation: GetAddressesByPostalCodes. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetAddressesByPostalCodesEndpointResult : EndpointResponse, IGetAddressesByPostalCodesEndpointResult +{ + public GetAddressesByPostalCodesEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public bool IsNotFound + => StatusCode == HttpStatusCode.NotFound; + + public IEnumerable
OkContent + => IsOk && ContentObject is IEnumerable
result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public string? BadRequestContent + => IsBadRequest && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public string? UnauthorizedContent + => IsUnauthorized && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); + + public string? NotFoundContent + => IsNotFound && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsNotFound property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Addresses/Interfaces/IGetAddressesByPostalCodesEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Addresses/Interfaces/IGetAddressesByPostalCodesEndpoint.verified.cs new file mode 100644 index 00000000..4ae03b04 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Addresses/Interfaces/IGetAddressesByPostalCodesEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Addresses.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Get addresses by postal code. +/// Operation: GetAddressesByPostalCodes. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetAddressesByPostalCodesEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + GetAddressesByPostalCodesParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Addresses/Interfaces/IGetAddressesByPostalCodesEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Addresses/Interfaces/IGetAddressesByPostalCodesEndpointResult.verified.cs new file mode 100644 index 00000000..820db63e --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Addresses/Interfaces/IGetAddressesByPostalCodesEndpointResult.verified.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Addresses.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Get addresses by postal code. +/// Operation: GetAddressesByPostalCodes. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetAddressesByPostalCodesEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + bool IsNotFound { get; } + + IEnumerable
OkContent { get; } + + string? BadRequestContent { get; } + + string? UnauthorizedContent { get; } + + string? NotFoundContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/EventArgs/GetEventArgByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/EventArgs/GetEventArgByIdEndpoint.verified.cs new file mode 100644 index 00000000..86c35bc3 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/EventArgs/GetEventArgByIdEndpoint.verified.cs @@ -0,0 +1,48 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.EventArgs; + +/// +/// Client Endpoint. +/// Description: Get EventArgs By Id. +/// Operation: GetEventArgById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetEventArgByIdEndpoint : IGetEventArgByIdEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public GetEventArgByIdEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + GetEventArgByIdParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/eventArgs/{id}"); + requestBuilder.WithPathParameter("id", parameters.Id); + + using var requestMessage = requestBuilder.Build(HttpMethod.Get); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + responseBuilder.AddErrorResponse(HttpStatusCode.NotFound); + return await responseBuilder.BuildResponseAsync(x => new GetEventArgByIdEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/EventArgs/GetEventArgByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/EventArgs/GetEventArgByIdEndpointResult.verified.cs new file mode 100644 index 00000000..eb55aeab --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/EventArgs/GetEventArgByIdEndpointResult.verified.cs @@ -0,0 +1,53 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.EventArgs; + +/// +/// Client Endpoint result. +/// Description: Get EventArgs By Id. +/// Operation: GetEventArgById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetEventArgByIdEndpointResult : EndpointResponse, IGetEventArgByIdEndpointResult +{ + public GetEventArgByIdEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public bool IsNotFound + => StatusCode == HttpStatusCode.NotFound; + + public EventArgs OkContent + => IsOk && ContentObject is EventArgs result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public string? BadRequestContent + => IsBadRequest && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public string? UnauthorizedContent + => IsUnauthorized && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); + + public string? NotFoundContent + => IsNotFound && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsNotFound property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/EventArgs/GetEventArgsEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/EventArgs/GetEventArgsEndpoint.verified.cs new file mode 100644 index 00000000..bb03ee99 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/EventArgs/GetEventArgsEndpoint.verified.cs @@ -0,0 +1,44 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.EventArgs; + +/// +/// Client Endpoint. +/// Description: Get EventArgs List. +/// Operation: GetEventArgs. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetEventArgsEndpoint : IGetEventArgsEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public GetEventArgsEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/eventArgs"); + + using var requestMessage = requestBuilder.Build(HttpMethod.Get); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse>(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + return await responseBuilder.BuildResponseAsync(x => new GetEventArgsEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/EventArgs/GetEventArgsEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/EventArgs/GetEventArgsEndpointResult.verified.cs new file mode 100644 index 00000000..46333393 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/EventArgs/GetEventArgsEndpointResult.verified.cs @@ -0,0 +1,37 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.EventArgs; + +/// +/// Client Endpoint result. +/// Description: Get EventArgs List. +/// Operation: GetEventArgs. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetEventArgsEndpointResult : EndpointResponse, IGetEventArgsEndpointResult +{ + public GetEventArgsEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public IEnumerable OkContent + => IsOk && ContentObject is IEnumerable result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public string? UnauthorizedContent + => IsUnauthorized && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgByIdEndpoint.verified.cs new file mode 100644 index 00000000..d7a02f5c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgByIdEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.EventArgs.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Get EventArgs By Id. +/// Operation: GetEventArgById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetEventArgByIdEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + GetEventArgByIdParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgByIdEndpointResult.verified.cs new file mode 100644 index 00000000..9d22c2a3 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgByIdEndpointResult.verified.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.EventArgs.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Get EventArgs By Id. +/// Operation: GetEventArgById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetEventArgByIdEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + bool IsNotFound { get; } + + EventArgs OkContent { get; } + + string? BadRequestContent { get; } + + string? UnauthorizedContent { get; } + + string? NotFoundContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgsEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgsEndpoint.verified.cs new file mode 100644 index 00000000..8d92e1aa --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgsEndpoint.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.EventArgs.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Get EventArgs List. +/// Operation: GetEventArgs. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetEventArgsEndpoint +{ + /// + /// Execute method. + /// + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgsEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgsEndpointResult.verified.cs new file mode 100644 index 00000000..65b954e6 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgsEndpointResult.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.EventArgs.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Get EventArgs List. +/// Operation: GetEventArgs. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetEventArgsEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsUnauthorized { get; } + + IEnumerable OkContent { get; } + + string? UnauthorizedContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/GetFileByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/GetFileByIdEndpoint.verified.cs new file mode 100644 index 00000000..e90dad63 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/GetFileByIdEndpoint.verified.cs @@ -0,0 +1,48 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Files; + +/// +/// Client Endpoint. +/// Description: Get File By Id. +/// Operation: GetFileById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetFileByIdEndpoint : IGetFileByIdEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public GetFileByIdEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + GetFileByIdParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/files/{id}"); + requestBuilder.WithPathParameter("id", parameters.Id); + + using var requestMessage = requestBuilder.Build(HttpMethod.Get); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + responseBuilder.AddErrorResponse(HttpStatusCode.NotFound); + return await responseBuilder.BuildResponseAsync(x => new GetFileByIdEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/GetFileByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/GetFileByIdEndpointResult.verified.cs new file mode 100644 index 00000000..e2b99e2c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/GetFileByIdEndpointResult.verified.cs @@ -0,0 +1,53 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Files; + +/// +/// Client Endpoint result. +/// Description: Get File By Id. +/// Operation: GetFileById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetFileByIdEndpointResult : EndpointResponse, IGetFileByIdEndpointResult +{ + public GetFileByIdEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public bool IsNotFound + => StatusCode == HttpStatusCode.NotFound; + + public byte[] OkContent + => IsOk && ContentObject is byte[] result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public string? BadRequestContent + => IsBadRequest && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public string? UnauthorizedContent + => IsUnauthorized && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); + + public string? NotFoundContent + => IsNotFound && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsNotFound property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IGetFileByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IGetFileByIdEndpoint.verified.cs new file mode 100644 index 00000000..8435232d --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IGetFileByIdEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Files.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Get File By Id. +/// Operation: GetFileById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetFileByIdEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + GetFileByIdParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IGetFileByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IGetFileByIdEndpointResult.verified.cs new file mode 100644 index 00000000..a4665c4e --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IGetFileByIdEndpointResult.verified.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Files.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Get File By Id. +/// Operation: GetFileById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetFileByIdEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + bool IsNotFound { get; } + + byte[] OkContent { get; } + + string? BadRequestContent { get; } + + string? UnauthorizedContent { get; } + + string? NotFoundContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadMultiFilesAsFormDataEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadMultiFilesAsFormDataEndpoint.verified.cs new file mode 100644 index 00000000..187053e2 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadMultiFilesAsFormDataEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Files.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Upload multi files as form data. +/// Operation: UploadMultiFilesAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IUploadMultiFilesAsFormDataEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + UploadMultiFilesAsFormDataParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadMultiFilesAsFormDataEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadMultiFilesAsFormDataEndpointResult.verified.cs new file mode 100644 index 00000000..46ba7de1 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadMultiFilesAsFormDataEndpointResult.verified.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Files.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Upload multi files as form data. +/// Operation: UploadMultiFilesAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IUploadMultiFilesAsFormDataEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + string? OkContent { get; } + + string? BadRequestContent { get; } + + string? UnauthorizedContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadSingleFileAsFormDataEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadSingleFileAsFormDataEndpoint.verified.cs new file mode 100644 index 00000000..48fa6b4c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadSingleFileAsFormDataEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Files.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Upload a file as OctetStream. +/// Operation: UploadSingleFileAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IUploadSingleFileAsFormDataEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + UploadSingleFileAsFormDataParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadSingleFileAsFormDataEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadSingleFileAsFormDataEndpointResult.verified.cs new file mode 100644 index 00000000..d70f6057 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadSingleFileAsFormDataEndpointResult.verified.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Files.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Upload a file as OctetStream. +/// Operation: UploadSingleFileAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IUploadSingleFileAsFormDataEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + string? OkContent { get; } + + string? BadRequestContent { get; } + + string? UnauthorizedContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadSingleObjectWithFileAsFormDataEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadSingleObjectWithFileAsFormDataEndpoint.verified.cs new file mode 100644 index 00000000..b3cad17e --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadSingleObjectWithFileAsFormDataEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Files.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Upload a file as FormData. +/// Operation: UploadSingleObjectWithFileAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IUploadSingleObjectWithFileAsFormDataEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + UploadSingleObjectWithFileAsFormDataParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadSingleObjectWithFileAsFormDataEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadSingleObjectWithFileAsFormDataEndpointResult.verified.cs new file mode 100644 index 00000000..2727d3f0 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadSingleObjectWithFileAsFormDataEndpointResult.verified.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Files.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Upload a file as FormData. +/// Operation: UploadSingleObjectWithFileAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IUploadSingleObjectWithFileAsFormDataEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + string? OkContent { get; } + + string? BadRequestContent { get; } + + string? UnauthorizedContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadSingleObjectWithFilesAsFormDataEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadSingleObjectWithFilesAsFormDataEndpoint.verified.cs new file mode 100644 index 00000000..3716111f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadSingleObjectWithFilesAsFormDataEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Files.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Upload files as FormData. +/// Operation: UploadSingleObjectWithFilesAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IUploadSingleObjectWithFilesAsFormDataEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + UploadSingleObjectWithFilesAsFormDataParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadSingleObjectWithFilesAsFormDataEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadSingleObjectWithFilesAsFormDataEndpointResult.verified.cs new file mode 100644 index 00000000..c8d21023 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadSingleObjectWithFilesAsFormDataEndpointResult.verified.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Files.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Upload files as FormData. +/// Operation: UploadSingleObjectWithFilesAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IUploadSingleObjectWithFilesAsFormDataEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + string? OkContent { get; } + + string? BadRequestContent { get; } + + string? UnauthorizedContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/UploadMultiFilesAsFormDataEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/UploadMultiFilesAsFormDataEndpoint.verified.cs new file mode 100644 index 00000000..16787a4b --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/UploadMultiFilesAsFormDataEndpoint.verified.cs @@ -0,0 +1,47 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Files; + +/// +/// Client Endpoint. +/// Description: Upload multi files as form data. +/// Operation: UploadMultiFilesAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UploadMultiFilesAsFormDataEndpoint : IUploadMultiFilesAsFormDataEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public UploadMultiFilesAsFormDataEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + UploadMultiFilesAsFormDataParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/files/form-data/multiFile"); + // TODO: Imp. With-Form + + using var requestMessage = requestBuilder.Build(HttpMethod.Post); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + return await responseBuilder.BuildResponseAsync(x => new UploadMultiFilesAsFormDataEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/UploadMultiFilesAsFormDataEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/UploadMultiFilesAsFormDataEndpointResult.verified.cs new file mode 100644 index 00000000..c036fd96 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/UploadMultiFilesAsFormDataEndpointResult.verified.cs @@ -0,0 +1,45 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Files; + +/// +/// Client Endpoint result. +/// Description: Upload multi files as form data. +/// Operation: UploadMultiFilesAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UploadMultiFilesAsFormDataEndpointResult : EndpointResponse, IUploadMultiFilesAsFormDataEndpointResult +{ + public UploadMultiFilesAsFormDataEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public string? OkContent + => IsOk && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public string? BadRequestContent + => IsBadRequest && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public string? UnauthorizedContent + => IsUnauthorized && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/UploadSingleFileAsFormDataEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/UploadSingleFileAsFormDataEndpoint.verified.cs new file mode 100644 index 00000000..5ef606d6 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/UploadSingleFileAsFormDataEndpoint.verified.cs @@ -0,0 +1,47 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Files; + +/// +/// Client Endpoint. +/// Description: Upload a file as OctetStream. +/// Operation: UploadSingleFileAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UploadSingleFileAsFormDataEndpoint : IUploadSingleFileAsFormDataEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public UploadSingleFileAsFormDataEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + UploadSingleFileAsFormDataParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/files/form-data/singleFile"); + requestBuilder.WithBody(parameters.Request); + + using var requestMessage = requestBuilder.Build(HttpMethod.Post); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + return await responseBuilder.BuildResponseAsync(x => new UploadSingleFileAsFormDataEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/UploadSingleFileAsFormDataEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/UploadSingleFileAsFormDataEndpointResult.verified.cs new file mode 100644 index 00000000..b6400159 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/UploadSingleFileAsFormDataEndpointResult.verified.cs @@ -0,0 +1,45 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Files; + +/// +/// Client Endpoint result. +/// Description: Upload a file as OctetStream. +/// Operation: UploadSingleFileAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UploadSingleFileAsFormDataEndpointResult : EndpointResponse, IUploadSingleFileAsFormDataEndpointResult +{ + public UploadSingleFileAsFormDataEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public string? OkContent + => IsOk && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public string? BadRequestContent + => IsBadRequest && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public string? UnauthorizedContent + => IsUnauthorized && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/UploadSingleObjectWithFileAsFormDataEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/UploadSingleObjectWithFileAsFormDataEndpoint.verified.cs new file mode 100644 index 00000000..3b9d8c37 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/UploadSingleObjectWithFileAsFormDataEndpoint.verified.cs @@ -0,0 +1,47 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Files; + +/// +/// Client Endpoint. +/// Description: Upload a file as FormData. +/// Operation: UploadSingleObjectWithFileAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UploadSingleObjectWithFileAsFormDataEndpoint : IUploadSingleObjectWithFileAsFormDataEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public UploadSingleObjectWithFileAsFormDataEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + UploadSingleObjectWithFileAsFormDataParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/files/form-data/singleObject"); + // TODO: Imp. With-Form + + using var requestMessage = requestBuilder.Build(HttpMethod.Post); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + return await responseBuilder.BuildResponseAsync(x => new UploadSingleObjectWithFileAsFormDataEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/UploadSingleObjectWithFileAsFormDataEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/UploadSingleObjectWithFileAsFormDataEndpointResult.verified.cs new file mode 100644 index 00000000..c25ca3e9 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/UploadSingleObjectWithFileAsFormDataEndpointResult.verified.cs @@ -0,0 +1,45 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Files; + +/// +/// Client Endpoint result. +/// Description: Upload a file as FormData. +/// Operation: UploadSingleObjectWithFileAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UploadSingleObjectWithFileAsFormDataEndpointResult : EndpointResponse, IUploadSingleObjectWithFileAsFormDataEndpointResult +{ + public UploadSingleObjectWithFileAsFormDataEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public string? OkContent + => IsOk && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public string? BadRequestContent + => IsBadRequest && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public string? UnauthorizedContent + => IsUnauthorized && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/UploadSingleObjectWithFilesAsFormDataEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/UploadSingleObjectWithFilesAsFormDataEndpoint.verified.cs new file mode 100644 index 00000000..1d2fccb4 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/UploadSingleObjectWithFilesAsFormDataEndpoint.verified.cs @@ -0,0 +1,47 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Files; + +/// +/// Client Endpoint. +/// Description: Upload files as FormData. +/// Operation: UploadSingleObjectWithFilesAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UploadSingleObjectWithFilesAsFormDataEndpoint : IUploadSingleObjectWithFilesAsFormDataEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public UploadSingleObjectWithFilesAsFormDataEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + UploadSingleObjectWithFilesAsFormDataParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/files/form-data/singleObjectMultiFile"); + // TODO: Imp. With-Form + + using var requestMessage = requestBuilder.Build(HttpMethod.Post); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + return await responseBuilder.BuildResponseAsync(x => new UploadSingleObjectWithFilesAsFormDataEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/UploadSingleObjectWithFilesAsFormDataEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/UploadSingleObjectWithFilesAsFormDataEndpointResult.verified.cs new file mode 100644 index 00000000..efa6d566 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/UploadSingleObjectWithFilesAsFormDataEndpointResult.verified.cs @@ -0,0 +1,45 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Files; + +/// +/// Client Endpoint result. +/// Description: Upload files as FormData. +/// Operation: UploadSingleObjectWithFilesAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UploadSingleObjectWithFilesAsFormDataEndpointResult : EndpointResponse, IUploadSingleObjectWithFilesAsFormDataEndpointResult +{ + public UploadSingleObjectWithFilesAsFormDataEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public string? OkContent + => IsOk && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public string? BadRequestContent + => IsBadRequest && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public string? UnauthorizedContent + => IsUnauthorized && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Items/CreateItemEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Items/CreateItemEndpoint.verified.cs new file mode 100644 index 00000000..658b3e19 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Items/CreateItemEndpoint.verified.cs @@ -0,0 +1,47 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Items; + +/// +/// Client Endpoint. +/// Description: Create a new item. +/// Operation: CreateItem. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class CreateItemEndpoint : ICreateItemEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public CreateItemEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + CreateItemParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/items"); + requestBuilder.WithBody(parameters.Request); + + using var requestMessage = requestBuilder.Build(HttpMethod.Post); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + return await responseBuilder.BuildResponseAsync(x => new CreateItemEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Items/CreateItemEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Items/CreateItemEndpointResult.verified.cs new file mode 100644 index 00000000..9ab6e3f9 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Items/CreateItemEndpointResult.verified.cs @@ -0,0 +1,45 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Items; + +/// +/// Client Endpoint result. +/// Description: Create a new item. +/// Operation: CreateItem. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class CreateItemEndpointResult : EndpointResponse, ICreateItemEndpointResult +{ + public CreateItemEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public string? OkContent + => IsOk && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public string? BadRequestContent + => IsBadRequest && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public string? UnauthorizedContent + => IsUnauthorized && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Items/Interfaces/ICreateItemEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Items/Interfaces/ICreateItemEndpoint.verified.cs new file mode 100644 index 00000000..0a2032e6 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Items/Interfaces/ICreateItemEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Items.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Create a new item. +/// Operation: CreateItem. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface ICreateItemEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + CreateItemParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Items/Interfaces/ICreateItemEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Items/Interfaces/ICreateItemEndpointResult.verified.cs new file mode 100644 index 00000000..af8b9d6a --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Items/Interfaces/ICreateItemEndpointResult.verified.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Items.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Create a new item. +/// Operation: CreateItem. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface ICreateItemEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + string? OkContent { get; } + + string? BadRequestContent { get; } + + string? UnauthorizedContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Items/Interfaces/IUpdateItemEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Items/Interfaces/IUpdateItemEndpoint.verified.cs new file mode 100644 index 00000000..13bbf478 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Items/Interfaces/IUpdateItemEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Items.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Updates an item. +/// Operation: UpdateItem. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IUpdateItemEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + UpdateItemParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Items/Interfaces/IUpdateItemEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Items/Interfaces/IUpdateItemEndpointResult.verified.cs new file mode 100644 index 00000000..cff86111 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Items/Interfaces/IUpdateItemEndpointResult.verified.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Items.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Updates an item. +/// Operation: UpdateItem. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IUpdateItemEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + Guid OkContent { get; } + + string? BadRequestContent { get; } + + string? UnauthorizedContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Items/UpdateItemEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Items/UpdateItemEndpoint.verified.cs new file mode 100644 index 00000000..825f3483 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Items/UpdateItemEndpoint.verified.cs @@ -0,0 +1,48 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Items; + +/// +/// Client Endpoint. +/// Description: Updates an item. +/// Operation: UpdateItem. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateItemEndpoint : IUpdateItemEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public UpdateItemEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + UpdateItemParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/items/{id}"); + requestBuilder.WithPathParameter("id", parameters.Id); + requestBuilder.WithBody(parameters.Request); + + using var requestMessage = requestBuilder.Build(HttpMethod.Put); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + return await responseBuilder.BuildResponseAsync(x => new UpdateItemEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Items/UpdateItemEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Items/UpdateItemEndpointResult.verified.cs new file mode 100644 index 00000000..3abf09f9 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Items/UpdateItemEndpointResult.verified.cs @@ -0,0 +1,45 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Items; + +/// +/// Client Endpoint result. +/// Description: Updates an item. +/// Operation: UpdateItem. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateItemEndpointResult : EndpointResponse, IUpdateItemEndpointResult +{ + public UpdateItemEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public Guid OkContent + => IsOk && ContentObject is Guid result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public string? BadRequestContent + => IsBadRequest && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public string? UnauthorizedContent + => IsUnauthorized && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/GetOrderByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/GetOrderByIdEndpoint.verified.cs new file mode 100644 index 00000000..5f670a57 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/GetOrderByIdEndpoint.verified.cs @@ -0,0 +1,50 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Orders; + +/// +/// Client Endpoint. +/// Description: Get order by id. +/// Operation: GetOrderById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetOrderByIdEndpoint : IGetOrderByIdEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public GetOrderByIdEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + GetOrderByIdParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/orders/{id}"); + requestBuilder.WithPathParameter("id", parameters.Id); + requestBuilder.WithQueryParameter("myEmail", parameters.MyEmail); + + using var requestMessage = requestBuilder.Build(HttpMethod.Get); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + responseBuilder.AddErrorResponse(HttpStatusCode.Forbidden); + responseBuilder.AddErrorResponse(HttpStatusCode.NotFound); + return await responseBuilder.BuildResponseAsync(x => new GetOrderByIdEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/GetOrderByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/GetOrderByIdEndpointResult.verified.cs new file mode 100644 index 00000000..9beab004 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/GetOrderByIdEndpointResult.verified.cs @@ -0,0 +1,61 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Orders; + +/// +/// Client Endpoint result. +/// Description: Get order by id. +/// Operation: GetOrderById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetOrderByIdEndpointResult : EndpointResponse, IGetOrderByIdEndpointResult +{ + public GetOrderByIdEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public bool IsForbidden + => StatusCode == HttpStatusCode.Forbidden; + + public bool IsNotFound + => StatusCode == HttpStatusCode.NotFound; + + public Order OkContent + => IsOk && ContentObject is Order result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public string? BadRequestContent + => IsBadRequest && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public string? UnauthorizedContent + => IsUnauthorized && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); + + public string? ForbiddenContent + => IsForbidden && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsForbidden property first."); + + public string? NotFoundContent + => IsNotFound && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsNotFound property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/GetOrdersEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/GetOrdersEndpoint.verified.cs new file mode 100644 index 00000000..2e0923df --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/GetOrdersEndpoint.verified.cs @@ -0,0 +1,56 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Orders; + +/// +/// Client Endpoint. +/// Description: Get orders. +/// Operation: GetOrders. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetOrdersEndpoint : IGetOrdersEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public GetOrdersEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + GetOrdersParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/orders"); + requestBuilder.WithQueryParameter("pageSize", parameters.PageSize); + requestBuilder.WithQueryParameter("pageIndex", parameters.PageIndex); + requestBuilder.WithQueryParameter("queryString", parameters.QueryString); + if (parameters.QueryStringArray.Any()) + { + requestBuilder.WithQueryParameter("queryStringArray", parameters.QueryStringArray); + } + + requestBuilder.WithQueryParameter("continuationToken", parameters.ContinuationToken); + + using var requestMessage = requestBuilder.Build(HttpMethod.Get); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse>(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + responseBuilder.AddErrorResponse(HttpStatusCode.NotFound); + return await responseBuilder.BuildResponseAsync(x => new GetOrdersEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/GetOrdersEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/GetOrdersEndpointResult.verified.cs new file mode 100644 index 00000000..9fbf5417 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/GetOrdersEndpointResult.verified.cs @@ -0,0 +1,53 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Orders; + +/// +/// Client Endpoint result. +/// Description: Get orders. +/// Operation: GetOrders. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetOrdersEndpointResult : EndpointResponse, IGetOrdersEndpointResult +{ + public GetOrdersEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public bool IsNotFound + => StatusCode == HttpStatusCode.NotFound; + + public Pagination OkContent + => IsOk && ContentObject is Pagination result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public string? BadRequestContent + => IsBadRequest && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public string? UnauthorizedContent + => IsUnauthorized && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); + + public string? NotFoundContent + => IsNotFound && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsNotFound property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrderByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrderByIdEndpoint.verified.cs new file mode 100644 index 00000000..b842186f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrderByIdEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Orders.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Get order by id. +/// Operation: GetOrderById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetOrderByIdEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + GetOrderByIdParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrderByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrderByIdEndpointResult.verified.cs new file mode 100644 index 00000000..0e51bffe --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrderByIdEndpointResult.verified.cs @@ -0,0 +1,37 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Orders.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Get order by id. +/// Operation: GetOrderById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetOrderByIdEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + bool IsForbidden { get; } + + bool IsNotFound { get; } + + Order OkContent { get; } + + string? BadRequestContent { get; } + + string? UnauthorizedContent { get; } + + string? ForbiddenContent { get; } + + string? NotFoundContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrdersEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrdersEndpoint.verified.cs new file mode 100644 index 00000000..8dd8dddd --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrdersEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Orders.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Get orders. +/// Operation: GetOrders. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetOrdersEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + GetOrdersParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrdersEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrdersEndpointResult.verified.cs new file mode 100644 index 00000000..76e5c510 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrdersEndpointResult.verified.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Orders.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Get orders. +/// Operation: GetOrders. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetOrdersEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + bool IsNotFound { get; } + + Pagination OkContent { get; } + + string? BadRequestContent { get; } + + string? UnauthorizedContent { get; } + + string? NotFoundContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/Interfaces/IPatchOrdersIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/Interfaces/IPatchOrdersIdEndpoint.verified.cs new file mode 100644 index 00000000..3c0dab43 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/Interfaces/IPatchOrdersIdEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Orders.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Update part of order by id. +/// Operation: PatchOrdersId. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IPatchOrdersIdEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + PatchOrdersIdParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/Interfaces/IPatchOrdersIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/Interfaces/IPatchOrdersIdEndpointResult.verified.cs new file mode 100644 index 00000000..67aa3602 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/Interfaces/IPatchOrdersIdEndpointResult.verified.cs @@ -0,0 +1,45 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Orders.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Update part of order by id. +/// Operation: PatchOrdersId. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IPatchOrdersIdEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + bool IsForbidden { get; } + + bool IsNotFound { get; } + + bool IsConflict { get; } + + bool IsBadGateway { get; } + + string? OkContent { get; } + + string? BadRequestContent { get; } + + string? UnauthorizedContent { get; } + + string? ForbiddenContent { get; } + + string? NotFoundContent { get; } + + string? ConflictContent { get; } + + string? BadGatewayContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/PatchOrdersIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/PatchOrdersIdEndpoint.verified.cs new file mode 100644 index 00000000..4d823b95 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/PatchOrdersIdEndpoint.verified.cs @@ -0,0 +1,56 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Orders; + +/// +/// Client Endpoint. +/// Description: Update part of order by id. +/// Operation: PatchOrdersId. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class PatchOrdersIdEndpoint : IPatchOrdersIdEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public PatchOrdersIdEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + PatchOrdersIdParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/orders/{id}"); + requestBuilder.WithPathParameter("id", parameters.Id); + requestBuilder.WithHeaderParameter("myTestHeader", parameters.MyTestHeader); + requestBuilder.WithHeaderParameter("myTestHeaderBool", parameters.MyTestHeaderBool); + requestBuilder.WithHeaderParameter("myTestHeaderInt", parameters.MyTestHeaderInt); + requestBuilder.WithHeaderParameter("x-correlation-id", parameters.CorrelationId); + requestBuilder.WithBody(parameters.Request); + + using var requestMessage = requestBuilder.Build(HttpMethod.Patch); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + responseBuilder.AddErrorResponse(HttpStatusCode.Forbidden); + responseBuilder.AddErrorResponse(HttpStatusCode.NotFound); + responseBuilder.AddErrorResponse(HttpStatusCode.Conflict); + responseBuilder.AddErrorResponse(HttpStatusCode.BadGateway); + return await responseBuilder.BuildResponseAsync(x => new PatchOrdersIdEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/PatchOrdersIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/PatchOrdersIdEndpointResult.verified.cs new file mode 100644 index 00000000..3a3037a5 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/PatchOrdersIdEndpointResult.verified.cs @@ -0,0 +1,77 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Orders; + +/// +/// Client Endpoint result. +/// Description: Update part of order by id. +/// Operation: PatchOrdersId. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class PatchOrdersIdEndpointResult : EndpointResponse, IPatchOrdersIdEndpointResult +{ + public PatchOrdersIdEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public bool IsForbidden + => StatusCode == HttpStatusCode.Forbidden; + + public bool IsNotFound + => StatusCode == HttpStatusCode.NotFound; + + public bool IsConflict + => StatusCode == HttpStatusCode.Conflict; + + public bool IsBadGateway + => StatusCode == HttpStatusCode.BadGateway; + + public string? OkContent + => IsOk && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public string? BadRequestContent + => IsBadRequest && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public string? UnauthorizedContent + => IsUnauthorized && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); + + public string? ForbiddenContent + => IsForbidden && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsForbidden property first."); + + public string? NotFoundContent + => IsNotFound && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsNotFound property first."); + + public string? ConflictContent + => IsConflict && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsConflict property first."); + + public string? BadGatewayContent + => IsBadGateway && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadGateway property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/RouteWithDash/GetRouteWithDashEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/RouteWithDash/GetRouteWithDashEndpoint.verified.cs new file mode 100644 index 00000000..f2886c4a --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/RouteWithDash/GetRouteWithDashEndpoint.verified.cs @@ -0,0 +1,44 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.RouteWithDash; + +/// +/// Client Endpoint. +/// Description: Your GET endpoint. +/// Operation: GetRouteWithDash. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetRouteWithDashEndpoint : IGetRouteWithDashEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public GetRouteWithDashEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/route-with-dash"); + + using var requestMessage = requestBuilder.Build(HttpMethod.Get); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + return await responseBuilder.BuildResponseAsync(x => new GetRouteWithDashEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/RouteWithDash/GetRouteWithDashEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/RouteWithDash/GetRouteWithDashEndpointResult.verified.cs new file mode 100644 index 00000000..ab8004a3 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/RouteWithDash/GetRouteWithDashEndpointResult.verified.cs @@ -0,0 +1,37 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.RouteWithDash; + +/// +/// Client Endpoint result. +/// Description: Your GET endpoint. +/// Operation: GetRouteWithDash. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetRouteWithDashEndpointResult : EndpointResponse, IGetRouteWithDashEndpointResult +{ + public GetRouteWithDashEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public string? OkContent + => IsOk && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public string? UnauthorizedContent + => IsUnauthorized && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/RouteWithDash/Interfaces/IGetRouteWithDashEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/RouteWithDash/Interfaces/IGetRouteWithDashEndpoint.verified.cs new file mode 100644 index 00000000..b09d0422 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/RouteWithDash/Interfaces/IGetRouteWithDashEndpoint.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.RouteWithDash.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Your GET endpoint. +/// Operation: GetRouteWithDash. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetRouteWithDashEndpoint +{ + /// + /// Execute method. + /// + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/RouteWithDash/Interfaces/IGetRouteWithDashEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/RouteWithDash/Interfaces/IGetRouteWithDashEndpointResult.verified.cs new file mode 100644 index 00000000..1e519927 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/RouteWithDash/Interfaces/IGetRouteWithDashEndpointResult.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.RouteWithDash.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Your GET endpoint. +/// Operation: GetRouteWithDash. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetRouteWithDashEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsUnauthorized { get; } + + string? OkContent { get; } + + string? UnauthorizedContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Tasks/GetTasksEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Tasks/GetTasksEndpoint.verified.cs new file mode 100644 index 00000000..5a4eabd7 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Tasks/GetTasksEndpoint.verified.cs @@ -0,0 +1,44 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Tasks; + +/// +/// Client Endpoint. +/// Description: Returns tasks. +/// Operation: GetTasks. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetTasksEndpoint : IGetTasksEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public GetTasksEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/tasks"); + + using var requestMessage = requestBuilder.Build(HttpMethod.Get); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse>(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + return await responseBuilder.BuildResponseAsync(x => new GetTasksEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Tasks/GetTasksEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Tasks/GetTasksEndpointResult.verified.cs new file mode 100644 index 00000000..b21facc7 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Tasks/GetTasksEndpointResult.verified.cs @@ -0,0 +1,37 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Tasks; + +/// +/// Client Endpoint result. +/// Description: Returns tasks. +/// Operation: GetTasks. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetTasksEndpointResult : EndpointResponse, IGetTasksEndpointResult +{ + public GetTasksEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public IEnumerable OkContent + => IsOk && ContentObject is IEnumerable result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public string? UnauthorizedContent + => IsUnauthorized && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Tasks/Interfaces/IGetTasksEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Tasks/Interfaces/IGetTasksEndpoint.verified.cs new file mode 100644 index 00000000..4070bc86 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Tasks/Interfaces/IGetTasksEndpoint.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Tasks.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Returns tasks. +/// Operation: GetTasks. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetTasksEndpoint +{ + /// + /// Execute method. + /// + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Tasks/Interfaces/IGetTasksEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Tasks/Interfaces/IGetTasksEndpointResult.verified.cs new file mode 100644 index 00000000..d5925ccf --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Tasks/Interfaces/IGetTasksEndpointResult.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Tasks.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Returns tasks. +/// Operation: GetTasks. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetTasksEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsUnauthorized { get; } + + IEnumerable OkContent { get; } + + string? UnauthorizedContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/DeleteUserByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/DeleteUserByIdEndpoint.verified.cs new file mode 100644 index 00000000..dd2ab217 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/DeleteUserByIdEndpoint.verified.cs @@ -0,0 +1,49 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users; + +/// +/// Client Endpoint. +/// Description: Delete user by id. +/// Operation: DeleteUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class DeleteUserByIdEndpoint : IDeleteUserByIdEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public DeleteUserByIdEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + DeleteUserByIdParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/users/{id}"); + requestBuilder.WithPathParameter("id", parameters.Id); + + using var requestMessage = requestBuilder.Build(HttpMethod.Delete); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + responseBuilder.AddErrorResponse(HttpStatusCode.NotFound); + responseBuilder.AddErrorResponse(HttpStatusCode.Conflict); + return await responseBuilder.BuildResponseAsync(x => new DeleteUserByIdEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/DeleteUserByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/DeleteUserByIdEndpointResult.verified.cs new file mode 100644 index 00000000..c7b575ce --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/DeleteUserByIdEndpointResult.verified.cs @@ -0,0 +1,61 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users; + +/// +/// Client Endpoint result. +/// Description: Delete user by id. +/// Operation: DeleteUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class DeleteUserByIdEndpointResult : EndpointResponse, IDeleteUserByIdEndpointResult +{ + public DeleteUserByIdEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public bool IsNotFound + => StatusCode == HttpStatusCode.NotFound; + + public bool IsConflict + => StatusCode == HttpStatusCode.Conflict; + + public string? OkContent + => IsOk && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public string? BadRequestContent + => IsBadRequest && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public string? UnauthorizedContent + => IsUnauthorized && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); + + public string? NotFoundContent + => IsNotFound && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsNotFound property first."); + + public string? ConflictContent + => IsConflict && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsConflict property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/GetUserByEmailEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/GetUserByEmailEndpoint.verified.cs new file mode 100644 index 00000000..e96c9c60 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/GetUserByEmailEndpoint.verified.cs @@ -0,0 +1,49 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users; + +/// +/// Client Endpoint. +/// Description: Get user by email. +/// Operation: GetUserByEmail. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetUserByEmailEndpoint : IGetUserByEmailEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public GetUserByEmailEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + GetUserByEmailParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/users/email"); + requestBuilder.WithQueryParameter("email", parameters.Email); + + using var requestMessage = requestBuilder.Build(HttpMethod.Get); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + responseBuilder.AddErrorResponse(HttpStatusCode.NotFound); + responseBuilder.AddErrorResponse(HttpStatusCode.Conflict); + return await responseBuilder.BuildResponseAsync(x => new GetUserByEmailEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/GetUserByEmailEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/GetUserByEmailEndpointResult.verified.cs new file mode 100644 index 00000000..a426c461 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/GetUserByEmailEndpointResult.verified.cs @@ -0,0 +1,61 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users; + +/// +/// Client Endpoint result. +/// Description: Get user by email. +/// Operation: GetUserByEmail. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetUserByEmailEndpointResult : EndpointResponse, IGetUserByEmailEndpointResult +{ + public GetUserByEmailEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public bool IsNotFound + => StatusCode == HttpStatusCode.NotFound; + + public bool IsConflict + => StatusCode == HttpStatusCode.Conflict; + + public User OkContent + => IsOk && ContentObject is User result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public string? BadRequestContent + => IsBadRequest && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public string? UnauthorizedContent + => IsUnauthorized && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); + + public string? NotFoundContent + => IsNotFound && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsNotFound property first."); + + public string? ConflictContent + => IsConflict && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsConflict property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/GetUserByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/GetUserByIdEndpoint.verified.cs new file mode 100644 index 00000000..c01861d9 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/GetUserByIdEndpoint.verified.cs @@ -0,0 +1,49 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users; + +/// +/// Client Endpoint. +/// Description: Get user by id. +/// Operation: GetUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetUserByIdEndpoint : IGetUserByIdEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public GetUserByIdEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + GetUserByIdParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/users/{id}"); + requestBuilder.WithPathParameter("id", parameters.Id); + + using var requestMessage = requestBuilder.Build(HttpMethod.Get); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + responseBuilder.AddErrorResponse(HttpStatusCode.NotFound); + responseBuilder.AddErrorResponse(HttpStatusCode.Conflict); + return await responseBuilder.BuildResponseAsync(x => new GetUserByIdEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/GetUserByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/GetUserByIdEndpointResult.verified.cs new file mode 100644 index 00000000..1723b875 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/GetUserByIdEndpointResult.verified.cs @@ -0,0 +1,61 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users; + +/// +/// Client Endpoint result. +/// Description: Get user by id. +/// Operation: GetUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetUserByIdEndpointResult : EndpointResponse, IGetUserByIdEndpointResult +{ + public GetUserByIdEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public bool IsNotFound + => StatusCode == HttpStatusCode.NotFound; + + public bool IsConflict + => StatusCode == HttpStatusCode.Conflict; + + public User OkContent + => IsOk && ContentObject is User result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public string? BadRequestContent + => IsBadRequest && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public string? UnauthorizedContent + => IsUnauthorized && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); + + public string? NotFoundContent + => IsNotFound && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsNotFound property first."); + + public string? ConflictContent + => IsConflict && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsConflict property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/GetUsersEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/GetUsersEndpoint.verified.cs new file mode 100644 index 00000000..63c13304 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/GetUsersEndpoint.verified.cs @@ -0,0 +1,45 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users; + +/// +/// Client Endpoint. +/// Description: Get all users. +/// Operation: GetUsers. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetUsersEndpoint : IGetUsersEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public GetUsersEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/users"); + + using var requestMessage = requestBuilder.Build(HttpMethod.Get); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse>(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + responseBuilder.AddErrorResponse(HttpStatusCode.Conflict); + return await responseBuilder.BuildResponseAsync(x => new GetUsersEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/GetUsersEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/GetUsersEndpointResult.verified.cs new file mode 100644 index 00000000..9b404e9b --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/GetUsersEndpointResult.verified.cs @@ -0,0 +1,45 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users; + +/// +/// Client Endpoint result. +/// Description: Get all users. +/// Operation: GetUsers. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetUsersEndpointResult : EndpointResponse, IGetUsersEndpointResult +{ + public GetUsersEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public bool IsConflict + => StatusCode == HttpStatusCode.Conflict; + + public IEnumerable OkContent + => IsOk && ContentObject is IEnumerable result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public string? UnauthorizedContent + => IsUnauthorized && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); + + public string? ConflictContent + => IsConflict && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsConflict property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IDeleteUserByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IDeleteUserByIdEndpoint.verified.cs new file mode 100644 index 00000000..396bac11 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IDeleteUserByIdEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Delete user by id. +/// Operation: DeleteUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IDeleteUserByIdEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + DeleteUserByIdParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IDeleteUserByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IDeleteUserByIdEndpointResult.verified.cs new file mode 100644 index 00000000..bb23ee5f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IDeleteUserByIdEndpointResult.verified.cs @@ -0,0 +1,37 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Delete user by id. +/// Operation: DeleteUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IDeleteUserByIdEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + bool IsNotFound { get; } + + bool IsConflict { get; } + + string? OkContent { get; } + + string? BadRequestContent { get; } + + string? UnauthorizedContent { get; } + + string? NotFoundContent { get; } + + string? ConflictContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUserByEmailEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUserByEmailEndpoint.verified.cs new file mode 100644 index 00000000..a2f1f173 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUserByEmailEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Get user by email. +/// Operation: GetUserByEmail. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetUserByEmailEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + GetUserByEmailParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUserByEmailEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUserByEmailEndpointResult.verified.cs new file mode 100644 index 00000000..b259d9db --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUserByEmailEndpointResult.verified.cs @@ -0,0 +1,37 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Get user by email. +/// Operation: GetUserByEmail. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetUserByEmailEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + bool IsNotFound { get; } + + bool IsConflict { get; } + + User OkContent { get; } + + string? BadRequestContent { get; } + + string? UnauthorizedContent { get; } + + string? NotFoundContent { get; } + + string? ConflictContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUserByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUserByIdEndpoint.verified.cs new file mode 100644 index 00000000..219df7a0 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUserByIdEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Get user by id. +/// Operation: GetUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetUserByIdEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + GetUserByIdParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUserByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUserByIdEndpointResult.verified.cs new file mode 100644 index 00000000..88cc434a --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUserByIdEndpointResult.verified.cs @@ -0,0 +1,37 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Get user by id. +/// Operation: GetUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetUserByIdEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + bool IsNotFound { get; } + + bool IsConflict { get; } + + User OkContent { get; } + + string? BadRequestContent { get; } + + string? UnauthorizedContent { get; } + + string? NotFoundContent { get; } + + string? ConflictContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUsersEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUsersEndpoint.verified.cs new file mode 100644 index 00000000..903f6b88 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUsersEndpoint.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Get all users. +/// Operation: GetUsers. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetUsersEndpoint +{ + /// + /// Execute method. + /// + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUsersEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUsersEndpointResult.verified.cs new file mode 100644 index 00000000..0484e88b --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUsersEndpointResult.verified.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Get all users. +/// Operation: GetUsers. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetUsersEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsUnauthorized { get; } + + bool IsConflict { get; } + + IEnumerable OkContent { get; } + + string? UnauthorizedContent { get; } + + string? ConflictContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IPostUserEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IPostUserEndpoint.verified.cs new file mode 100644 index 00000000..ab621f84 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IPostUserEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Create a new user. +/// Operation: PostUser. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IPostUserEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + PostUserParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IPostUserEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IPostUserEndpointResult.verified.cs new file mode 100644 index 00000000..3db77b1c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IPostUserEndpointResult.verified.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Create a new user. +/// Operation: PostUser. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IPostUserEndpointResult : IEndpointResponse +{ + + bool IsCreated { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + bool IsConflict { get; } + + string? CreatedContent { get; } + + string? BadRequestContent { get; } + + string? UnauthorizedContent { get; } + + string? ConflictContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IUpdateMyTestGenderEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IUpdateMyTestGenderEndpoint.verified.cs new file mode 100644 index 00000000..c4659eb5 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IUpdateMyTestGenderEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Update gender on a user. +/// Operation: UpdateMyTestGender. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IUpdateMyTestGenderEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + UpdateMyTestGenderParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IUpdateMyTestGenderEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IUpdateMyTestGenderEndpointResult.verified.cs new file mode 100644 index 00000000..ef3e9b2f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IUpdateMyTestGenderEndpointResult.verified.cs @@ -0,0 +1,37 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Update gender on a user. +/// Operation: UpdateMyTestGender. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IUpdateMyTestGenderEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + bool IsNotFound { get; } + + bool IsConflict { get; } + + string? OkContent { get; } + + string? BadRequestContent { get; } + + string? UnauthorizedContent { get; } + + string? NotFoundContent { get; } + + string? ConflictContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IUpdateUserByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IUpdateUserByIdEndpoint.verified.cs new file mode 100644 index 00000000..9584631c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IUpdateUserByIdEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Update user by id. +/// Operation: UpdateUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IUpdateUserByIdEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + UpdateUserByIdParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IUpdateUserByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IUpdateUserByIdEndpointResult.verified.cs new file mode 100644 index 00000000..d4554366 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IUpdateUserByIdEndpointResult.verified.cs @@ -0,0 +1,37 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Update user by id. +/// Operation: UpdateUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IUpdateUserByIdEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + bool IsNotFound { get; } + + bool IsConflict { get; } + + string? OkContent { get; } + + string? BadRequestContent { get; } + + string? UnauthorizedContent { get; } + + string? NotFoundContent { get; } + + string? ConflictContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/PostUserEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/PostUserEndpoint.verified.cs new file mode 100644 index 00000000..36e77b77 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/PostUserEndpoint.verified.cs @@ -0,0 +1,48 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users; + +/// +/// Client Endpoint. +/// Description: Create a new user. +/// Operation: PostUser. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class PostUserEndpoint : IPostUserEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public PostUserEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + PostUserParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/users"); + requestBuilder.WithBody(parameters.Request); + + using var requestMessage = requestBuilder.Build(HttpMethod.Post); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddErrorResponse(HttpStatusCode.Created); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + responseBuilder.AddErrorResponse(HttpStatusCode.Conflict); + return await responseBuilder.BuildResponseAsync(x => new PostUserEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/PostUserEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/PostUserEndpointResult.verified.cs new file mode 100644 index 00000000..785203b8 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/PostUserEndpointResult.verified.cs @@ -0,0 +1,53 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users; + +/// +/// Client Endpoint result. +/// Description: Create a new user. +/// Operation: PostUser. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class PostUserEndpointResult : EndpointResponse, IPostUserEndpointResult +{ + public PostUserEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsCreated + => StatusCode == HttpStatusCode.Created; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public bool IsConflict + => StatusCode == HttpStatusCode.Conflict; + + public string? CreatedContent + => IsCreated && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsCreated property first."); + + public string? BadRequestContent + => IsBadRequest && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public string? UnauthorizedContent + => IsUnauthorized && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); + + public string? ConflictContent + => IsConflict && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsConflict property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/UpdateMyTestGenderEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/UpdateMyTestGenderEndpoint.verified.cs new file mode 100644 index 00000000..c5fee937 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/UpdateMyTestGenderEndpoint.verified.cs @@ -0,0 +1,51 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users; + +/// +/// Client Endpoint. +/// Description: Update gender on a user. +/// Operation: UpdateMyTestGender. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateMyTestGenderEndpoint : IUpdateMyTestGenderEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public UpdateMyTestGenderEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + UpdateMyTestGenderParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/users/{id}/gender"); + requestBuilder.WithPathParameter("id", parameters.Id); + requestBuilder.WithQueryParameter("genderParam", parameters.GenderParam); + requestBuilder.WithBody(parameters.Request); + + using var requestMessage = requestBuilder.Build(HttpMethod.Put); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + responseBuilder.AddErrorResponse(HttpStatusCode.NotFound); + responseBuilder.AddErrorResponse(HttpStatusCode.Conflict); + return await responseBuilder.BuildResponseAsync(x => new UpdateMyTestGenderEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/UpdateMyTestGenderEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/UpdateMyTestGenderEndpointResult.verified.cs new file mode 100644 index 00000000..f9ad2ca5 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/UpdateMyTestGenderEndpointResult.verified.cs @@ -0,0 +1,61 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users; + +/// +/// Client Endpoint result. +/// Description: Update gender on a user. +/// Operation: UpdateMyTestGender. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateMyTestGenderEndpointResult : EndpointResponse, IUpdateMyTestGenderEndpointResult +{ + public UpdateMyTestGenderEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public bool IsNotFound + => StatusCode == HttpStatusCode.NotFound; + + public bool IsConflict + => StatusCode == HttpStatusCode.Conflict; + + public string? OkContent + => IsOk && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public string? BadRequestContent + => IsBadRequest && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public string? UnauthorizedContent + => IsUnauthorized && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); + + public string? NotFoundContent + => IsNotFound && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsNotFound property first."); + + public string? ConflictContent + => IsConflict && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsConflict property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/UpdateUserByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/UpdateUserByIdEndpoint.verified.cs new file mode 100644 index 00000000..899d3b17 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/UpdateUserByIdEndpoint.verified.cs @@ -0,0 +1,50 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users; + +/// +/// Client Endpoint. +/// Description: Update user by id. +/// Operation: UpdateUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateUserByIdEndpoint : IUpdateUserByIdEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public UpdateUserByIdEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + UpdateUserByIdParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/users/{id}"); + requestBuilder.WithPathParameter("id", parameters.Id); + requestBuilder.WithBody(parameters.Request); + + using var requestMessage = requestBuilder.Build(HttpMethod.Put); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + responseBuilder.AddErrorResponse(HttpStatusCode.NotFound); + responseBuilder.AddErrorResponse(HttpStatusCode.Conflict); + return await responseBuilder.BuildResponseAsync(x => new UpdateUserByIdEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/UpdateUserByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/UpdateUserByIdEndpointResult.verified.cs new file mode 100644 index 00000000..1cabdbf2 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/UpdateUserByIdEndpointResult.verified.cs @@ -0,0 +1,61 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users; + +/// +/// Client Endpoint result. +/// Description: Update user by id. +/// Operation: UpdateUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateUserByIdEndpointResult : EndpointResponse, IUpdateUserByIdEndpointResult +{ + public UpdateUserByIdEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public bool IsNotFound + => StatusCode == HttpStatusCode.NotFound; + + public bool IsConflict + => StatusCode == HttpStatusCode.Conflict; + + public string? OkContent + => IsOk && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public string? BadRequestContent + => IsBadRequest && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public string? UnauthorizedContent + => IsUnauthorized && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); + + public string? NotFoundContent + => IsNotFound && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsNotFound property first."); + + public string? ConflictContent + => IsConflict && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsConflict property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/GlobalUsings.verified.cs new file mode 100644 index 00000000..b364f161 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WOPD/src/DemoSample.ApiClient.Generated/GlobalUsings.verified.cs @@ -0,0 +1,35 @@ +global using System; +global using System.CodeDom.Compiler; +global using System.Collections.Generic; +global using System.ComponentModel.DataAnnotations; +global using System.Linq; +global using System.Net; +global using System.Net.Http; +global using System.Threading; +global using System.Threading.Tasks; + +global using Atc.Rest.Client; +global using Atc.Rest.Client.Builder; +global using Atc.Rest.Results; + +global using DemoSample.ApiClient.Generated.Contracts; +global using DemoSample.ApiClient.Generated.Contracts.Accounts; +global using DemoSample.ApiClient.Generated.Contracts.Addresses; +global using DemoSample.ApiClient.Generated.Contracts.EventArgs; +global using DemoSample.ApiClient.Generated.Contracts.Files; +global using DemoSample.ApiClient.Generated.Contracts.Items; +global using DemoSample.ApiClient.Generated.Contracts.Orders; +global using DemoSample.ApiClient.Generated.Contracts.Tasks; +global using DemoSample.ApiClient.Generated.Contracts.Users; +global using DemoSample.ApiClient.Generated.Endpoints.Accounts.Interfaces; +global using DemoSample.ApiClient.Generated.Endpoints.Addresses.Interfaces; +global using DemoSample.ApiClient.Generated.Endpoints.EventArgs.Interfaces; +global using DemoSample.ApiClient.Generated.Endpoints.Files.Interfaces; +global using DemoSample.ApiClient.Generated.Endpoints.Items.Interfaces; +global using DemoSample.ApiClient.Generated.Endpoints.Orders.Interfaces; +global using DemoSample.ApiClient.Generated.Endpoints.RouteWithDash.Interfaces; +global using DemoSample.ApiClient.Generated.Endpoints.Tasks.Interfaces; +global using DemoSample.ApiClient.Generated.Endpoints.Users.Interfaces; + +global using Microsoft.AspNetCore.Http; +global using Microsoft.AspNetCore.Mvc; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Accounts/RequestParameters/SetAccountNameParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Accounts/RequestParameters/SetAccountNameParameters.verified.cs new file mode 100644 index 00000000..31ea3df5 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Accounts/RequestParameters/SetAccountNameParameters.verified.cs @@ -0,0 +1,32 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Accounts; + +/// +/// Parameters for operation request. +/// Description: Set name of account. +/// Operation: SetAccountName. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class SetAccountNameParameters +{ + /// + /// The accountId. + /// + [Required] + public Guid AccountId { get; set; } + + /// + /// UpdateAccountRequest. + /// + [Required] + public UpdateAccountRequest Request { get; set; } + + /// + public override string ToString() + => $"{nameof(AccountId)}: {AccountId}, {nameof(Request)}: ({Request})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Accounts/RequestParameters/UpdateAccountNameParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Accounts/RequestParameters/UpdateAccountNameParameters.verified.cs new file mode 100644 index 00000000..6c39c530 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Accounts/RequestParameters/UpdateAccountNameParameters.verified.cs @@ -0,0 +1,31 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Accounts; + +/// +/// Parameters for operation request. +/// Description: Update name of account. +/// Operation: UpdateAccountName. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateAccountNameParameters +{ + /// + /// The accountId. + /// + [Required] + public Guid AccountId { get; set; } + + /// + /// The account name. + /// + public string Name { get; set; } + + /// + public override string ToString() + => $"{nameof(AccountId)}: {AccountId}, {nameof(Name)}: {Name}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Accounts/UpdateAccountRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Accounts/UpdateAccountRequest.verified.cs new file mode 100644 index 00000000..163eeb73 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Accounts/UpdateAccountRequest.verified.cs @@ -0,0 +1,20 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Accounts; + +/// +/// UpdateAccountRequest. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateAccountRequest +{ + public string Name { get; set; } + + /// + public override string ToString() + => $"{nameof(Name)}: {Name}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Addresses/RequestParameters/GetAddressesByPostalCodesParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Addresses/RequestParameters/GetAddressesByPostalCodesParameters.verified.cs new file mode 100644 index 00000000..5aa0af72 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Addresses/RequestParameters/GetAddressesByPostalCodesParameters.verified.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Addresses; + +/// +/// Parameters for operation request. +/// Description: Get addresses by postal code. +/// Operation: GetAddressesByPostalCodes. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetAddressesByPostalCodesParameters +{ + /// + /// The postalCode to limit addresses on. + /// + [Required] + public string PostalCode { get; set; } + + /// + public override string ToString() + => $"{nameof(PostalCode)}: {PostalCode}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/EventArgs/EventArgs.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/EventArgs/EventArgs.verified.cs new file mode 100644 index 00000000..1454afa6 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/EventArgs/EventArgs.verified.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.EventArgs; + +/// +/// EventArgs. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class EventArgs +{ + public Guid Id { get; set; } + + public string EventName { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(EventName)}: {EventName}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/EventArgs/RequestParameters/GetEventArgByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/EventArgs/RequestParameters/GetEventArgByIdParameters.verified.cs new file mode 100644 index 00000000..b03cf8e9 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/EventArgs/RequestParameters/GetEventArgByIdParameters.verified.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.EventArgs; + +/// +/// Parameters for operation request. +/// Description: Get EventArgs By Id. +/// Operation: GetEventArgById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetEventArgByIdParameters +{ + /// + /// The id of the eventArgs. + /// + [Required] + public string Id { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Files/FileAsFormDataRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Files/FileAsFormDataRequest.verified.cs new file mode 100644 index 00000000..f20ba628 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Files/FileAsFormDataRequest.verified.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Files; + +/// +/// FileAsFormDataRequest. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class FileAsFormDataRequest +{ + [Required] + public string ItemName { get; set; } + + public IFormFile? File { get; set; } + + [Required] + public List Items { get; set; } + + /// + public override string ToString() + => $"{nameof(ItemName)}: {ItemName}, {nameof(File)}: {File}, {nameof(Items)}.Count: {Items?.Count ?? 0}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Files/FilesAsFormDataRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Files/FilesAsFormDataRequest.verified.cs new file mode 100644 index 00000000..b90e32ab --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Files/FilesAsFormDataRequest.verified.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Files; + +/// +/// FilesAsFormDataRequest. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class FilesAsFormDataRequest +{ + /// + /// A list of File(s). + /// + public List Files { get; set; } = new List(); + + /// + public override string ToString() + => $"{nameof(Files)}.Count: {Files?.Count ?? 0}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Files/RequestParameters/GetFileByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Files/RequestParameters/GetFileByIdParameters.verified.cs new file mode 100644 index 00000000..f97b2e7c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Files/RequestParameters/GetFileByIdParameters.verified.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Files; + +/// +/// Parameters for operation request. +/// Description: Get File By Id. +/// Operation: GetFileById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetFileByIdParameters +{ + /// + /// The file id. + /// + [Required] + public string Id { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Files/RequestParameters/UploadMultiFilesAsFormDataParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Files/RequestParameters/UploadMultiFilesAsFormDataParameters.verified.cs new file mode 100644 index 00000000..50defdf9 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Files/RequestParameters/UploadMultiFilesAsFormDataParameters.verified.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Files; + +/// +/// Parameters for operation request. +/// Description: Upload multi files as form data. +/// Operation: UploadMultiFilesAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UploadMultiFilesAsFormDataParameters +{ + [Required] + public List Request { get; set; } = new List(); + + /// + public override string ToString() + => $"{nameof(Request)}.Count: {Request?.Count ?? 0}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Files/RequestParameters/UploadSingleFileAsFormDataParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Files/RequestParameters/UploadSingleFileAsFormDataParameters.verified.cs new file mode 100644 index 00000000..ee44b8a5 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Files/RequestParameters/UploadSingleFileAsFormDataParameters.verified.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Files; + +/// +/// Parameters for operation request. +/// Description: Upload a file as OctetStream. +/// Operation: UploadSingleFileAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UploadSingleFileAsFormDataParameters +{ + [Required] + public IFormFile Request { get; set; } + + /// + public override string ToString() + => $"{nameof(Request)}: ({Request})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Files/RequestParameters/UploadSingleObjectWithFileAsFormDataParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Files/RequestParameters/UploadSingleObjectWithFileAsFormDataParameters.verified.cs new file mode 100644 index 00000000..5be9867b --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Files/RequestParameters/UploadSingleObjectWithFileAsFormDataParameters.verified.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Files; + +/// +/// Parameters for operation request. +/// Description: Upload a file as FormData. +/// Operation: UploadSingleObjectWithFileAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UploadSingleObjectWithFileAsFormDataParameters +{ + /// + /// FileAsFormDataRequest. + /// + [Required] + public FileAsFormDataRequest Request { get; set; } + + /// + public override string ToString() + => $"{nameof(Request)}: ({Request})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Files/RequestParameters/UploadSingleObjectWithFilesAsFormDataParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Files/RequestParameters/UploadSingleObjectWithFilesAsFormDataParameters.verified.cs new file mode 100644 index 00000000..629a8608 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Files/RequestParameters/UploadSingleObjectWithFilesAsFormDataParameters.verified.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Files; + +/// +/// Parameters for operation request. +/// Description: Upload files as FormData. +/// Operation: UploadSingleObjectWithFilesAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UploadSingleObjectWithFilesAsFormDataParameters +{ + /// + /// FilesAsFormDataRequest. + /// + [Required] + public FilesAsFormDataRequest Request { get; set; } + + /// + public override string ToString() + => $"{nameof(Request)}: ({Request})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Items/CreateItemRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Items/CreateItemRequest.verified.cs new file mode 100644 index 00000000..64c9e95e --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Items/CreateItemRequest.verified.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Items; + +/// +/// CreateItemRequest. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class CreateItemRequest +{ + /// + /// Item. + /// + [Required] + public Item Item { get; set; } + + /// + /// A list of Item. + /// + [Required] + public List MyItems { get; set; } + + /// + public override string ToString() + => $"{nameof(Item)}: ({Item}), {nameof(MyItems)}.Count: {MyItems?.Count ?? 0}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Items/Item.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Items/Item.verified.cs new file mode 100644 index 00000000..164a73c4 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Items/Item.verified.cs @@ -0,0 +1,21 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Items; + +/// +/// Item. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Item +{ + [Required] + public string Name { get; set; } + + /// + public override string ToString() + => $"{nameof(Name)}: {Name}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Items/RequestParameters/CreateItemParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Items/RequestParameters/CreateItemParameters.verified.cs new file mode 100644 index 00000000..9066fd24 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Items/RequestParameters/CreateItemParameters.verified.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Items; + +/// +/// Parameters for operation request. +/// Description: Create a new item. +/// Operation: CreateItem. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class CreateItemParameters +{ + /// + /// CreateItemRequest. + /// + [Required] + public CreateItemRequest Request { get; set; } + + /// + public override string ToString() + => $"{nameof(Request)}: ({Request})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Items/RequestParameters/UpdateItemParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Items/RequestParameters/UpdateItemParameters.verified.cs new file mode 100644 index 00000000..d8070629 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Items/RequestParameters/UpdateItemParameters.verified.cs @@ -0,0 +1,32 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Items; + +/// +/// Parameters for operation request. +/// Description: Updates an item. +/// Operation: UpdateItem. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateItemParameters +{ + /// + /// The id of the order. + /// + [Required] + public Guid Id { get; set; } + + /// + /// UpdateItemRequest. + /// + [Required] + public UpdateItemRequest Request { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(Request)}: ({Request})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Items/UpdateItemRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Items/UpdateItemRequest.verified.cs new file mode 100644 index 00000000..381c4829 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Items/UpdateItemRequest.verified.cs @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Items; + +/// +/// UpdateItemRequest. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateItemRequest +{ + /// + /// Item. + /// + [Required] + public Item Item { get; set; } + + /// + public override string ToString() + => $"{nameof(Item)}: ({Item})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Orders/Order.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Orders/Order.verified.cs new file mode 100644 index 00000000..69a922e9 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Orders/Order.verified.cs @@ -0,0 +1,79 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Orders; + +/// +/// A single order. +/// Hallo description with multiline and no ending dot. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Order +{ + public Guid Id { get; set; } + + public string Description { get; set; } + + public DateTimeOffset MyTime { get; set; } + + /// + /// Undefined description. + /// + /// + /// Email validation being enforced. + /// + [EmailAddress] + public string MyEmail { get; set; } = "a@a.com"; + + public DateTimeOffset? MyNullableDateTime { get; set; } + + public DateTimeOffset MyDateTime { get; set; } + + [Range(1.1, 20.2)] + public double MyNumber { get; set; } + + [Range(-2147483648, 50)] + public int MyInteger { get; set; } = 15; + + /// + /// MyBool is great. + /// + public bool MyBool { get; set; } + + /// + /// This is the good uri :-). + /// + /// + /// Url validation being enforced. + /// + [Uri] + public Uri MyUri { get; set; } + + /// + /// Undefined description. + /// + /// + /// This string should be base64-encoded. + /// + public string MyByte { get; set; } + + /// + /// Hallo myStringList desc :-). + /// + public List MyStringList { get; set; } = new List(); + + [Range(10, 2147483647)] + public long MyLong { get; set; } + + /// + /// Address. + /// + public Address DeliveryAddress { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(Description)}: {Description}, {nameof(MyTime)}: ({MyTime}), {nameof(MyEmail)}: {MyEmail}, {nameof(MyNullableDateTime)}: ({MyNullableDateTime}), {nameof(MyDateTime)}: ({MyDateTime}), {nameof(MyNumber)}: {MyNumber}, {nameof(MyInteger)}: {MyInteger}, {nameof(MyBool)}: {MyBool}, {nameof(MyUri)}: ({MyUri}), {nameof(MyByte)}: {MyByte}, {nameof(MyStringList)}.Count: {MyStringList?.Count ?? 0}, {nameof(MyLong)}: {MyLong}, {nameof(DeliveryAddress)}: ({DeliveryAddress})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Orders/RequestParameters/GetOrderByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Orders/RequestParameters/GetOrderByIdParameters.verified.cs new file mode 100644 index 00000000..230a5fa8 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Orders/RequestParameters/GetOrderByIdParameters.verified.cs @@ -0,0 +1,35 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Orders; + +/// +/// Parameters for operation request. +/// Description: Get order by id. +/// Operation: GetOrderById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetOrderByIdParameters +{ + /// + /// The id of the order. + /// + [Required] + public Guid Id { get; set; } + + /// + /// The email for filter orders to retrieve. + /// + /// + /// Email validation being enforced. + /// + [EmailAddress] + public string? MyEmail { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(MyEmail)}: {MyEmail}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Orders/RequestParameters/GetOrdersParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Orders/RequestParameters/GetOrdersParameters.verified.cs new file mode 100644 index 00000000..d69b071b --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Orders/RequestParameters/GetOrdersParameters.verified.cs @@ -0,0 +1,48 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Orders; + +/// +/// Parameters for operation request. +/// Description: Get orders. +/// Operation: GetOrders. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetOrdersParameters +{ + /// + /// The numbers of items to return. + /// + [Required] + [Range(1, 100)] + public int PageSize { get; set; } = 10; + + /// + /// The number of items to skip before starting to collect the result set. + /// + [Range(0, 2147483647)] + public int PageIndex { get; set; } = 0; + + /// + /// The query string. + /// + public string? QueryString { get; set; } + + /// + /// The query array of string. + /// + public List QueryStringArray { get; set; } = new List(); + + /// + /// The continuation token. + /// + public string? ContinuationToken { get; set; } + + /// + public override string ToString() + => $"{nameof(PageSize)}: {PageSize}, {nameof(PageIndex)}: {PageIndex}, {nameof(QueryString)}: {QueryString}, {nameof(QueryStringArray)}.Count: {QueryStringArray?.Count ?? 0}, {nameof(ContinuationToken)}: {ContinuationToken}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Orders/RequestParameters/PatchOrdersIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Orders/RequestParameters/PatchOrdersIdParameters.verified.cs new file mode 100644 index 00000000..d88c8869 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Orders/RequestParameters/PatchOrdersIdParameters.verified.cs @@ -0,0 +1,56 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Orders; + +/// +/// Parameters for operation request. +/// Description: Update part of order by id. +/// Operation: PatchOrdersId. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class PatchOrdersIdParameters +{ + /// + /// The id of the order. + /// + [Required] + public Guid Id { get; set; } + + /// + /// The myTestHeader special key. + /// + [Required] + public string MyTestHeader { get; set; } + + /// + /// The myTestHeaderBool special key. + /// + [Required] + public bool MyTestHeaderBool { get; set; } + + /// + /// The myTestHeaderInt special key. + /// + [Required] + public int MyTestHeaderInt { get; set; } + + /// + /// The correlationId. + /// + [Required] + public string CorrelationId { get; set; } + + /// + /// Request to update an order. + /// + [Required] + public UpdateOrderRequest Request { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(MyTestHeader)}: {MyTestHeader}, {nameof(MyTestHeaderBool)}: {MyTestHeaderBool}, {nameof(MyTestHeaderInt)}: {MyTestHeaderInt}, {nameof(CorrelationId)}: {CorrelationId}, {nameof(Request)}: ({Request})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Orders/UpdateOrderRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Orders/UpdateOrderRequest.verified.cs new file mode 100644 index 00000000..7575954b --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Orders/UpdateOrderRequest.verified.cs @@ -0,0 +1,28 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Orders; + +/// +/// Request to update an order. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateOrderRequest +{ + /// + /// Undefined description. + /// + /// + /// Email validation being enforced. + /// + [Required] + [EmailAddress] + public string MyEmail { get; set; } + + /// + public override string ToString() + => $"{nameof(MyEmail)}: {MyEmail}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Tasks/Task.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Tasks/Task.verified.cs new file mode 100644 index 00000000..5caa1907 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Tasks/Task.verified.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Tasks; + +/// +/// Describes a single task. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Task +{ + public Guid Id { get; set; } + + public string Name { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(Name)}: {Name}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Tasks/Tasks.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Tasks/Tasks.verified.cs new file mode 100644 index 00000000..9823d387 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Tasks/Tasks.verified.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Tasks; + +/// +/// Contains a list of Tasks. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Tasks +{ + /// + /// A list of Task. + /// + public List TaskList { get; set; } = new List(); + + /// + public override string ToString() + => $"{nameof(TaskList)}.Count: {TaskList?.Count ?? 0}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Users/CreateUserRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Users/CreateUserRequest.verified.cs new file mode 100644 index 00000000..b1e6b561 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Users/CreateUserRequest.verified.cs @@ -0,0 +1,65 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Users; + +/// +/// Request to create a user. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class CreateUserRequest +{ + [Required] + public string FirstName { get; set; } + + [Required] + public string LastName { get; set; } + + public DateTimeOffset? MyNullableDateTime { get; set; } + + [Required] + public DateTimeOffset MyDateTime { get; set; } + + /// + /// Undefined description. + /// + /// + /// Email validation being enforced. + /// + [Required] + [EmailAddress] + public string Email { get; set; } + + /// + /// Undefined description. + /// + /// + /// Url validation being enforced. + /// + [Uri] + public Uri Homepage { get; set; } + + /// + /// GenderType. + /// + [Required] + public GenderType Gender { get; set; } + + public Address? MyNullableAddress { get; set; } + + [Required] + public Dictionary Tags { get; set; } + + public Dictionary DesiredProperties1 { get; set; } + + public Dictionary? DesiredProperties2 { get; set; } + + public Dictionary? DesiredProperties3 { get; set; } + + /// + public override string ToString() + => $"{nameof(FirstName)}: {FirstName}, {nameof(LastName)}: {LastName}, {nameof(MyNullableDateTime)}: ({MyNullableDateTime}), {nameof(MyDateTime)}: ({MyDateTime}), {nameof(Email)}: {Email}, {nameof(Homepage)}: ({Homepage}), {nameof(Gender)}: {Gender}, {nameof(MyNullableAddress)}: ({MyNullableAddress}), {nameof(Tags)}: ({Tags}), {nameof(DesiredProperties1)}: ({DesiredProperties1}), {nameof(DesiredProperties2)}: ({DesiredProperties2}), {nameof(DesiredProperties3)}: ({DesiredProperties3})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Users/RequestParameters/DeleteUserByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Users/RequestParameters/DeleteUserByIdParameters.verified.cs new file mode 100644 index 00000000..f7240e4a --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Users/RequestParameters/DeleteUserByIdParameters.verified.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Users; + +/// +/// Parameters for operation request. +/// Description: Delete user by id. +/// Operation: DeleteUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class DeleteUserByIdParameters +{ + /// + /// Id of the user. + /// + [Required] + public Guid Id { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Users/RequestParameters/GetUserByEmailParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Users/RequestParameters/GetUserByEmailParameters.verified.cs new file mode 100644 index 00000000..577ad2dd --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Users/RequestParameters/GetUserByEmailParameters.verified.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Users; + +/// +/// Parameters for operation request. +/// Description: Get user by email. +/// Operation: GetUserByEmail. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetUserByEmailParameters +{ + /// + /// The email of the user to retrieve. + /// + /// + /// Email validation being enforced. + /// + [Required] + [EmailAddress] + public string Email { get; set; } + + /// + public override string ToString() + => $"{nameof(Email)}: {Email}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Users/RequestParameters/GetUserByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Users/RequestParameters/GetUserByIdParameters.verified.cs new file mode 100644 index 00000000..e1536897 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Users/RequestParameters/GetUserByIdParameters.verified.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Users; + +/// +/// Parameters for operation request. +/// Description: Get user by id. +/// Operation: GetUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetUserByIdParameters +{ + /// + /// Id of the user. + /// + [Required] + public Guid Id { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Users/RequestParameters/PostUserParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Users/RequestParameters/PostUserParameters.verified.cs new file mode 100644 index 00000000..56209cc4 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Users/RequestParameters/PostUserParameters.verified.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Users; + +/// +/// Parameters for operation request. +/// Description: Create a new user. +/// Operation: PostUser. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class PostUserParameters +{ + /// + /// Request to create a user. + /// + [Required] + public CreateUserRequest Request { get; set; } + + /// + public override string ToString() + => $"{nameof(Request)}: ({Request})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Users/RequestParameters/UpdateMyTestGenderParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Users/RequestParameters/UpdateMyTestGenderParameters.verified.cs new file mode 100644 index 00000000..430b3183 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Users/RequestParameters/UpdateMyTestGenderParameters.verified.cs @@ -0,0 +1,37 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Users; + +/// +/// Parameters for operation request. +/// Description: Update gender on a user. +/// Operation: UpdateMyTestGender. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateMyTestGenderParameters +{ + /// + /// Id of the user. + /// + [Required] + public Guid Id { get; set; } + + /// + /// The gender to set on the user. + /// + public GenderType? GenderParam { get; set; } + + /// + /// Update test-gender Request. + /// + [Required] + public UpdateTestGenderRequest Request { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(GenderParam)}: {GenderParam}, {nameof(Request)}: ({Request})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Users/RequestParameters/UpdateUserByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Users/RequestParameters/UpdateUserByIdParameters.verified.cs new file mode 100644 index 00000000..759dd1f9 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Users/RequestParameters/UpdateUserByIdParameters.verified.cs @@ -0,0 +1,32 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Users; + +/// +/// Parameters for operation request. +/// Description: Update user by id. +/// Operation: UpdateUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateUserByIdParameters +{ + /// + /// Id of the user. + /// + [Required] + public Guid Id { get; set; } + + /// + /// Request to update a user. + /// + [Required] + public UpdateUserRequest Request { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(Request)}: ({Request})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Users/UpdateTestGenderRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Users/UpdateTestGenderRequest.verified.cs new file mode 100644 index 00000000..7d125ba7 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Users/UpdateTestGenderRequest.verified.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Users; + +/// +/// Update test-gender Request. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateTestGenderRequest +{ + /// + /// GenderType. + /// + public GenderType Gender { get; set; } + + /// + public override string ToString() + => $"{nameof(Gender)}: {Gender}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Users/UpdateUserRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Users/UpdateUserRequest.verified.cs new file mode 100644 index 00000000..3fc46ab8 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Users/UpdateUserRequest.verified.cs @@ -0,0 +1,36 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Users; + +/// +/// Request to update a user. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateUserRequest +{ + public string FirstName { get; set; } + + public string LastName { get; set; } + + /// + /// Undefined description. + /// + /// + /// Email validation being enforced. + /// + [EmailAddress] + public string Email { get; set; } + + /// + /// GenderType. + /// + public GenderType Gender { get; set; } + + /// + public override string ToString() + => $"{nameof(FirstName)}: {FirstName}, {nameof(LastName)}: {LastName}, {nameof(Email)}: {Email}, {nameof(Gender)}: {Gender}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Users/User.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Users/User.verified.cs new file mode 100644 index 00000000..09abb259 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Users/User.verified.cs @@ -0,0 +1,62 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Users; + +/// +/// A single user. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class User +{ + public Guid Id { get; set; } + + /// + /// GenderType. + /// + public GenderType Gender { get; set; } + + public string FirstName { get; set; } + + public string LastName { get; set; } + + /// + /// Undefined description. + /// + /// + /// Email validation being enforced. + /// + [EmailAddress] + public string Email { get; set; } + + /// + /// Undefined description. + /// + /// + /// Url validation being enforced. + /// + [Uri] + public Uri Homepage { get; set; } + + /// + /// ColorType. + /// + public ColorType Color { get; set; } + + /// + /// Address. + /// + public Address HomeAddress { get; set; } + + /// + /// Address. + /// + public Address CompanyAddress { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(Gender)}: {Gender}, {nameof(FirstName)}: {FirstName}, {nameof(LastName)}: {LastName}, {nameof(Email)}: {Email}, {nameof(Homepage)}: ({Homepage}), {nameof(Color)}: {Color}, {nameof(HomeAddress)}: ({HomeAddress}), {nameof(CompanyAddress)}: ({CompanyAddress})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Users/Users.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Users/Users.verified.cs new file mode 100644 index 00000000..1e46aa8f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/Users/Users.verified.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts.Users; + +/// +/// A list of users. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Users +{ + /// + /// A list of User. + /// + public List UserList { get; set; } = new List(); + + /// + public override string ToString() + => $"{nameof(UserList)}.Count: {UserList?.Count ?? 0}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/_EnumerationTypes/ColorType.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/_EnumerationTypes/ColorType.verified.cs new file mode 100644 index 00000000..38ad2c32 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/_EnumerationTypes/ColorType.verified.cs @@ -0,0 +1,21 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts; + +/// +/// Enumeration: ColorType. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +[Flags] +public enum ColorType +{ + None = 0, + Black = 1, + White = 2, + Yellow = 4, + Red = 8, +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/_EnumerationTypes/GenderType.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/_EnumerationTypes/GenderType.verified.cs new file mode 100644 index 00000000..ad9d533f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/_EnumerationTypes/GenderType.verified.cs @@ -0,0 +1,19 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts; + +/// +/// Enumeration: GenderType. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public enum GenderType +{ + None, + NonBinary, + Male, + Female, +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/_Shared/Address.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/_Shared/Address.verified.cs new file mode 100644 index 00000000..89a16764 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/_Shared/Address.verified.cs @@ -0,0 +1,32 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts; + +/// +/// Address. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Address +{ + [StringLength(255)] + public string StreetName { get; set; } + + public string StreetNumber { get; set; } + + public string PostalCode { get; set; } + + public string CityName { get; set; } + + /// + /// Country. + /// + public Country MyCountry { get; set; } + + /// + public override string ToString() + => $"{nameof(StreetName)}: {StreetName}, {nameof(StreetNumber)}: {StreetNumber}, {nameof(PostalCode)}: {PostalCode}, {nameof(CityName)}: {CityName}, {nameof(MyCountry)}: ({MyCountry})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/_Shared/Country.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/_Shared/Country.verified.cs new file mode 100644 index 00000000..b73439e0 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Contracts/_Shared/Country.verified.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Contracts; + +/// +/// Country. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Country +{ + [Required] + public string Name { get; set; } + + [Required] + [MinLength(2)] + [MaxLength(2)] + [RegularExpression("^[A-Za-z]{2}$")] + public string Alpha2Code { get; set; } + + [Required] + [MinLength(3)] + [MaxLength(3)] + [RegularExpression("^[A-Za-z]{3}$")] + public string Alpha3Code { get; set; } + + /// + public override string ToString() + => $"{nameof(Name)}: {Name}, {nameof(Alpha2Code)}: {Alpha2Code}, {nameof(Alpha3Code)}: {Alpha3Code}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Accounts/Interfaces/ISetAccountNameEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Accounts/Interfaces/ISetAccountNameEndpoint.verified.cs new file mode 100644 index 00000000..af9de0bd --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Accounts/Interfaces/ISetAccountNameEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Accounts.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Set name of account. +/// Operation: SetAccountName. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface ISetAccountNameEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + SetAccountNameParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Accounts/Interfaces/ISetAccountNameEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Accounts/Interfaces/ISetAccountNameEndpointResult.verified.cs new file mode 100644 index 00000000..bfe836a5 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Accounts/Interfaces/ISetAccountNameEndpointResult.verified.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Accounts.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Set name of account. +/// Operation: SetAccountName. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface ISetAccountNameEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + string? OkContent { get; } + + ValidationProblemDetails BadRequestContent { get; } + + ProblemDetails UnauthorizedContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Accounts/Interfaces/IUpdateAccountNameEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Accounts/Interfaces/IUpdateAccountNameEndpoint.verified.cs new file mode 100644 index 00000000..de932999 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Accounts/Interfaces/IUpdateAccountNameEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Accounts.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Update name of account. +/// Operation: UpdateAccountName. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IUpdateAccountNameEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + UpdateAccountNameParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Accounts/Interfaces/IUpdateAccountNameEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Accounts/Interfaces/IUpdateAccountNameEndpointResult.verified.cs new file mode 100644 index 00000000..c236a12e --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Accounts/Interfaces/IUpdateAccountNameEndpointResult.verified.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Accounts.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Update name of account. +/// Operation: UpdateAccountName. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IUpdateAccountNameEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + string? OkContent { get; } + + ValidationProblemDetails BadRequestContent { get; } + + ProblemDetails UnauthorizedContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Accounts/SetAccountNameEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Accounts/SetAccountNameEndpoint.verified.cs new file mode 100644 index 00000000..4b73cb8b --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Accounts/SetAccountNameEndpoint.verified.cs @@ -0,0 +1,48 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Accounts; + +/// +/// Client Endpoint. +/// Description: Set name of account. +/// Operation: SetAccountName. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class SetAccountNameEndpoint : ISetAccountNameEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public SetAccountNameEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + SetAccountNameParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/accounts/{accountId}/name"); + requestBuilder.WithPathParameter("accountId", parameters.AccountId); + requestBuilder.WithBody(parameters.Request); + + using var requestMessage = requestBuilder.Build(HttpMethod.Post); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + return await responseBuilder.BuildResponseAsync(x => new SetAccountNameEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Accounts/SetAccountNameEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Accounts/SetAccountNameEndpointResult.verified.cs new file mode 100644 index 00000000..849991bf --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Accounts/SetAccountNameEndpointResult.verified.cs @@ -0,0 +1,45 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Accounts; + +/// +/// Client Endpoint result. +/// Description: Set name of account. +/// Operation: SetAccountName. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class SetAccountNameEndpointResult : EndpointResponse, ISetAccountNameEndpointResult +{ + public SetAccountNameEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public string? OkContent + => IsOk && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public ValidationProblemDetails BadRequestContent + => IsBadRequest && ContentObject is ValidationProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public ProblemDetails UnauthorizedContent + => IsUnauthorized && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Accounts/UpdateAccountNameEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Accounts/UpdateAccountNameEndpoint.verified.cs new file mode 100644 index 00000000..ad2455e0 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Accounts/UpdateAccountNameEndpoint.verified.cs @@ -0,0 +1,48 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Accounts; + +/// +/// Client Endpoint. +/// Description: Update name of account. +/// Operation: UpdateAccountName. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateAccountNameEndpoint : IUpdateAccountNameEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public UpdateAccountNameEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + UpdateAccountNameParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/accounts/{accountId}/name"); + requestBuilder.WithPathParameter("accountId", parameters.AccountId); + requestBuilder.WithHeaderParameter("name", parameters.Name); + + using var requestMessage = requestBuilder.Build(HttpMethod.Put); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + return await responseBuilder.BuildResponseAsync(x => new UpdateAccountNameEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Accounts/UpdateAccountNameEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Accounts/UpdateAccountNameEndpointResult.verified.cs new file mode 100644 index 00000000..c0fb692a --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Accounts/UpdateAccountNameEndpointResult.verified.cs @@ -0,0 +1,45 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Accounts; + +/// +/// Client Endpoint result. +/// Description: Update name of account. +/// Operation: UpdateAccountName. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateAccountNameEndpointResult : EndpointResponse, IUpdateAccountNameEndpointResult +{ + public UpdateAccountNameEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public string? OkContent + => IsOk && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public ValidationProblemDetails BadRequestContent + => IsBadRequest && ContentObject is ValidationProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public ProblemDetails UnauthorizedContent + => IsUnauthorized && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Addresses/GetAddressesByPostalCodesEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Addresses/GetAddressesByPostalCodesEndpoint.verified.cs new file mode 100644 index 00000000..4b503a97 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Addresses/GetAddressesByPostalCodesEndpoint.verified.cs @@ -0,0 +1,48 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Addresses; + +/// +/// Client Endpoint. +/// Description: Get addresses by postal code. +/// Operation: GetAddressesByPostalCodes. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetAddressesByPostalCodesEndpoint : IGetAddressesByPostalCodesEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public GetAddressesByPostalCodesEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + GetAddressesByPostalCodesParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/addresses/{postalCode}"); + requestBuilder.WithPathParameter("postalCode", parameters.PostalCode); + + using var requestMessage = requestBuilder.Build(HttpMethod.Get); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse>(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + responseBuilder.AddErrorResponse(HttpStatusCode.NotFound); + return await responseBuilder.BuildResponseAsync(x => new GetAddressesByPostalCodesEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Addresses/GetAddressesByPostalCodesEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Addresses/GetAddressesByPostalCodesEndpointResult.verified.cs new file mode 100644 index 00000000..e90add1a --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Addresses/GetAddressesByPostalCodesEndpointResult.verified.cs @@ -0,0 +1,53 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Addresses; + +/// +/// Client Endpoint result. +/// Description: Get addresses by postal code. +/// Operation: GetAddressesByPostalCodes. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetAddressesByPostalCodesEndpointResult : EndpointResponse, IGetAddressesByPostalCodesEndpointResult +{ + public GetAddressesByPostalCodesEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public bool IsNotFound + => StatusCode == HttpStatusCode.NotFound; + + public IEnumerable
OkContent + => IsOk && ContentObject is IEnumerable
result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public ValidationProblemDetails BadRequestContent + => IsBadRequest && ContentObject is ValidationProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public ProblemDetails UnauthorizedContent + => IsUnauthorized && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); + + public ProblemDetails NotFoundContent + => IsNotFound && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsNotFound property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Addresses/Interfaces/IGetAddressesByPostalCodesEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Addresses/Interfaces/IGetAddressesByPostalCodesEndpoint.verified.cs new file mode 100644 index 00000000..4ae03b04 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Addresses/Interfaces/IGetAddressesByPostalCodesEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Addresses.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Get addresses by postal code. +/// Operation: GetAddressesByPostalCodes. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetAddressesByPostalCodesEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + GetAddressesByPostalCodesParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Addresses/Interfaces/IGetAddressesByPostalCodesEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Addresses/Interfaces/IGetAddressesByPostalCodesEndpointResult.verified.cs new file mode 100644 index 00000000..5bf530cd --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Addresses/Interfaces/IGetAddressesByPostalCodesEndpointResult.verified.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Addresses.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Get addresses by postal code. +/// Operation: GetAddressesByPostalCodes. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetAddressesByPostalCodesEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + bool IsNotFound { get; } + + IEnumerable
OkContent { get; } + + ValidationProblemDetails BadRequestContent { get; } + + ProblemDetails UnauthorizedContent { get; } + + ProblemDetails NotFoundContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/EventArgs/GetEventArgByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/EventArgs/GetEventArgByIdEndpoint.verified.cs new file mode 100644 index 00000000..86335fbe --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/EventArgs/GetEventArgByIdEndpoint.verified.cs @@ -0,0 +1,48 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.EventArgs; + +/// +/// Client Endpoint. +/// Description: Get EventArgs By Id. +/// Operation: GetEventArgById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetEventArgByIdEndpoint : IGetEventArgByIdEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public GetEventArgByIdEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + GetEventArgByIdParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/eventArgs/{id}"); + requestBuilder.WithPathParameter("id", parameters.Id); + + using var requestMessage = requestBuilder.Build(HttpMethod.Get); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + responseBuilder.AddErrorResponse(HttpStatusCode.NotFound); + return await responseBuilder.BuildResponseAsync(x => new GetEventArgByIdEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/EventArgs/GetEventArgByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/EventArgs/GetEventArgByIdEndpointResult.verified.cs new file mode 100644 index 00000000..abdd50bf --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/EventArgs/GetEventArgByIdEndpointResult.verified.cs @@ -0,0 +1,53 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.EventArgs; + +/// +/// Client Endpoint result. +/// Description: Get EventArgs By Id. +/// Operation: GetEventArgById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetEventArgByIdEndpointResult : EndpointResponse, IGetEventArgByIdEndpointResult +{ + public GetEventArgByIdEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public bool IsNotFound + => StatusCode == HttpStatusCode.NotFound; + + public EventArgs OkContent + => IsOk && ContentObject is EventArgs result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public ValidationProblemDetails BadRequestContent + => IsBadRequest && ContentObject is ValidationProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public ProblemDetails UnauthorizedContent + => IsUnauthorized && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); + + public ProblemDetails NotFoundContent + => IsNotFound && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsNotFound property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/EventArgs/GetEventArgsEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/EventArgs/GetEventArgsEndpoint.verified.cs new file mode 100644 index 00000000..5b6349f9 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/EventArgs/GetEventArgsEndpoint.verified.cs @@ -0,0 +1,44 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.EventArgs; + +/// +/// Client Endpoint. +/// Description: Get EventArgs List. +/// Operation: GetEventArgs. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetEventArgsEndpoint : IGetEventArgsEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public GetEventArgsEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/eventArgs"); + + using var requestMessage = requestBuilder.Build(HttpMethod.Get); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse>(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + return await responseBuilder.BuildResponseAsync(x => new GetEventArgsEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/EventArgs/GetEventArgsEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/EventArgs/GetEventArgsEndpointResult.verified.cs new file mode 100644 index 00000000..2b2bb4c4 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/EventArgs/GetEventArgsEndpointResult.verified.cs @@ -0,0 +1,37 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.EventArgs; + +/// +/// Client Endpoint result. +/// Description: Get EventArgs List. +/// Operation: GetEventArgs. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetEventArgsEndpointResult : EndpointResponse, IGetEventArgsEndpointResult +{ + public GetEventArgsEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public IEnumerable OkContent + => IsOk && ContentObject is IEnumerable result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public ProblemDetails UnauthorizedContent + => IsUnauthorized && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgByIdEndpoint.verified.cs new file mode 100644 index 00000000..d7a02f5c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgByIdEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.EventArgs.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Get EventArgs By Id. +/// Operation: GetEventArgById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetEventArgByIdEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + GetEventArgByIdParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgByIdEndpointResult.verified.cs new file mode 100644 index 00000000..af73bd3e --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgByIdEndpointResult.verified.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.EventArgs.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Get EventArgs By Id. +/// Operation: GetEventArgById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetEventArgByIdEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + bool IsNotFound { get; } + + EventArgs OkContent { get; } + + ValidationProblemDetails BadRequestContent { get; } + + ProblemDetails UnauthorizedContent { get; } + + ProblemDetails NotFoundContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgsEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgsEndpoint.verified.cs new file mode 100644 index 00000000..8d92e1aa --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgsEndpoint.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.EventArgs.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Get EventArgs List. +/// Operation: GetEventArgs. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetEventArgsEndpoint +{ + /// + /// Execute method. + /// + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgsEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgsEndpointResult.verified.cs new file mode 100644 index 00000000..de3de14a --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgsEndpointResult.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.EventArgs.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Get EventArgs List. +/// Operation: GetEventArgs. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetEventArgsEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsUnauthorized { get; } + + IEnumerable OkContent { get; } + + ProblemDetails UnauthorizedContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/GetFileByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/GetFileByIdEndpoint.verified.cs new file mode 100644 index 00000000..b24ed836 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/GetFileByIdEndpoint.verified.cs @@ -0,0 +1,48 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Files; + +/// +/// Client Endpoint. +/// Description: Get File By Id. +/// Operation: GetFileById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetFileByIdEndpoint : IGetFileByIdEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public GetFileByIdEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + GetFileByIdParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/files/{id}"); + requestBuilder.WithPathParameter("id", parameters.Id); + + using var requestMessage = requestBuilder.Build(HttpMethod.Get); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + responseBuilder.AddErrorResponse(HttpStatusCode.NotFound); + return await responseBuilder.BuildResponseAsync(x => new GetFileByIdEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/GetFileByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/GetFileByIdEndpointResult.verified.cs new file mode 100644 index 00000000..3a23810a --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/GetFileByIdEndpointResult.verified.cs @@ -0,0 +1,53 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Files; + +/// +/// Client Endpoint result. +/// Description: Get File By Id. +/// Operation: GetFileById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetFileByIdEndpointResult : EndpointResponse, IGetFileByIdEndpointResult +{ + public GetFileByIdEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public bool IsNotFound + => StatusCode == HttpStatusCode.NotFound; + + public byte[] OkContent + => IsOk && ContentObject is byte[] result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public ValidationProblemDetails BadRequestContent + => IsBadRequest && ContentObject is ValidationProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public ProblemDetails UnauthorizedContent + => IsUnauthorized && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); + + public ProblemDetails NotFoundContent + => IsNotFound && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsNotFound property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IGetFileByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IGetFileByIdEndpoint.verified.cs new file mode 100644 index 00000000..8435232d --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IGetFileByIdEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Files.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Get File By Id. +/// Operation: GetFileById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetFileByIdEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + GetFileByIdParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IGetFileByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IGetFileByIdEndpointResult.verified.cs new file mode 100644 index 00000000..f11599a4 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IGetFileByIdEndpointResult.verified.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Files.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Get File By Id. +/// Operation: GetFileById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetFileByIdEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + bool IsNotFound { get; } + + byte[] OkContent { get; } + + ValidationProblemDetails BadRequestContent { get; } + + ProblemDetails UnauthorizedContent { get; } + + ProblemDetails NotFoundContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadMultiFilesAsFormDataEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadMultiFilesAsFormDataEndpoint.verified.cs new file mode 100644 index 00000000..187053e2 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadMultiFilesAsFormDataEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Files.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Upload multi files as form data. +/// Operation: UploadMultiFilesAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IUploadMultiFilesAsFormDataEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + UploadMultiFilesAsFormDataParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadMultiFilesAsFormDataEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadMultiFilesAsFormDataEndpointResult.verified.cs new file mode 100644 index 00000000..0ed2c716 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadMultiFilesAsFormDataEndpointResult.verified.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Files.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Upload multi files as form data. +/// Operation: UploadMultiFilesAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IUploadMultiFilesAsFormDataEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + string? OkContent { get; } + + ValidationProblemDetails BadRequestContent { get; } + + ProblemDetails UnauthorizedContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadSingleFileAsFormDataEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadSingleFileAsFormDataEndpoint.verified.cs new file mode 100644 index 00000000..48fa6b4c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadSingleFileAsFormDataEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Files.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Upload a file as OctetStream. +/// Operation: UploadSingleFileAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IUploadSingleFileAsFormDataEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + UploadSingleFileAsFormDataParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadSingleFileAsFormDataEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadSingleFileAsFormDataEndpointResult.verified.cs new file mode 100644 index 00000000..20daa9e9 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadSingleFileAsFormDataEndpointResult.verified.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Files.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Upload a file as OctetStream. +/// Operation: UploadSingleFileAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IUploadSingleFileAsFormDataEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + string? OkContent { get; } + + ValidationProblemDetails BadRequestContent { get; } + + ProblemDetails UnauthorizedContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadSingleObjectWithFileAsFormDataEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadSingleObjectWithFileAsFormDataEndpoint.verified.cs new file mode 100644 index 00000000..b3cad17e --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadSingleObjectWithFileAsFormDataEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Files.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Upload a file as FormData. +/// Operation: UploadSingleObjectWithFileAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IUploadSingleObjectWithFileAsFormDataEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + UploadSingleObjectWithFileAsFormDataParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadSingleObjectWithFileAsFormDataEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadSingleObjectWithFileAsFormDataEndpointResult.verified.cs new file mode 100644 index 00000000..4088b195 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadSingleObjectWithFileAsFormDataEndpointResult.verified.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Files.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Upload a file as FormData. +/// Operation: UploadSingleObjectWithFileAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IUploadSingleObjectWithFileAsFormDataEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + string? OkContent { get; } + + ValidationProblemDetails BadRequestContent { get; } + + ProblemDetails UnauthorizedContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadSingleObjectWithFilesAsFormDataEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadSingleObjectWithFilesAsFormDataEndpoint.verified.cs new file mode 100644 index 00000000..3716111f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadSingleObjectWithFilesAsFormDataEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Files.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Upload files as FormData. +/// Operation: UploadSingleObjectWithFilesAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IUploadSingleObjectWithFilesAsFormDataEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + UploadSingleObjectWithFilesAsFormDataParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadSingleObjectWithFilesAsFormDataEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadSingleObjectWithFilesAsFormDataEndpointResult.verified.cs new file mode 100644 index 00000000..5b088116 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/Interfaces/IUploadSingleObjectWithFilesAsFormDataEndpointResult.verified.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Files.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Upload files as FormData. +/// Operation: UploadSingleObjectWithFilesAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IUploadSingleObjectWithFilesAsFormDataEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + string? OkContent { get; } + + ValidationProblemDetails BadRequestContent { get; } + + ProblemDetails UnauthorizedContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/UploadMultiFilesAsFormDataEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/UploadMultiFilesAsFormDataEndpoint.verified.cs new file mode 100644 index 00000000..df17b8c2 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/UploadMultiFilesAsFormDataEndpoint.verified.cs @@ -0,0 +1,47 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Files; + +/// +/// Client Endpoint. +/// Description: Upload multi files as form data. +/// Operation: UploadMultiFilesAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UploadMultiFilesAsFormDataEndpoint : IUploadMultiFilesAsFormDataEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public UploadMultiFilesAsFormDataEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + UploadMultiFilesAsFormDataParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/files/form-data/multiFile"); + // TODO: Imp. With-Form + + using var requestMessage = requestBuilder.Build(HttpMethod.Post); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + return await responseBuilder.BuildResponseAsync(x => new UploadMultiFilesAsFormDataEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/UploadMultiFilesAsFormDataEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/UploadMultiFilesAsFormDataEndpointResult.verified.cs new file mode 100644 index 00000000..6e5db245 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/UploadMultiFilesAsFormDataEndpointResult.verified.cs @@ -0,0 +1,45 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Files; + +/// +/// Client Endpoint result. +/// Description: Upload multi files as form data. +/// Operation: UploadMultiFilesAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UploadMultiFilesAsFormDataEndpointResult : EndpointResponse, IUploadMultiFilesAsFormDataEndpointResult +{ + public UploadMultiFilesAsFormDataEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public string? OkContent + => IsOk && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public ValidationProblemDetails BadRequestContent + => IsBadRequest && ContentObject is ValidationProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public ProblemDetails UnauthorizedContent + => IsUnauthorized && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/UploadSingleFileAsFormDataEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/UploadSingleFileAsFormDataEndpoint.verified.cs new file mode 100644 index 00000000..bc1a79e5 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/UploadSingleFileAsFormDataEndpoint.verified.cs @@ -0,0 +1,47 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Files; + +/// +/// Client Endpoint. +/// Description: Upload a file as OctetStream. +/// Operation: UploadSingleFileAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UploadSingleFileAsFormDataEndpoint : IUploadSingleFileAsFormDataEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public UploadSingleFileAsFormDataEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + UploadSingleFileAsFormDataParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/files/form-data/singleFile"); + requestBuilder.WithBody(parameters.Request); + + using var requestMessage = requestBuilder.Build(HttpMethod.Post); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + return await responseBuilder.BuildResponseAsync(x => new UploadSingleFileAsFormDataEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/UploadSingleFileAsFormDataEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/UploadSingleFileAsFormDataEndpointResult.verified.cs new file mode 100644 index 00000000..cf013f9e --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/UploadSingleFileAsFormDataEndpointResult.verified.cs @@ -0,0 +1,45 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Files; + +/// +/// Client Endpoint result. +/// Description: Upload a file as OctetStream. +/// Operation: UploadSingleFileAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UploadSingleFileAsFormDataEndpointResult : EndpointResponse, IUploadSingleFileAsFormDataEndpointResult +{ + public UploadSingleFileAsFormDataEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public string? OkContent + => IsOk && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public ValidationProblemDetails BadRequestContent + => IsBadRequest && ContentObject is ValidationProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public ProblemDetails UnauthorizedContent + => IsUnauthorized && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/UploadSingleObjectWithFileAsFormDataEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/UploadSingleObjectWithFileAsFormDataEndpoint.verified.cs new file mode 100644 index 00000000..f972fdc4 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/UploadSingleObjectWithFileAsFormDataEndpoint.verified.cs @@ -0,0 +1,47 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Files; + +/// +/// Client Endpoint. +/// Description: Upload a file as FormData. +/// Operation: UploadSingleObjectWithFileAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UploadSingleObjectWithFileAsFormDataEndpoint : IUploadSingleObjectWithFileAsFormDataEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public UploadSingleObjectWithFileAsFormDataEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + UploadSingleObjectWithFileAsFormDataParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/files/form-data/singleObject"); + // TODO: Imp. With-Form + + using var requestMessage = requestBuilder.Build(HttpMethod.Post); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + return await responseBuilder.BuildResponseAsync(x => new UploadSingleObjectWithFileAsFormDataEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/UploadSingleObjectWithFileAsFormDataEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/UploadSingleObjectWithFileAsFormDataEndpointResult.verified.cs new file mode 100644 index 00000000..1fd200f6 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/UploadSingleObjectWithFileAsFormDataEndpointResult.verified.cs @@ -0,0 +1,45 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Files; + +/// +/// Client Endpoint result. +/// Description: Upload a file as FormData. +/// Operation: UploadSingleObjectWithFileAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UploadSingleObjectWithFileAsFormDataEndpointResult : EndpointResponse, IUploadSingleObjectWithFileAsFormDataEndpointResult +{ + public UploadSingleObjectWithFileAsFormDataEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public string? OkContent + => IsOk && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public ValidationProblemDetails BadRequestContent + => IsBadRequest && ContentObject is ValidationProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public ProblemDetails UnauthorizedContent + => IsUnauthorized && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/UploadSingleObjectWithFilesAsFormDataEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/UploadSingleObjectWithFilesAsFormDataEndpoint.verified.cs new file mode 100644 index 00000000..870b0108 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/UploadSingleObjectWithFilesAsFormDataEndpoint.verified.cs @@ -0,0 +1,47 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Files; + +/// +/// Client Endpoint. +/// Description: Upload files as FormData. +/// Operation: UploadSingleObjectWithFilesAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UploadSingleObjectWithFilesAsFormDataEndpoint : IUploadSingleObjectWithFilesAsFormDataEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public UploadSingleObjectWithFilesAsFormDataEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + UploadSingleObjectWithFilesAsFormDataParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/files/form-data/singleObjectMultiFile"); + // TODO: Imp. With-Form + + using var requestMessage = requestBuilder.Build(HttpMethod.Post); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + return await responseBuilder.BuildResponseAsync(x => new UploadSingleObjectWithFilesAsFormDataEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/UploadSingleObjectWithFilesAsFormDataEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/UploadSingleObjectWithFilesAsFormDataEndpointResult.verified.cs new file mode 100644 index 00000000..3073bc11 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Files/UploadSingleObjectWithFilesAsFormDataEndpointResult.verified.cs @@ -0,0 +1,45 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Files; + +/// +/// Client Endpoint result. +/// Description: Upload files as FormData. +/// Operation: UploadSingleObjectWithFilesAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UploadSingleObjectWithFilesAsFormDataEndpointResult : EndpointResponse, IUploadSingleObjectWithFilesAsFormDataEndpointResult +{ + public UploadSingleObjectWithFilesAsFormDataEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public string? OkContent + => IsOk && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public ValidationProblemDetails BadRequestContent + => IsBadRequest && ContentObject is ValidationProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public ProblemDetails UnauthorizedContent + => IsUnauthorized && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Items/CreateItemEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Items/CreateItemEndpoint.verified.cs new file mode 100644 index 00000000..540e7468 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Items/CreateItemEndpoint.verified.cs @@ -0,0 +1,47 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Items; + +/// +/// Client Endpoint. +/// Description: Create a new item. +/// Operation: CreateItem. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class CreateItemEndpoint : ICreateItemEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public CreateItemEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + CreateItemParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/items"); + requestBuilder.WithBody(parameters.Request); + + using var requestMessage = requestBuilder.Build(HttpMethod.Post); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + return await responseBuilder.BuildResponseAsync(x => new CreateItemEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Items/CreateItemEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Items/CreateItemEndpointResult.verified.cs new file mode 100644 index 00000000..ffeace3f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Items/CreateItemEndpointResult.verified.cs @@ -0,0 +1,45 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Items; + +/// +/// Client Endpoint result. +/// Description: Create a new item. +/// Operation: CreateItem. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class CreateItemEndpointResult : EndpointResponse, ICreateItemEndpointResult +{ + public CreateItemEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public string? OkContent + => IsOk && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public ValidationProblemDetails BadRequestContent + => IsBadRequest && ContentObject is ValidationProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public ProblemDetails UnauthorizedContent + => IsUnauthorized && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Items/Interfaces/ICreateItemEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Items/Interfaces/ICreateItemEndpoint.verified.cs new file mode 100644 index 00000000..0a2032e6 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Items/Interfaces/ICreateItemEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Items.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Create a new item. +/// Operation: CreateItem. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface ICreateItemEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + CreateItemParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Items/Interfaces/ICreateItemEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Items/Interfaces/ICreateItemEndpointResult.verified.cs new file mode 100644 index 00000000..6f441f59 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Items/Interfaces/ICreateItemEndpointResult.verified.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Items.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Create a new item. +/// Operation: CreateItem. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface ICreateItemEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + string? OkContent { get; } + + ValidationProblemDetails BadRequestContent { get; } + + ProblemDetails UnauthorizedContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Items/Interfaces/IUpdateItemEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Items/Interfaces/IUpdateItemEndpoint.verified.cs new file mode 100644 index 00000000..13bbf478 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Items/Interfaces/IUpdateItemEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Items.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Updates an item. +/// Operation: UpdateItem. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IUpdateItemEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + UpdateItemParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Items/Interfaces/IUpdateItemEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Items/Interfaces/IUpdateItemEndpointResult.verified.cs new file mode 100644 index 00000000..0f780b02 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Items/Interfaces/IUpdateItemEndpointResult.verified.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Items.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Updates an item. +/// Operation: UpdateItem. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IUpdateItemEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + Guid OkContent { get; } + + ValidationProblemDetails BadRequestContent { get; } + + ProblemDetails UnauthorizedContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Items/UpdateItemEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Items/UpdateItemEndpoint.verified.cs new file mode 100644 index 00000000..7b5c4605 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Items/UpdateItemEndpoint.verified.cs @@ -0,0 +1,48 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Items; + +/// +/// Client Endpoint. +/// Description: Updates an item. +/// Operation: UpdateItem. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateItemEndpoint : IUpdateItemEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public UpdateItemEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + UpdateItemParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/items/{id}"); + requestBuilder.WithPathParameter("id", parameters.Id); + requestBuilder.WithBody(parameters.Request); + + using var requestMessage = requestBuilder.Build(HttpMethod.Put); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + return await responseBuilder.BuildResponseAsync(x => new UpdateItemEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Items/UpdateItemEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Items/UpdateItemEndpointResult.verified.cs new file mode 100644 index 00000000..babd88d4 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Items/UpdateItemEndpointResult.verified.cs @@ -0,0 +1,45 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Items; + +/// +/// Client Endpoint result. +/// Description: Updates an item. +/// Operation: UpdateItem. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateItemEndpointResult : EndpointResponse, IUpdateItemEndpointResult +{ + public UpdateItemEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public Guid OkContent + => IsOk && ContentObject is Guid result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public ValidationProblemDetails BadRequestContent + => IsBadRequest && ContentObject is ValidationProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public ProblemDetails UnauthorizedContent + => IsUnauthorized && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/GetOrderByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/GetOrderByIdEndpoint.verified.cs new file mode 100644 index 00000000..8b4900c1 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/GetOrderByIdEndpoint.verified.cs @@ -0,0 +1,50 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Orders; + +/// +/// Client Endpoint. +/// Description: Get order by id. +/// Operation: GetOrderById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetOrderByIdEndpoint : IGetOrderByIdEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public GetOrderByIdEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + GetOrderByIdParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/orders/{id}"); + requestBuilder.WithPathParameter("id", parameters.Id); + requestBuilder.WithQueryParameter("myEmail", parameters.MyEmail); + + using var requestMessage = requestBuilder.Build(HttpMethod.Get); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + responseBuilder.AddErrorResponse(HttpStatusCode.Forbidden); + responseBuilder.AddErrorResponse(HttpStatusCode.NotFound); + return await responseBuilder.BuildResponseAsync(x => new GetOrderByIdEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/GetOrderByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/GetOrderByIdEndpointResult.verified.cs new file mode 100644 index 00000000..d37d38e0 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/GetOrderByIdEndpointResult.verified.cs @@ -0,0 +1,61 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Orders; + +/// +/// Client Endpoint result. +/// Description: Get order by id. +/// Operation: GetOrderById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetOrderByIdEndpointResult : EndpointResponse, IGetOrderByIdEndpointResult +{ + public GetOrderByIdEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public bool IsForbidden + => StatusCode == HttpStatusCode.Forbidden; + + public bool IsNotFound + => StatusCode == HttpStatusCode.NotFound; + + public Order OkContent + => IsOk && ContentObject is Order result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public ValidationProblemDetails BadRequestContent + => IsBadRequest && ContentObject is ValidationProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public ProblemDetails UnauthorizedContent + => IsUnauthorized && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); + + public ProblemDetails ForbiddenContent + => IsForbidden && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsForbidden property first."); + + public ProblemDetails NotFoundContent + => IsNotFound && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsNotFound property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/GetOrdersEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/GetOrdersEndpoint.verified.cs new file mode 100644 index 00000000..bf260124 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/GetOrdersEndpoint.verified.cs @@ -0,0 +1,56 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Orders; + +/// +/// Client Endpoint. +/// Description: Get orders. +/// Operation: GetOrders. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetOrdersEndpoint : IGetOrdersEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public GetOrdersEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + GetOrdersParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/orders"); + requestBuilder.WithQueryParameter("pageSize", parameters.PageSize); + requestBuilder.WithQueryParameter("pageIndex", parameters.PageIndex); + requestBuilder.WithQueryParameter("queryString", parameters.QueryString); + if (parameters.QueryStringArray.Any()) + { + requestBuilder.WithQueryParameter("queryStringArray", parameters.QueryStringArray); + } + + requestBuilder.WithQueryParameter("continuationToken", parameters.ContinuationToken); + + using var requestMessage = requestBuilder.Build(HttpMethod.Get); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse>(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + responseBuilder.AddErrorResponse(HttpStatusCode.NotFound); + return await responseBuilder.BuildResponseAsync(x => new GetOrdersEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/GetOrdersEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/GetOrdersEndpointResult.verified.cs new file mode 100644 index 00000000..0397604a --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/GetOrdersEndpointResult.verified.cs @@ -0,0 +1,53 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Orders; + +/// +/// Client Endpoint result. +/// Description: Get orders. +/// Operation: GetOrders. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetOrdersEndpointResult : EndpointResponse, IGetOrdersEndpointResult +{ + public GetOrdersEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public bool IsNotFound + => StatusCode == HttpStatusCode.NotFound; + + public Pagination OkContent + => IsOk && ContentObject is Pagination result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public ValidationProblemDetails BadRequestContent + => IsBadRequest && ContentObject is ValidationProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public ProblemDetails UnauthorizedContent + => IsUnauthorized && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); + + public ProblemDetails NotFoundContent + => IsNotFound && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsNotFound property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrderByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrderByIdEndpoint.verified.cs new file mode 100644 index 00000000..b842186f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrderByIdEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Orders.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Get order by id. +/// Operation: GetOrderById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetOrderByIdEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + GetOrderByIdParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrderByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrderByIdEndpointResult.verified.cs new file mode 100644 index 00000000..2a0e1e44 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrderByIdEndpointResult.verified.cs @@ -0,0 +1,37 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Orders.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Get order by id. +/// Operation: GetOrderById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetOrderByIdEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + bool IsForbidden { get; } + + bool IsNotFound { get; } + + Order OkContent { get; } + + ValidationProblemDetails BadRequestContent { get; } + + ProblemDetails UnauthorizedContent { get; } + + ProblemDetails ForbiddenContent { get; } + + ProblemDetails NotFoundContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrdersEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrdersEndpoint.verified.cs new file mode 100644 index 00000000..8dd8dddd --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrdersEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Orders.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Get orders. +/// Operation: GetOrders. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetOrdersEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + GetOrdersParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrdersEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrdersEndpointResult.verified.cs new file mode 100644 index 00000000..0cd179b7 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrdersEndpointResult.verified.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Orders.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Get orders. +/// Operation: GetOrders. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetOrdersEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + bool IsNotFound { get; } + + Pagination OkContent { get; } + + ValidationProblemDetails BadRequestContent { get; } + + ProblemDetails UnauthorizedContent { get; } + + ProblemDetails NotFoundContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/Interfaces/IPatchOrdersIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/Interfaces/IPatchOrdersIdEndpoint.verified.cs new file mode 100644 index 00000000..3c0dab43 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/Interfaces/IPatchOrdersIdEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Orders.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Update part of order by id. +/// Operation: PatchOrdersId. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IPatchOrdersIdEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + PatchOrdersIdParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/Interfaces/IPatchOrdersIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/Interfaces/IPatchOrdersIdEndpointResult.verified.cs new file mode 100644 index 00000000..29aac17c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/Interfaces/IPatchOrdersIdEndpointResult.verified.cs @@ -0,0 +1,45 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Orders.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Update part of order by id. +/// Operation: PatchOrdersId. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IPatchOrdersIdEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + bool IsForbidden { get; } + + bool IsNotFound { get; } + + bool IsConflict { get; } + + bool IsBadGateway { get; } + + string? OkContent { get; } + + ValidationProblemDetails BadRequestContent { get; } + + ProblemDetails UnauthorizedContent { get; } + + ProblemDetails ForbiddenContent { get; } + + ProblemDetails NotFoundContent { get; } + + ProblemDetails ConflictContent { get; } + + ProblemDetails BadGatewayContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/PatchOrdersIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/PatchOrdersIdEndpoint.verified.cs new file mode 100644 index 00000000..5772a3eb --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/PatchOrdersIdEndpoint.verified.cs @@ -0,0 +1,56 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Orders; + +/// +/// Client Endpoint. +/// Description: Update part of order by id. +/// Operation: PatchOrdersId. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class PatchOrdersIdEndpoint : IPatchOrdersIdEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public PatchOrdersIdEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + PatchOrdersIdParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/orders/{id}"); + requestBuilder.WithPathParameter("id", parameters.Id); + requestBuilder.WithHeaderParameter("myTestHeader", parameters.MyTestHeader); + requestBuilder.WithHeaderParameter("myTestHeaderBool", parameters.MyTestHeaderBool); + requestBuilder.WithHeaderParameter("myTestHeaderInt", parameters.MyTestHeaderInt); + requestBuilder.WithHeaderParameter("x-correlation-id", parameters.CorrelationId); + requestBuilder.WithBody(parameters.Request); + + using var requestMessage = requestBuilder.Build(HttpMethod.Patch); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + responseBuilder.AddErrorResponse(HttpStatusCode.Forbidden); + responseBuilder.AddErrorResponse(HttpStatusCode.NotFound); + responseBuilder.AddErrorResponse(HttpStatusCode.Conflict); + responseBuilder.AddErrorResponse(HttpStatusCode.BadGateway); + return await responseBuilder.BuildResponseAsync(x => new PatchOrdersIdEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/PatchOrdersIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/PatchOrdersIdEndpointResult.verified.cs new file mode 100644 index 00000000..f59a3329 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Orders/PatchOrdersIdEndpointResult.verified.cs @@ -0,0 +1,77 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Orders; + +/// +/// Client Endpoint result. +/// Description: Update part of order by id. +/// Operation: PatchOrdersId. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class PatchOrdersIdEndpointResult : EndpointResponse, IPatchOrdersIdEndpointResult +{ + public PatchOrdersIdEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public bool IsForbidden + => StatusCode == HttpStatusCode.Forbidden; + + public bool IsNotFound + => StatusCode == HttpStatusCode.NotFound; + + public bool IsConflict + => StatusCode == HttpStatusCode.Conflict; + + public bool IsBadGateway + => StatusCode == HttpStatusCode.BadGateway; + + public string? OkContent + => IsOk && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public ValidationProblemDetails BadRequestContent + => IsBadRequest && ContentObject is ValidationProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public ProblemDetails UnauthorizedContent + => IsUnauthorized && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); + + public ProblemDetails ForbiddenContent + => IsForbidden && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsForbidden property first."); + + public ProblemDetails NotFoundContent + => IsNotFound && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsNotFound property first."); + + public ProblemDetails ConflictContent + => IsConflict && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsConflict property first."); + + public ProblemDetails BadGatewayContent + => IsBadGateway && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadGateway property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/RouteWithDash/GetRouteWithDashEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/RouteWithDash/GetRouteWithDashEndpoint.verified.cs new file mode 100644 index 00000000..e997ec06 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/RouteWithDash/GetRouteWithDashEndpoint.verified.cs @@ -0,0 +1,44 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.RouteWithDash; + +/// +/// Client Endpoint. +/// Description: Your GET endpoint. +/// Operation: GetRouteWithDash. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetRouteWithDashEndpoint : IGetRouteWithDashEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public GetRouteWithDashEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/route-with-dash"); + + using var requestMessage = requestBuilder.Build(HttpMethod.Get); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + return await responseBuilder.BuildResponseAsync(x => new GetRouteWithDashEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/RouteWithDash/GetRouteWithDashEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/RouteWithDash/GetRouteWithDashEndpointResult.verified.cs new file mode 100644 index 00000000..eac3dd8c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/RouteWithDash/GetRouteWithDashEndpointResult.verified.cs @@ -0,0 +1,37 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.RouteWithDash; + +/// +/// Client Endpoint result. +/// Description: Your GET endpoint. +/// Operation: GetRouteWithDash. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetRouteWithDashEndpointResult : EndpointResponse, IGetRouteWithDashEndpointResult +{ + public GetRouteWithDashEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public string? OkContent + => IsOk && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public ProblemDetails UnauthorizedContent + => IsUnauthorized && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/RouteWithDash/Interfaces/IGetRouteWithDashEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/RouteWithDash/Interfaces/IGetRouteWithDashEndpoint.verified.cs new file mode 100644 index 00000000..b09d0422 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/RouteWithDash/Interfaces/IGetRouteWithDashEndpoint.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.RouteWithDash.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Your GET endpoint. +/// Operation: GetRouteWithDash. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetRouteWithDashEndpoint +{ + /// + /// Execute method. + /// + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/RouteWithDash/Interfaces/IGetRouteWithDashEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/RouteWithDash/Interfaces/IGetRouteWithDashEndpointResult.verified.cs new file mode 100644 index 00000000..0707c316 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/RouteWithDash/Interfaces/IGetRouteWithDashEndpointResult.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.RouteWithDash.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Your GET endpoint. +/// Operation: GetRouteWithDash. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetRouteWithDashEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsUnauthorized { get; } + + string? OkContent { get; } + + ProblemDetails UnauthorizedContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Tasks/GetTasksEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Tasks/GetTasksEndpoint.verified.cs new file mode 100644 index 00000000..4d0e7ba4 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Tasks/GetTasksEndpoint.verified.cs @@ -0,0 +1,44 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Tasks; + +/// +/// Client Endpoint. +/// Description: Returns tasks. +/// Operation: GetTasks. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetTasksEndpoint : IGetTasksEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public GetTasksEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/tasks"); + + using var requestMessage = requestBuilder.Build(HttpMethod.Get); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse>(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + return await responseBuilder.BuildResponseAsync(x => new GetTasksEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Tasks/GetTasksEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Tasks/GetTasksEndpointResult.verified.cs new file mode 100644 index 00000000..eb3ca69c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Tasks/GetTasksEndpointResult.verified.cs @@ -0,0 +1,37 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Tasks; + +/// +/// Client Endpoint result. +/// Description: Returns tasks. +/// Operation: GetTasks. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetTasksEndpointResult : EndpointResponse, IGetTasksEndpointResult +{ + public GetTasksEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public IEnumerable OkContent + => IsOk && ContentObject is IEnumerable result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public ProblemDetails UnauthorizedContent + => IsUnauthorized && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Tasks/Interfaces/IGetTasksEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Tasks/Interfaces/IGetTasksEndpoint.verified.cs new file mode 100644 index 00000000..4070bc86 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Tasks/Interfaces/IGetTasksEndpoint.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Tasks.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Returns tasks. +/// Operation: GetTasks. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetTasksEndpoint +{ + /// + /// Execute method. + /// + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Tasks/Interfaces/IGetTasksEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Tasks/Interfaces/IGetTasksEndpointResult.verified.cs new file mode 100644 index 00000000..53393266 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Tasks/Interfaces/IGetTasksEndpointResult.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Tasks.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Returns tasks. +/// Operation: GetTasks. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetTasksEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsUnauthorized { get; } + + IEnumerable OkContent { get; } + + ProblemDetails UnauthorizedContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/DeleteUserByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/DeleteUserByIdEndpoint.verified.cs new file mode 100644 index 00000000..acde01cb --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/DeleteUserByIdEndpoint.verified.cs @@ -0,0 +1,49 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users; + +/// +/// Client Endpoint. +/// Description: Delete user by id. +/// Operation: DeleteUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class DeleteUserByIdEndpoint : IDeleteUserByIdEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public DeleteUserByIdEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + DeleteUserByIdParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/users/{id}"); + requestBuilder.WithPathParameter("id", parameters.Id); + + using var requestMessage = requestBuilder.Build(HttpMethod.Delete); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + responseBuilder.AddErrorResponse(HttpStatusCode.NotFound); + responseBuilder.AddErrorResponse(HttpStatusCode.Conflict); + return await responseBuilder.BuildResponseAsync(x => new DeleteUserByIdEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/DeleteUserByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/DeleteUserByIdEndpointResult.verified.cs new file mode 100644 index 00000000..4ae2862d --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/DeleteUserByIdEndpointResult.verified.cs @@ -0,0 +1,61 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users; + +/// +/// Client Endpoint result. +/// Description: Delete user by id. +/// Operation: DeleteUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class DeleteUserByIdEndpointResult : EndpointResponse, IDeleteUserByIdEndpointResult +{ + public DeleteUserByIdEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public bool IsNotFound + => StatusCode == HttpStatusCode.NotFound; + + public bool IsConflict + => StatusCode == HttpStatusCode.Conflict; + + public string? OkContent + => IsOk && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public ValidationProblemDetails BadRequestContent + => IsBadRequest && ContentObject is ValidationProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public ProblemDetails UnauthorizedContent + => IsUnauthorized && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); + + public ProblemDetails NotFoundContent + => IsNotFound && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsNotFound property first."); + + public ProblemDetails ConflictContent + => IsConflict && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsConflict property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/GetUserByEmailEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/GetUserByEmailEndpoint.verified.cs new file mode 100644 index 00000000..f743076d --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/GetUserByEmailEndpoint.verified.cs @@ -0,0 +1,49 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users; + +/// +/// Client Endpoint. +/// Description: Get user by email. +/// Operation: GetUserByEmail. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetUserByEmailEndpoint : IGetUserByEmailEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public GetUserByEmailEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + GetUserByEmailParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/users/email"); + requestBuilder.WithQueryParameter("email", parameters.Email); + + using var requestMessage = requestBuilder.Build(HttpMethod.Get); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + responseBuilder.AddErrorResponse(HttpStatusCode.NotFound); + responseBuilder.AddErrorResponse(HttpStatusCode.Conflict); + return await responseBuilder.BuildResponseAsync(x => new GetUserByEmailEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/GetUserByEmailEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/GetUserByEmailEndpointResult.verified.cs new file mode 100644 index 00000000..5ca1308b --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/GetUserByEmailEndpointResult.verified.cs @@ -0,0 +1,61 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users; + +/// +/// Client Endpoint result. +/// Description: Get user by email. +/// Operation: GetUserByEmail. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetUserByEmailEndpointResult : EndpointResponse, IGetUserByEmailEndpointResult +{ + public GetUserByEmailEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public bool IsNotFound + => StatusCode == HttpStatusCode.NotFound; + + public bool IsConflict + => StatusCode == HttpStatusCode.Conflict; + + public User OkContent + => IsOk && ContentObject is User result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public ValidationProblemDetails BadRequestContent + => IsBadRequest && ContentObject is ValidationProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public ProblemDetails UnauthorizedContent + => IsUnauthorized && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); + + public ProblemDetails NotFoundContent + => IsNotFound && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsNotFound property first."); + + public ProblemDetails ConflictContent + => IsConflict && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsConflict property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/GetUserByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/GetUserByIdEndpoint.verified.cs new file mode 100644 index 00000000..a40d6e99 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/GetUserByIdEndpoint.verified.cs @@ -0,0 +1,49 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users; + +/// +/// Client Endpoint. +/// Description: Get user by id. +/// Operation: GetUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetUserByIdEndpoint : IGetUserByIdEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public GetUserByIdEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + GetUserByIdParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/users/{id}"); + requestBuilder.WithPathParameter("id", parameters.Id); + + using var requestMessage = requestBuilder.Build(HttpMethod.Get); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + responseBuilder.AddErrorResponse(HttpStatusCode.NotFound); + responseBuilder.AddErrorResponse(HttpStatusCode.Conflict); + return await responseBuilder.BuildResponseAsync(x => new GetUserByIdEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/GetUserByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/GetUserByIdEndpointResult.verified.cs new file mode 100644 index 00000000..f81ecdf0 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/GetUserByIdEndpointResult.verified.cs @@ -0,0 +1,61 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users; + +/// +/// Client Endpoint result. +/// Description: Get user by id. +/// Operation: GetUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetUserByIdEndpointResult : EndpointResponse, IGetUserByIdEndpointResult +{ + public GetUserByIdEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public bool IsNotFound + => StatusCode == HttpStatusCode.NotFound; + + public bool IsConflict + => StatusCode == HttpStatusCode.Conflict; + + public User OkContent + => IsOk && ContentObject is User result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public ValidationProblemDetails BadRequestContent + => IsBadRequest && ContentObject is ValidationProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public ProblemDetails UnauthorizedContent + => IsUnauthorized && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); + + public ProblemDetails NotFoundContent + => IsNotFound && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsNotFound property first."); + + public ProblemDetails ConflictContent + => IsConflict && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsConflict property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/GetUsersEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/GetUsersEndpoint.verified.cs new file mode 100644 index 00000000..e9d19bbc --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/GetUsersEndpoint.verified.cs @@ -0,0 +1,45 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users; + +/// +/// Client Endpoint. +/// Description: Get all users. +/// Operation: GetUsers. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetUsersEndpoint : IGetUsersEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public GetUsersEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/users"); + + using var requestMessage = requestBuilder.Build(HttpMethod.Get); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse>(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + responseBuilder.AddErrorResponse(HttpStatusCode.Conflict); + return await responseBuilder.BuildResponseAsync(x => new GetUsersEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/GetUsersEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/GetUsersEndpointResult.verified.cs new file mode 100644 index 00000000..8d971630 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/GetUsersEndpointResult.verified.cs @@ -0,0 +1,45 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users; + +/// +/// Client Endpoint result. +/// Description: Get all users. +/// Operation: GetUsers. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetUsersEndpointResult : EndpointResponse, IGetUsersEndpointResult +{ + public GetUsersEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public bool IsConflict + => StatusCode == HttpStatusCode.Conflict; + + public IEnumerable OkContent + => IsOk && ContentObject is IEnumerable result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public ProblemDetails UnauthorizedContent + => IsUnauthorized && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); + + public ProblemDetails ConflictContent + => IsConflict && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsConflict property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IDeleteUserByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IDeleteUserByIdEndpoint.verified.cs new file mode 100644 index 00000000..396bac11 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IDeleteUserByIdEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Delete user by id. +/// Operation: DeleteUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IDeleteUserByIdEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + DeleteUserByIdParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IDeleteUserByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IDeleteUserByIdEndpointResult.verified.cs new file mode 100644 index 00000000..08fae9ff --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IDeleteUserByIdEndpointResult.verified.cs @@ -0,0 +1,37 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Delete user by id. +/// Operation: DeleteUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IDeleteUserByIdEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + bool IsNotFound { get; } + + bool IsConflict { get; } + + string? OkContent { get; } + + ValidationProblemDetails BadRequestContent { get; } + + ProblemDetails UnauthorizedContent { get; } + + ProblemDetails NotFoundContent { get; } + + ProblemDetails ConflictContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUserByEmailEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUserByEmailEndpoint.verified.cs new file mode 100644 index 00000000..a2f1f173 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUserByEmailEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Get user by email. +/// Operation: GetUserByEmail. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetUserByEmailEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + GetUserByEmailParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUserByEmailEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUserByEmailEndpointResult.verified.cs new file mode 100644 index 00000000..e7ddcc94 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUserByEmailEndpointResult.verified.cs @@ -0,0 +1,37 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Get user by email. +/// Operation: GetUserByEmail. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetUserByEmailEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + bool IsNotFound { get; } + + bool IsConflict { get; } + + User OkContent { get; } + + ValidationProblemDetails BadRequestContent { get; } + + ProblemDetails UnauthorizedContent { get; } + + ProblemDetails NotFoundContent { get; } + + ProblemDetails ConflictContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUserByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUserByIdEndpoint.verified.cs new file mode 100644 index 00000000..219df7a0 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUserByIdEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Get user by id. +/// Operation: GetUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetUserByIdEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + GetUserByIdParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUserByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUserByIdEndpointResult.verified.cs new file mode 100644 index 00000000..80bd278b --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUserByIdEndpointResult.verified.cs @@ -0,0 +1,37 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Get user by id. +/// Operation: GetUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetUserByIdEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + bool IsNotFound { get; } + + bool IsConflict { get; } + + User OkContent { get; } + + ValidationProblemDetails BadRequestContent { get; } + + ProblemDetails UnauthorizedContent { get; } + + ProblemDetails NotFoundContent { get; } + + ProblemDetails ConflictContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUsersEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUsersEndpoint.verified.cs new file mode 100644 index 00000000..903f6b88 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUsersEndpoint.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Get all users. +/// Operation: GetUsers. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetUsersEndpoint +{ + /// + /// Execute method. + /// + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUsersEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUsersEndpointResult.verified.cs new file mode 100644 index 00000000..9b1b5ae1 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUsersEndpointResult.verified.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Get all users. +/// Operation: GetUsers. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetUsersEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsUnauthorized { get; } + + bool IsConflict { get; } + + IEnumerable OkContent { get; } + + ProblemDetails UnauthorizedContent { get; } + + ProblemDetails ConflictContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IPostUserEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IPostUserEndpoint.verified.cs new file mode 100644 index 00000000..ab621f84 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IPostUserEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Create a new user. +/// Operation: PostUser. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IPostUserEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + PostUserParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IPostUserEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IPostUserEndpointResult.verified.cs new file mode 100644 index 00000000..7ef393e4 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IPostUserEndpointResult.verified.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Create a new user. +/// Operation: PostUser. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IPostUserEndpointResult : IEndpointResponse +{ + + bool IsCreated { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + bool IsConflict { get; } + + ProblemDetails CreatedContent { get; } + + ValidationProblemDetails BadRequestContent { get; } + + ProblemDetails UnauthorizedContent { get; } + + ProblemDetails ConflictContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IUpdateMyTestGenderEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IUpdateMyTestGenderEndpoint.verified.cs new file mode 100644 index 00000000..c4659eb5 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IUpdateMyTestGenderEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Update gender on a user. +/// Operation: UpdateMyTestGender. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IUpdateMyTestGenderEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + UpdateMyTestGenderParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IUpdateMyTestGenderEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IUpdateMyTestGenderEndpointResult.verified.cs new file mode 100644 index 00000000..1c4336b2 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IUpdateMyTestGenderEndpointResult.verified.cs @@ -0,0 +1,37 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Update gender on a user. +/// Operation: UpdateMyTestGender. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IUpdateMyTestGenderEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + bool IsNotFound { get; } + + bool IsConflict { get; } + + string? OkContent { get; } + + ValidationProblemDetails BadRequestContent { get; } + + ProblemDetails UnauthorizedContent { get; } + + ProblemDetails NotFoundContent { get; } + + ProblemDetails ConflictContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IUpdateUserByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IUpdateUserByIdEndpoint.verified.cs new file mode 100644 index 00000000..9584631c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IUpdateUserByIdEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Update user by id. +/// Operation: UpdateUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IUpdateUserByIdEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + UpdateUserByIdParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IUpdateUserByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IUpdateUserByIdEndpointResult.verified.cs new file mode 100644 index 00000000..30aeb468 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/Interfaces/IUpdateUserByIdEndpointResult.verified.cs @@ -0,0 +1,37 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Update user by id. +/// Operation: UpdateUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IUpdateUserByIdEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + bool IsNotFound { get; } + + bool IsConflict { get; } + + string? OkContent { get; } + + ValidationProblemDetails BadRequestContent { get; } + + ProblemDetails UnauthorizedContent { get; } + + ProblemDetails NotFoundContent { get; } + + ProblemDetails ConflictContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/PostUserEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/PostUserEndpoint.verified.cs new file mode 100644 index 00000000..35f93d28 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/PostUserEndpoint.verified.cs @@ -0,0 +1,48 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users; + +/// +/// Client Endpoint. +/// Description: Create a new user. +/// Operation: PostUser. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class PostUserEndpoint : IPostUserEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public PostUserEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + PostUserParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/users"); + requestBuilder.WithBody(parameters.Request); + + using var requestMessage = requestBuilder.Build(HttpMethod.Post); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddErrorResponse(HttpStatusCode.Created); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + responseBuilder.AddErrorResponse(HttpStatusCode.Conflict); + return await responseBuilder.BuildResponseAsync(x => new PostUserEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/PostUserEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/PostUserEndpointResult.verified.cs new file mode 100644 index 00000000..89e779cc --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/PostUserEndpointResult.verified.cs @@ -0,0 +1,53 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users; + +/// +/// Client Endpoint result. +/// Description: Create a new user. +/// Operation: PostUser. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class PostUserEndpointResult : EndpointResponse, IPostUserEndpointResult +{ + public PostUserEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsCreated + => StatusCode == HttpStatusCode.Created; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public bool IsConflict + => StatusCode == HttpStatusCode.Conflict; + + public ProblemDetails CreatedContent + => IsCreated && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsCreated property first."); + + public ValidationProblemDetails BadRequestContent + => IsBadRequest && ContentObject is ValidationProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public ProblemDetails UnauthorizedContent + => IsUnauthorized && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); + + public ProblemDetails ConflictContent + => IsConflict && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsConflict property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/UpdateMyTestGenderEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/UpdateMyTestGenderEndpoint.verified.cs new file mode 100644 index 00000000..3287d873 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/UpdateMyTestGenderEndpoint.verified.cs @@ -0,0 +1,51 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users; + +/// +/// Client Endpoint. +/// Description: Update gender on a user. +/// Operation: UpdateMyTestGender. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateMyTestGenderEndpoint : IUpdateMyTestGenderEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public UpdateMyTestGenderEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + UpdateMyTestGenderParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/users/{id}/gender"); + requestBuilder.WithPathParameter("id", parameters.Id); + requestBuilder.WithQueryParameter("genderParam", parameters.GenderParam); + requestBuilder.WithBody(parameters.Request); + + using var requestMessage = requestBuilder.Build(HttpMethod.Put); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + responseBuilder.AddErrorResponse(HttpStatusCode.NotFound); + responseBuilder.AddErrorResponse(HttpStatusCode.Conflict); + return await responseBuilder.BuildResponseAsync(x => new UpdateMyTestGenderEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/UpdateMyTestGenderEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/UpdateMyTestGenderEndpointResult.verified.cs new file mode 100644 index 00000000..35c96ed4 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/UpdateMyTestGenderEndpointResult.verified.cs @@ -0,0 +1,61 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users; + +/// +/// Client Endpoint result. +/// Description: Update gender on a user. +/// Operation: UpdateMyTestGender. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateMyTestGenderEndpointResult : EndpointResponse, IUpdateMyTestGenderEndpointResult +{ + public UpdateMyTestGenderEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public bool IsNotFound + => StatusCode == HttpStatusCode.NotFound; + + public bool IsConflict + => StatusCode == HttpStatusCode.Conflict; + + public string? OkContent + => IsOk && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public ValidationProblemDetails BadRequestContent + => IsBadRequest && ContentObject is ValidationProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public ProblemDetails UnauthorizedContent + => IsUnauthorized && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); + + public ProblemDetails NotFoundContent + => IsNotFound && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsNotFound property first."); + + public ProblemDetails ConflictContent + => IsConflict && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsConflict property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/UpdateUserByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/UpdateUserByIdEndpoint.verified.cs new file mode 100644 index 00000000..1b523188 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/UpdateUserByIdEndpoint.verified.cs @@ -0,0 +1,50 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users; + +/// +/// Client Endpoint. +/// Description: Update user by id. +/// Operation: UpdateUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateUserByIdEndpoint : IUpdateUserByIdEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public UpdateUserByIdEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + UpdateUserByIdParameters parameters, + string httpClientName = "DemoSample-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/users/{id}"); + requestBuilder.WithPathParameter("id", parameters.Id); + requestBuilder.WithBody(parameters.Request); + + using var requestMessage = requestBuilder.Build(HttpMethod.Put); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + responseBuilder.AddErrorResponse(HttpStatusCode.NotFound); + responseBuilder.AddErrorResponse(HttpStatusCode.Conflict); + return await responseBuilder.BuildResponseAsync(x => new UpdateUserByIdEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/UpdateUserByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/UpdateUserByIdEndpointResult.verified.cs new file mode 100644 index 00000000..3afbb995 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/Endpoints/Users/UpdateUserByIdEndpointResult.verified.cs @@ -0,0 +1,61 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.ApiClient.Generated.Endpoints.Users; + +/// +/// Client Endpoint result. +/// Description: Update user by id. +/// Operation: UpdateUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateUserByIdEndpointResult : EndpointResponse, IUpdateUserByIdEndpointResult +{ + public UpdateUserByIdEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public bool IsNotFound + => StatusCode == HttpStatusCode.NotFound; + + public bool IsConflict + => StatusCode == HttpStatusCode.Conflict; + + public string? OkContent + => IsOk && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public ValidationProblemDetails BadRequestContent + => IsBadRequest && ContentObject is ValidationProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public ProblemDetails UnauthorizedContent + => IsUnauthorized && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); + + public ProblemDetails NotFoundContent + => IsNotFound && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsNotFound property first."); + + public ProblemDetails ConflictContent + => IsConflict && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsConflict property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/GlobalUsings.verified.cs new file mode 100644 index 00000000..b364f161 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyClient/WPD/src/DemoSample.ApiClient.Generated/GlobalUsings.verified.cs @@ -0,0 +1,35 @@ +global using System; +global using System.CodeDom.Compiler; +global using System.Collections.Generic; +global using System.ComponentModel.DataAnnotations; +global using System.Linq; +global using System.Net; +global using System.Net.Http; +global using System.Threading; +global using System.Threading.Tasks; + +global using Atc.Rest.Client; +global using Atc.Rest.Client.Builder; +global using Atc.Rest.Results; + +global using DemoSample.ApiClient.Generated.Contracts; +global using DemoSample.ApiClient.Generated.Contracts.Accounts; +global using DemoSample.ApiClient.Generated.Contracts.Addresses; +global using DemoSample.ApiClient.Generated.Contracts.EventArgs; +global using DemoSample.ApiClient.Generated.Contracts.Files; +global using DemoSample.ApiClient.Generated.Contracts.Items; +global using DemoSample.ApiClient.Generated.Contracts.Orders; +global using DemoSample.ApiClient.Generated.Contracts.Tasks; +global using DemoSample.ApiClient.Generated.Contracts.Users; +global using DemoSample.ApiClient.Generated.Endpoints.Accounts.Interfaces; +global using DemoSample.ApiClient.Generated.Endpoints.Addresses.Interfaces; +global using DemoSample.ApiClient.Generated.Endpoints.EventArgs.Interfaces; +global using DemoSample.ApiClient.Generated.Endpoints.Files.Interfaces; +global using DemoSample.ApiClient.Generated.Endpoints.Items.Interfaces; +global using DemoSample.ApiClient.Generated.Endpoints.Orders.Interfaces; +global using DemoSample.ApiClient.Generated.Endpoints.RouteWithDash.Interfaces; +global using DemoSample.ApiClient.Generated.Endpoints.Tasks.Interfaces; +global using DemoSample.ApiClient.Generated.Endpoints.Users.Interfaces; + +global using Microsoft.AspNetCore.Http; +global using Microsoft.AspNetCore.Mvc; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/ApiRegistration.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/ApiRegistration.verified.cs new file mode 100644 index 00000000..05f42f79 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/ApiRegistration.verified.cs @@ -0,0 +1,12 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ApiRegistration +{ +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Accounts/Interfaces/ISetAccountNameHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Accounts/Interfaces/ISetAccountNameHandler.verified.cs new file mode 100644 index 00000000..e2054a9f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Accounts/Interfaces/ISetAccountNameHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Accounts; + +/// +/// Domain Interface for RequestHandler. +/// Description: Set name of account. +/// Operation: SetAccountName. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface ISetAccountNameHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + SetAccountNameParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Accounts/Interfaces/IUpdateAccountNameHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Accounts/Interfaces/IUpdateAccountNameHandler.verified.cs new file mode 100644 index 00000000..ed70b673 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Accounts/Interfaces/IUpdateAccountNameHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Accounts; + +/// +/// Domain Interface for RequestHandler. +/// Description: Update name of account. +/// Operation: UpdateAccountName. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IUpdateAccountNameHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + UpdateAccountNameParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Accounts/Models/UpdateAccountRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Accounts/Models/UpdateAccountRequest.verified.cs new file mode 100644 index 00000000..0d1014a1 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Accounts/Models/UpdateAccountRequest.verified.cs @@ -0,0 +1,20 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Accounts; + +/// +/// UpdateAccountRequest. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateAccountRequest +{ + public string Name { get; set; } + + /// + public override string ToString() + => $"{nameof(Name)}: {Name}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Accounts/Parameters/SetAccountNameParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Accounts/Parameters/SetAccountNameParameters.verified.cs new file mode 100644 index 00000000..5e851a3c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Accounts/Parameters/SetAccountNameParameters.verified.cs @@ -0,0 +1,34 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Accounts; + +/// +/// Parameters for operation request. +/// Description: Set name of account. +/// Operation: SetAccountName. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class SetAccountNameParameters +{ + /// + /// The accountId. + /// + [FromRoute(Name = "accountId")] + [Required] + public Guid AccountId { get; set; } + + /// + /// UpdateAccountRequest. + /// + [FromBody] + [Required] + public UpdateAccountRequest Request { get; set; } + + /// + public override string ToString() + => $"{nameof(AccountId)}: {AccountId}, {nameof(Request)}: ({Request})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Accounts/Parameters/UpdateAccountNameParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Accounts/Parameters/UpdateAccountNameParameters.verified.cs new file mode 100644 index 00000000..cfcaded4 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Accounts/Parameters/UpdateAccountNameParameters.verified.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Accounts; + +/// +/// Parameters for operation request. +/// Description: Update name of account. +/// Operation: UpdateAccountName. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateAccountNameParameters +{ + /// + /// The accountId. + /// + [FromRoute(Name = "accountId")] + [Required] + public Guid AccountId { get; set; } + + /// + /// The account name. + /// + [FromHeader(Name = "name")] + public string? Name { get; set; } + + /// + public override string ToString() + => $"{nameof(AccountId)}: {AccountId}, {nameof(Name)}: {Name}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Accounts/Results/SetAccountNameResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Accounts/Results/SetAccountNameResult.verified.cs new file mode 100644 index 00000000..44244284 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Accounts/Results/SetAccountNameResult.verified.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Accounts; + +/// +/// Results for operation request. +/// Description: Set name of account. +/// Operation: SetAccountName. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class SetAccountNameResult : ResultBase +{ + private SetAccountNameResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static SetAccountNameResult Ok(string? message = null) + => new SetAccountNameResult(new OkObjectResult(message)); + + /// + /// Performs an implicit conversion from SetAccountNameResult to ActionResult. + /// + public static implicit operator SetAccountNameResult(string response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Accounts/Results/UpdateAccountNameResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Accounts/Results/UpdateAccountNameResult.verified.cs new file mode 100644 index 00000000..d7ac4f99 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Accounts/Results/UpdateAccountNameResult.verified.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Accounts; + +/// +/// Results for operation request. +/// Description: Update name of account. +/// Operation: UpdateAccountName. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateAccountNameResult : ResultBase +{ + private UpdateAccountNameResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static UpdateAccountNameResult Ok(string? message = null) + => new UpdateAccountNameResult(new OkObjectResult(message)); + + /// + /// Performs an implicit conversion from UpdateAccountNameResult to ActionResult. + /// + public static implicit operator UpdateAccountNameResult(string response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Addresses/Interfaces/IGetAddressesByPostalCodesHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Addresses/Interfaces/IGetAddressesByPostalCodesHandler.verified.cs new file mode 100644 index 00000000..74e63f6f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Addresses/Interfaces/IGetAddressesByPostalCodesHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Addresses; + +/// +/// Domain Interface for RequestHandler. +/// Description: Get addresses by postal code. +/// Operation: GetAddressesByPostalCodes. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetAddressesByPostalCodesHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + GetAddressesByPostalCodesParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Addresses/Parameters/GetAddressesByPostalCodesParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Addresses/Parameters/GetAddressesByPostalCodesParameters.verified.cs new file mode 100644 index 00000000..b3d1da3b --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Addresses/Parameters/GetAddressesByPostalCodesParameters.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Addresses; + +/// +/// Parameters for operation request. +/// Description: Get addresses by postal code. +/// Operation: GetAddressesByPostalCodes. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetAddressesByPostalCodesParameters +{ + /// + /// The postalCode to limit addresses on. + /// + [FromRoute(Name = "postalCode")] + [Required] + public string PostalCode { get; set; } + + /// + public override string ToString() + => $"{nameof(PostalCode)}: {PostalCode}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Addresses/Results/GetAddressesByPostalCodesResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Addresses/Results/GetAddressesByPostalCodesResult.verified.cs new file mode 100644 index 00000000..4b50660c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Addresses/Results/GetAddressesByPostalCodesResult.verified.cs @@ -0,0 +1,36 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Addresses; + +/// +/// Results for operation request. +/// Description: Get addresses by postal code. +/// Operation: GetAddressesByPostalCodes. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetAddressesByPostalCodesResult : ResultBase +{ + private GetAddressesByPostalCodesResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static GetAddressesByPostalCodesResult Ok(IEnumerable
response) + => new GetAddressesByPostalCodesResult(new OkObjectResult(response ?? Enumerable.Empty
())); + + /// + /// 404 - NotFound response. + /// + public static GetAddressesByPostalCodesResult NotFound(string? message = null) + => new GetAddressesByPostalCodesResult(new NotFoundObjectResult(message)); + + /// + /// Performs an implicit conversion from GetAddressesByPostalCodesResult to ActionResult. + /// + public static implicit operator GetAddressesByPostalCodesResult(List
response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/EventArgs/Interfaces/IGetEventArgByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/EventArgs/Interfaces/IGetEventArgByIdHandler.verified.cs new file mode 100644 index 00000000..9908e66a --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/EventArgs/Interfaces/IGetEventArgByIdHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.EventArgs; + +/// +/// Domain Interface for RequestHandler. +/// Description: Get EventArgs By Id. +/// Operation: GetEventArgById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetEventArgByIdHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + GetEventArgByIdParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/EventArgs/Interfaces/IGetEventArgsHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/EventArgs/Interfaces/IGetEventArgsHandler.verified.cs new file mode 100644 index 00000000..f02b36fa --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/EventArgs/Interfaces/IGetEventArgsHandler.verified.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.EventArgs; + +/// +/// Domain Interface for RequestHandler. +/// Description: Get EventArgs List. +/// Operation: GetEventArgs. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetEventArgsHandler +{ + /// + /// Execute method. + /// + /// The cancellation token. + Task ExecuteAsync( + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/EventArgs/Models/EventArgs.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/EventArgs/Models/EventArgs.verified.cs new file mode 100644 index 00000000..0305f76f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/EventArgs/Models/EventArgs.verified.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.EventArgs; + +/// +/// EventArgs. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class EventArgs +{ + public Guid Id { get; set; } + + public string EventName { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(EventName)}: {EventName}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/EventArgs/Parameters/GetEventArgByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/EventArgs/Parameters/GetEventArgByIdParameters.verified.cs new file mode 100644 index 00000000..c7eb960c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/EventArgs/Parameters/GetEventArgByIdParameters.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.EventArgs; + +/// +/// Parameters for operation request. +/// Description: Get EventArgs By Id. +/// Operation: GetEventArgById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetEventArgByIdParameters +{ + /// + /// The id of the eventArgs. + /// + [FromRoute(Name = "id")] + [Required] + public string Id { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/EventArgs/Results/GetEventArgByIdResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/EventArgs/Results/GetEventArgByIdResult.verified.cs new file mode 100644 index 00000000..26002197 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/EventArgs/Results/GetEventArgByIdResult.verified.cs @@ -0,0 +1,36 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.EventArgs; + +/// +/// Results for operation request. +/// Description: Get EventArgs By Id. +/// Operation: GetEventArgById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetEventArgByIdResult : ResultBase +{ + private GetEventArgByIdResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static GetEventArgByIdResult Ok(EventArgs response) + => new GetEventArgByIdResult(new OkObjectResult(response)); + + /// + /// 404 - NotFound response. + /// + public static GetEventArgByIdResult NotFound(string? message = null) + => new GetEventArgByIdResult(new NotFoundObjectResult(message)); + + /// + /// Performs an implicit conversion from GetEventArgByIdResult to ActionResult. + /// + public static implicit operator GetEventArgByIdResult(EventArgs response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/EventArgs/Results/GetEventArgsResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/EventArgs/Results/GetEventArgsResult.verified.cs new file mode 100644 index 00000000..00254520 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/EventArgs/Results/GetEventArgsResult.verified.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.EventArgs; + +/// +/// Results for operation request. +/// Description: Get EventArgs List. +/// Operation: GetEventArgs. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetEventArgsResult : ResultBase +{ + private GetEventArgsResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static GetEventArgsResult Ok(IEnumerable response) + => new GetEventArgsResult(new OkObjectResult(response ?? Enumerable.Empty())); + + /// + /// Performs an implicit conversion from GetEventArgsResult to ActionResult. + /// + public static implicit operator GetEventArgsResult(List response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Files/Interfaces/IGetFileByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Files/Interfaces/IGetFileByIdHandler.verified.cs new file mode 100644 index 00000000..0121cf0d --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Files/Interfaces/IGetFileByIdHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Files; + +/// +/// Domain Interface for RequestHandler. +/// Description: Get File By Id. +/// Operation: GetFileById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetFileByIdHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + GetFileByIdParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Files/Interfaces/IUploadMultiFilesAsFormDataHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Files/Interfaces/IUploadMultiFilesAsFormDataHandler.verified.cs new file mode 100644 index 00000000..d6a97f61 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Files/Interfaces/IUploadMultiFilesAsFormDataHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Files; + +/// +/// Domain Interface for RequestHandler. +/// Description: Upload multi files as form data. +/// Operation: UploadMultiFilesAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IUploadMultiFilesAsFormDataHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + UploadMultiFilesAsFormDataParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Files/Interfaces/IUploadSingleFileAsFormDataHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Files/Interfaces/IUploadSingleFileAsFormDataHandler.verified.cs new file mode 100644 index 00000000..a1933245 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Files/Interfaces/IUploadSingleFileAsFormDataHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Files; + +/// +/// Domain Interface for RequestHandler. +/// Description: Upload a file as OctetStream. +/// Operation: UploadSingleFileAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IUploadSingleFileAsFormDataHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + UploadSingleFileAsFormDataParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Files/Interfaces/IUploadSingleObjectWithFileAsFormDataHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Files/Interfaces/IUploadSingleObjectWithFileAsFormDataHandler.verified.cs new file mode 100644 index 00000000..976a100e --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Files/Interfaces/IUploadSingleObjectWithFileAsFormDataHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Files; + +/// +/// Domain Interface for RequestHandler. +/// Description: Upload a file as FormData. +/// Operation: UploadSingleObjectWithFileAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IUploadSingleObjectWithFileAsFormDataHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + UploadSingleObjectWithFileAsFormDataParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Files/Interfaces/IUploadSingleObjectWithFilesAsFormDataHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Files/Interfaces/IUploadSingleObjectWithFilesAsFormDataHandler.verified.cs new file mode 100644 index 00000000..777186e2 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Files/Interfaces/IUploadSingleObjectWithFilesAsFormDataHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Files; + +/// +/// Domain Interface for RequestHandler. +/// Description: Upload files as FormData. +/// Operation: UploadSingleObjectWithFilesAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IUploadSingleObjectWithFilesAsFormDataHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + UploadSingleObjectWithFilesAsFormDataParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Files/Models/FileAsFormDataRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Files/Models/FileAsFormDataRequest.verified.cs new file mode 100644 index 00000000..e64a9991 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Files/Models/FileAsFormDataRequest.verified.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Files; + +/// +/// FileAsFormDataRequest. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class FileAsFormDataRequest +{ + [Required] + public string ItemName { get; set; } + + public IFormFile? File { get; set; } + + [Required] + public List Items { get; set; } + + /// + public override string ToString() + => $"{nameof(ItemName)}: {ItemName}, {nameof(File)}: {File}, {nameof(Items)}.Count: {Items?.Count ?? 0}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Files/Models/FilesAsFormDataRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Files/Models/FilesAsFormDataRequest.verified.cs new file mode 100644 index 00000000..d0b4c799 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Files/Models/FilesAsFormDataRequest.verified.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Files; + +/// +/// FilesAsFormDataRequest. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class FilesAsFormDataRequest +{ + /// + /// A list of File(s). + /// + public List Files { get; set; } = new List(); + + /// + public override string ToString() + => $"{nameof(Files)}.Count: {Files?.Count ?? 0}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Files/Parameters/GetFileByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Files/Parameters/GetFileByIdParameters.verified.cs new file mode 100644 index 00000000..11c04947 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Files/Parameters/GetFileByIdParameters.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Files; + +/// +/// Parameters for operation request. +/// Description: Get File By Id. +/// Operation: GetFileById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetFileByIdParameters +{ + /// + /// The file id. + /// + [FromRoute(Name = "id")] + [Required] + public string Id { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Files/Parameters/UploadMultiFilesAsFormDataParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Files/Parameters/UploadMultiFilesAsFormDataParameters.verified.cs new file mode 100644 index 00000000..e41dfcc2 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Files/Parameters/UploadMultiFilesAsFormDataParameters.verified.cs @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Files; + +/// +/// Parameters for operation request. +/// Description: Upload multi files as form data. +/// Operation: UploadMultiFilesAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UploadMultiFilesAsFormDataParameters +{ + [FromForm] + [Required] + public List Request { get; set; } = new List(); + + /// + public override string ToString() + => $"{nameof(Request)}.Count: {Request?.Count ?? 0}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Files/Parameters/UploadSingleFileAsFormDataParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Files/Parameters/UploadSingleFileAsFormDataParameters.verified.cs new file mode 100644 index 00000000..7ef10fb1 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Files/Parameters/UploadSingleFileAsFormDataParameters.verified.cs @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Files; + +/// +/// Parameters for operation request. +/// Description: Upload a file as OctetStream. +/// Operation: UploadSingleFileAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UploadSingleFileAsFormDataParameters +{ + [FromBody] + [Required] + public IFormFile Request { get; set; } + + /// + public override string ToString() + => $"{nameof(Request)}: ({Request})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Files/Parameters/UploadSingleObjectWithFileAsFormDataParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Files/Parameters/UploadSingleObjectWithFileAsFormDataParameters.verified.cs new file mode 100644 index 00000000..7a5462ec --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Files/Parameters/UploadSingleObjectWithFileAsFormDataParameters.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Files; + +/// +/// Parameters for operation request. +/// Description: Upload a file as FormData. +/// Operation: UploadSingleObjectWithFileAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UploadSingleObjectWithFileAsFormDataParameters +{ + /// + /// FileAsFormDataRequest. + /// + [FromForm] + [Required] + public FileAsFormDataRequest Request { get; set; } + + /// + public override string ToString() + => $"{nameof(Request)}: ({Request})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Files/Parameters/UploadSingleObjectWithFilesAsFormDataParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Files/Parameters/UploadSingleObjectWithFilesAsFormDataParameters.verified.cs new file mode 100644 index 00000000..7039a93f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Files/Parameters/UploadSingleObjectWithFilesAsFormDataParameters.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Files; + +/// +/// Parameters for operation request. +/// Description: Upload files as FormData. +/// Operation: UploadSingleObjectWithFilesAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UploadSingleObjectWithFilesAsFormDataParameters +{ + /// + /// FilesAsFormDataRequest. + /// + [FromForm] + [Required] + public FilesAsFormDataRequest Request { get; set; } + + /// + public override string ToString() + => $"{nameof(Request)}: ({Request})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Files/Results/GetFileByIdResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Files/Results/GetFileByIdResult.verified.cs new file mode 100644 index 00000000..f27365b1 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Files/Results/GetFileByIdResult.verified.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Files; + +/// +/// Results for operation request. +/// Description: Get File By Id. +/// Operation: GetFileById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetFileByIdResult : ResultBase +{ + private GetFileByIdResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static GetFileByIdResult Ok(byte[] bytes, string fileName) + => new GetFileByIdResult(ResultFactory.CreateFileContentResult(bytes, fileName)); + + /// + /// 404 - NotFound response. + /// + public static GetFileByIdResult NotFound(string? message = null) + => new GetFileByIdResult(new NotFoundObjectResult(message)); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Files/Results/UploadMultiFilesAsFormDataResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Files/Results/UploadMultiFilesAsFormDataResult.verified.cs new file mode 100644 index 00000000..5f4441db --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Files/Results/UploadMultiFilesAsFormDataResult.verified.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Files; + +/// +/// Results for operation request. +/// Description: Upload multi files as form data. +/// Operation: UploadMultiFilesAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UploadMultiFilesAsFormDataResult : ResultBase +{ + private UploadMultiFilesAsFormDataResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static UploadMultiFilesAsFormDataResult Ok(string? message = null) + => new UploadMultiFilesAsFormDataResult(new OkObjectResult(message)); + + /// + /// Performs an implicit conversion from UploadMultiFilesAsFormDataResult to ActionResult. + /// + public static implicit operator UploadMultiFilesAsFormDataResult(string response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Files/Results/UploadSingleFileAsFormDataResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Files/Results/UploadSingleFileAsFormDataResult.verified.cs new file mode 100644 index 00000000..82fb37d2 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Files/Results/UploadSingleFileAsFormDataResult.verified.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Files; + +/// +/// Results for operation request. +/// Description: Upload a file as OctetStream. +/// Operation: UploadSingleFileAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UploadSingleFileAsFormDataResult : ResultBase +{ + private UploadSingleFileAsFormDataResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static UploadSingleFileAsFormDataResult Ok(string? message = null) + => new UploadSingleFileAsFormDataResult(new OkObjectResult(message)); + + /// + /// Performs an implicit conversion from UploadSingleFileAsFormDataResult to ActionResult. + /// + public static implicit operator UploadSingleFileAsFormDataResult(string response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Files/Results/UploadSingleObjectWithFileAsFormDataResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Files/Results/UploadSingleObjectWithFileAsFormDataResult.verified.cs new file mode 100644 index 00000000..8381d82b --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Files/Results/UploadSingleObjectWithFileAsFormDataResult.verified.cs @@ -0,0 +1,36 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Files; + +/// +/// Results for operation request. +/// Description: Upload a file as FormData. +/// Operation: UploadSingleObjectWithFileAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UploadSingleObjectWithFileAsFormDataResult : ResultBase +{ + private UploadSingleObjectWithFileAsFormDataResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static UploadSingleObjectWithFileAsFormDataResult Ok(string? message = null) + => new UploadSingleObjectWithFileAsFormDataResult(new OkObjectResult(message)); + + /// + /// 400 - BadRequest response. + /// + public static UploadSingleObjectWithFileAsFormDataResult BadRequest(string? message = null) + => new UploadSingleObjectWithFileAsFormDataResult(new BadRequestObjectResult(message)); + + /// + /// Performs an implicit conversion from UploadSingleObjectWithFileAsFormDataResult to ActionResult. + /// + public static implicit operator UploadSingleObjectWithFileAsFormDataResult(string response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Files/Results/UploadSingleObjectWithFilesAsFormDataResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Files/Results/UploadSingleObjectWithFilesAsFormDataResult.verified.cs new file mode 100644 index 00000000..d35b444c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Files/Results/UploadSingleObjectWithFilesAsFormDataResult.verified.cs @@ -0,0 +1,36 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Files; + +/// +/// Results for operation request. +/// Description: Upload files as FormData. +/// Operation: UploadSingleObjectWithFilesAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UploadSingleObjectWithFilesAsFormDataResult : ResultBase +{ + private UploadSingleObjectWithFilesAsFormDataResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static UploadSingleObjectWithFilesAsFormDataResult Ok(string? message = null) + => new UploadSingleObjectWithFilesAsFormDataResult(new OkObjectResult(message)); + + /// + /// 400 - BadRequest response. + /// + public static UploadSingleObjectWithFilesAsFormDataResult BadRequest(string? message = null) + => new UploadSingleObjectWithFilesAsFormDataResult(new BadRequestObjectResult(message)); + + /// + /// Performs an implicit conversion from UploadSingleObjectWithFilesAsFormDataResult to ActionResult. + /// + public static implicit operator UploadSingleObjectWithFilesAsFormDataResult(string response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Items/Interfaces/ICreateItemHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Items/Interfaces/ICreateItemHandler.verified.cs new file mode 100644 index 00000000..e18627be --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Items/Interfaces/ICreateItemHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Items; + +/// +/// Domain Interface for RequestHandler. +/// Description: Create a new item. +/// Operation: CreateItem. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface ICreateItemHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + CreateItemParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Items/Interfaces/IUpdateItemHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Items/Interfaces/IUpdateItemHandler.verified.cs new file mode 100644 index 00000000..2917f14c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Items/Interfaces/IUpdateItemHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Items; + +/// +/// Domain Interface for RequestHandler. +/// Description: Updates an item. +/// Operation: UpdateItem. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IUpdateItemHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + UpdateItemParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Items/Models/CreateItemRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Items/Models/CreateItemRequest.verified.cs new file mode 100644 index 00000000..7b9879e6 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Items/Models/CreateItemRequest.verified.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Items; + +/// +/// CreateItemRequest. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class CreateItemRequest +{ + /// + /// Item. + /// + [Required] + public Item Item { get; set; } + + /// + /// A list of Item. + /// + [Required] + public List MyItems { get; set; } + + /// + public override string ToString() + => $"{nameof(Item)}: ({Item}), {nameof(MyItems)}.Count: {MyItems?.Count ?? 0}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Items/Models/Item.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Items/Models/Item.verified.cs new file mode 100644 index 00000000..81ca337f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Items/Models/Item.verified.cs @@ -0,0 +1,21 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Items; + +/// +/// Item. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Item +{ + [Required] + public string Name { get; set; } + + /// + public override string ToString() + => $"{nameof(Name)}: {Name}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Items/Models/UpdateItemRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Items/Models/UpdateItemRequest.verified.cs new file mode 100644 index 00000000..623546f5 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Items/Models/UpdateItemRequest.verified.cs @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Items; + +/// +/// UpdateItemRequest. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateItemRequest +{ + /// + /// Item. + /// + [Required] + public Item Item { get; set; } + + /// + public override string ToString() + => $"{nameof(Item)}: ({Item})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Items/Parameters/CreateItemParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Items/Parameters/CreateItemParameters.verified.cs new file mode 100644 index 00000000..6066aac8 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Items/Parameters/CreateItemParameters.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Items; + +/// +/// Parameters for operation request. +/// Description: Create a new item. +/// Operation: CreateItem. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class CreateItemParameters +{ + /// + /// CreateItemRequest. + /// + [FromBody] + [Required] + public CreateItemRequest Request { get; set; } + + /// + public override string ToString() + => $"{nameof(Request)}: ({Request})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Items/Parameters/UpdateItemParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Items/Parameters/UpdateItemParameters.verified.cs new file mode 100644 index 00000000..cf1f9d53 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Items/Parameters/UpdateItemParameters.verified.cs @@ -0,0 +1,34 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Items; + +/// +/// Parameters for operation request. +/// Description: Updates an item. +/// Operation: UpdateItem. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateItemParameters +{ + /// + /// The id of the order. + /// + [FromRoute(Name = "id")] + [Required] + public Guid Id { get; set; } + + /// + /// UpdateItemRequest. + /// + [FromBody] + [Required] + public UpdateItemRequest Request { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(Request)}: ({Request})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Items/Results/CreateItemResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Items/Results/CreateItemResult.verified.cs new file mode 100644 index 00000000..aa2df4a2 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Items/Results/CreateItemResult.verified.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Items; + +/// +/// Results for operation request. +/// Description: Create a new item. +/// Operation: CreateItem. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class CreateItemResult : ResultBase +{ + private CreateItemResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static CreateItemResult Ok(string? message = null) + => new CreateItemResult(new OkObjectResult(message)); + + /// + /// Performs an implicit conversion from CreateItemResult to ActionResult. + /// + public static implicit operator CreateItemResult(string response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Items/Results/UpdateItemResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Items/Results/UpdateItemResult.verified.cs new file mode 100644 index 00000000..8ab0397e --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Items/Results/UpdateItemResult.verified.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Items; + +/// +/// Results for operation request. +/// Description: Updates an item. +/// Operation: UpdateItem. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateItemResult : ResultBase +{ + private UpdateItemResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static UpdateItemResult Ok(Guid response) + => new UpdateItemResult(new OkObjectResult(response)); + + /// + /// Performs an implicit conversion from UpdateItemResult to ActionResult. + /// + public static implicit operator UpdateItemResult(Guid response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Orders/Interfaces/IGetOrderByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Orders/Interfaces/IGetOrderByIdHandler.verified.cs new file mode 100644 index 00000000..3744780b --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Orders/Interfaces/IGetOrderByIdHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Orders; + +/// +/// Domain Interface for RequestHandler. +/// Description: Get order by id. +/// Operation: GetOrderById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetOrderByIdHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + GetOrderByIdParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Orders/Interfaces/IGetOrdersHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Orders/Interfaces/IGetOrdersHandler.verified.cs new file mode 100644 index 00000000..7d8363cf --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Orders/Interfaces/IGetOrdersHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Orders; + +/// +/// Domain Interface for RequestHandler. +/// Description: Get orders. +/// Operation: GetOrders. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetOrdersHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + GetOrdersParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Orders/Interfaces/IPatchOrdersIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Orders/Interfaces/IPatchOrdersIdHandler.verified.cs new file mode 100644 index 00000000..a928e1ca --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Orders/Interfaces/IPatchOrdersIdHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Orders; + +/// +/// Domain Interface for RequestHandler. +/// Description: Update part of order by id. +/// Operation: PatchOrdersId. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IPatchOrdersIdHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + PatchOrdersIdParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Orders/Models/Order.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Orders/Models/Order.verified.cs new file mode 100644 index 00000000..df052d84 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Orders/Models/Order.verified.cs @@ -0,0 +1,79 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Orders; + +/// +/// A single order. +/// Hallo description with multiline and no ending dot. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Order +{ + public Guid Id { get; set; } + + public string Description { get; set; } + + public DateTimeOffset MyTime { get; set; } + + /// + /// Undefined description. + /// + /// + /// Email validation being enforced. + /// + [EmailAddress] + public string MyEmail { get; set; } = "a@a.com"; + + public DateTimeOffset? MyNullableDateTime { get; set; } + + public DateTimeOffset MyDateTime { get; set; } + + [Range(1.1, 20.2)] + public double MyNumber { get; set; } + + [Range(-2147483648, 50)] + public int MyInteger { get; set; } = 15; + + /// + /// MyBool is great. + /// + public bool MyBool { get; set; } + + /// + /// This is the good uri :-). + /// + /// + /// Url validation being enforced. + /// + [Uri] + public Uri MyUri { get; set; } + + /// + /// Undefined description. + /// + /// + /// This string should be base64-encoded. + /// + public string MyByte { get; set; } + + /// + /// Hallo myStringList desc :-). + /// + public List MyStringList { get; set; } = new List(); + + [Range(10, 2147483647)] + public long MyLong { get; set; } + + /// + /// Address. + /// + public Address DeliveryAddress { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(Description)}: {Description}, {nameof(MyTime)}: ({MyTime}), {nameof(MyEmail)}: {MyEmail}, {nameof(MyNullableDateTime)}: ({MyNullableDateTime}), {nameof(MyDateTime)}: ({MyDateTime}), {nameof(MyNumber)}: {MyNumber}, {nameof(MyInteger)}: {MyInteger}, {nameof(MyBool)}: {MyBool}, {nameof(MyUri)}: ({MyUri}), {nameof(MyByte)}: {MyByte}, {nameof(MyStringList)}.Count: {MyStringList?.Count ?? 0}, {nameof(MyLong)}: {MyLong}, {nameof(DeliveryAddress)}: ({DeliveryAddress})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Orders/Models/UpdateOrderRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Orders/Models/UpdateOrderRequest.verified.cs new file mode 100644 index 00000000..af86ad95 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Orders/Models/UpdateOrderRequest.verified.cs @@ -0,0 +1,28 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Orders; + +/// +/// Request to update an order. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateOrderRequest +{ + /// + /// Undefined description. + /// + /// + /// Email validation being enforced. + /// + [Required] + [EmailAddress] + public string MyEmail { get; set; } + + /// + public override string ToString() + => $"{nameof(MyEmail)}: {MyEmail}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Orders/Parameters/GetOrderByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Orders/Parameters/GetOrderByIdParameters.verified.cs new file mode 100644 index 00000000..1c016476 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Orders/Parameters/GetOrderByIdParameters.verified.cs @@ -0,0 +1,37 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Orders; + +/// +/// Parameters for operation request. +/// Description: Get order by id. +/// Operation: GetOrderById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetOrderByIdParameters +{ + /// + /// The id of the order. + /// + [FromRoute(Name = "id")] + [Required] + public Guid Id { get; set; } + + /// + /// The email for filter orders to retrieve. + /// + /// + /// Email validation being enforced. + /// + [FromQuery(Name = "myEmail")] + [EmailAddress] + public string? MyEmail { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(MyEmail)}: {MyEmail}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Orders/Parameters/GetOrdersParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Orders/Parameters/GetOrdersParameters.verified.cs new file mode 100644 index 00000000..45c7ad65 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Orders/Parameters/GetOrdersParameters.verified.cs @@ -0,0 +1,53 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Orders; + +/// +/// Parameters for operation request. +/// Description: Get orders. +/// Operation: GetOrders. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetOrdersParameters +{ + /// + /// The numbers of items to return. + /// + [FromQuery(Name = "pageSize")] + [Required] + [Range(1, 100)] + public int PageSize { get; set; } = 10; + + /// + /// The number of items to skip before starting to collect the result set. + /// + [FromQuery(Name = "pageIndex")] + [Range(0, 2147483647)] + public int PageIndex { get; set; } = 0; + + /// + /// The query string. + /// + [FromQuery(Name = "queryString")] + public string? QueryString { get; set; } + + /// + /// The query array of string. + /// + [FromQuery(Name = "queryStringArray")] + public List QueryStringArray { get; set; } = new List(); + + /// + /// The continuation token. + /// + [FromQuery(Name = "continuationToken")] + public string? ContinuationToken { get; set; } + + /// + public override string ToString() + => $"{nameof(PageSize)}: {PageSize}, {nameof(PageIndex)}: {PageIndex}, {nameof(QueryString)}: {QueryString}, {nameof(QueryStringArray)}.Count: {QueryStringArray?.Count ?? 0}, {nameof(ContinuationToken)}: {ContinuationToken}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Orders/Parameters/PatchOrdersIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Orders/Parameters/PatchOrdersIdParameters.verified.cs new file mode 100644 index 00000000..e8f4db33 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Orders/Parameters/PatchOrdersIdParameters.verified.cs @@ -0,0 +1,62 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Orders; + +/// +/// Parameters for operation request. +/// Description: Update part of order by id. +/// Operation: PatchOrdersId. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class PatchOrdersIdParameters +{ + /// + /// The id of the order. + /// + [FromRoute(Name = "id")] + [Required] + public Guid Id { get; set; } + + /// + /// The myTestHeader special key. + /// + [FromHeader(Name = "myTestHeader")] + [Required] + public string MyTestHeader { get; set; } + + /// + /// The myTestHeaderBool special key. + /// + [FromHeader(Name = "myTestHeaderBool")] + [Required] + public bool MyTestHeaderBool { get; set; } + + /// + /// The myTestHeaderInt special key. + /// + [FromHeader(Name = "myTestHeaderInt")] + [Required] + public int MyTestHeaderInt { get; set; } + + /// + /// The correlationId. + /// + [FromHeader(Name = "x-correlation-id")] + [Required] + public string CorrelationId { get; set; } + + /// + /// Request to update an order. + /// + [FromBody] + [Required] + public UpdateOrderRequest Request { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(MyTestHeader)}: {MyTestHeader}, {nameof(MyTestHeaderBool)}: {MyTestHeaderBool}, {nameof(MyTestHeaderInt)}: {MyTestHeaderInt}, {nameof(CorrelationId)}: {CorrelationId}, {nameof(Request)}: ({Request})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Orders/Results/GetOrderByIdResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Orders/Results/GetOrderByIdResult.verified.cs new file mode 100644 index 00000000..1c41373f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Orders/Results/GetOrderByIdResult.verified.cs @@ -0,0 +1,36 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Orders; + +/// +/// Results for operation request. +/// Description: Get order by id. +/// Operation: GetOrderById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetOrderByIdResult : ResultBase +{ + private GetOrderByIdResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static GetOrderByIdResult Ok(Order response) + => new GetOrderByIdResult(new OkObjectResult(response)); + + /// + /// 404 - NotFound response. + /// + public static GetOrderByIdResult NotFound(string? message = null) + => new GetOrderByIdResult(new NotFoundObjectResult(message)); + + /// + /// Performs an implicit conversion from GetOrderByIdResult to ActionResult. + /// + public static implicit operator GetOrderByIdResult(Order response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Orders/Results/GetOrdersResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Orders/Results/GetOrdersResult.verified.cs new file mode 100644 index 00000000..f10c1886 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Orders/Results/GetOrdersResult.verified.cs @@ -0,0 +1,36 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Orders; + +/// +/// Results for operation request. +/// Description: Get orders. +/// Operation: GetOrders. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetOrdersResult : ResultBase +{ + private GetOrdersResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static GetOrdersResult Ok(Pagination response) + => new GetOrdersResult(new OkObjectResult(response)); + + /// + /// 404 - NotFound response. + /// + public static GetOrdersResult NotFound(string? message = null) + => new GetOrdersResult(new NotFoundObjectResult(message)); + + /// + /// Performs an implicit conversion from GetOrdersResult to ActionResult. + /// + public static implicit operator GetOrdersResult(Pagination response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Orders/Results/PatchOrdersIdResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Orders/Results/PatchOrdersIdResult.verified.cs new file mode 100644 index 00000000..1610be7d --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Orders/Results/PatchOrdersIdResult.verified.cs @@ -0,0 +1,48 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Orders; + +/// +/// Results for operation request. +/// Description: Update part of order by id. +/// Operation: PatchOrdersId. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class PatchOrdersIdResult : ResultBase +{ + private PatchOrdersIdResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static PatchOrdersIdResult Ok(string? message = null) + => new PatchOrdersIdResult(new OkObjectResult(message)); + + /// + /// 404 - NotFound response. + /// + public static PatchOrdersIdResult NotFound(string? message = null) + => new PatchOrdersIdResult(new NotFoundObjectResult(message)); + + /// + /// 409 - Conflict response. + /// + public static PatchOrdersIdResult Conflict(string? message = null) + => new PatchOrdersIdResult(new ConflictObjectResult(message)); + + /// + /// 502 - BadGateway response. + /// + public static PatchOrdersIdResult BadGateway(string? message = null) + => new PatchOrdersIdResult(ResultFactory.CreateContentResult(HttpStatusCode.BadGateway, message)); + + /// + /// Performs an implicit conversion from PatchOrdersIdResult to ActionResult. + /// + public static implicit operator PatchOrdersIdResult(string response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/RouteWithDash/Interfaces/IGetRouteWithDashHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/RouteWithDash/Interfaces/IGetRouteWithDashHandler.verified.cs new file mode 100644 index 00000000..2091eb1e --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/RouteWithDash/Interfaces/IGetRouteWithDashHandler.verified.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.RouteWithDash; + +/// +/// Domain Interface for RequestHandler. +/// Description: Your GET endpoint. +/// Operation: GetRouteWithDash. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetRouteWithDashHandler +{ + /// + /// Execute method. + /// + /// The cancellation token. + Task ExecuteAsync( + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/RouteWithDash/Results/GetRouteWithDashResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/RouteWithDash/Results/GetRouteWithDashResult.verified.cs new file mode 100644 index 00000000..6931b120 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/RouteWithDash/Results/GetRouteWithDashResult.verified.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.RouteWithDash; + +/// +/// Results for operation request. +/// Description: Your GET endpoint. +/// Operation: GetRouteWithDash. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetRouteWithDashResult : ResultBase +{ + private GetRouteWithDashResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static GetRouteWithDashResult Ok(string? message = null) + => new GetRouteWithDashResult(new OkObjectResult(message)); + + /// + /// Performs an implicit conversion from GetRouteWithDashResult to ActionResult. + /// + public static implicit operator GetRouteWithDashResult(string response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Tasks/Interfaces/IGetTasksHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Tasks/Interfaces/IGetTasksHandler.verified.cs new file mode 100644 index 00000000..f8201041 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Tasks/Interfaces/IGetTasksHandler.verified.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Tasks; + +/// +/// Domain Interface for RequestHandler. +/// Description: Returns tasks. +/// Operation: GetTasks. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetTasksHandler +{ + /// + /// Execute method. + /// + /// The cancellation token. + Task ExecuteAsync( + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Tasks/Models/Task.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Tasks/Models/Task.verified.cs new file mode 100644 index 00000000..9058efb6 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Tasks/Models/Task.verified.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Tasks; + +/// +/// Describes a single task. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Task +{ + public Guid Id { get; set; } + + public string Name { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(Name)}: {Name}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Tasks/Models/Tasks.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Tasks/Models/Tasks.verified.cs new file mode 100644 index 00000000..4d63ac24 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Tasks/Models/Tasks.verified.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Tasks; + +/// +/// Contains a list of Tasks. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Tasks +{ + /// + /// A list of Task. + /// + public List TaskList { get; set; } = new List(); + + /// + public override string ToString() + => $"{nameof(TaskList)}.Count: {TaskList?.Count ?? 0}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Tasks/Results/GetTasksResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Tasks/Results/GetTasksResult.verified.cs new file mode 100644 index 00000000..11aeca16 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Tasks/Results/GetTasksResult.verified.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Tasks; + +/// +/// Results for operation request. +/// Description: Returns tasks. +/// Operation: GetTasks. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetTasksResult : ResultBase +{ + private GetTasksResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static GetTasksResult Ok(IEnumerable response) + => new GetTasksResult(new OkObjectResult(response ?? Enumerable.Empty())); + + /// + /// Performs an implicit conversion from GetTasksResult to ActionResult. + /// + public static implicit operator GetTasksResult(List response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Interfaces/IDeleteUserByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Interfaces/IDeleteUserByIdHandler.verified.cs new file mode 100644 index 00000000..0fff983b --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Interfaces/IDeleteUserByIdHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Users; + +/// +/// Domain Interface for RequestHandler. +/// Description: Delete user by id. +/// Operation: DeleteUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IDeleteUserByIdHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + DeleteUserByIdParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Interfaces/IGetUserByEmailHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Interfaces/IGetUserByEmailHandler.verified.cs new file mode 100644 index 00000000..f9753d12 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Interfaces/IGetUserByEmailHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Users; + +/// +/// Domain Interface for RequestHandler. +/// Description: Get user by email. +/// Operation: GetUserByEmail. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetUserByEmailHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + GetUserByEmailParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Interfaces/IGetUserByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Interfaces/IGetUserByIdHandler.verified.cs new file mode 100644 index 00000000..6e7c4e98 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Interfaces/IGetUserByIdHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Users; + +/// +/// Domain Interface for RequestHandler. +/// Description: Get user by id. +/// Operation: GetUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetUserByIdHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + GetUserByIdParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Interfaces/IGetUsersHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Interfaces/IGetUsersHandler.verified.cs new file mode 100644 index 00000000..5d58eef5 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Interfaces/IGetUsersHandler.verified.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Users; + +/// +/// Domain Interface for RequestHandler. +/// Description: Get all users. +/// Operation: GetUsers. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetUsersHandler +{ + /// + /// Execute method. + /// + /// The cancellation token. + Task ExecuteAsync( + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Interfaces/IPostUserHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Interfaces/IPostUserHandler.verified.cs new file mode 100644 index 00000000..1ab5ca87 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Interfaces/IPostUserHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Users; + +/// +/// Domain Interface for RequestHandler. +/// Description: Create a new user. +/// Operation: PostUser. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IPostUserHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + PostUserParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Interfaces/IUpdateMyTestGenderHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Interfaces/IUpdateMyTestGenderHandler.verified.cs new file mode 100644 index 00000000..5df1c46b --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Interfaces/IUpdateMyTestGenderHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Users; + +/// +/// Domain Interface for RequestHandler. +/// Description: Update gender on a user. +/// Operation: UpdateMyTestGender. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IUpdateMyTestGenderHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + UpdateMyTestGenderParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Interfaces/IUpdateUserByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Interfaces/IUpdateUserByIdHandler.verified.cs new file mode 100644 index 00000000..4196bb84 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Interfaces/IUpdateUserByIdHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Users; + +/// +/// Domain Interface for RequestHandler. +/// Description: Update user by id. +/// Operation: UpdateUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IUpdateUserByIdHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + UpdateUserByIdParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Models/CreateUserRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Models/CreateUserRequest.verified.cs new file mode 100644 index 00000000..2680cd9b --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Models/CreateUserRequest.verified.cs @@ -0,0 +1,65 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Users; + +/// +/// Request to create a user. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class CreateUserRequest +{ + [Required] + public string FirstName { get; set; } + + [Required] + public string LastName { get; set; } + + public DateTimeOffset? MyNullableDateTime { get; set; } + + [Required] + public DateTimeOffset MyDateTime { get; set; } + + /// + /// Undefined description. + /// + /// + /// Email validation being enforced. + /// + [Required] + [EmailAddress] + public string Email { get; set; } + + /// + /// Undefined description. + /// + /// + /// Url validation being enforced. + /// + [Uri] + public Uri Homepage { get; set; } + + /// + /// GenderType. + /// + [Required] + public GenderType Gender { get; set; } + + public Address? MyNullableAddress { get; set; } + + [Required] + public Dictionary Tags { get; set; } + + public Dictionary DesiredProperties1 { get; set; } + + public Dictionary? DesiredProperties2 { get; set; } + + public Dictionary? DesiredProperties3 { get; set; } + + /// + public override string ToString() + => $"{nameof(FirstName)}: {FirstName}, {nameof(LastName)}: {LastName}, {nameof(MyNullableDateTime)}: ({MyNullableDateTime}), {nameof(MyDateTime)}: ({MyDateTime}), {nameof(Email)}: {Email}, {nameof(Homepage)}: ({Homepage}), {nameof(Gender)}: {Gender}, {nameof(MyNullableAddress)}: ({MyNullableAddress}), {nameof(Tags)}: ({Tags}), {nameof(DesiredProperties1)}: ({DesiredProperties1}), {nameof(DesiredProperties2)}: ({DesiredProperties2}), {nameof(DesiredProperties3)}: ({DesiredProperties3})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Models/UpdateTestGenderRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Models/UpdateTestGenderRequest.verified.cs new file mode 100644 index 00000000..e2cf15b3 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Models/UpdateTestGenderRequest.verified.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Users; + +/// +/// Update test-gender Request. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateTestGenderRequest +{ + /// + /// GenderType. + /// + public GenderType Gender { get; set; } + + /// + public override string ToString() + => $"{nameof(Gender)}: {Gender}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Models/UpdateUserRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Models/UpdateUserRequest.verified.cs new file mode 100644 index 00000000..c0cfe19c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Models/UpdateUserRequest.verified.cs @@ -0,0 +1,36 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Users; + +/// +/// Request to update a user. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateUserRequest +{ + public string FirstName { get; set; } + + public string LastName { get; set; } + + /// + /// Undefined description. + /// + /// + /// Email validation being enforced. + /// + [EmailAddress] + public string Email { get; set; } + + /// + /// GenderType. + /// + public GenderType Gender { get; set; } + + /// + public override string ToString() + => $"{nameof(FirstName)}: {FirstName}, {nameof(LastName)}: {LastName}, {nameof(Email)}: {Email}, {nameof(Gender)}: {Gender}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Models/User.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Models/User.verified.cs new file mode 100644 index 00000000..931a823a --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Models/User.verified.cs @@ -0,0 +1,62 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Users; + +/// +/// A single user. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class User +{ + public Guid Id { get; set; } + + /// + /// GenderType. + /// + public GenderType Gender { get; set; } + + public string FirstName { get; set; } + + public string LastName { get; set; } + + /// + /// Undefined description. + /// + /// + /// Email validation being enforced. + /// + [EmailAddress] + public string Email { get; set; } + + /// + /// Undefined description. + /// + /// + /// Url validation being enforced. + /// + [Uri] + public Uri Homepage { get; set; } + + /// + /// ColorType. + /// + public ColorType Color { get; set; } + + /// + /// Address. + /// + public Address HomeAddress { get; set; } + + /// + /// Address. + /// + public Address CompanyAddress { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(Gender)}: {Gender}, {nameof(FirstName)}: {FirstName}, {nameof(LastName)}: {LastName}, {nameof(Email)}: {Email}, {nameof(Homepage)}: ({Homepage}), {nameof(Color)}: {Color}, {nameof(HomeAddress)}: ({HomeAddress}), {nameof(CompanyAddress)}: ({CompanyAddress})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Models/Users.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Models/Users.verified.cs new file mode 100644 index 00000000..d336a3e4 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Models/Users.verified.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Users; + +/// +/// A list of users. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Users +{ + /// + /// A list of User. + /// + public List UserList { get; set; } = new List(); + + /// + public override string ToString() + => $"{nameof(UserList)}.Count: {UserList?.Count ?? 0}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Parameters/DeleteUserByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Parameters/DeleteUserByIdParameters.verified.cs new file mode 100644 index 00000000..348eab10 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Parameters/DeleteUserByIdParameters.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Users; + +/// +/// Parameters for operation request. +/// Description: Delete user by id. +/// Operation: DeleteUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class DeleteUserByIdParameters +{ + /// + /// Id of the user. + /// + [FromRoute(Name = "id")] + [Required] + public Guid Id { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Parameters/GetUserByEmailParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Parameters/GetUserByEmailParameters.verified.cs new file mode 100644 index 00000000..d427547d --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Parameters/GetUserByEmailParameters.verified.cs @@ -0,0 +1,31 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Users; + +/// +/// Parameters for operation request. +/// Description: Get user by email. +/// Operation: GetUserByEmail. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetUserByEmailParameters +{ + /// + /// The email of the user to retrieve. + /// + /// + /// Email validation being enforced. + /// + [FromQuery(Name = "email")] + [Required] + [EmailAddress] + public string Email { get; set; } + + /// + public override string ToString() + => $"{nameof(Email)}: {Email}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Parameters/GetUserByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Parameters/GetUserByIdParameters.verified.cs new file mode 100644 index 00000000..af7585fb --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Parameters/GetUserByIdParameters.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Users; + +/// +/// Parameters for operation request. +/// Description: Get user by id. +/// Operation: GetUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetUserByIdParameters +{ + /// + /// Id of the user. + /// + [FromRoute(Name = "id")] + [Required] + public Guid Id { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Parameters/PostUserParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Parameters/PostUserParameters.verified.cs new file mode 100644 index 00000000..81d220f6 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Parameters/PostUserParameters.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Users; + +/// +/// Parameters for operation request. +/// Description: Create a new user. +/// Operation: PostUser. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class PostUserParameters +{ + /// + /// Request to create a user. + /// + [FromBody] + [Required] + public CreateUserRequest Request { get; set; } + + /// + public override string ToString() + => $"{nameof(Request)}: ({Request})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Parameters/UpdateMyTestGenderParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Parameters/UpdateMyTestGenderParameters.verified.cs new file mode 100644 index 00000000..fbc38d30 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Parameters/UpdateMyTestGenderParameters.verified.cs @@ -0,0 +1,40 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Users; + +/// +/// Parameters for operation request. +/// Description: Update gender on a user. +/// Operation: UpdateMyTestGender. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateMyTestGenderParameters +{ + /// + /// Id of the user. + /// + [FromRoute(Name = "id")] + [Required] + public Guid Id { get; set; } + + /// + /// The gender to set on the user. + /// + [FromQuery(Name = "genderParam")] + public GenderType? GenderParam { get; set; } + + /// + /// Update test-gender Request. + /// + [FromBody] + [Required] + public UpdateTestGenderRequest Request { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(GenderParam)}: {GenderParam}, {nameof(Request)}: ({Request})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Parameters/UpdateUserByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Parameters/UpdateUserByIdParameters.verified.cs new file mode 100644 index 00000000..f2e09c7a --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Parameters/UpdateUserByIdParameters.verified.cs @@ -0,0 +1,34 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Users; + +/// +/// Parameters for operation request. +/// Description: Update user by id. +/// Operation: UpdateUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateUserByIdParameters +{ + /// + /// Id of the user. + /// + [FromRoute(Name = "id")] + [Required] + public Guid Id { get; set; } + + /// + /// Request to update a user. + /// + [FromBody] + [Required] + public UpdateUserRequest Request { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(Request)}: ({Request})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Results/DeleteUserByIdResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Results/DeleteUserByIdResult.verified.cs new file mode 100644 index 00000000..03b1346e --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Results/DeleteUserByIdResult.verified.cs @@ -0,0 +1,42 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Users; + +/// +/// Results for operation request. +/// Description: Delete user by id. +/// Operation: DeleteUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class DeleteUserByIdResult : ResultBase +{ + private DeleteUserByIdResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static DeleteUserByIdResult Ok(string? message = null) + => new DeleteUserByIdResult(new OkObjectResult(message)); + + /// + /// 404 - NotFound response. + /// + public static DeleteUserByIdResult NotFound(string? message = null) + => new DeleteUserByIdResult(new NotFoundObjectResult(message)); + + /// + /// 409 - Conflict response. + /// + public static DeleteUserByIdResult Conflict(string? message = null) + => new DeleteUserByIdResult(new ConflictObjectResult(message)); + + /// + /// Performs an implicit conversion from DeleteUserByIdResult to ActionResult. + /// + public static implicit operator DeleteUserByIdResult(string response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Results/GetUserByEmailResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Results/GetUserByEmailResult.verified.cs new file mode 100644 index 00000000..2cb9b59d --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Results/GetUserByEmailResult.verified.cs @@ -0,0 +1,48 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Users; + +/// +/// Results for operation request. +/// Description: Get user by email. +/// Operation: GetUserByEmail. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetUserByEmailResult : ResultBase +{ + private GetUserByEmailResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static GetUserByEmailResult Ok(User response) + => new GetUserByEmailResult(new OkObjectResult(response)); + + /// + /// 400 - BadRequest response. + /// + public static GetUserByEmailResult BadRequest(string? message = null) + => new GetUserByEmailResult(new BadRequestObjectResult(message)); + + /// + /// 404 - NotFound response. + /// + public static GetUserByEmailResult NotFound(string? message = null) + => new GetUserByEmailResult(new NotFoundObjectResult(message)); + + /// + /// 409 - Conflict response. + /// + public static GetUserByEmailResult Conflict(string? message = null) + => new GetUserByEmailResult(new ConflictObjectResult(message)); + + /// + /// Performs an implicit conversion from GetUserByEmailResult to ActionResult. + /// + public static implicit operator GetUserByEmailResult(User response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Results/GetUserByIdResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Results/GetUserByIdResult.verified.cs new file mode 100644 index 00000000..2b172c01 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Results/GetUserByIdResult.verified.cs @@ -0,0 +1,42 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Users; + +/// +/// Results for operation request. +/// Description: Get user by id. +/// Operation: GetUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetUserByIdResult : ResultBase +{ + private GetUserByIdResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static GetUserByIdResult Ok(User response) + => new GetUserByIdResult(new OkObjectResult(response)); + + /// + /// 404 - NotFound response. + /// + public static GetUserByIdResult NotFound(string? message = null) + => new GetUserByIdResult(new NotFoundObjectResult(message)); + + /// + /// 409 - Conflict response. + /// + public static GetUserByIdResult Conflict(string? message = null) + => new GetUserByIdResult(new ConflictObjectResult(message)); + + /// + /// Performs an implicit conversion from GetUserByIdResult to ActionResult. + /// + public static implicit operator GetUserByIdResult(User response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Results/GetUsersResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Results/GetUsersResult.verified.cs new file mode 100644 index 00000000..8f873e0e --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Results/GetUsersResult.verified.cs @@ -0,0 +1,36 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Users; + +/// +/// Results for operation request. +/// Description: Get all users. +/// Operation: GetUsers. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetUsersResult : ResultBase +{ + private GetUsersResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static GetUsersResult Ok(IEnumerable response) + => new GetUsersResult(new OkObjectResult(response ?? Enumerable.Empty())); + + /// + /// 409 - Conflict response. + /// + public static GetUsersResult Conflict(string? message = null) + => new GetUsersResult(new ConflictObjectResult(message)); + + /// + /// Performs an implicit conversion from GetUsersResult to ActionResult. + /// + public static implicit operator GetUsersResult(List response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Results/PostUserResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Results/PostUserResult.verified.cs new file mode 100644 index 00000000..3ecf8347 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Results/PostUserResult.verified.cs @@ -0,0 +1,36 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Users; + +/// +/// Results for operation request. +/// Description: Create a new user. +/// Operation: PostUser. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class PostUserResult : ResultBase +{ + private PostUserResult(ActionResult result) : base(result) { } + + /// + /// 201 - Created response. + /// + public static PostUserResult Created(string? uri = null) + => new PostUserResult(ResultFactory.CreateContentResult(HttpStatusCode.Created, uri)); + + /// + /// 400 - BadRequest response. + /// + public static PostUserResult BadRequest(string? message = null) + => new PostUserResult(new BadRequestObjectResult(message)); + + /// + /// 409 - Conflict response. + /// + public static PostUserResult Conflict(string? message = null) + => new PostUserResult(new ConflictObjectResult(message)); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Results/UpdateMyTestGenderResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Results/UpdateMyTestGenderResult.verified.cs new file mode 100644 index 00000000..c67c2dec --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Results/UpdateMyTestGenderResult.verified.cs @@ -0,0 +1,48 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Users; + +/// +/// Results for operation request. +/// Description: Update gender on a user. +/// Operation: UpdateMyTestGender. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateMyTestGenderResult : ResultBase +{ + private UpdateMyTestGenderResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static UpdateMyTestGenderResult Ok(string? message = null) + => new UpdateMyTestGenderResult(new OkObjectResult(message)); + + /// + /// 400 - BadRequest response. + /// + public static UpdateMyTestGenderResult BadRequest(string? message = null) + => new UpdateMyTestGenderResult(new BadRequestObjectResult(message)); + + /// + /// 404 - NotFound response. + /// + public static UpdateMyTestGenderResult NotFound(string? message = null) + => new UpdateMyTestGenderResult(new NotFoundObjectResult(message)); + + /// + /// 409 - Conflict response. + /// + public static UpdateMyTestGenderResult Conflict(string? message = null) + => new UpdateMyTestGenderResult(new ConflictObjectResult(message)); + + /// + /// Performs an implicit conversion from UpdateMyTestGenderResult to ActionResult. + /// + public static implicit operator UpdateMyTestGenderResult(string response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Results/UpdateUserByIdResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Results/UpdateUserByIdResult.verified.cs new file mode 100644 index 00000000..a00aa57f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/Users/Results/UpdateUserByIdResult.verified.cs @@ -0,0 +1,48 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Users; + +/// +/// Results for operation request. +/// Description: Update user by id. +/// Operation: UpdateUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateUserByIdResult : ResultBase +{ + private UpdateUserByIdResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static UpdateUserByIdResult Ok(string? message = null) + => new UpdateUserByIdResult(new OkObjectResult(message)); + + /// + /// 400 - BadRequest response. + /// + public static UpdateUserByIdResult BadRequest(string? message = null) + => new UpdateUserByIdResult(new BadRequestObjectResult(message)); + + /// + /// 404 - NotFound response. + /// + public static UpdateUserByIdResult NotFound(string? message = null) + => new UpdateUserByIdResult(new NotFoundObjectResult(message)); + + /// + /// 409 - Conflict response. + /// + public static UpdateUserByIdResult Conflict(string? message = null) + => new UpdateUserByIdResult(new ConflictObjectResult(message)); + + /// + /// Performs an implicit conversion from UpdateUserByIdResult to ActionResult. + /// + public static implicit operator UpdateUserByIdResult(string response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/_EnumerationTypes/ColorType.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/_EnumerationTypes/ColorType.verified.cs new file mode 100644 index 00000000..986b8be5 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/_EnumerationTypes/ColorType.verified.cs @@ -0,0 +1,21 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts; + +/// +/// Enumeration: ColorType. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +[Flags] +public enum ColorType +{ + None = 0, + Black = 1, + White = 2, + Yellow = 4, + Red = 8, +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/_EnumerationTypes/GenderType.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/_EnumerationTypes/GenderType.verified.cs new file mode 100644 index 00000000..8ced6ccb --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/_EnumerationTypes/GenderType.verified.cs @@ -0,0 +1,19 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts; + +/// +/// Enumeration: GenderType. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public enum GenderType +{ + None, + NonBinary, + Male, + Female, +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/_Shared/Address.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/_Shared/Address.verified.cs new file mode 100644 index 00000000..96d54e99 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/_Shared/Address.verified.cs @@ -0,0 +1,32 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts; + +/// +/// Address. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Address +{ + [StringLength(255)] + public string StreetName { get; set; } + + public string StreetNumber { get; set; } + + public string PostalCode { get; set; } + + public string CityName { get; set; } + + /// + /// Country. + /// + public Country MyCountry { get; set; } + + /// + public override string ToString() + => $"{nameof(StreetName)}: {StreetName}, {nameof(StreetNumber)}: {StreetNumber}, {nameof(PostalCode)}: {PostalCode}, {nameof(CityName)}: {CityName}, {nameof(MyCountry)}: ({MyCountry})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/_Shared/Country.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/_Shared/Country.verified.cs new file mode 100644 index 00000000..50e92519 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Contracts/_Shared/Country.verified.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts; + +/// +/// Country. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Country +{ + [Required] + public string Name { get; set; } + + [Required] + [MinLength(2)] + [MaxLength(2)] + [RegularExpression("^[A-Za-z]{2}$")] + public string Alpha2Code { get; set; } + + [Required] + [MinLength(3)] + [MaxLength(3)] + [RegularExpression("^[A-Za-z]{3}$")] + public string Alpha3Code { get; set; } + + /// + public override string ToString() + => $"{nameof(Name)}: {Name}, {nameof(Alpha2Code)}: {Alpha2Code}, {nameof(Alpha3Code)}: {Alpha3Code}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Endpoints/AccountsController.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Endpoints/AccountsController.verified.cs new file mode 100644 index 00000000..aef33a8d --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Endpoints/AccountsController.verified.cs @@ -0,0 +1,45 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Endpoints; + +/// +/// Endpoint definitions. +/// +[Authorize] +[ApiController] +[Route("/api/v1/accounts")] +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public sealed class AccountsController : ControllerBase +{ + /// + /// Description: Update name of account. + /// Operation: UpdateAccountName. + /// + [HttpPut("{accountId}/name")] + [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + public async Task UpdateAccountName( + UpdateAccountNameParameters parameters, + [FromServices] IUpdateAccountNameHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); + + /// + /// Description: Set name of account. + /// Operation: SetAccountName. + /// + [HttpPost("{accountId}/name")] + [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + public async Task SetAccountName( + SetAccountNameParameters parameters, + [FromServices] ISetAccountNameHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Endpoints/AddressesController.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Endpoints/AddressesController.verified.cs new file mode 100644 index 00000000..b117190d --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Endpoints/AddressesController.verified.cs @@ -0,0 +1,32 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Endpoints; + +/// +/// Endpoint definitions. +/// +[Authorize] +[ApiController] +[Route("/api/v1/addresses")] +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public sealed class AddressesController : ControllerBase +{ + /// + /// Description: Get addresses by postal code. + /// Operation: GetAddressesByPostalCodes. + /// + [HttpGet("{postalCode}")] + [ProducesResponseType(typeof(IEnumerable
), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(typeof(string), StatusCodes.Status404NotFound)] + public async Task GetAddressesByPostalCodes( + GetAddressesByPostalCodesParameters parameters, + [FromServices] IGetAddressesByPostalCodesHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Endpoints/EventArgsController.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Endpoints/EventArgsController.verified.cs new file mode 100644 index 00000000..4fc1886e --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Endpoints/EventArgsController.verified.cs @@ -0,0 +1,44 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Endpoints; + +/// +/// Endpoint definitions. +/// +[Authorize] +[ApiController] +[Route("/api/v1/eventArgs")] +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public sealed class EventArgsController : ControllerBase +{ + /// + /// Description: Get EventArgs List. + /// Operation: GetEventArgs. + /// + [HttpGet] + [ProducesResponseType(typeof(IEnumerable), StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + public async Task GetEventArgs( + [FromServices] IGetEventArgsHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(cancellationToken); + + /// + /// Description: Get EventArgs By Id. + /// Operation: GetEventArgById. + /// + [HttpGet("{id}")] + [ProducesResponseType(typeof(Contracts.EventArgs.EventArgs), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(typeof(string), StatusCodes.Status404NotFound)] + public async Task GetEventArgById( + GetEventArgByIdParameters parameters, + [FromServices] IGetEventArgByIdHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Endpoints/FilesController.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Endpoints/FilesController.verified.cs new file mode 100644 index 00000000..df19492d --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Endpoints/FilesController.verified.cs @@ -0,0 +1,92 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Endpoints; + +/// +/// Endpoint definitions. +/// +[Authorize] +[ApiController] +[Route("/api/v1/files")] +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public sealed class FilesController : ControllerBase +{ + /// + /// Description: Upload multi files as form data. + /// Operation: UploadMultiFilesAsFormData. + /// + [HttpPost("form-data/multiFile")] + [RequestFormLimits(MultipartBodyLengthLimit = long.MaxValue)] + [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + public async Task UploadMultiFilesAsFormData( + UploadMultiFilesAsFormDataParameters parameters, + [FromServices] IUploadMultiFilesAsFormDataHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); + + /// + /// Description: Upload a file as OctetStream. + /// Operation: UploadSingleFileAsFormData. + /// + [HttpPost("form-data/singleFile")] + [RequestFormLimits(MultipartBodyLengthLimit = long.MaxValue)] + [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + public async Task UploadSingleFileAsFormData( + UploadSingleFileAsFormDataParameters parameters, + [FromServices] IUploadSingleFileAsFormDataHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); + + /// + /// Description: Upload a file as FormData. + /// Operation: UploadSingleObjectWithFileAsFormData. + /// + [HttpPost("form-data/singleObject")] + [RequestFormLimits(MultipartBodyLengthLimit = long.MaxValue)] + [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + public async Task UploadSingleObjectWithFileAsFormData( + UploadSingleObjectWithFileAsFormDataParameters parameters, + [FromServices] IUploadSingleObjectWithFileAsFormDataHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); + + /// + /// Description: Upload files as FormData. + /// Operation: UploadSingleObjectWithFilesAsFormData. + /// + [HttpPost("form-data/singleObjectMultiFile")] + [RequestFormLimits(MultipartBodyLengthLimit = long.MaxValue)] + [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + public async Task UploadSingleObjectWithFilesAsFormData( + UploadSingleObjectWithFilesAsFormDataParameters parameters, + [FromServices] IUploadSingleObjectWithFilesAsFormDataHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); + + /// + /// Description: Get File By Id. + /// Operation: GetFileById. + /// + [HttpGet("{id}")] + [ProducesResponseType(typeof(byte[]), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(typeof(string), StatusCodes.Status404NotFound)] + public async Task GetFileById( + GetFileByIdParameters parameters, + [FromServices] IGetFileByIdHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Endpoints/ItemsController.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Endpoints/ItemsController.verified.cs new file mode 100644 index 00000000..33c2a662 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Endpoints/ItemsController.verified.cs @@ -0,0 +1,45 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Endpoints; + +/// +/// Endpoint definitions. +/// +[Authorize] +[ApiController] +[Route("/api/v1/items")] +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public sealed class ItemsController : ControllerBase +{ + /// + /// Description: Create a new item. + /// Operation: CreateItem. + /// + [HttpPost] + [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + public async Task CreateItem( + CreateItemParameters parameters, + [FromServices] ICreateItemHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); + + /// + /// Description: Updates an item. + /// Operation: UpdateItem. + /// + [HttpPut("{id}")] + [ProducesResponseType(typeof(Guid), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + public async Task UpdateItem( + UpdateItemParameters parameters, + [FromServices] IUpdateItemHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Endpoints/OrdersController.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Endpoints/OrdersController.verified.cs new file mode 100644 index 00000000..4ba25664 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Endpoints/OrdersController.verified.cs @@ -0,0 +1,68 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Endpoints; + +/// +/// Endpoint definitions. +/// +[Authorize] +[ApiController] +[Route("/api/v1/orders")] +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public sealed class OrdersController : ControllerBase +{ + /// + /// Description: Get orders. + /// Operation: GetOrders. + /// + [HttpGet] + [ProducesResponseType(typeof(Pagination), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(typeof(string), StatusCodes.Status404NotFound)] + public async Task GetOrders( + GetOrdersParameters parameters, + [FromServices] IGetOrdersHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); + + /// + /// Description: Get order by id. + /// Operation: GetOrderById. + /// + [Authorize(Roles = "operator")] + [HttpGet("{id}")] + [ProducesResponseType(typeof(Order), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(StatusCodes.Status403Forbidden)] + [ProducesResponseType(typeof(string), StatusCodes.Status404NotFound)] + public async Task GetOrderById( + GetOrderByIdParameters parameters, + [FromServices] IGetOrderByIdHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); + + /// + /// Description: Update part of order by id. + /// Operation: PatchOrdersId. + /// + [Authorize(Roles = "admin,operator")] + [HttpPatch("{id}")] + [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(StatusCodes.Status403Forbidden)] + [ProducesResponseType(typeof(string), StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(string), StatusCodes.Status409Conflict)] + [ProducesResponseType(StatusCodes.Status502BadGateway)] + public async Task PatchOrdersId( + PatchOrdersIdParameters parameters, + [FromServices] IPatchOrdersIdHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Endpoints/RouteWithDashController.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Endpoints/RouteWithDashController.verified.cs new file mode 100644 index 00000000..dcf284d3 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Endpoints/RouteWithDashController.verified.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Endpoints; + +/// +/// Endpoint definitions. +/// +[Authorize] +[ApiController] +[Route("/api/v1/route-with-dash")] +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public sealed class RouteWithDashController : ControllerBase +{ + /// + /// Description: Your GET endpoint. + /// Operation: GetRouteWithDash. + /// + [HttpGet] + [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + public async Task GetRouteWithDash( + [FromServices] IGetRouteWithDashHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(cancellationToken); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Endpoints/TasksController.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Endpoints/TasksController.verified.cs new file mode 100644 index 00000000..02011162 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Endpoints/TasksController.verified.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Endpoints; + +/// +/// Endpoint definitions. +/// +[Authorize] +[ApiController] +[Route("/api/v1/tasks")] +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public sealed class TasksController : ControllerBase +{ + /// + /// Description: Returns tasks. + /// Operation: GetTasks. + /// + [HttpGet] + [ProducesResponseType(typeof(IEnumerable), StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + public async Task GetTasks( + [FromServices] IGetTasksHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(cancellationToken); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Endpoints/UsersController.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Endpoints/UsersController.verified.cs new file mode 100644 index 00000000..de390460 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/Endpoints/UsersController.verified.cs @@ -0,0 +1,125 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Endpoints; + +/// +/// Endpoint definitions. +/// +[Authorize] +[ApiController] +[Route("/api/v1/users")] +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public sealed class UsersController : ControllerBase +{ + /// + /// Description: Get all users. + /// Operation: GetUsers. + /// + [HttpGet] + [ProducesResponseType(typeof(IEnumerable), StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(typeof(string), StatusCodes.Status409Conflict)] + public async Task GetUsers( + [FromServices] IGetUsersHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(cancellationToken); + + /// + /// Description: Create a new user. + /// Operation: PostUser. + /// + [HttpPost] + [ProducesResponseType(typeof(string), StatusCodes.Status201Created)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(typeof(string), StatusCodes.Status409Conflict)] + public async Task PostUser( + PostUserParameters parameters, + [FromServices] IPostUserHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); + + /// + /// Description: Get user by email. + /// Operation: GetUserByEmail. + /// + [HttpGet("email")] + [ProducesResponseType(typeof(User), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(typeof(string), StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(string), StatusCodes.Status409Conflict)] + public async Task GetUserByEmail( + GetUserByEmailParameters parameters, + [FromServices] IGetUserByEmailHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); + + /// + /// Description: Get user by id. + /// Operation: GetUserById. + /// + [HttpGet("{id}")] + [ProducesResponseType(typeof(User), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(typeof(string), StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(string), StatusCodes.Status409Conflict)] + public async Task GetUserById( + GetUserByIdParameters parameters, + [FromServices] IGetUserByIdHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); + + /// + /// Description: Update user by id. + /// Operation: UpdateUserById. + /// + [HttpPut("{id}")] + [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(typeof(string), StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(string), StatusCodes.Status409Conflict)] + public async Task UpdateUserById( + UpdateUserByIdParameters parameters, + [FromServices] IUpdateUserByIdHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); + + /// + /// Description: Delete user by id. + /// Operation: DeleteUserById. + /// + [HttpDelete("{id}")] + [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(typeof(string), StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(string), StatusCodes.Status409Conflict)] + public async Task DeleteUserById( + DeleteUserByIdParameters parameters, + [FromServices] IDeleteUserByIdHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); + + /// + /// Description: Update gender on a user. + /// Operation: UpdateMyTestGender. + /// + [HttpPut("{id}/gender")] + [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(typeof(string), StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(string), StatusCodes.Status409Conflict)] + public async Task UpdateMyTestGender( + UpdateMyTestGenderParameters parameters, + [FromServices] IUpdateMyTestGenderHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/GlobalUsings.verified.cs new file mode 100644 index 00000000..b67b2b11 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api.Generated/GlobalUsings.verified.cs @@ -0,0 +1,20 @@ +global using System.CodeDom.Compiler; +global using System.ComponentModel.DataAnnotations; +global using System.Net; + +global using Atc.Rest.Results; + +global using DemoSample.Api.Generated.Contracts; +global using DemoSample.Api.Generated.Contracts.Accounts; +global using DemoSample.Api.Generated.Contracts.Addresses; +global using DemoSample.Api.Generated.Contracts.EventArgs; +global using DemoSample.Api.Generated.Contracts.Files; +global using DemoSample.Api.Generated.Contracts.Items; +global using DemoSample.Api.Generated.Contracts.Orders; +global using DemoSample.Api.Generated.Contracts.RouteWithDash; +global using DemoSample.Api.Generated.Contracts.Tasks; +global using DemoSample.Api.Generated.Contracts.Users; + +global using Microsoft.AspNetCore.Authorization; +global using Microsoft.AspNetCore.Http; +global using Microsoft.AspNetCore.Mvc; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api/GlobalUsings.verified.cs new file mode 100644 index 00000000..102771e3 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api/GlobalUsings.verified.cs @@ -0,0 +1,15 @@ +global using System.CodeDom.Compiler; +global using System.Reflection; + +global using Asp.Versioning.ApiExplorer; + +global using Atc.Rest.Extended.Options; + +global using DemoSample.Api.Generated; +global using DemoSample.Api.Options; +global using DemoSample.Domain; + +global using Microsoft.Extensions.Options; +global using Microsoft.OpenApi.Models; + +global using Swashbuckle.AspNetCore.SwaggerGen; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api/Options/ConfigureSwaggerDocOptions.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api/Options/ConfigureSwaggerDocOptions.verified.cs new file mode 100644 index 00000000..37c42a6b --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api/Options/ConfigureSwaggerDocOptions.verified.cs @@ -0,0 +1,39 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Options; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ConfigureSwaggerDocOptions : IConfigureOptions +{ + private readonly IApiVersionDescriptionProvider provider; + + public ConfigureSwaggerDocOptions( + IApiVersionDescriptionProvider provider) + => this.provider = provider; + + public void Configure( + SwaggerGenOptions options) + { + foreach (var version in provider.ApiVersionDescriptions) + { + options.SwaggerDoc( + version.GroupName, + new OpenApiInfo + { + Version = "1.0", + Title = "Demo Sample Api", + Description = "Demo Sample Api - SingleFileVersion", + Contact = new OpenApiContact + { + Name = "atc-net A/S", + }, + }); + } + + options.IncludeXmlComments(Path.ChangeExtension(GetType().Assembly.Location, "xml")); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api/Program.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api/Program.verified.cs new file mode 100644 index 00000000..fd8e4e03 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api/Program.verified.cs @@ -0,0 +1,23 @@ +namespace DemoSample.Api; + +public static class Program +{ + public static void Main(string[] args) + { + CreateHostBuilder(args) + .Build() + .Run(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) + { + var builder = Host + .CreateDefaultBuilder(args) + .ConfigureWebHostDefaults(webBuilder => + { + webBuilder.UseStartup(); + }); + + return builder; + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api/Startup.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api/Startup.verified.cs new file mode 100644 index 00000000..ea2f691c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Api/Startup.verified.cs @@ -0,0 +1,38 @@ +namespace DemoSample.Api; + +public class Startup +{ + private readonly RestApiExtendedOptions restApiOptions; + + public Startup( + IConfiguration configuration) + { + Configuration = configuration; + restApiOptions = new RestApiExtendedOptions + { + // TODO: Remove/out-comment/set to false this for production scenarios! + AllowAnonymousAccessForDevelopment = true, + }; + + restApiOptions.AddAssemblyPairs( + Assembly.GetAssembly(typeof(ApiRegistration)), + Assembly.GetAssembly(typeof(DomainRegistration))); + } + + public IConfiguration Configuration { get; } + + public void ConfigureServices( + IServiceCollection services) + { + services.ConfigureOptions(); + + services.AddRestApi(restApiOptions, Configuration); + } + + public void Configure( + IApplicationBuilder app, + IWebHostEnvironment env) + { + app.ConfigureRestApi(env, restApiOptions); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/DomainRegistration.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/DomainRegistration.verified.cs new file mode 100644 index 00000000..a4207dd3 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/DomainRegistration.verified.cs @@ -0,0 +1,12 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Domain; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class DomainRegistration +{ +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/GlobalUsings.verified.cs new file mode 100644 index 00000000..115399f8 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/GlobalUsings.verified.cs @@ -0,0 +1,11 @@ +global using System.CodeDom.Compiler; + +global using DemoSample.Api.Generated.Contracts.Accounts; +global using DemoSample.Api.Generated.Contracts.Addresses; +global using DemoSample.Api.Generated.Contracts.EventArgs; +global using DemoSample.Api.Generated.Contracts.Files; +global using DemoSample.Api.Generated.Contracts.Items; +global using DemoSample.Api.Generated.Contracts.Orders; +global using DemoSample.Api.Generated.Contracts.RouteWithDash; +global using DemoSample.Api.Generated.Contracts.Tasks; +global using DemoSample.Api.Generated.Contracts.Users; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Accounts/SetAccountNameHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Accounts/SetAccountNameHandler.verified.cs new file mode 100644 index 00000000..74011829 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Accounts/SetAccountNameHandler.verified.cs @@ -0,0 +1,18 @@ +namespace DemoSample.Domain.Handlers.Accounts; + +/// +/// Handler for operation request. +/// Description: Set name of account. +/// Operation: SetAccountName. +/// +public class SetAccountNameHandler : ISetAccountNameHandler +{ + public Task ExecuteAsync( + SetAccountNameParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for SetAccountNameHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Accounts/UpdateAccountNameHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Accounts/UpdateAccountNameHandler.verified.cs new file mode 100644 index 00000000..f16f7b71 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Accounts/UpdateAccountNameHandler.verified.cs @@ -0,0 +1,18 @@ +namespace DemoSample.Domain.Handlers.Accounts; + +/// +/// Handler for operation request. +/// Description: Update name of account. +/// Operation: UpdateAccountName. +/// +public class UpdateAccountNameHandler : IUpdateAccountNameHandler +{ + public Task ExecuteAsync( + UpdateAccountNameParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for UpdateAccountNameHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Addresses/GetAddressesByPostalCodesHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Addresses/GetAddressesByPostalCodesHandler.verified.cs new file mode 100644 index 00000000..11e35eb5 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Addresses/GetAddressesByPostalCodesHandler.verified.cs @@ -0,0 +1,18 @@ +namespace DemoSample.Domain.Handlers.Addresses; + +/// +/// Handler for operation request. +/// Description: Get addresses by postal code. +/// Operation: GetAddressesByPostalCodes. +/// +public class GetAddressesByPostalCodesHandler : IGetAddressesByPostalCodesHandler +{ + public Task ExecuteAsync( + GetAddressesByPostalCodesParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for GetAddressesByPostalCodesHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/EventArgs/GetEventArgByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/EventArgs/GetEventArgByIdHandler.verified.cs new file mode 100644 index 00000000..26d122c2 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/EventArgs/GetEventArgByIdHandler.verified.cs @@ -0,0 +1,18 @@ +namespace DemoSample.Domain.Handlers.EventArgs; + +/// +/// Handler for operation request. +/// Description: Get EventArgs By Id. +/// Operation: GetEventArgById. +/// +public class GetEventArgByIdHandler : IGetEventArgByIdHandler +{ + public Task ExecuteAsync( + GetEventArgByIdParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for GetEventArgByIdHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/EventArgs/GetEventArgsHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/EventArgs/GetEventArgsHandler.verified.cs new file mode 100644 index 00000000..871231a4 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/EventArgs/GetEventArgsHandler.verified.cs @@ -0,0 +1,15 @@ +namespace DemoSample.Domain.Handlers.EventArgs; + +/// +/// Handler for operation request. +/// Description: Get EventArgs List. +/// Operation: GetEventArgs. +/// +public class GetEventArgsHandler : IGetEventArgsHandler +{ + public Task ExecuteAsync( + CancellationToken cancellationToken = default) + { + throw new NotImplementedException("Add logic here for GetEventArgsHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Files/GetFileByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Files/GetFileByIdHandler.verified.cs new file mode 100644 index 00000000..c5b768bb --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Files/GetFileByIdHandler.verified.cs @@ -0,0 +1,18 @@ +namespace DemoSample.Domain.Handlers.Files; + +/// +/// Handler for operation request. +/// Description: Get File By Id. +/// Operation: GetFileById. +/// +public class GetFileByIdHandler : IGetFileByIdHandler +{ + public Task ExecuteAsync( + GetFileByIdParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for GetFileByIdHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Files/UploadMultiFilesAsFormDataHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Files/UploadMultiFilesAsFormDataHandler.verified.cs new file mode 100644 index 00000000..c9b60425 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Files/UploadMultiFilesAsFormDataHandler.verified.cs @@ -0,0 +1,18 @@ +namespace DemoSample.Domain.Handlers.Files; + +/// +/// Handler for operation request. +/// Description: Upload multi files as form data. +/// Operation: UploadMultiFilesAsFormData. +/// +public class UploadMultiFilesAsFormDataHandler : IUploadMultiFilesAsFormDataHandler +{ + public Task ExecuteAsync( + UploadMultiFilesAsFormDataParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for UploadMultiFilesAsFormDataHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Files/UploadSingleFileAsFormDataHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Files/UploadSingleFileAsFormDataHandler.verified.cs new file mode 100644 index 00000000..30b7bf72 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Files/UploadSingleFileAsFormDataHandler.verified.cs @@ -0,0 +1,18 @@ +namespace DemoSample.Domain.Handlers.Files; + +/// +/// Handler for operation request. +/// Description: Upload a file as OctetStream. +/// Operation: UploadSingleFileAsFormData. +/// +public class UploadSingleFileAsFormDataHandler : IUploadSingleFileAsFormDataHandler +{ + public Task ExecuteAsync( + UploadSingleFileAsFormDataParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for UploadSingleFileAsFormDataHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Files/UploadSingleObjectWithFileAsFormDataHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Files/UploadSingleObjectWithFileAsFormDataHandler.verified.cs new file mode 100644 index 00000000..bea71e5c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Files/UploadSingleObjectWithFileAsFormDataHandler.verified.cs @@ -0,0 +1,18 @@ +namespace DemoSample.Domain.Handlers.Files; + +/// +/// Handler for operation request. +/// Description: Upload a file as FormData. +/// Operation: UploadSingleObjectWithFileAsFormData. +/// +public class UploadSingleObjectWithFileAsFormDataHandler : IUploadSingleObjectWithFileAsFormDataHandler +{ + public Task ExecuteAsync( + UploadSingleObjectWithFileAsFormDataParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for UploadSingleObjectWithFileAsFormDataHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Files/UploadSingleObjectWithFilesAsFormDataHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Files/UploadSingleObjectWithFilesAsFormDataHandler.verified.cs new file mode 100644 index 00000000..2cbf5d1f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Files/UploadSingleObjectWithFilesAsFormDataHandler.verified.cs @@ -0,0 +1,18 @@ +namespace DemoSample.Domain.Handlers.Files; + +/// +/// Handler for operation request. +/// Description: Upload files as FormData. +/// Operation: UploadSingleObjectWithFilesAsFormData. +/// +public class UploadSingleObjectWithFilesAsFormDataHandler : IUploadSingleObjectWithFilesAsFormDataHandler +{ + public Task ExecuteAsync( + UploadSingleObjectWithFilesAsFormDataParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for UploadSingleObjectWithFilesAsFormDataHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Items/CreateItemHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Items/CreateItemHandler.verified.cs new file mode 100644 index 00000000..f7bc0b7a --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Items/CreateItemHandler.verified.cs @@ -0,0 +1,18 @@ +namespace DemoSample.Domain.Handlers.Items; + +/// +/// Handler for operation request. +/// Description: Create a new item. +/// Operation: CreateItem. +/// +public class CreateItemHandler : ICreateItemHandler +{ + public Task ExecuteAsync( + CreateItemParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for CreateItemHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Items/UpdateItemHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Items/UpdateItemHandler.verified.cs new file mode 100644 index 00000000..ab540578 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Items/UpdateItemHandler.verified.cs @@ -0,0 +1,18 @@ +namespace DemoSample.Domain.Handlers.Items; + +/// +/// Handler for operation request. +/// Description: Updates an item. +/// Operation: UpdateItem. +/// +public class UpdateItemHandler : IUpdateItemHandler +{ + public Task ExecuteAsync( + UpdateItemParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for UpdateItemHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Orders/GetOrderByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Orders/GetOrderByIdHandler.verified.cs new file mode 100644 index 00000000..bb191095 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Orders/GetOrderByIdHandler.verified.cs @@ -0,0 +1,18 @@ +namespace DemoSample.Domain.Handlers.Orders; + +/// +/// Handler for operation request. +/// Description: Get order by id. +/// Operation: GetOrderById. +/// +public class GetOrderByIdHandler : IGetOrderByIdHandler +{ + public Task ExecuteAsync( + GetOrderByIdParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for GetOrderByIdHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Orders/GetOrdersHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Orders/GetOrdersHandler.verified.cs new file mode 100644 index 00000000..0a6a1735 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Orders/GetOrdersHandler.verified.cs @@ -0,0 +1,18 @@ +namespace DemoSample.Domain.Handlers.Orders; + +/// +/// Handler for operation request. +/// Description: Get orders. +/// Operation: GetOrders. +/// +public class GetOrdersHandler : IGetOrdersHandler +{ + public Task ExecuteAsync( + GetOrdersParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for GetOrdersHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Orders/PatchOrdersIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Orders/PatchOrdersIdHandler.verified.cs new file mode 100644 index 00000000..b88929d7 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Orders/PatchOrdersIdHandler.verified.cs @@ -0,0 +1,18 @@ +namespace DemoSample.Domain.Handlers.Orders; + +/// +/// Handler for operation request. +/// Description: Update part of order by id. +/// Operation: PatchOrdersId. +/// +public class PatchOrdersIdHandler : IPatchOrdersIdHandler +{ + public Task ExecuteAsync( + PatchOrdersIdParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for PatchOrdersIdHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/RouteWithDash/GetRouteWithDashHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/RouteWithDash/GetRouteWithDashHandler.verified.cs new file mode 100644 index 00000000..28de0339 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/RouteWithDash/GetRouteWithDashHandler.verified.cs @@ -0,0 +1,15 @@ +namespace DemoSample.Domain.Handlers.RouteWithDash; + +/// +/// Handler for operation request. +/// Description: Your GET endpoint. +/// Operation: GetRouteWithDash. +/// +public class GetRouteWithDashHandler : IGetRouteWithDashHandler +{ + public Task ExecuteAsync( + CancellationToken cancellationToken = default) + { + throw new NotImplementedException("Add logic here for GetRouteWithDashHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Tasks/GetTasksHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Tasks/GetTasksHandler.verified.cs new file mode 100644 index 00000000..6f5a039e --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Tasks/GetTasksHandler.verified.cs @@ -0,0 +1,15 @@ +namespace DemoSample.Domain.Handlers.Tasks; + +/// +/// Handler for operation request. +/// Description: Returns tasks. +/// Operation: GetTasks. +/// +public class GetTasksHandler : IGetTasksHandler +{ + public Task ExecuteAsync( + CancellationToken cancellationToken = default) + { + throw new NotImplementedException("Add logic here for GetTasksHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Users/DeleteUserByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Users/DeleteUserByIdHandler.verified.cs new file mode 100644 index 00000000..43b0d40c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Users/DeleteUserByIdHandler.verified.cs @@ -0,0 +1,18 @@ +namespace DemoSample.Domain.Handlers.Users; + +/// +/// Handler for operation request. +/// Description: Delete user by id. +/// Operation: DeleteUserById. +/// +public class DeleteUserByIdHandler : IDeleteUserByIdHandler +{ + public Task ExecuteAsync( + DeleteUserByIdParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for DeleteUserByIdHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Users/GetUserByEmailHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Users/GetUserByEmailHandler.verified.cs new file mode 100644 index 00000000..ea1d73bf --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Users/GetUserByEmailHandler.verified.cs @@ -0,0 +1,18 @@ +namespace DemoSample.Domain.Handlers.Users; + +/// +/// Handler for operation request. +/// Description: Get user by email. +/// Operation: GetUserByEmail. +/// +public class GetUserByEmailHandler : IGetUserByEmailHandler +{ + public Task ExecuteAsync( + GetUserByEmailParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for GetUserByEmailHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Users/GetUserByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Users/GetUserByIdHandler.verified.cs new file mode 100644 index 00000000..a79a6d74 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Users/GetUserByIdHandler.verified.cs @@ -0,0 +1,18 @@ +namespace DemoSample.Domain.Handlers.Users; + +/// +/// Handler for operation request. +/// Description: Get user by id. +/// Operation: GetUserById. +/// +public class GetUserByIdHandler : IGetUserByIdHandler +{ + public Task ExecuteAsync( + GetUserByIdParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for GetUserByIdHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Users/GetUsersHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Users/GetUsersHandler.verified.cs new file mode 100644 index 00000000..1cec955a --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Users/GetUsersHandler.verified.cs @@ -0,0 +1,15 @@ +namespace DemoSample.Domain.Handlers.Users; + +/// +/// Handler for operation request. +/// Description: Get all users. +/// Operation: GetUsers. +/// +public class GetUsersHandler : IGetUsersHandler +{ + public Task ExecuteAsync( + CancellationToken cancellationToken = default) + { + throw new NotImplementedException("Add logic here for GetUsersHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Users/PostUserHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Users/PostUserHandler.verified.cs new file mode 100644 index 00000000..cd9593f7 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Users/PostUserHandler.verified.cs @@ -0,0 +1,18 @@ +namespace DemoSample.Domain.Handlers.Users; + +/// +/// Handler for operation request. +/// Description: Create a new user. +/// Operation: PostUser. +/// +public class PostUserHandler : IPostUserHandler +{ + public Task ExecuteAsync( + PostUserParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for PostUserHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Users/UpdateMyTestGenderHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Users/UpdateMyTestGenderHandler.verified.cs new file mode 100644 index 00000000..335364a9 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Users/UpdateMyTestGenderHandler.verified.cs @@ -0,0 +1,18 @@ +namespace DemoSample.Domain.Handlers.Users; + +/// +/// Handler for operation request. +/// Description: Update gender on a user. +/// Operation: UpdateMyTestGender. +/// +public class UpdateMyTestGenderHandler : IUpdateMyTestGenderHandler +{ + public Task ExecuteAsync( + UpdateMyTestGenderParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for UpdateMyTestGenderHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Users/UpdateUserByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Users/UpdateUserByIdHandler.verified.cs new file mode 100644 index 00000000..733d3253 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/src/DemoSample.Domain/Handlers/Users/UpdateUserByIdHandler.verified.cs @@ -0,0 +1,18 @@ +namespace DemoSample.Domain.Handlers.Users; + +/// +/// Handler for operation request. +/// Description: Update user by id. +/// Operation: UpdateUserById. +/// +public class UpdateUserByIdHandler : IUpdateUserByIdHandler +{ + public Task ExecuteAsync( + UpdateUserByIdParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for UpdateUserByIdHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Accounts/SetAccountNameHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Accounts/SetAccountNameHandlerStub.verified.cs new file mode 100644 index 00000000..54ed87c9 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Accounts/SetAccountNameHandlerStub.verified.cs @@ -0,0 +1,18 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Tests.Endpoints.Accounts; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class SetAccountNameHandlerStub : ISetAccountNameHandler +{ + public Task ExecuteAsync( + SetAccountNameParameters parameters, + CancellationToken cancellationToken = default) + { + return Task.FromResult(SetAccountNameResult.Ok("Hallo world")); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Accounts/SetAccountNameTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Accounts/SetAccountNameTests.verified.cs new file mode 100644 index 00000000..0195fd02 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Accounts/SetAccountNameTests.verified.cs @@ -0,0 +1,21 @@ +namespace DemoSample.Api.Tests.Endpoints.Accounts; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class SetAccountNameTests : WebApiControllerBaseTest +{ + public SetAccountNameTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Accounts/UpdateAccountNameHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Accounts/UpdateAccountNameHandlerStub.verified.cs new file mode 100644 index 00000000..47b107e5 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Accounts/UpdateAccountNameHandlerStub.verified.cs @@ -0,0 +1,18 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Tests.Endpoints.Accounts; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateAccountNameHandlerStub : IUpdateAccountNameHandler +{ + public Task ExecuteAsync( + UpdateAccountNameParameters parameters, + CancellationToken cancellationToken = default) + { + return Task.FromResult(UpdateAccountNameResult.Ok("Hallo world")); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Accounts/UpdateAccountNameTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Accounts/UpdateAccountNameTests.verified.cs new file mode 100644 index 00000000..f4884a2c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Accounts/UpdateAccountNameTests.verified.cs @@ -0,0 +1,21 @@ +namespace DemoSample.Api.Tests.Endpoints.Accounts; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class UpdateAccountNameTests : WebApiControllerBaseTest +{ + public UpdateAccountNameTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Addresses/GetAddressesByPostalCodesHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Addresses/GetAddressesByPostalCodesHandlerStub.verified.cs new file mode 100644 index 00000000..0eeeb4b4 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Addresses/GetAddressesByPostalCodesHandlerStub.verified.cs @@ -0,0 +1,20 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Tests.Endpoints.Addresses; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetAddressesByPostalCodesHandlerStub : IGetAddressesByPostalCodesHandler +{ + public Task ExecuteAsync( + GetAddressesByPostalCodesParameters parameters, + CancellationToken cancellationToken = default) + { + var data = new Fixture().Create>(); + + return Task.FromResult(GetAddressesByPostalCodesResult.Ok(data)); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Addresses/GetAddressesByPostalCodesTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Addresses/GetAddressesByPostalCodesTests.verified.cs new file mode 100644 index 00000000..dcef1894 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Addresses/GetAddressesByPostalCodesTests.verified.cs @@ -0,0 +1,21 @@ +namespace DemoSample.Api.Tests.Endpoints.Addresses; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class GetAddressesByPostalCodesTests : WebApiControllerBaseTest +{ + public GetAddressesByPostalCodesTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/EventArgs/GetEventArgByIdHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/EventArgs/GetEventArgByIdHandlerStub.verified.cs new file mode 100644 index 00000000..915772fe --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/EventArgs/GetEventArgByIdHandlerStub.verified.cs @@ -0,0 +1,20 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Tests.Endpoints.EventArgs; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetEventArgByIdHandlerStub : IGetEventArgByIdHandler +{ + public Task ExecuteAsync( + GetEventArgByIdParameters parameters, + CancellationToken cancellationToken = default) + { + var data = new Fixture().Create(); + + return Task.FromResult(GetEventArgByIdResult.Ok(data)); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/EventArgs/GetEventArgByIdTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/EventArgs/GetEventArgByIdTests.verified.cs new file mode 100644 index 00000000..139af5ba --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/EventArgs/GetEventArgByIdTests.verified.cs @@ -0,0 +1,21 @@ +namespace DemoSample.Api.Tests.Endpoints.EventArgs; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class GetEventArgByIdTests : WebApiControllerBaseTest +{ + public GetEventArgByIdTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/EventArgs/GetEventArgsHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/EventArgs/GetEventArgsHandlerStub.verified.cs new file mode 100644 index 00000000..c8a3fa3e --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/EventArgs/GetEventArgsHandlerStub.verified.cs @@ -0,0 +1,19 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Tests.Endpoints.EventArgs; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetEventArgsHandlerStub : IGetEventArgsHandler +{ + public Task ExecuteAsync( + CancellationToken cancellationToken = default) + { + var data = new Fixture().Create>(); + + return Task.FromResult(GetEventArgsResult.Ok(data)); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/EventArgs/GetEventArgsTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/EventArgs/GetEventArgsTests.verified.cs new file mode 100644 index 00000000..003d9acf --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/EventArgs/GetEventArgsTests.verified.cs @@ -0,0 +1,21 @@ +namespace DemoSample.Api.Tests.Endpoints.EventArgs; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class GetEventArgsTests : WebApiControllerBaseTest +{ + public GetEventArgsTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Files/GetFileByIdHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Files/GetFileByIdHandlerStub.verified.cs new file mode 100644 index 00000000..92e14e1a --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Files/GetFileByIdHandlerStub.verified.cs @@ -0,0 +1,19 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Tests.Endpoints.Files; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetFileByIdHandlerStub : IGetFileByIdHandler +{ + public Task ExecuteAsync( + GetFileByIdParameters parameters, + CancellationToken cancellationToken = default) + { + var bytes = Encoding.UTF8.GetBytes("Hello World"); + return Task.FromResult(GetFileByIdResult.Ok(bytes, "dummy.txt")); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Files/GetFileByIdTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Files/GetFileByIdTests.verified.cs new file mode 100644 index 00000000..324a172c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Files/GetFileByIdTests.verified.cs @@ -0,0 +1,21 @@ +namespace DemoSample.Api.Tests.Endpoints.Files; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class GetFileByIdTests : WebApiControllerBaseTest +{ + public GetFileByIdTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Files/UploadMultiFilesAsFormDataHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Files/UploadMultiFilesAsFormDataHandlerStub.verified.cs new file mode 100644 index 00000000..aa7d49c4 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Files/UploadMultiFilesAsFormDataHandlerStub.verified.cs @@ -0,0 +1,18 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Tests.Endpoints.Files; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UploadMultiFilesAsFormDataHandlerStub : IUploadMultiFilesAsFormDataHandler +{ + public Task ExecuteAsync( + UploadMultiFilesAsFormDataParameters parameters, + CancellationToken cancellationToken = default) + { + return Task.FromResult(UploadMultiFilesAsFormDataResult.Ok("Hallo world")); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Files/UploadMultiFilesAsFormDataTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Files/UploadMultiFilesAsFormDataTests.verified.cs new file mode 100644 index 00000000..cbee92da --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Files/UploadMultiFilesAsFormDataTests.verified.cs @@ -0,0 +1,21 @@ +namespace DemoSample.Api.Tests.Endpoints.Files; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class UploadMultiFilesAsFormDataTests : WebApiControllerBaseTest +{ + public UploadMultiFilesAsFormDataTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Files/UploadSingleFileAsFormDataHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Files/UploadSingleFileAsFormDataHandlerStub.verified.cs new file mode 100644 index 00000000..9fb5d157 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Files/UploadSingleFileAsFormDataHandlerStub.verified.cs @@ -0,0 +1,18 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Tests.Endpoints.Files; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UploadSingleFileAsFormDataHandlerStub : IUploadSingleFileAsFormDataHandler +{ + public Task ExecuteAsync( + UploadSingleFileAsFormDataParameters parameters, + CancellationToken cancellationToken = default) + { + return Task.FromResult(UploadSingleFileAsFormDataResult.Ok("Hallo world")); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Files/UploadSingleFileAsFormDataTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Files/UploadSingleFileAsFormDataTests.verified.cs new file mode 100644 index 00000000..d76dca89 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Files/UploadSingleFileAsFormDataTests.verified.cs @@ -0,0 +1,21 @@ +namespace DemoSample.Api.Tests.Endpoints.Files; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class UploadSingleFileAsFormDataTests : WebApiControllerBaseTest +{ + public UploadSingleFileAsFormDataTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Files/UploadSingleObjectWithFileAsFormDataHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Files/UploadSingleObjectWithFileAsFormDataHandlerStub.verified.cs new file mode 100644 index 00000000..40a4d378 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Files/UploadSingleObjectWithFileAsFormDataHandlerStub.verified.cs @@ -0,0 +1,18 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Tests.Endpoints.Files; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UploadSingleObjectWithFileAsFormDataHandlerStub : IUploadSingleObjectWithFileAsFormDataHandler +{ + public Task ExecuteAsync( + UploadSingleObjectWithFileAsFormDataParameters parameters, + CancellationToken cancellationToken = default) + { + return Task.FromResult(UploadSingleObjectWithFileAsFormDataResult.Ok("Hallo world")); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Files/UploadSingleObjectWithFileAsFormDataTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Files/UploadSingleObjectWithFileAsFormDataTests.verified.cs new file mode 100644 index 00000000..af984fe0 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Files/UploadSingleObjectWithFileAsFormDataTests.verified.cs @@ -0,0 +1,21 @@ +namespace DemoSample.Api.Tests.Endpoints.Files; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class UploadSingleObjectWithFileAsFormDataTests : WebApiControllerBaseTest +{ + public UploadSingleObjectWithFileAsFormDataTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Files/UploadSingleObjectWithFilesAsFormDataHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Files/UploadSingleObjectWithFilesAsFormDataHandlerStub.verified.cs new file mode 100644 index 00000000..bbc9a812 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Files/UploadSingleObjectWithFilesAsFormDataHandlerStub.verified.cs @@ -0,0 +1,18 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Tests.Endpoints.Files; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UploadSingleObjectWithFilesAsFormDataHandlerStub : IUploadSingleObjectWithFilesAsFormDataHandler +{ + public Task ExecuteAsync( + UploadSingleObjectWithFilesAsFormDataParameters parameters, + CancellationToken cancellationToken = default) + { + return Task.FromResult(UploadSingleObjectWithFilesAsFormDataResult.Ok("Hallo world")); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Files/UploadSingleObjectWithFilesAsFormDataTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Files/UploadSingleObjectWithFilesAsFormDataTests.verified.cs new file mode 100644 index 00000000..2b224503 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Files/UploadSingleObjectWithFilesAsFormDataTests.verified.cs @@ -0,0 +1,21 @@ +namespace DemoSample.Api.Tests.Endpoints.Files; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class UploadSingleObjectWithFilesAsFormDataTests : WebApiControllerBaseTest +{ + public UploadSingleObjectWithFilesAsFormDataTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Items/CreateItemHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Items/CreateItemHandlerStub.verified.cs new file mode 100644 index 00000000..42c8231f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Items/CreateItemHandlerStub.verified.cs @@ -0,0 +1,18 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Tests.Endpoints.Items; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class CreateItemHandlerStub : ICreateItemHandler +{ + public Task ExecuteAsync( + CreateItemParameters parameters, + CancellationToken cancellationToken = default) + { + return Task.FromResult(CreateItemResult.Ok("Hallo world")); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Items/CreateItemTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Items/CreateItemTests.verified.cs new file mode 100644 index 00000000..c6c5d0a6 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Items/CreateItemTests.verified.cs @@ -0,0 +1,21 @@ +namespace DemoSample.Api.Tests.Endpoints.Items; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class CreateItemTests : WebApiControllerBaseTest +{ + public CreateItemTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Items/UpdateItemHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Items/UpdateItemHandlerStub.verified.cs new file mode 100644 index 00000000..c3b0916b --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Items/UpdateItemHandlerStub.verified.cs @@ -0,0 +1,18 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Tests.Endpoints.Items; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateItemHandlerStub : IUpdateItemHandler +{ + public Task ExecuteAsync( + UpdateItemParameters parameters, + CancellationToken cancellationToken = default) + { + return Task.FromResult(UpdateItemResult.Ok(Guid.NewGuid())); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Items/UpdateItemTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Items/UpdateItemTests.verified.cs new file mode 100644 index 00000000..f57ec582 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Items/UpdateItemTests.verified.cs @@ -0,0 +1,21 @@ +namespace DemoSample.Api.Tests.Endpoints.Items; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class UpdateItemTests : WebApiControllerBaseTest +{ + public UpdateItemTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Orders/GetOrderByIdHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Orders/GetOrderByIdHandlerStub.verified.cs new file mode 100644 index 00000000..69b08995 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Orders/GetOrderByIdHandlerStub.verified.cs @@ -0,0 +1,20 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Tests.Endpoints.Orders; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetOrderByIdHandlerStub : IGetOrderByIdHandler +{ + public Task ExecuteAsync( + GetOrderByIdParameters parameters, + CancellationToken cancellationToken = default) + { + var data = new Fixture().Create(); + + return Task.FromResult(GetOrderByIdResult.Ok(data)); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Orders/GetOrderByIdTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Orders/GetOrderByIdTests.verified.cs new file mode 100644 index 00000000..c0e26b3f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Orders/GetOrderByIdTests.verified.cs @@ -0,0 +1,21 @@ +namespace DemoSample.Api.Tests.Endpoints.Orders; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class GetOrderByIdTests : WebApiControllerBaseTest +{ + public GetOrderByIdTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Orders/GetOrdersHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Orders/GetOrdersHandlerStub.verified.cs new file mode 100644 index 00000000..f0017248 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Orders/GetOrdersHandlerStub.verified.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Tests.Endpoints.Orders; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetOrdersHandlerStub : IGetOrdersHandler +{ + public Task ExecuteAsync( + GetOrdersParameters parameters, + CancellationToken cancellationToken = default) + { + var data = new Fixture().Create>(); + + var paginationData = new Pagination( + data, + parameters.PageSize, + parameters.QueryString, + parameters.ContinuationToken); + + return Task.FromResult(GetOrdersResult.Ok(paginationData)); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Orders/GetOrdersTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Orders/GetOrdersTests.verified.cs new file mode 100644 index 00000000..d71f3385 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Orders/GetOrdersTests.verified.cs @@ -0,0 +1,21 @@ +namespace DemoSample.Api.Tests.Endpoints.Orders; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class GetOrdersTests : WebApiControllerBaseTest +{ + public GetOrdersTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Orders/PatchOrdersIdHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Orders/PatchOrdersIdHandlerStub.verified.cs new file mode 100644 index 00000000..abfba40f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Orders/PatchOrdersIdHandlerStub.verified.cs @@ -0,0 +1,18 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Tests.Endpoints.Orders; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class PatchOrdersIdHandlerStub : IPatchOrdersIdHandler +{ + public Task ExecuteAsync( + PatchOrdersIdParameters parameters, + CancellationToken cancellationToken = default) + { + return Task.FromResult(PatchOrdersIdResult.Ok("Hallo world")); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Orders/PatchOrdersIdTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Orders/PatchOrdersIdTests.verified.cs new file mode 100644 index 00000000..6aeda555 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Orders/PatchOrdersIdTests.verified.cs @@ -0,0 +1,21 @@ +namespace DemoSample.Api.Tests.Endpoints.Orders; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class PatchOrdersIdTests : WebApiControllerBaseTest +{ + public PatchOrdersIdTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/RouteWithDash/GetRouteWithDashHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/RouteWithDash/GetRouteWithDashHandlerStub.verified.cs new file mode 100644 index 00000000..7de4ff14 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/RouteWithDash/GetRouteWithDashHandlerStub.verified.cs @@ -0,0 +1,17 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Tests.Endpoints.RouteWithDash; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetRouteWithDashHandlerStub : IGetRouteWithDashHandler +{ + public Task ExecuteAsync( + CancellationToken cancellationToken = default) + { + return Task.FromResult(GetRouteWithDashResult.Ok("Hallo world")); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/RouteWithDash/GetRouteWithDashTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/RouteWithDash/GetRouteWithDashTests.verified.cs new file mode 100644 index 00000000..39c353be --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/RouteWithDash/GetRouteWithDashTests.verified.cs @@ -0,0 +1,21 @@ +namespace DemoSample.Api.Tests.Endpoints.RouteWithDash; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class GetRouteWithDashTests : WebApiControllerBaseTest +{ + public GetRouteWithDashTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Tasks/GetTasksHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Tasks/GetTasksHandlerStub.verified.cs new file mode 100644 index 00000000..4de36cb4 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Tasks/GetTasksHandlerStub.verified.cs @@ -0,0 +1,19 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Tests.Endpoints.Tasks; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetTasksHandlerStub : DemoSample.Api.Generated.Contracts.Tasks.IGetTasksHandler +{ + public Task ExecuteAsync( + CancellationToken cancellationToken = default) + { + var data = new Fixture().Create>(); + + return Task.FromResult(DemoSample.Api.Generated.Contracts.Tasks.GetTasksResult.Ok(data)); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Tasks/GetTasksTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Tasks/GetTasksTests.verified.cs new file mode 100644 index 00000000..fecf4ccb --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Tasks/GetTasksTests.verified.cs @@ -0,0 +1,21 @@ +namespace DemoSample.Api.Tests.Endpoints.Tasks; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class GetTasksTests : WebApiControllerBaseTest +{ + public GetTasksTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Users/DeleteUserByIdHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Users/DeleteUserByIdHandlerStub.verified.cs new file mode 100644 index 00000000..7c743a82 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Users/DeleteUserByIdHandlerStub.verified.cs @@ -0,0 +1,18 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Tests.Endpoints.Users; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class DeleteUserByIdHandlerStub : IDeleteUserByIdHandler +{ + public Task ExecuteAsync( + DeleteUserByIdParameters parameters, + CancellationToken cancellationToken = default) + { + return Task.FromResult(DeleteUserByIdResult.Ok("Hallo world")); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Users/DeleteUserByIdTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Users/DeleteUserByIdTests.verified.cs new file mode 100644 index 00000000..5215a618 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Users/DeleteUserByIdTests.verified.cs @@ -0,0 +1,21 @@ +namespace DemoSample.Api.Tests.Endpoints.Users; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class DeleteUserByIdTests : WebApiControllerBaseTest +{ + public DeleteUserByIdTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Users/GetUserByEmailHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Users/GetUserByEmailHandlerStub.verified.cs new file mode 100644 index 00000000..b32e0041 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Users/GetUserByEmailHandlerStub.verified.cs @@ -0,0 +1,20 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Tests.Endpoints.Users; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetUserByEmailHandlerStub : IGetUserByEmailHandler +{ + public Task ExecuteAsync( + GetUserByEmailParameters parameters, + CancellationToken cancellationToken = default) + { + var data = new Fixture().Create(); + + return Task.FromResult(GetUserByEmailResult.Ok(data)); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Users/GetUserByEmailTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Users/GetUserByEmailTests.verified.cs new file mode 100644 index 00000000..0085538f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Users/GetUserByEmailTests.verified.cs @@ -0,0 +1,21 @@ +namespace DemoSample.Api.Tests.Endpoints.Users; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class GetUserByEmailTests : WebApiControllerBaseTest +{ + public GetUserByEmailTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Users/GetUserByIdHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Users/GetUserByIdHandlerStub.verified.cs new file mode 100644 index 00000000..aafcb762 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Users/GetUserByIdHandlerStub.verified.cs @@ -0,0 +1,20 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Tests.Endpoints.Users; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetUserByIdHandlerStub : IGetUserByIdHandler +{ + public Task ExecuteAsync( + GetUserByIdParameters parameters, + CancellationToken cancellationToken = default) + { + var data = new Fixture().Create(); + + return Task.FromResult(GetUserByIdResult.Ok(data)); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Users/GetUserByIdTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Users/GetUserByIdTests.verified.cs new file mode 100644 index 00000000..21cd40fb --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Users/GetUserByIdTests.verified.cs @@ -0,0 +1,21 @@ +namespace DemoSample.Api.Tests.Endpoints.Users; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class GetUserByIdTests : WebApiControllerBaseTest +{ + public GetUserByIdTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Users/GetUsersHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Users/GetUsersHandlerStub.verified.cs new file mode 100644 index 00000000..55c5a939 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Users/GetUsersHandlerStub.verified.cs @@ -0,0 +1,19 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Tests.Endpoints.Users; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetUsersHandlerStub : IGetUsersHandler +{ + public Task ExecuteAsync( + CancellationToken cancellationToken = default) + { + var data = new Fixture().Create>(); + + return Task.FromResult(GetUsersResult.Ok(data)); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Users/GetUsersTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Users/GetUsersTests.verified.cs new file mode 100644 index 00000000..99ea5ae4 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Users/GetUsersTests.verified.cs @@ -0,0 +1,21 @@ +namespace DemoSample.Api.Tests.Endpoints.Users; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class GetUsersTests : WebApiControllerBaseTest +{ + public GetUsersTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Users/PostUserHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Users/PostUserHandlerStub.verified.cs new file mode 100644 index 00000000..da0bc736 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Users/PostUserHandlerStub.verified.cs @@ -0,0 +1,18 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Tests.Endpoints.Users; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class PostUserHandlerStub : IPostUserHandler +{ + public Task ExecuteAsync( + PostUserParameters parameters, + CancellationToken cancellationToken = default) + { + return Task.FromResult(PostUserResult.Created()); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Users/PostUserTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Users/PostUserTests.verified.cs new file mode 100644 index 00000000..25989f91 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Users/PostUserTests.verified.cs @@ -0,0 +1,21 @@ +namespace DemoSample.Api.Tests.Endpoints.Users; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class PostUserTests : WebApiControllerBaseTest +{ + public PostUserTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Users/UpdateMyTestGenderHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Users/UpdateMyTestGenderHandlerStub.verified.cs new file mode 100644 index 00000000..076d3b7d --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Users/UpdateMyTestGenderHandlerStub.verified.cs @@ -0,0 +1,18 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Tests.Endpoints.Users; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateMyTestGenderHandlerStub : IUpdateMyTestGenderHandler +{ + public Task ExecuteAsync( + UpdateMyTestGenderParameters parameters, + CancellationToken cancellationToken = default) + { + return Task.FromResult(UpdateMyTestGenderResult.Ok("Hallo world")); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Users/UpdateMyTestGenderTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Users/UpdateMyTestGenderTests.verified.cs new file mode 100644 index 00000000..b6bcf1d1 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Users/UpdateMyTestGenderTests.verified.cs @@ -0,0 +1,21 @@ +namespace DemoSample.Api.Tests.Endpoints.Users; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class UpdateMyTestGenderTests : WebApiControllerBaseTest +{ + public UpdateMyTestGenderTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Users/UpdateUserByIdHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Users/UpdateUserByIdHandlerStub.verified.cs new file mode 100644 index 00000000..78efb17a --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Users/UpdateUserByIdHandlerStub.verified.cs @@ -0,0 +1,18 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Tests.Endpoints.Users; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateUserByIdHandlerStub : IUpdateUserByIdHandler +{ + public Task ExecuteAsync( + UpdateUserByIdParameters parameters, + CancellationToken cancellationToken = default) + { + return Task.FromResult(UpdateUserByIdResult.Ok("Hallo world")); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Users/UpdateUserByIdTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Users/UpdateUserByIdTests.verified.cs new file mode 100644 index 00000000..6bdc22eb --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/Endpoints/Users/UpdateUserByIdTests.verified.cs @@ -0,0 +1,21 @@ +namespace DemoSample.Api.Tests.Endpoints.Users; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class UpdateUserByIdTests : WebApiControllerBaseTest +{ + public UpdateUserByIdTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/GlobalUsings.verified.cs new file mode 100644 index 00000000..7c1f4a76 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/GlobalUsings.verified.cs @@ -0,0 +1,31 @@ +global using System.CodeDom.Compiler; +global using System.Reflection; +global using System.Text; +global using System.Text.Json; +global using System.Text.Json.Serialization; + +global using Atc.Rest.Options; +global using Atc.Rest.Results; +global using Atc.XUnit; + +global using AutoFixture; + +global using DemoSample.Api.Generated; +global using DemoSample.Api.Generated.Contracts; +global using DemoSample.Api.Generated.Contracts.Accounts; +global using DemoSample.Api.Generated.Contracts.Addresses; +global using DemoSample.Api.Generated.Contracts.EventArgs; +global using DemoSample.Api.Generated.Contracts.Files; +global using DemoSample.Api.Generated.Contracts.Items; +global using DemoSample.Api.Generated.Contracts.Orders; +global using DemoSample.Api.Generated.Contracts.RouteWithDash; +global using DemoSample.Api.Generated.Contracts.Users; + +global using Microsoft.AspNetCore.Hosting; +global using Microsoft.AspNetCore.Http; +global using Microsoft.AspNetCore.Mvc.Testing; +global using Microsoft.AspNetCore.TestHost; +global using Microsoft.Extensions.Configuration; +global using Microsoft.Extensions.DependencyInjection; + +global using Xunit; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/WebApiControllerBaseTest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/WebApiControllerBaseTest.verified.cs new file mode 100644 index 00000000..0136dbf6 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/WebApiControllerBaseTest.verified.cs @@ -0,0 +1,56 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Tests; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public abstract class WebApiControllerBaseTest : IClassFixture +{ + protected readonly WebApiStartupFactory Factory; + + protected readonly HttpClient HttpClient; + + protected readonly IConfiguration Configuration; + + protected static JsonSerializerOptions? JsonSerializerOptions; + + protected WebApiControllerBaseTest(WebApiStartupFactory fixture) + { + this.Factory = fixture; + this.HttpClient = this.Factory.CreateClient(); + this.Configuration = new ConfigurationBuilder().Build(); + JsonSerializerOptions = new JsonSerializerOptions + { + PropertyNameCaseInsensitive = true, + Converters = + { + new JsonStringEnumConverter() + }, + }; + } + + protected static StringContent ToJson(object data) + => new(JsonSerializer.Serialize(data, JsonSerializerOptions), Encoding.UTF8, "application/json"); + + protected static StringContent Json(string data) + => new(data, Encoding.UTF8, "application/json"); + + protected static IFormFile GetTestFile() + { + var bytes = Encoding.UTF8.GetBytes("Hello World"); + var stream = new MemoryStream(bytes); + var formFile = new FormFile(stream, 0, stream.Length, "dummy", "dummy.txt") + { + Headers = new HeaderDictionary(), + ContentType = "application/octet-stream", + }; + + return formFile; + } + + protected static List GetTestFiles() + => new() { GetTestFile(), GetTestFile() }; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/WebApiStartupFactory.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/WebApiStartupFactory.verified.cs new file mode 100644 index 00000000..19996e35 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Api.Tests/WebApiStartupFactory.verified.cs @@ -0,0 +1,40 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Tests; + +/// +/// Factory for bootstrapping in memory tests. +/// Includes options to override configuration and service collection using a partial class. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public partial class WebApiStartupFactory : WebApplicationFactory +{ + protected override void ConfigureWebHost(IWebHostBuilder builder) + { + builder.ConfigureAppConfiguration(config => + { + ModifyConfiguration(config); + var integrationConfig = new ConfigurationBuilder() + .AddJsonFile("appsettings.integrationtest.json") + .Build(); + config.AddConfiguration(integrationConfig); + }); + + builder.ConfigureTestServices(services => + { + ModifyServices(services); + services.AddSingleton(); + services.AutoRegistrateServices( + Assembly.GetAssembly(typeof(ApiRegistration))!, + Assembly.GetAssembly(typeof(WebApiStartupFactory))!); + }); + } + + partial void ModifyConfiguration(IConfigurationBuilder config); + + partial void ModifyServices(IServiceCollection services); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/GlobalUsings.verified.cs new file mode 100644 index 00000000..8c927eb7 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/GlobalUsings.verified.cs @@ -0,0 +1 @@ +global using Xunit; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Accounts/SetAccountNameHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Accounts/SetAccountNameHandlerTests.verified.cs new file mode 100644 index 00000000..1ea3a715 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Accounts/SetAccountNameHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace DemoSample.Domain.Tests.Handlers.Accounts; + +public class SetAccountNameHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Accounts/UpdateAccountNameHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Accounts/UpdateAccountNameHandlerTests.verified.cs new file mode 100644 index 00000000..0ba36057 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Accounts/UpdateAccountNameHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace DemoSample.Domain.Tests.Handlers.Accounts; + +public class UpdateAccountNameHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Addresses/GetAddressesByPostalCodesHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Addresses/GetAddressesByPostalCodesHandlerTests.verified.cs new file mode 100644 index 00000000..bd68ba9f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Addresses/GetAddressesByPostalCodesHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace DemoSample.Domain.Tests.Handlers.Addresses; + +public class GetAddressesByPostalCodesHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/EventArgs/GetEventArgByIdHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/EventArgs/GetEventArgByIdHandlerTests.verified.cs new file mode 100644 index 00000000..b1ac99da --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/EventArgs/GetEventArgByIdHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace DemoSample.Domain.Tests.Handlers.EventArgs; + +public class GetEventArgByIdHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/EventArgs/GetEventArgsHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/EventArgs/GetEventArgsHandlerTests.verified.cs new file mode 100644 index 00000000..9fd735c9 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/EventArgs/GetEventArgsHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace DemoSample.Domain.Tests.Handlers.EventArgs; + +public class GetEventArgsHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Files/GetFileByIdHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Files/GetFileByIdHandlerTests.verified.cs new file mode 100644 index 00000000..1cc73f77 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Files/GetFileByIdHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace DemoSample.Domain.Tests.Handlers.Files; + +public class GetFileByIdHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Files/UploadMultiFilesAsFormDataHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Files/UploadMultiFilesAsFormDataHandlerTests.verified.cs new file mode 100644 index 00000000..228ef2ed --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Files/UploadMultiFilesAsFormDataHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace DemoSample.Domain.Tests.Handlers.Files; + +public class UploadMultiFilesAsFormDataHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Files/UploadSingleFileAsFormDataHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Files/UploadSingleFileAsFormDataHandlerTests.verified.cs new file mode 100644 index 00000000..235feb67 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Files/UploadSingleFileAsFormDataHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace DemoSample.Domain.Tests.Handlers.Files; + +public class UploadSingleFileAsFormDataHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Files/UploadSingleObjectWithFileAsFormDataHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Files/UploadSingleObjectWithFileAsFormDataHandlerTests.verified.cs new file mode 100644 index 00000000..5b81d028 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Files/UploadSingleObjectWithFileAsFormDataHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace DemoSample.Domain.Tests.Handlers.Files; + +public class UploadSingleObjectWithFileAsFormDataHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Files/UploadSingleObjectWithFilesAsFormDataHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Files/UploadSingleObjectWithFilesAsFormDataHandlerTests.verified.cs new file mode 100644 index 00000000..1dc72c83 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Files/UploadSingleObjectWithFilesAsFormDataHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace DemoSample.Domain.Tests.Handlers.Files; + +public class UploadSingleObjectWithFilesAsFormDataHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Items/CreateItemHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Items/CreateItemHandlerTests.verified.cs new file mode 100644 index 00000000..46321c81 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Items/CreateItemHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace DemoSample.Domain.Tests.Handlers.Items; + +public class CreateItemHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Items/UpdateItemHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Items/UpdateItemHandlerTests.verified.cs new file mode 100644 index 00000000..6ed7d5e8 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Items/UpdateItemHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace DemoSample.Domain.Tests.Handlers.Items; + +public class UpdateItemHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Orders/GetOrderByIdHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Orders/GetOrderByIdHandlerTests.verified.cs new file mode 100644 index 00000000..38bc01cc --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Orders/GetOrderByIdHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace DemoSample.Domain.Tests.Handlers.Orders; + +public class GetOrderByIdHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Orders/GetOrdersHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Orders/GetOrdersHandlerTests.verified.cs new file mode 100644 index 00000000..b1dd6459 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Orders/GetOrdersHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace DemoSample.Domain.Tests.Handlers.Orders; + +public class GetOrdersHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Orders/PatchOrdersIdHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Orders/PatchOrdersIdHandlerTests.verified.cs new file mode 100644 index 00000000..6ae6caa4 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Orders/PatchOrdersIdHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace DemoSample.Domain.Tests.Handlers.Orders; + +public class PatchOrdersIdHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/RouteWithDash/GetRouteWithDashHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/RouteWithDash/GetRouteWithDashHandlerTests.verified.cs new file mode 100644 index 00000000..0e1c6b5d --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/RouteWithDash/GetRouteWithDashHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace DemoSample.Domain.Tests.Handlers.RouteWithDash; + +public class GetRouteWithDashHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Tasks/GetTasksHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Tasks/GetTasksHandlerTests.verified.cs new file mode 100644 index 00000000..e340c3bd --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Tasks/GetTasksHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace DemoSample.Domain.Tests.Handlers.Tasks; + +public class GetTasksHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Users/DeleteUserByIdHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Users/DeleteUserByIdHandlerTests.verified.cs new file mode 100644 index 00000000..89ec5c16 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Users/DeleteUserByIdHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace DemoSample.Domain.Tests.Handlers.Users; + +public class DeleteUserByIdHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Users/GetUserByEmailHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Users/GetUserByEmailHandlerTests.verified.cs new file mode 100644 index 00000000..cb39c5bc --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Users/GetUserByEmailHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace DemoSample.Domain.Tests.Handlers.Users; + +public class GetUserByEmailHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Users/GetUserByIdHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Users/GetUserByIdHandlerTests.verified.cs new file mode 100644 index 00000000..1a6be2e5 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Users/GetUserByIdHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace DemoSample.Domain.Tests.Handlers.Users; + +public class GetUserByIdHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Users/GetUsersHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Users/GetUsersHandlerTests.verified.cs new file mode 100644 index 00000000..98dc36bc --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Users/GetUsersHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace DemoSample.Domain.Tests.Handlers.Users; + +public class GetUsersHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Users/PostUserHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Users/PostUserHandlerTests.verified.cs new file mode 100644 index 00000000..617a93c3 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Users/PostUserHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace DemoSample.Domain.Tests.Handlers.Users; + +public class PostUserHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Users/UpdateMyTestGenderHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Users/UpdateMyTestGenderHandlerTests.verified.cs new file mode 100644 index 00000000..7dcc90af --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Users/UpdateMyTestGenderHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace DemoSample.Domain.Tests.Handlers.Users; + +public class UpdateMyTestGenderHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Users/UpdateUserByIdHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Users/UpdateUserByIdHandlerTests.verified.cs new file mode 100644 index 00000000..9859e9fd --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WOPD/test/DemoSample.Domain.Tests/Handlers/Users/UpdateUserByIdHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace DemoSample.Domain.Tests.Handlers.Users; + +public class UpdateUserByIdHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/ApiRegistration.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/ApiRegistration.verified.cs new file mode 100644 index 00000000..05f42f79 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/ApiRegistration.verified.cs @@ -0,0 +1,12 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ApiRegistration +{ +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Accounts/Interfaces/ISetAccountNameHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Accounts/Interfaces/ISetAccountNameHandler.verified.cs new file mode 100644 index 00000000..e2054a9f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Accounts/Interfaces/ISetAccountNameHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Accounts; + +/// +/// Domain Interface for RequestHandler. +/// Description: Set name of account. +/// Operation: SetAccountName. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface ISetAccountNameHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + SetAccountNameParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Accounts/Interfaces/IUpdateAccountNameHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Accounts/Interfaces/IUpdateAccountNameHandler.verified.cs new file mode 100644 index 00000000..ed70b673 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Accounts/Interfaces/IUpdateAccountNameHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Accounts; + +/// +/// Domain Interface for RequestHandler. +/// Description: Update name of account. +/// Operation: UpdateAccountName. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IUpdateAccountNameHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + UpdateAccountNameParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Accounts/Models/UpdateAccountRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Accounts/Models/UpdateAccountRequest.verified.cs new file mode 100644 index 00000000..0d1014a1 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Accounts/Models/UpdateAccountRequest.verified.cs @@ -0,0 +1,20 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Accounts; + +/// +/// UpdateAccountRequest. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateAccountRequest +{ + public string Name { get; set; } + + /// + public override string ToString() + => $"{nameof(Name)}: {Name}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Accounts/Parameters/SetAccountNameParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Accounts/Parameters/SetAccountNameParameters.verified.cs new file mode 100644 index 00000000..5e851a3c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Accounts/Parameters/SetAccountNameParameters.verified.cs @@ -0,0 +1,34 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Accounts; + +/// +/// Parameters for operation request. +/// Description: Set name of account. +/// Operation: SetAccountName. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class SetAccountNameParameters +{ + /// + /// The accountId. + /// + [FromRoute(Name = "accountId")] + [Required] + public Guid AccountId { get; set; } + + /// + /// UpdateAccountRequest. + /// + [FromBody] + [Required] + public UpdateAccountRequest Request { get; set; } + + /// + public override string ToString() + => $"{nameof(AccountId)}: {AccountId}, {nameof(Request)}: ({Request})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Accounts/Parameters/UpdateAccountNameParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Accounts/Parameters/UpdateAccountNameParameters.verified.cs new file mode 100644 index 00000000..cfcaded4 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Accounts/Parameters/UpdateAccountNameParameters.verified.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Accounts; + +/// +/// Parameters for operation request. +/// Description: Update name of account. +/// Operation: UpdateAccountName. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateAccountNameParameters +{ + /// + /// The accountId. + /// + [FromRoute(Name = "accountId")] + [Required] + public Guid AccountId { get; set; } + + /// + /// The account name. + /// + [FromHeader(Name = "name")] + public string? Name { get; set; } + + /// + public override string ToString() + => $"{nameof(AccountId)}: {AccountId}, {nameof(Name)}: {Name}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Accounts/Results/SetAccountNameResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Accounts/Results/SetAccountNameResult.verified.cs new file mode 100644 index 00000000..44244284 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Accounts/Results/SetAccountNameResult.verified.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Accounts; + +/// +/// Results for operation request. +/// Description: Set name of account. +/// Operation: SetAccountName. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class SetAccountNameResult : ResultBase +{ + private SetAccountNameResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static SetAccountNameResult Ok(string? message = null) + => new SetAccountNameResult(new OkObjectResult(message)); + + /// + /// Performs an implicit conversion from SetAccountNameResult to ActionResult. + /// + public static implicit operator SetAccountNameResult(string response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Accounts/Results/UpdateAccountNameResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Accounts/Results/UpdateAccountNameResult.verified.cs new file mode 100644 index 00000000..d7ac4f99 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Accounts/Results/UpdateAccountNameResult.verified.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Accounts; + +/// +/// Results for operation request. +/// Description: Update name of account. +/// Operation: UpdateAccountName. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateAccountNameResult : ResultBase +{ + private UpdateAccountNameResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static UpdateAccountNameResult Ok(string? message = null) + => new UpdateAccountNameResult(new OkObjectResult(message)); + + /// + /// Performs an implicit conversion from UpdateAccountNameResult to ActionResult. + /// + public static implicit operator UpdateAccountNameResult(string response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Addresses/Interfaces/IGetAddressesByPostalCodesHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Addresses/Interfaces/IGetAddressesByPostalCodesHandler.verified.cs new file mode 100644 index 00000000..74e63f6f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Addresses/Interfaces/IGetAddressesByPostalCodesHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Addresses; + +/// +/// Domain Interface for RequestHandler. +/// Description: Get addresses by postal code. +/// Operation: GetAddressesByPostalCodes. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetAddressesByPostalCodesHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + GetAddressesByPostalCodesParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Addresses/Parameters/GetAddressesByPostalCodesParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Addresses/Parameters/GetAddressesByPostalCodesParameters.verified.cs new file mode 100644 index 00000000..b3d1da3b --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Addresses/Parameters/GetAddressesByPostalCodesParameters.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Addresses; + +/// +/// Parameters for operation request. +/// Description: Get addresses by postal code. +/// Operation: GetAddressesByPostalCodes. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetAddressesByPostalCodesParameters +{ + /// + /// The postalCode to limit addresses on. + /// + [FromRoute(Name = "postalCode")] + [Required] + public string PostalCode { get; set; } + + /// + public override string ToString() + => $"{nameof(PostalCode)}: {PostalCode}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Addresses/Results/GetAddressesByPostalCodesResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Addresses/Results/GetAddressesByPostalCodesResult.verified.cs new file mode 100644 index 00000000..c307f0c9 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Addresses/Results/GetAddressesByPostalCodesResult.verified.cs @@ -0,0 +1,36 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Addresses; + +/// +/// Results for operation request. +/// Description: Get addresses by postal code. +/// Operation: GetAddressesByPostalCodes. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetAddressesByPostalCodesResult : ResultBase +{ + private GetAddressesByPostalCodesResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static GetAddressesByPostalCodesResult Ok(IEnumerable
response) + => new GetAddressesByPostalCodesResult(new OkObjectResult(response ?? Enumerable.Empty
())); + + /// + /// 404 - NotFound response. + /// + public static GetAddressesByPostalCodesResult NotFound(string? message = null) + => new GetAddressesByPostalCodesResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.NotFound, message)); + + /// + /// Performs an implicit conversion from GetAddressesByPostalCodesResult to ActionResult. + /// + public static implicit operator GetAddressesByPostalCodesResult(List
response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/EventArgs/Interfaces/IGetEventArgByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/EventArgs/Interfaces/IGetEventArgByIdHandler.verified.cs new file mode 100644 index 00000000..9908e66a --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/EventArgs/Interfaces/IGetEventArgByIdHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.EventArgs; + +/// +/// Domain Interface for RequestHandler. +/// Description: Get EventArgs By Id. +/// Operation: GetEventArgById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetEventArgByIdHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + GetEventArgByIdParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/EventArgs/Interfaces/IGetEventArgsHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/EventArgs/Interfaces/IGetEventArgsHandler.verified.cs new file mode 100644 index 00000000..f02b36fa --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/EventArgs/Interfaces/IGetEventArgsHandler.verified.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.EventArgs; + +/// +/// Domain Interface for RequestHandler. +/// Description: Get EventArgs List. +/// Operation: GetEventArgs. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetEventArgsHandler +{ + /// + /// Execute method. + /// + /// The cancellation token. + Task ExecuteAsync( + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/EventArgs/Models/EventArgs.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/EventArgs/Models/EventArgs.verified.cs new file mode 100644 index 00000000..0305f76f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/EventArgs/Models/EventArgs.verified.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.EventArgs; + +/// +/// EventArgs. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class EventArgs +{ + public Guid Id { get; set; } + + public string EventName { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(EventName)}: {EventName}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/EventArgs/Parameters/GetEventArgByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/EventArgs/Parameters/GetEventArgByIdParameters.verified.cs new file mode 100644 index 00000000..c7eb960c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/EventArgs/Parameters/GetEventArgByIdParameters.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.EventArgs; + +/// +/// Parameters for operation request. +/// Description: Get EventArgs By Id. +/// Operation: GetEventArgById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetEventArgByIdParameters +{ + /// + /// The id of the eventArgs. + /// + [FromRoute(Name = "id")] + [Required] + public string Id { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/EventArgs/Results/GetEventArgByIdResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/EventArgs/Results/GetEventArgByIdResult.verified.cs new file mode 100644 index 00000000..3d1c24c6 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/EventArgs/Results/GetEventArgByIdResult.verified.cs @@ -0,0 +1,36 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.EventArgs; + +/// +/// Results for operation request. +/// Description: Get EventArgs By Id. +/// Operation: GetEventArgById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetEventArgByIdResult : ResultBase +{ + private GetEventArgByIdResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static GetEventArgByIdResult Ok(EventArgs response) + => new GetEventArgByIdResult(new OkObjectResult(response)); + + /// + /// 404 - NotFound response. + /// + public static GetEventArgByIdResult NotFound(string? message = null) + => new GetEventArgByIdResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.NotFound, message)); + + /// + /// Performs an implicit conversion from GetEventArgByIdResult to ActionResult. + /// + public static implicit operator GetEventArgByIdResult(EventArgs response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/EventArgs/Results/GetEventArgsResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/EventArgs/Results/GetEventArgsResult.verified.cs new file mode 100644 index 00000000..00254520 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/EventArgs/Results/GetEventArgsResult.verified.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.EventArgs; + +/// +/// Results for operation request. +/// Description: Get EventArgs List. +/// Operation: GetEventArgs. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetEventArgsResult : ResultBase +{ + private GetEventArgsResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static GetEventArgsResult Ok(IEnumerable response) + => new GetEventArgsResult(new OkObjectResult(response ?? Enumerable.Empty())); + + /// + /// Performs an implicit conversion from GetEventArgsResult to ActionResult. + /// + public static implicit operator GetEventArgsResult(List response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Files/Interfaces/IGetFileByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Files/Interfaces/IGetFileByIdHandler.verified.cs new file mode 100644 index 00000000..0121cf0d --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Files/Interfaces/IGetFileByIdHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Files; + +/// +/// Domain Interface for RequestHandler. +/// Description: Get File By Id. +/// Operation: GetFileById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetFileByIdHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + GetFileByIdParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Files/Interfaces/IUploadMultiFilesAsFormDataHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Files/Interfaces/IUploadMultiFilesAsFormDataHandler.verified.cs new file mode 100644 index 00000000..d6a97f61 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Files/Interfaces/IUploadMultiFilesAsFormDataHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Files; + +/// +/// Domain Interface for RequestHandler. +/// Description: Upload multi files as form data. +/// Operation: UploadMultiFilesAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IUploadMultiFilesAsFormDataHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + UploadMultiFilesAsFormDataParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Files/Interfaces/IUploadSingleFileAsFormDataHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Files/Interfaces/IUploadSingleFileAsFormDataHandler.verified.cs new file mode 100644 index 00000000..a1933245 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Files/Interfaces/IUploadSingleFileAsFormDataHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Files; + +/// +/// Domain Interface for RequestHandler. +/// Description: Upload a file as OctetStream. +/// Operation: UploadSingleFileAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IUploadSingleFileAsFormDataHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + UploadSingleFileAsFormDataParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Files/Interfaces/IUploadSingleObjectWithFileAsFormDataHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Files/Interfaces/IUploadSingleObjectWithFileAsFormDataHandler.verified.cs new file mode 100644 index 00000000..976a100e --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Files/Interfaces/IUploadSingleObjectWithFileAsFormDataHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Files; + +/// +/// Domain Interface for RequestHandler. +/// Description: Upload a file as FormData. +/// Operation: UploadSingleObjectWithFileAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IUploadSingleObjectWithFileAsFormDataHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + UploadSingleObjectWithFileAsFormDataParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Files/Interfaces/IUploadSingleObjectWithFilesAsFormDataHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Files/Interfaces/IUploadSingleObjectWithFilesAsFormDataHandler.verified.cs new file mode 100644 index 00000000..777186e2 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Files/Interfaces/IUploadSingleObjectWithFilesAsFormDataHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Files; + +/// +/// Domain Interface for RequestHandler. +/// Description: Upload files as FormData. +/// Operation: UploadSingleObjectWithFilesAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IUploadSingleObjectWithFilesAsFormDataHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + UploadSingleObjectWithFilesAsFormDataParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Files/Models/FileAsFormDataRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Files/Models/FileAsFormDataRequest.verified.cs new file mode 100644 index 00000000..e64a9991 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Files/Models/FileAsFormDataRequest.verified.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Files; + +/// +/// FileAsFormDataRequest. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class FileAsFormDataRequest +{ + [Required] + public string ItemName { get; set; } + + public IFormFile? File { get; set; } + + [Required] + public List Items { get; set; } + + /// + public override string ToString() + => $"{nameof(ItemName)}: {ItemName}, {nameof(File)}: {File}, {nameof(Items)}.Count: {Items?.Count ?? 0}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Files/Models/FilesAsFormDataRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Files/Models/FilesAsFormDataRequest.verified.cs new file mode 100644 index 00000000..d0b4c799 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Files/Models/FilesAsFormDataRequest.verified.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Files; + +/// +/// FilesAsFormDataRequest. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class FilesAsFormDataRequest +{ + /// + /// A list of File(s). + /// + public List Files { get; set; } = new List(); + + /// + public override string ToString() + => $"{nameof(Files)}.Count: {Files?.Count ?? 0}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Files/Parameters/GetFileByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Files/Parameters/GetFileByIdParameters.verified.cs new file mode 100644 index 00000000..11c04947 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Files/Parameters/GetFileByIdParameters.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Files; + +/// +/// Parameters for operation request. +/// Description: Get File By Id. +/// Operation: GetFileById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetFileByIdParameters +{ + /// + /// The file id. + /// + [FromRoute(Name = "id")] + [Required] + public string Id { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Files/Parameters/UploadMultiFilesAsFormDataParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Files/Parameters/UploadMultiFilesAsFormDataParameters.verified.cs new file mode 100644 index 00000000..e41dfcc2 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Files/Parameters/UploadMultiFilesAsFormDataParameters.verified.cs @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Files; + +/// +/// Parameters for operation request. +/// Description: Upload multi files as form data. +/// Operation: UploadMultiFilesAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UploadMultiFilesAsFormDataParameters +{ + [FromForm] + [Required] + public List Request { get; set; } = new List(); + + /// + public override string ToString() + => $"{nameof(Request)}.Count: {Request?.Count ?? 0}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Files/Parameters/UploadSingleFileAsFormDataParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Files/Parameters/UploadSingleFileAsFormDataParameters.verified.cs new file mode 100644 index 00000000..7ef10fb1 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Files/Parameters/UploadSingleFileAsFormDataParameters.verified.cs @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Files; + +/// +/// Parameters for operation request. +/// Description: Upload a file as OctetStream. +/// Operation: UploadSingleFileAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UploadSingleFileAsFormDataParameters +{ + [FromBody] + [Required] + public IFormFile Request { get; set; } + + /// + public override string ToString() + => $"{nameof(Request)}: ({Request})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Files/Parameters/UploadSingleObjectWithFileAsFormDataParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Files/Parameters/UploadSingleObjectWithFileAsFormDataParameters.verified.cs new file mode 100644 index 00000000..7a5462ec --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Files/Parameters/UploadSingleObjectWithFileAsFormDataParameters.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Files; + +/// +/// Parameters for operation request. +/// Description: Upload a file as FormData. +/// Operation: UploadSingleObjectWithFileAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UploadSingleObjectWithFileAsFormDataParameters +{ + /// + /// FileAsFormDataRequest. + /// + [FromForm] + [Required] + public FileAsFormDataRequest Request { get; set; } + + /// + public override string ToString() + => $"{nameof(Request)}: ({Request})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Files/Parameters/UploadSingleObjectWithFilesAsFormDataParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Files/Parameters/UploadSingleObjectWithFilesAsFormDataParameters.verified.cs new file mode 100644 index 00000000..7039a93f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Files/Parameters/UploadSingleObjectWithFilesAsFormDataParameters.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Files; + +/// +/// Parameters for operation request. +/// Description: Upload files as FormData. +/// Operation: UploadSingleObjectWithFilesAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UploadSingleObjectWithFilesAsFormDataParameters +{ + /// + /// FilesAsFormDataRequest. + /// + [FromForm] + [Required] + public FilesAsFormDataRequest Request { get; set; } + + /// + public override string ToString() + => $"{nameof(Request)}: ({Request})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Files/Results/GetFileByIdResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Files/Results/GetFileByIdResult.verified.cs new file mode 100644 index 00000000..e5b56a27 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Files/Results/GetFileByIdResult.verified.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Files; + +/// +/// Results for operation request. +/// Description: Get File By Id. +/// Operation: GetFileById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetFileByIdResult : ResultBase +{ + private GetFileByIdResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static GetFileByIdResult Ok(byte[] bytes, string fileName) + => new GetFileByIdResult(ResultFactory.CreateFileContentResult(bytes, fileName)); + + /// + /// 404 - NotFound response. + /// + public static GetFileByIdResult NotFound(string? message = null) + => new GetFileByIdResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.NotFound, message)); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Files/Results/UploadMultiFilesAsFormDataResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Files/Results/UploadMultiFilesAsFormDataResult.verified.cs new file mode 100644 index 00000000..5f4441db --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Files/Results/UploadMultiFilesAsFormDataResult.verified.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Files; + +/// +/// Results for operation request. +/// Description: Upload multi files as form data. +/// Operation: UploadMultiFilesAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UploadMultiFilesAsFormDataResult : ResultBase +{ + private UploadMultiFilesAsFormDataResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static UploadMultiFilesAsFormDataResult Ok(string? message = null) + => new UploadMultiFilesAsFormDataResult(new OkObjectResult(message)); + + /// + /// Performs an implicit conversion from UploadMultiFilesAsFormDataResult to ActionResult. + /// + public static implicit operator UploadMultiFilesAsFormDataResult(string response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Files/Results/UploadSingleFileAsFormDataResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Files/Results/UploadSingleFileAsFormDataResult.verified.cs new file mode 100644 index 00000000..82fb37d2 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Files/Results/UploadSingleFileAsFormDataResult.verified.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Files; + +/// +/// Results for operation request. +/// Description: Upload a file as OctetStream. +/// Operation: UploadSingleFileAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UploadSingleFileAsFormDataResult : ResultBase +{ + private UploadSingleFileAsFormDataResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static UploadSingleFileAsFormDataResult Ok(string? message = null) + => new UploadSingleFileAsFormDataResult(new OkObjectResult(message)); + + /// + /// Performs an implicit conversion from UploadSingleFileAsFormDataResult to ActionResult. + /// + public static implicit operator UploadSingleFileAsFormDataResult(string response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Files/Results/UploadSingleObjectWithFileAsFormDataResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Files/Results/UploadSingleObjectWithFileAsFormDataResult.verified.cs new file mode 100644 index 00000000..370c15ab --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Files/Results/UploadSingleObjectWithFileAsFormDataResult.verified.cs @@ -0,0 +1,36 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Files; + +/// +/// Results for operation request. +/// Description: Upload a file as FormData. +/// Operation: UploadSingleObjectWithFileAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UploadSingleObjectWithFileAsFormDataResult : ResultBase +{ + private UploadSingleObjectWithFileAsFormDataResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static UploadSingleObjectWithFileAsFormDataResult Ok(string? message = null) + => new UploadSingleObjectWithFileAsFormDataResult(new OkObjectResult(message)); + + /// + /// 400 - BadRequest response. + /// + public static UploadSingleObjectWithFileAsFormDataResult BadRequest(string? message = null) + => new UploadSingleObjectWithFileAsFormDataResult(ResultFactory.CreateContentResultWithValidationProblemDetails(HttpStatusCode.BadRequest, message)); + + /// + /// Performs an implicit conversion from UploadSingleObjectWithFileAsFormDataResult to ActionResult. + /// + public static implicit operator UploadSingleObjectWithFileAsFormDataResult(string response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Files/Results/UploadSingleObjectWithFilesAsFormDataResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Files/Results/UploadSingleObjectWithFilesAsFormDataResult.verified.cs new file mode 100644 index 00000000..41b1ffac --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Files/Results/UploadSingleObjectWithFilesAsFormDataResult.verified.cs @@ -0,0 +1,36 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Files; + +/// +/// Results for operation request. +/// Description: Upload files as FormData. +/// Operation: UploadSingleObjectWithFilesAsFormData. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UploadSingleObjectWithFilesAsFormDataResult : ResultBase +{ + private UploadSingleObjectWithFilesAsFormDataResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static UploadSingleObjectWithFilesAsFormDataResult Ok(string? message = null) + => new UploadSingleObjectWithFilesAsFormDataResult(new OkObjectResult(message)); + + /// + /// 400 - BadRequest response. + /// + public static UploadSingleObjectWithFilesAsFormDataResult BadRequest(string? message = null) + => new UploadSingleObjectWithFilesAsFormDataResult(ResultFactory.CreateContentResultWithValidationProblemDetails(HttpStatusCode.BadRequest, message)); + + /// + /// Performs an implicit conversion from UploadSingleObjectWithFilesAsFormDataResult to ActionResult. + /// + public static implicit operator UploadSingleObjectWithFilesAsFormDataResult(string response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Items/Interfaces/ICreateItemHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Items/Interfaces/ICreateItemHandler.verified.cs new file mode 100644 index 00000000..e18627be --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Items/Interfaces/ICreateItemHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Items; + +/// +/// Domain Interface for RequestHandler. +/// Description: Create a new item. +/// Operation: CreateItem. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface ICreateItemHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + CreateItemParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Items/Interfaces/IUpdateItemHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Items/Interfaces/IUpdateItemHandler.verified.cs new file mode 100644 index 00000000..2917f14c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Items/Interfaces/IUpdateItemHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Items; + +/// +/// Domain Interface for RequestHandler. +/// Description: Updates an item. +/// Operation: UpdateItem. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IUpdateItemHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + UpdateItemParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Items/Models/CreateItemRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Items/Models/CreateItemRequest.verified.cs new file mode 100644 index 00000000..7b9879e6 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Items/Models/CreateItemRequest.verified.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Items; + +/// +/// CreateItemRequest. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class CreateItemRequest +{ + /// + /// Item. + /// + [Required] + public Item Item { get; set; } + + /// + /// A list of Item. + /// + [Required] + public List MyItems { get; set; } + + /// + public override string ToString() + => $"{nameof(Item)}: ({Item}), {nameof(MyItems)}.Count: {MyItems?.Count ?? 0}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Items/Models/Item.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Items/Models/Item.verified.cs new file mode 100644 index 00000000..81ca337f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Items/Models/Item.verified.cs @@ -0,0 +1,21 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Items; + +/// +/// Item. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Item +{ + [Required] + public string Name { get; set; } + + /// + public override string ToString() + => $"{nameof(Name)}: {Name}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Items/Models/UpdateItemRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Items/Models/UpdateItemRequest.verified.cs new file mode 100644 index 00000000..623546f5 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Items/Models/UpdateItemRequest.verified.cs @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Items; + +/// +/// UpdateItemRequest. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateItemRequest +{ + /// + /// Item. + /// + [Required] + public Item Item { get; set; } + + /// + public override string ToString() + => $"{nameof(Item)}: ({Item})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Items/Parameters/CreateItemParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Items/Parameters/CreateItemParameters.verified.cs new file mode 100644 index 00000000..6066aac8 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Items/Parameters/CreateItemParameters.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Items; + +/// +/// Parameters for operation request. +/// Description: Create a new item. +/// Operation: CreateItem. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class CreateItemParameters +{ + /// + /// CreateItemRequest. + /// + [FromBody] + [Required] + public CreateItemRequest Request { get; set; } + + /// + public override string ToString() + => $"{nameof(Request)}: ({Request})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Items/Parameters/UpdateItemParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Items/Parameters/UpdateItemParameters.verified.cs new file mode 100644 index 00000000..cf1f9d53 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Items/Parameters/UpdateItemParameters.verified.cs @@ -0,0 +1,34 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Items; + +/// +/// Parameters for operation request. +/// Description: Updates an item. +/// Operation: UpdateItem. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateItemParameters +{ + /// + /// The id of the order. + /// + [FromRoute(Name = "id")] + [Required] + public Guid Id { get; set; } + + /// + /// UpdateItemRequest. + /// + [FromBody] + [Required] + public UpdateItemRequest Request { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(Request)}: ({Request})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Items/Results/CreateItemResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Items/Results/CreateItemResult.verified.cs new file mode 100644 index 00000000..aa2df4a2 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Items/Results/CreateItemResult.verified.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Items; + +/// +/// Results for operation request. +/// Description: Create a new item. +/// Operation: CreateItem. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class CreateItemResult : ResultBase +{ + private CreateItemResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static CreateItemResult Ok(string? message = null) + => new CreateItemResult(new OkObjectResult(message)); + + /// + /// Performs an implicit conversion from CreateItemResult to ActionResult. + /// + public static implicit operator CreateItemResult(string response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Items/Results/UpdateItemResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Items/Results/UpdateItemResult.verified.cs new file mode 100644 index 00000000..8ab0397e --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Items/Results/UpdateItemResult.verified.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Items; + +/// +/// Results for operation request. +/// Description: Updates an item. +/// Operation: UpdateItem. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateItemResult : ResultBase +{ + private UpdateItemResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static UpdateItemResult Ok(Guid response) + => new UpdateItemResult(new OkObjectResult(response)); + + /// + /// Performs an implicit conversion from UpdateItemResult to ActionResult. + /// + public static implicit operator UpdateItemResult(Guid response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Orders/Interfaces/IGetOrderByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Orders/Interfaces/IGetOrderByIdHandler.verified.cs new file mode 100644 index 00000000..3744780b --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Orders/Interfaces/IGetOrderByIdHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Orders; + +/// +/// Domain Interface for RequestHandler. +/// Description: Get order by id. +/// Operation: GetOrderById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetOrderByIdHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + GetOrderByIdParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Orders/Interfaces/IGetOrdersHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Orders/Interfaces/IGetOrdersHandler.verified.cs new file mode 100644 index 00000000..7d8363cf --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Orders/Interfaces/IGetOrdersHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Orders; + +/// +/// Domain Interface for RequestHandler. +/// Description: Get orders. +/// Operation: GetOrders. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetOrdersHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + GetOrdersParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Orders/Interfaces/IPatchOrdersIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Orders/Interfaces/IPatchOrdersIdHandler.verified.cs new file mode 100644 index 00000000..a928e1ca --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Orders/Interfaces/IPatchOrdersIdHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Orders; + +/// +/// Domain Interface for RequestHandler. +/// Description: Update part of order by id. +/// Operation: PatchOrdersId. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IPatchOrdersIdHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + PatchOrdersIdParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Orders/Models/Order.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Orders/Models/Order.verified.cs new file mode 100644 index 00000000..df052d84 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Orders/Models/Order.verified.cs @@ -0,0 +1,79 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Orders; + +/// +/// A single order. +/// Hallo description with multiline and no ending dot. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Order +{ + public Guid Id { get; set; } + + public string Description { get; set; } + + public DateTimeOffset MyTime { get; set; } + + /// + /// Undefined description. + /// + /// + /// Email validation being enforced. + /// + [EmailAddress] + public string MyEmail { get; set; } = "a@a.com"; + + public DateTimeOffset? MyNullableDateTime { get; set; } + + public DateTimeOffset MyDateTime { get; set; } + + [Range(1.1, 20.2)] + public double MyNumber { get; set; } + + [Range(-2147483648, 50)] + public int MyInteger { get; set; } = 15; + + /// + /// MyBool is great. + /// + public bool MyBool { get; set; } + + /// + /// This is the good uri :-). + /// + /// + /// Url validation being enforced. + /// + [Uri] + public Uri MyUri { get; set; } + + /// + /// Undefined description. + /// + /// + /// This string should be base64-encoded. + /// + public string MyByte { get; set; } + + /// + /// Hallo myStringList desc :-). + /// + public List MyStringList { get; set; } = new List(); + + [Range(10, 2147483647)] + public long MyLong { get; set; } + + /// + /// Address. + /// + public Address DeliveryAddress { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(Description)}: {Description}, {nameof(MyTime)}: ({MyTime}), {nameof(MyEmail)}: {MyEmail}, {nameof(MyNullableDateTime)}: ({MyNullableDateTime}), {nameof(MyDateTime)}: ({MyDateTime}), {nameof(MyNumber)}: {MyNumber}, {nameof(MyInteger)}: {MyInteger}, {nameof(MyBool)}: {MyBool}, {nameof(MyUri)}: ({MyUri}), {nameof(MyByte)}: {MyByte}, {nameof(MyStringList)}.Count: {MyStringList?.Count ?? 0}, {nameof(MyLong)}: {MyLong}, {nameof(DeliveryAddress)}: ({DeliveryAddress})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Orders/Models/UpdateOrderRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Orders/Models/UpdateOrderRequest.verified.cs new file mode 100644 index 00000000..af86ad95 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Orders/Models/UpdateOrderRequest.verified.cs @@ -0,0 +1,28 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Orders; + +/// +/// Request to update an order. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateOrderRequest +{ + /// + /// Undefined description. + /// + /// + /// Email validation being enforced. + /// + [Required] + [EmailAddress] + public string MyEmail { get; set; } + + /// + public override string ToString() + => $"{nameof(MyEmail)}: {MyEmail}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Orders/Parameters/GetOrderByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Orders/Parameters/GetOrderByIdParameters.verified.cs new file mode 100644 index 00000000..1c016476 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Orders/Parameters/GetOrderByIdParameters.verified.cs @@ -0,0 +1,37 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Orders; + +/// +/// Parameters for operation request. +/// Description: Get order by id. +/// Operation: GetOrderById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetOrderByIdParameters +{ + /// + /// The id of the order. + /// + [FromRoute(Name = "id")] + [Required] + public Guid Id { get; set; } + + /// + /// The email for filter orders to retrieve. + /// + /// + /// Email validation being enforced. + /// + [FromQuery(Name = "myEmail")] + [EmailAddress] + public string? MyEmail { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(MyEmail)}: {MyEmail}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Orders/Parameters/GetOrdersParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Orders/Parameters/GetOrdersParameters.verified.cs new file mode 100644 index 00000000..45c7ad65 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Orders/Parameters/GetOrdersParameters.verified.cs @@ -0,0 +1,53 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Orders; + +/// +/// Parameters for operation request. +/// Description: Get orders. +/// Operation: GetOrders. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetOrdersParameters +{ + /// + /// The numbers of items to return. + /// + [FromQuery(Name = "pageSize")] + [Required] + [Range(1, 100)] + public int PageSize { get; set; } = 10; + + /// + /// The number of items to skip before starting to collect the result set. + /// + [FromQuery(Name = "pageIndex")] + [Range(0, 2147483647)] + public int PageIndex { get; set; } = 0; + + /// + /// The query string. + /// + [FromQuery(Name = "queryString")] + public string? QueryString { get; set; } + + /// + /// The query array of string. + /// + [FromQuery(Name = "queryStringArray")] + public List QueryStringArray { get; set; } = new List(); + + /// + /// The continuation token. + /// + [FromQuery(Name = "continuationToken")] + public string? ContinuationToken { get; set; } + + /// + public override string ToString() + => $"{nameof(PageSize)}: {PageSize}, {nameof(PageIndex)}: {PageIndex}, {nameof(QueryString)}: {QueryString}, {nameof(QueryStringArray)}.Count: {QueryStringArray?.Count ?? 0}, {nameof(ContinuationToken)}: {ContinuationToken}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Orders/Parameters/PatchOrdersIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Orders/Parameters/PatchOrdersIdParameters.verified.cs new file mode 100644 index 00000000..e8f4db33 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Orders/Parameters/PatchOrdersIdParameters.verified.cs @@ -0,0 +1,62 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Orders; + +/// +/// Parameters for operation request. +/// Description: Update part of order by id. +/// Operation: PatchOrdersId. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class PatchOrdersIdParameters +{ + /// + /// The id of the order. + /// + [FromRoute(Name = "id")] + [Required] + public Guid Id { get; set; } + + /// + /// The myTestHeader special key. + /// + [FromHeader(Name = "myTestHeader")] + [Required] + public string MyTestHeader { get; set; } + + /// + /// The myTestHeaderBool special key. + /// + [FromHeader(Name = "myTestHeaderBool")] + [Required] + public bool MyTestHeaderBool { get; set; } + + /// + /// The myTestHeaderInt special key. + /// + [FromHeader(Name = "myTestHeaderInt")] + [Required] + public int MyTestHeaderInt { get; set; } + + /// + /// The correlationId. + /// + [FromHeader(Name = "x-correlation-id")] + [Required] + public string CorrelationId { get; set; } + + /// + /// Request to update an order. + /// + [FromBody] + [Required] + public UpdateOrderRequest Request { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(MyTestHeader)}: {MyTestHeader}, {nameof(MyTestHeaderBool)}: {MyTestHeaderBool}, {nameof(MyTestHeaderInt)}: {MyTestHeaderInt}, {nameof(CorrelationId)}: {CorrelationId}, {nameof(Request)}: ({Request})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Orders/Results/GetOrderByIdResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Orders/Results/GetOrderByIdResult.verified.cs new file mode 100644 index 00000000..3f11b9a1 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Orders/Results/GetOrderByIdResult.verified.cs @@ -0,0 +1,36 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Orders; + +/// +/// Results for operation request. +/// Description: Get order by id. +/// Operation: GetOrderById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetOrderByIdResult : ResultBase +{ + private GetOrderByIdResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static GetOrderByIdResult Ok(Order response) + => new GetOrderByIdResult(new OkObjectResult(response)); + + /// + /// 404 - NotFound response. + /// + public static GetOrderByIdResult NotFound(string? message = null) + => new GetOrderByIdResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.NotFound, message)); + + /// + /// Performs an implicit conversion from GetOrderByIdResult to ActionResult. + /// + public static implicit operator GetOrderByIdResult(Order response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Orders/Results/GetOrdersResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Orders/Results/GetOrdersResult.verified.cs new file mode 100644 index 00000000..0834f126 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Orders/Results/GetOrdersResult.verified.cs @@ -0,0 +1,36 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Orders; + +/// +/// Results for operation request. +/// Description: Get orders. +/// Operation: GetOrders. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetOrdersResult : ResultBase +{ + private GetOrdersResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static GetOrdersResult Ok(Pagination response) + => new GetOrdersResult(new OkObjectResult(response)); + + /// + /// 404 - NotFound response. + /// + public static GetOrdersResult NotFound(string? message = null) + => new GetOrdersResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.NotFound, message)); + + /// + /// Performs an implicit conversion from GetOrdersResult to ActionResult. + /// + public static implicit operator GetOrdersResult(Pagination response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Orders/Results/PatchOrdersIdResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Orders/Results/PatchOrdersIdResult.verified.cs new file mode 100644 index 00000000..9c105912 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Orders/Results/PatchOrdersIdResult.verified.cs @@ -0,0 +1,48 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Orders; + +/// +/// Results for operation request. +/// Description: Update part of order by id. +/// Operation: PatchOrdersId. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class PatchOrdersIdResult : ResultBase +{ + private PatchOrdersIdResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static PatchOrdersIdResult Ok(string? message = null) + => new PatchOrdersIdResult(new OkObjectResult(message)); + + /// + /// 404 - NotFound response. + /// + public static PatchOrdersIdResult NotFound(string? message = null) + => new PatchOrdersIdResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.NotFound, message)); + + /// + /// 409 - Conflict response. + /// + public static PatchOrdersIdResult Conflict(string? message = null) + => new PatchOrdersIdResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.Conflict, message)); + + /// + /// 502 - BadGateway response. + /// + public static PatchOrdersIdResult BadGateway(string? message = null) + => new PatchOrdersIdResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.BadGateway, message)); + + /// + /// Performs an implicit conversion from PatchOrdersIdResult to ActionResult. + /// + public static implicit operator PatchOrdersIdResult(string response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/RouteWithDash/Interfaces/IGetRouteWithDashHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/RouteWithDash/Interfaces/IGetRouteWithDashHandler.verified.cs new file mode 100644 index 00000000..2091eb1e --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/RouteWithDash/Interfaces/IGetRouteWithDashHandler.verified.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.RouteWithDash; + +/// +/// Domain Interface for RequestHandler. +/// Description: Your GET endpoint. +/// Operation: GetRouteWithDash. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetRouteWithDashHandler +{ + /// + /// Execute method. + /// + /// The cancellation token. + Task ExecuteAsync( + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/RouteWithDash/Results/GetRouteWithDashResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/RouteWithDash/Results/GetRouteWithDashResult.verified.cs new file mode 100644 index 00000000..6931b120 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/RouteWithDash/Results/GetRouteWithDashResult.verified.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.RouteWithDash; + +/// +/// Results for operation request. +/// Description: Your GET endpoint. +/// Operation: GetRouteWithDash. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetRouteWithDashResult : ResultBase +{ + private GetRouteWithDashResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static GetRouteWithDashResult Ok(string? message = null) + => new GetRouteWithDashResult(new OkObjectResult(message)); + + /// + /// Performs an implicit conversion from GetRouteWithDashResult to ActionResult. + /// + public static implicit operator GetRouteWithDashResult(string response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Tasks/Interfaces/IGetTasksHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Tasks/Interfaces/IGetTasksHandler.verified.cs new file mode 100644 index 00000000..f8201041 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Tasks/Interfaces/IGetTasksHandler.verified.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Tasks; + +/// +/// Domain Interface for RequestHandler. +/// Description: Returns tasks. +/// Operation: GetTasks. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetTasksHandler +{ + /// + /// Execute method. + /// + /// The cancellation token. + Task ExecuteAsync( + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Tasks/Models/Task.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Tasks/Models/Task.verified.cs new file mode 100644 index 00000000..9058efb6 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Tasks/Models/Task.verified.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Tasks; + +/// +/// Describes a single task. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Task +{ + public Guid Id { get; set; } + + public string Name { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(Name)}: {Name}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Tasks/Models/Tasks.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Tasks/Models/Tasks.verified.cs new file mode 100644 index 00000000..4d63ac24 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Tasks/Models/Tasks.verified.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Tasks; + +/// +/// Contains a list of Tasks. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Tasks +{ + /// + /// A list of Task. + /// + public List TaskList { get; set; } = new List(); + + /// + public override string ToString() + => $"{nameof(TaskList)}.Count: {TaskList?.Count ?? 0}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Tasks/Results/GetTasksResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Tasks/Results/GetTasksResult.verified.cs new file mode 100644 index 00000000..11aeca16 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Tasks/Results/GetTasksResult.verified.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Tasks; + +/// +/// Results for operation request. +/// Description: Returns tasks. +/// Operation: GetTasks. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetTasksResult : ResultBase +{ + private GetTasksResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static GetTasksResult Ok(IEnumerable response) + => new GetTasksResult(new OkObjectResult(response ?? Enumerable.Empty())); + + /// + /// Performs an implicit conversion from GetTasksResult to ActionResult. + /// + public static implicit operator GetTasksResult(List response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Interfaces/IDeleteUserByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Interfaces/IDeleteUserByIdHandler.verified.cs new file mode 100644 index 00000000..0fff983b --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Interfaces/IDeleteUserByIdHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Users; + +/// +/// Domain Interface for RequestHandler. +/// Description: Delete user by id. +/// Operation: DeleteUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IDeleteUserByIdHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + DeleteUserByIdParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Interfaces/IGetUserByEmailHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Interfaces/IGetUserByEmailHandler.verified.cs new file mode 100644 index 00000000..f9753d12 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Interfaces/IGetUserByEmailHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Users; + +/// +/// Domain Interface for RequestHandler. +/// Description: Get user by email. +/// Operation: GetUserByEmail. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetUserByEmailHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + GetUserByEmailParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Interfaces/IGetUserByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Interfaces/IGetUserByIdHandler.verified.cs new file mode 100644 index 00000000..6e7c4e98 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Interfaces/IGetUserByIdHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Users; + +/// +/// Domain Interface for RequestHandler. +/// Description: Get user by id. +/// Operation: GetUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetUserByIdHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + GetUserByIdParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Interfaces/IGetUsersHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Interfaces/IGetUsersHandler.verified.cs new file mode 100644 index 00000000..5d58eef5 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Interfaces/IGetUsersHandler.verified.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Users; + +/// +/// Domain Interface for RequestHandler. +/// Description: Get all users. +/// Operation: GetUsers. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetUsersHandler +{ + /// + /// Execute method. + /// + /// The cancellation token. + Task ExecuteAsync( + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Interfaces/IPostUserHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Interfaces/IPostUserHandler.verified.cs new file mode 100644 index 00000000..1ab5ca87 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Interfaces/IPostUserHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Users; + +/// +/// Domain Interface for RequestHandler. +/// Description: Create a new user. +/// Operation: PostUser. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IPostUserHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + PostUserParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Interfaces/IUpdateMyTestGenderHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Interfaces/IUpdateMyTestGenderHandler.verified.cs new file mode 100644 index 00000000..5df1c46b --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Interfaces/IUpdateMyTestGenderHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Users; + +/// +/// Domain Interface for RequestHandler. +/// Description: Update gender on a user. +/// Operation: UpdateMyTestGender. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IUpdateMyTestGenderHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + UpdateMyTestGenderParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Interfaces/IUpdateUserByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Interfaces/IUpdateUserByIdHandler.verified.cs new file mode 100644 index 00000000..4196bb84 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Interfaces/IUpdateUserByIdHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Users; + +/// +/// Domain Interface for RequestHandler. +/// Description: Update user by id. +/// Operation: UpdateUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IUpdateUserByIdHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + UpdateUserByIdParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Models/CreateUserRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Models/CreateUserRequest.verified.cs new file mode 100644 index 00000000..2680cd9b --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Models/CreateUserRequest.verified.cs @@ -0,0 +1,65 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Users; + +/// +/// Request to create a user. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class CreateUserRequest +{ + [Required] + public string FirstName { get; set; } + + [Required] + public string LastName { get; set; } + + public DateTimeOffset? MyNullableDateTime { get; set; } + + [Required] + public DateTimeOffset MyDateTime { get; set; } + + /// + /// Undefined description. + /// + /// + /// Email validation being enforced. + /// + [Required] + [EmailAddress] + public string Email { get; set; } + + /// + /// Undefined description. + /// + /// + /// Url validation being enforced. + /// + [Uri] + public Uri Homepage { get; set; } + + /// + /// GenderType. + /// + [Required] + public GenderType Gender { get; set; } + + public Address? MyNullableAddress { get; set; } + + [Required] + public Dictionary Tags { get; set; } + + public Dictionary DesiredProperties1 { get; set; } + + public Dictionary? DesiredProperties2 { get; set; } + + public Dictionary? DesiredProperties3 { get; set; } + + /// + public override string ToString() + => $"{nameof(FirstName)}: {FirstName}, {nameof(LastName)}: {LastName}, {nameof(MyNullableDateTime)}: ({MyNullableDateTime}), {nameof(MyDateTime)}: ({MyDateTime}), {nameof(Email)}: {Email}, {nameof(Homepage)}: ({Homepage}), {nameof(Gender)}: {Gender}, {nameof(MyNullableAddress)}: ({MyNullableAddress}), {nameof(Tags)}: ({Tags}), {nameof(DesiredProperties1)}: ({DesiredProperties1}), {nameof(DesiredProperties2)}: ({DesiredProperties2}), {nameof(DesiredProperties3)}: ({DesiredProperties3})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Models/UpdateTestGenderRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Models/UpdateTestGenderRequest.verified.cs new file mode 100644 index 00000000..e2cf15b3 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Models/UpdateTestGenderRequest.verified.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Users; + +/// +/// Update test-gender Request. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateTestGenderRequest +{ + /// + /// GenderType. + /// + public GenderType Gender { get; set; } + + /// + public override string ToString() + => $"{nameof(Gender)}: {Gender}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Models/UpdateUserRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Models/UpdateUserRequest.verified.cs new file mode 100644 index 00000000..c0cfe19c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Models/UpdateUserRequest.verified.cs @@ -0,0 +1,36 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Users; + +/// +/// Request to update a user. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateUserRequest +{ + public string FirstName { get; set; } + + public string LastName { get; set; } + + /// + /// Undefined description. + /// + /// + /// Email validation being enforced. + /// + [EmailAddress] + public string Email { get; set; } + + /// + /// GenderType. + /// + public GenderType Gender { get; set; } + + /// + public override string ToString() + => $"{nameof(FirstName)}: {FirstName}, {nameof(LastName)}: {LastName}, {nameof(Email)}: {Email}, {nameof(Gender)}: {Gender}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Models/User.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Models/User.verified.cs new file mode 100644 index 00000000..931a823a --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Models/User.verified.cs @@ -0,0 +1,62 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Users; + +/// +/// A single user. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class User +{ + public Guid Id { get; set; } + + /// + /// GenderType. + /// + public GenderType Gender { get; set; } + + public string FirstName { get; set; } + + public string LastName { get; set; } + + /// + /// Undefined description. + /// + /// + /// Email validation being enforced. + /// + [EmailAddress] + public string Email { get; set; } + + /// + /// Undefined description. + /// + /// + /// Url validation being enforced. + /// + [Uri] + public Uri Homepage { get; set; } + + /// + /// ColorType. + /// + public ColorType Color { get; set; } + + /// + /// Address. + /// + public Address HomeAddress { get; set; } + + /// + /// Address. + /// + public Address CompanyAddress { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(Gender)}: {Gender}, {nameof(FirstName)}: {FirstName}, {nameof(LastName)}: {LastName}, {nameof(Email)}: {Email}, {nameof(Homepage)}: ({Homepage}), {nameof(Color)}: {Color}, {nameof(HomeAddress)}: ({HomeAddress}), {nameof(CompanyAddress)}: ({CompanyAddress})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Models/Users.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Models/Users.verified.cs new file mode 100644 index 00000000..d336a3e4 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Models/Users.verified.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Users; + +/// +/// A list of users. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Users +{ + /// + /// A list of User. + /// + public List UserList { get; set; } = new List(); + + /// + public override string ToString() + => $"{nameof(UserList)}.Count: {UserList?.Count ?? 0}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Parameters/DeleteUserByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Parameters/DeleteUserByIdParameters.verified.cs new file mode 100644 index 00000000..348eab10 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Parameters/DeleteUserByIdParameters.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Users; + +/// +/// Parameters for operation request. +/// Description: Delete user by id. +/// Operation: DeleteUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class DeleteUserByIdParameters +{ + /// + /// Id of the user. + /// + [FromRoute(Name = "id")] + [Required] + public Guid Id { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Parameters/GetUserByEmailParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Parameters/GetUserByEmailParameters.verified.cs new file mode 100644 index 00000000..d427547d --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Parameters/GetUserByEmailParameters.verified.cs @@ -0,0 +1,31 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Users; + +/// +/// Parameters for operation request. +/// Description: Get user by email. +/// Operation: GetUserByEmail. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetUserByEmailParameters +{ + /// + /// The email of the user to retrieve. + /// + /// + /// Email validation being enforced. + /// + [FromQuery(Name = "email")] + [Required] + [EmailAddress] + public string Email { get; set; } + + /// + public override string ToString() + => $"{nameof(Email)}: {Email}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Parameters/GetUserByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Parameters/GetUserByIdParameters.verified.cs new file mode 100644 index 00000000..af7585fb --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Parameters/GetUserByIdParameters.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Users; + +/// +/// Parameters for operation request. +/// Description: Get user by id. +/// Operation: GetUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetUserByIdParameters +{ + /// + /// Id of the user. + /// + [FromRoute(Name = "id")] + [Required] + public Guid Id { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Parameters/PostUserParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Parameters/PostUserParameters.verified.cs new file mode 100644 index 00000000..81d220f6 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Parameters/PostUserParameters.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Users; + +/// +/// Parameters for operation request. +/// Description: Create a new user. +/// Operation: PostUser. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class PostUserParameters +{ + /// + /// Request to create a user. + /// + [FromBody] + [Required] + public CreateUserRequest Request { get; set; } + + /// + public override string ToString() + => $"{nameof(Request)}: ({Request})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Parameters/UpdateMyTestGenderParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Parameters/UpdateMyTestGenderParameters.verified.cs new file mode 100644 index 00000000..fbc38d30 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Parameters/UpdateMyTestGenderParameters.verified.cs @@ -0,0 +1,40 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Users; + +/// +/// Parameters for operation request. +/// Description: Update gender on a user. +/// Operation: UpdateMyTestGender. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateMyTestGenderParameters +{ + /// + /// Id of the user. + /// + [FromRoute(Name = "id")] + [Required] + public Guid Id { get; set; } + + /// + /// The gender to set on the user. + /// + [FromQuery(Name = "genderParam")] + public GenderType? GenderParam { get; set; } + + /// + /// Update test-gender Request. + /// + [FromBody] + [Required] + public UpdateTestGenderRequest Request { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(GenderParam)}: {GenderParam}, {nameof(Request)}: ({Request})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Parameters/UpdateUserByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Parameters/UpdateUserByIdParameters.verified.cs new file mode 100644 index 00000000..f2e09c7a --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Parameters/UpdateUserByIdParameters.verified.cs @@ -0,0 +1,34 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Users; + +/// +/// Parameters for operation request. +/// Description: Update user by id. +/// Operation: UpdateUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateUserByIdParameters +{ + /// + /// Id of the user. + /// + [FromRoute(Name = "id")] + [Required] + public Guid Id { get; set; } + + /// + /// Request to update a user. + /// + [FromBody] + [Required] + public UpdateUserRequest Request { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(Request)}: ({Request})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Results/DeleteUserByIdResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Results/DeleteUserByIdResult.verified.cs new file mode 100644 index 00000000..8d63cb7e --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Results/DeleteUserByIdResult.verified.cs @@ -0,0 +1,42 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Users; + +/// +/// Results for operation request. +/// Description: Delete user by id. +/// Operation: DeleteUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class DeleteUserByIdResult : ResultBase +{ + private DeleteUserByIdResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static DeleteUserByIdResult Ok(string? message = null) + => new DeleteUserByIdResult(new OkObjectResult(message)); + + /// + /// 404 - NotFound response. + /// + public static DeleteUserByIdResult NotFound(string? message = null) + => new DeleteUserByIdResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.NotFound, message)); + + /// + /// 409 - Conflict response. + /// + public static DeleteUserByIdResult Conflict(string? message = null) + => new DeleteUserByIdResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.Conflict, message)); + + /// + /// Performs an implicit conversion from DeleteUserByIdResult to ActionResult. + /// + public static implicit operator DeleteUserByIdResult(string response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Results/GetUserByEmailResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Results/GetUserByEmailResult.verified.cs new file mode 100644 index 00000000..c0d5c7b9 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Results/GetUserByEmailResult.verified.cs @@ -0,0 +1,48 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Users; + +/// +/// Results for operation request. +/// Description: Get user by email. +/// Operation: GetUserByEmail. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetUserByEmailResult : ResultBase +{ + private GetUserByEmailResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static GetUserByEmailResult Ok(User response) + => new GetUserByEmailResult(new OkObjectResult(response)); + + /// + /// 400 - BadRequest response. + /// + public static GetUserByEmailResult BadRequest(string? message = null) + => new GetUserByEmailResult(ResultFactory.CreateContentResultWithValidationProblemDetails(HttpStatusCode.BadRequest, message)); + + /// + /// 404 - NotFound response. + /// + public static GetUserByEmailResult NotFound(string? message = null) + => new GetUserByEmailResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.NotFound, message)); + + /// + /// 409 - Conflict response. + /// + public static GetUserByEmailResult Conflict(string? message = null) + => new GetUserByEmailResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.Conflict, message)); + + /// + /// Performs an implicit conversion from GetUserByEmailResult to ActionResult. + /// + public static implicit operator GetUserByEmailResult(User response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Results/GetUserByIdResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Results/GetUserByIdResult.verified.cs new file mode 100644 index 00000000..a68ad23c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Results/GetUserByIdResult.verified.cs @@ -0,0 +1,42 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Users; + +/// +/// Results for operation request. +/// Description: Get user by id. +/// Operation: GetUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetUserByIdResult : ResultBase +{ + private GetUserByIdResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static GetUserByIdResult Ok(User response) + => new GetUserByIdResult(new OkObjectResult(response)); + + /// + /// 404 - NotFound response. + /// + public static GetUserByIdResult NotFound(string? message = null) + => new GetUserByIdResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.NotFound, message)); + + /// + /// 409 - Conflict response. + /// + public static GetUserByIdResult Conflict(string? message = null) + => new GetUserByIdResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.Conflict, message)); + + /// + /// Performs an implicit conversion from GetUserByIdResult to ActionResult. + /// + public static implicit operator GetUserByIdResult(User response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Results/GetUsersResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Results/GetUsersResult.verified.cs new file mode 100644 index 00000000..09ef390f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Results/GetUsersResult.verified.cs @@ -0,0 +1,36 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Users; + +/// +/// Results for operation request. +/// Description: Get all users. +/// Operation: GetUsers. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetUsersResult : ResultBase +{ + private GetUsersResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static GetUsersResult Ok(IEnumerable response) + => new GetUsersResult(new OkObjectResult(response ?? Enumerable.Empty())); + + /// + /// 409 - Conflict response. + /// + public static GetUsersResult Conflict(string? message = null) + => new GetUsersResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.Conflict, message)); + + /// + /// Performs an implicit conversion from GetUsersResult to ActionResult. + /// + public static implicit operator GetUsersResult(List response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Results/PostUserResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Results/PostUserResult.verified.cs new file mode 100644 index 00000000..a6ea0d83 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Results/PostUserResult.verified.cs @@ -0,0 +1,36 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Users; + +/// +/// Results for operation request. +/// Description: Create a new user. +/// Operation: PostUser. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class PostUserResult : ResultBase +{ + private PostUserResult(ActionResult result) : base(result) { } + + /// + /// 201 - Created response. + /// + public static PostUserResult Created(string? uri = null) + => new PostUserResult(ResultFactory.CreateContentResult(HttpStatusCode.Created, uri)); + + /// + /// 400 - BadRequest response. + /// + public static PostUserResult BadRequest(string? message = null) + => new PostUserResult(ResultFactory.CreateContentResultWithValidationProblemDetails(HttpStatusCode.BadRequest, message)); + + /// + /// 409 - Conflict response. + /// + public static PostUserResult Conflict(string? message = null) + => new PostUserResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.Conflict, message)); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Results/UpdateMyTestGenderResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Results/UpdateMyTestGenderResult.verified.cs new file mode 100644 index 00000000..8b99948d --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Results/UpdateMyTestGenderResult.verified.cs @@ -0,0 +1,48 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Users; + +/// +/// Results for operation request. +/// Description: Update gender on a user. +/// Operation: UpdateMyTestGender. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateMyTestGenderResult : ResultBase +{ + private UpdateMyTestGenderResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static UpdateMyTestGenderResult Ok(string? message = null) + => new UpdateMyTestGenderResult(new OkObjectResult(message)); + + /// + /// 400 - BadRequest response. + /// + public static UpdateMyTestGenderResult BadRequest(string? message = null) + => new UpdateMyTestGenderResult(ResultFactory.CreateContentResultWithValidationProblemDetails(HttpStatusCode.BadRequest, message)); + + /// + /// 404 - NotFound response. + /// + public static UpdateMyTestGenderResult NotFound(string? message = null) + => new UpdateMyTestGenderResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.NotFound, message)); + + /// + /// 409 - Conflict response. + /// + public static UpdateMyTestGenderResult Conflict(string? message = null) + => new UpdateMyTestGenderResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.Conflict, message)); + + /// + /// Performs an implicit conversion from UpdateMyTestGenderResult to ActionResult. + /// + public static implicit operator UpdateMyTestGenderResult(string response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Results/UpdateUserByIdResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Results/UpdateUserByIdResult.verified.cs new file mode 100644 index 00000000..f258c9de --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/Users/Results/UpdateUserByIdResult.verified.cs @@ -0,0 +1,48 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts.Users; + +/// +/// Results for operation request. +/// Description: Update user by id. +/// Operation: UpdateUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateUserByIdResult : ResultBase +{ + private UpdateUserByIdResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static UpdateUserByIdResult Ok(string? message = null) + => new UpdateUserByIdResult(new OkObjectResult(message)); + + /// + /// 400 - BadRequest response. + /// + public static UpdateUserByIdResult BadRequest(string? message = null) + => new UpdateUserByIdResult(ResultFactory.CreateContentResultWithValidationProblemDetails(HttpStatusCode.BadRequest, message)); + + /// + /// 404 - NotFound response. + /// + public static UpdateUserByIdResult NotFound(string? message = null) + => new UpdateUserByIdResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.NotFound, message)); + + /// + /// 409 - Conflict response. + /// + public static UpdateUserByIdResult Conflict(string? message = null) + => new UpdateUserByIdResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.Conflict, message)); + + /// + /// Performs an implicit conversion from UpdateUserByIdResult to ActionResult. + /// + public static implicit operator UpdateUserByIdResult(string response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/_EnumerationTypes/ColorType.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/_EnumerationTypes/ColorType.verified.cs new file mode 100644 index 00000000..986b8be5 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/_EnumerationTypes/ColorType.verified.cs @@ -0,0 +1,21 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts; + +/// +/// Enumeration: ColorType. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +[Flags] +public enum ColorType +{ + None = 0, + Black = 1, + White = 2, + Yellow = 4, + Red = 8, +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/_EnumerationTypes/GenderType.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/_EnumerationTypes/GenderType.verified.cs new file mode 100644 index 00000000..8ced6ccb --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/_EnumerationTypes/GenderType.verified.cs @@ -0,0 +1,19 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts; + +/// +/// Enumeration: GenderType. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public enum GenderType +{ + None, + NonBinary, + Male, + Female, +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/_Shared/Address.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/_Shared/Address.verified.cs new file mode 100644 index 00000000..96d54e99 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/_Shared/Address.verified.cs @@ -0,0 +1,32 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts; + +/// +/// Address. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Address +{ + [StringLength(255)] + public string StreetName { get; set; } + + public string StreetNumber { get; set; } + + public string PostalCode { get; set; } + + public string CityName { get; set; } + + /// + /// Country. + /// + public Country MyCountry { get; set; } + + /// + public override string ToString() + => $"{nameof(StreetName)}: {StreetName}, {nameof(StreetNumber)}: {StreetNumber}, {nameof(PostalCode)}: {PostalCode}, {nameof(CityName)}: {CityName}, {nameof(MyCountry)}: ({MyCountry})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/_Shared/Country.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/_Shared/Country.verified.cs new file mode 100644 index 00000000..50e92519 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Contracts/_Shared/Country.verified.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Contracts; + +/// +/// Country. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Country +{ + [Required] + public string Name { get; set; } + + [Required] + [MinLength(2)] + [MaxLength(2)] + [RegularExpression("^[A-Za-z]{2}$")] + public string Alpha2Code { get; set; } + + [Required] + [MinLength(3)] + [MaxLength(3)] + [RegularExpression("^[A-Za-z]{3}$")] + public string Alpha3Code { get; set; } + + /// + public override string ToString() + => $"{nameof(Name)}: {Name}, {nameof(Alpha2Code)}: {Alpha2Code}, {nameof(Alpha3Code)}: {Alpha3Code}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Endpoints/AccountsController.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Endpoints/AccountsController.verified.cs new file mode 100644 index 00000000..df5f6121 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Endpoints/AccountsController.verified.cs @@ -0,0 +1,45 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Endpoints; + +/// +/// Endpoint definitions. +/// +[Authorize] +[ApiController] +[Route("/api/v1/accounts")] +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public sealed class AccountsController : ControllerBase +{ + /// + /// Description: Update name of account. + /// Operation: UpdateAccountName. + /// + [HttpPut("{accountId}/name")] + [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] + public async Task UpdateAccountName( + UpdateAccountNameParameters parameters, + [FromServices] IUpdateAccountNameHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); + + /// + /// Description: Set name of account. + /// Operation: SetAccountName. + /// + [HttpPost("{accountId}/name")] + [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] + public async Task SetAccountName( + SetAccountNameParameters parameters, + [FromServices] ISetAccountNameHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Endpoints/AddressesController.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Endpoints/AddressesController.verified.cs new file mode 100644 index 00000000..745b4cae --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Endpoints/AddressesController.verified.cs @@ -0,0 +1,32 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Endpoints; + +/// +/// Endpoint definitions. +/// +[Authorize] +[ApiController] +[Route("/api/v1/addresses")] +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public sealed class AddressesController : ControllerBase +{ + /// + /// Description: Get addresses by postal code. + /// Operation: GetAddressesByPostalCodes. + /// + [HttpGet("{postalCode}")] + [ProducesResponseType(typeof(IEnumerable
), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] + public async Task GetAddressesByPostalCodes( + GetAddressesByPostalCodesParameters parameters, + [FromServices] IGetAddressesByPostalCodesHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Endpoints/EventArgsController.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Endpoints/EventArgsController.verified.cs new file mode 100644 index 00000000..a1791fa1 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Endpoints/EventArgsController.verified.cs @@ -0,0 +1,44 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Endpoints; + +/// +/// Endpoint definitions. +/// +[Authorize] +[ApiController] +[Route("/api/v1/eventArgs")] +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public sealed class EventArgsController : ControllerBase +{ + /// + /// Description: Get EventArgs List. + /// Operation: GetEventArgs. + /// + [HttpGet] + [ProducesResponseType(typeof(IEnumerable), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] + public async Task GetEventArgs( + [FromServices] IGetEventArgsHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(cancellationToken); + + /// + /// Description: Get EventArgs By Id. + /// Operation: GetEventArgById. + /// + [HttpGet("{id}")] + [ProducesResponseType(typeof(Contracts.EventArgs.EventArgs), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] + public async Task GetEventArgById( + GetEventArgByIdParameters parameters, + [FromServices] IGetEventArgByIdHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Endpoints/FilesController.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Endpoints/FilesController.verified.cs new file mode 100644 index 00000000..e1e0b4c0 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Endpoints/FilesController.verified.cs @@ -0,0 +1,92 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Endpoints; + +/// +/// Endpoint definitions. +/// +[Authorize] +[ApiController] +[Route("/api/v1/files")] +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public sealed class FilesController : ControllerBase +{ + /// + /// Description: Upload multi files as form data. + /// Operation: UploadMultiFilesAsFormData. + /// + [HttpPost("form-data/multiFile")] + [RequestFormLimits(MultipartBodyLengthLimit = long.MaxValue)] + [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] + public async Task UploadMultiFilesAsFormData( + UploadMultiFilesAsFormDataParameters parameters, + [FromServices] IUploadMultiFilesAsFormDataHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); + + /// + /// Description: Upload a file as OctetStream. + /// Operation: UploadSingleFileAsFormData. + /// + [HttpPost("form-data/singleFile")] + [RequestFormLimits(MultipartBodyLengthLimit = long.MaxValue)] + [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] + public async Task UploadSingleFileAsFormData( + UploadSingleFileAsFormDataParameters parameters, + [FromServices] IUploadSingleFileAsFormDataHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); + + /// + /// Description: Upload a file as FormData. + /// Operation: UploadSingleObjectWithFileAsFormData. + /// + [HttpPost("form-data/singleObject")] + [RequestFormLimits(MultipartBodyLengthLimit = long.MaxValue)] + [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] + public async Task UploadSingleObjectWithFileAsFormData( + UploadSingleObjectWithFileAsFormDataParameters parameters, + [FromServices] IUploadSingleObjectWithFileAsFormDataHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); + + /// + /// Description: Upload files as FormData. + /// Operation: UploadSingleObjectWithFilesAsFormData. + /// + [HttpPost("form-data/singleObjectMultiFile")] + [RequestFormLimits(MultipartBodyLengthLimit = long.MaxValue)] + [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] + public async Task UploadSingleObjectWithFilesAsFormData( + UploadSingleObjectWithFilesAsFormDataParameters parameters, + [FromServices] IUploadSingleObjectWithFilesAsFormDataHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); + + /// + /// Description: Get File By Id. + /// Operation: GetFileById. + /// + [HttpGet("{id}")] + [ProducesResponseType(typeof(byte[]), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] + public async Task GetFileById( + GetFileByIdParameters parameters, + [FromServices] IGetFileByIdHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Endpoints/ItemsController.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Endpoints/ItemsController.verified.cs new file mode 100644 index 00000000..a2982f58 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Endpoints/ItemsController.verified.cs @@ -0,0 +1,45 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Endpoints; + +/// +/// Endpoint definitions. +/// +[Authorize] +[ApiController] +[Route("/api/v1/items")] +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public sealed class ItemsController : ControllerBase +{ + /// + /// Description: Create a new item. + /// Operation: CreateItem. + /// + [HttpPost] + [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] + public async Task CreateItem( + CreateItemParameters parameters, + [FromServices] ICreateItemHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); + + /// + /// Description: Updates an item. + /// Operation: UpdateItem. + /// + [HttpPut("{id}")] + [ProducesResponseType(typeof(Guid), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] + public async Task UpdateItem( + UpdateItemParameters parameters, + [FromServices] IUpdateItemHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Endpoints/OrdersController.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Endpoints/OrdersController.verified.cs new file mode 100644 index 00000000..29e66c98 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Endpoints/OrdersController.verified.cs @@ -0,0 +1,68 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Endpoints; + +/// +/// Endpoint definitions. +/// +[Authorize] +[ApiController] +[Route("/api/v1/orders")] +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public sealed class OrdersController : ControllerBase +{ + /// + /// Description: Get orders. + /// Operation: GetOrders. + /// + [HttpGet] + [ProducesResponseType(typeof(Pagination), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] + public async Task GetOrders( + GetOrdersParameters parameters, + [FromServices] IGetOrdersHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); + + /// + /// Description: Get order by id. + /// Operation: GetOrderById. + /// + [Authorize(Roles = "operator")] + [HttpGet("{id}")] + [ProducesResponseType(typeof(Order), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status403Forbidden)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] + public async Task GetOrderById( + GetOrderByIdParameters parameters, + [FromServices] IGetOrderByIdHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); + + /// + /// Description: Update part of order by id. + /// Operation: PatchOrdersId. + /// + [Authorize(Roles = "admin,operator")] + [HttpPatch("{id}")] + [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status403Forbidden)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status409Conflict)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status502BadGateway)] + public async Task PatchOrdersId( + PatchOrdersIdParameters parameters, + [FromServices] IPatchOrdersIdHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Endpoints/RouteWithDashController.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Endpoints/RouteWithDashController.verified.cs new file mode 100644 index 00000000..3ebd1771 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Endpoints/RouteWithDashController.verified.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Endpoints; + +/// +/// Endpoint definitions. +/// +[Authorize] +[ApiController] +[Route("/api/v1/route-with-dash")] +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public sealed class RouteWithDashController : ControllerBase +{ + /// + /// Description: Your GET endpoint. + /// Operation: GetRouteWithDash. + /// + [HttpGet] + [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] + public async Task GetRouteWithDash( + [FromServices] IGetRouteWithDashHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(cancellationToken); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Endpoints/TasksController.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Endpoints/TasksController.verified.cs new file mode 100644 index 00000000..3a34818d --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Endpoints/TasksController.verified.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Endpoints; + +/// +/// Endpoint definitions. +/// +[Authorize] +[ApiController] +[Route("/api/v1/tasks")] +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public sealed class TasksController : ControllerBase +{ + /// + /// Description: Returns tasks. + /// Operation: GetTasks. + /// + [HttpGet] + [ProducesResponseType(typeof(IEnumerable), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] + public async Task GetTasks( + [FromServices] IGetTasksHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(cancellationToken); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Endpoints/UsersController.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Endpoints/UsersController.verified.cs new file mode 100644 index 00000000..d756e905 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/Endpoints/UsersController.verified.cs @@ -0,0 +1,125 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Generated.Endpoints; + +/// +/// Endpoint definitions. +/// +[Authorize] +[ApiController] +[Route("/api/v1/users")] +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public sealed class UsersController : ControllerBase +{ + /// + /// Description: Get all users. + /// Operation: GetUsers. + /// + [HttpGet] + [ProducesResponseType(typeof(IEnumerable), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status409Conflict)] + public async Task GetUsers( + [FromServices] IGetUsersHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(cancellationToken); + + /// + /// Description: Create a new user. + /// Operation: PostUser. + /// + [HttpPost] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status201Created)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status409Conflict)] + public async Task PostUser( + PostUserParameters parameters, + [FromServices] IPostUserHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); + + /// + /// Description: Get user by email. + /// Operation: GetUserByEmail. + /// + [HttpGet("email")] + [ProducesResponseType(typeof(User), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status409Conflict)] + public async Task GetUserByEmail( + GetUserByEmailParameters parameters, + [FromServices] IGetUserByEmailHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); + + /// + /// Description: Get user by id. + /// Operation: GetUserById. + /// + [HttpGet("{id}")] + [ProducesResponseType(typeof(User), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status409Conflict)] + public async Task GetUserById( + GetUserByIdParameters parameters, + [FromServices] IGetUserByIdHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); + + /// + /// Description: Update user by id. + /// Operation: UpdateUserById. + /// + [HttpPut("{id}")] + [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status409Conflict)] + public async Task UpdateUserById( + UpdateUserByIdParameters parameters, + [FromServices] IUpdateUserByIdHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); + + /// + /// Description: Delete user by id. + /// Operation: DeleteUserById. + /// + [HttpDelete("{id}")] + [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status409Conflict)] + public async Task DeleteUserById( + DeleteUserByIdParameters parameters, + [FromServices] IDeleteUserByIdHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); + + /// + /// Description: Update gender on a user. + /// Operation: UpdateMyTestGender. + /// + [HttpPut("{id}/gender")] + [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status409Conflict)] + public async Task UpdateMyTestGender( + UpdateMyTestGenderParameters parameters, + [FromServices] IUpdateMyTestGenderHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/GlobalUsings.verified.cs new file mode 100644 index 00000000..b67b2b11 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api.Generated/GlobalUsings.verified.cs @@ -0,0 +1,20 @@ +global using System.CodeDom.Compiler; +global using System.ComponentModel.DataAnnotations; +global using System.Net; + +global using Atc.Rest.Results; + +global using DemoSample.Api.Generated.Contracts; +global using DemoSample.Api.Generated.Contracts.Accounts; +global using DemoSample.Api.Generated.Contracts.Addresses; +global using DemoSample.Api.Generated.Contracts.EventArgs; +global using DemoSample.Api.Generated.Contracts.Files; +global using DemoSample.Api.Generated.Contracts.Items; +global using DemoSample.Api.Generated.Contracts.Orders; +global using DemoSample.Api.Generated.Contracts.RouteWithDash; +global using DemoSample.Api.Generated.Contracts.Tasks; +global using DemoSample.Api.Generated.Contracts.Users; + +global using Microsoft.AspNetCore.Authorization; +global using Microsoft.AspNetCore.Http; +global using Microsoft.AspNetCore.Mvc; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api/GlobalUsings.verified.cs new file mode 100644 index 00000000..102771e3 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api/GlobalUsings.verified.cs @@ -0,0 +1,15 @@ +global using System.CodeDom.Compiler; +global using System.Reflection; + +global using Asp.Versioning.ApiExplorer; + +global using Atc.Rest.Extended.Options; + +global using DemoSample.Api.Generated; +global using DemoSample.Api.Options; +global using DemoSample.Domain; + +global using Microsoft.Extensions.Options; +global using Microsoft.OpenApi.Models; + +global using Swashbuckle.AspNetCore.SwaggerGen; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api/Options/ConfigureSwaggerDocOptions.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api/Options/ConfigureSwaggerDocOptions.verified.cs new file mode 100644 index 00000000..37c42a6b --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api/Options/ConfigureSwaggerDocOptions.verified.cs @@ -0,0 +1,39 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Options; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ConfigureSwaggerDocOptions : IConfigureOptions +{ + private readonly IApiVersionDescriptionProvider provider; + + public ConfigureSwaggerDocOptions( + IApiVersionDescriptionProvider provider) + => this.provider = provider; + + public void Configure( + SwaggerGenOptions options) + { + foreach (var version in provider.ApiVersionDescriptions) + { + options.SwaggerDoc( + version.GroupName, + new OpenApiInfo + { + Version = "1.0", + Title = "Demo Sample Api", + Description = "Demo Sample Api - SingleFileVersion", + Contact = new OpenApiContact + { + Name = "atc-net A/S", + }, + }); + } + + options.IncludeXmlComments(Path.ChangeExtension(GetType().Assembly.Location, "xml")); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api/Program.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api/Program.verified.cs new file mode 100644 index 00000000..fd8e4e03 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api/Program.verified.cs @@ -0,0 +1,23 @@ +namespace DemoSample.Api; + +public static class Program +{ + public static void Main(string[] args) + { + CreateHostBuilder(args) + .Build() + .Run(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) + { + var builder = Host + .CreateDefaultBuilder(args) + .ConfigureWebHostDefaults(webBuilder => + { + webBuilder.UseStartup(); + }); + + return builder; + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api/Startup.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api/Startup.verified.cs new file mode 100644 index 00000000..ea2f691c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Api/Startup.verified.cs @@ -0,0 +1,38 @@ +namespace DemoSample.Api; + +public class Startup +{ + private readonly RestApiExtendedOptions restApiOptions; + + public Startup( + IConfiguration configuration) + { + Configuration = configuration; + restApiOptions = new RestApiExtendedOptions + { + // TODO: Remove/out-comment/set to false this for production scenarios! + AllowAnonymousAccessForDevelopment = true, + }; + + restApiOptions.AddAssemblyPairs( + Assembly.GetAssembly(typeof(ApiRegistration)), + Assembly.GetAssembly(typeof(DomainRegistration))); + } + + public IConfiguration Configuration { get; } + + public void ConfigureServices( + IServiceCollection services) + { + services.ConfigureOptions(); + + services.AddRestApi(restApiOptions, Configuration); + } + + public void Configure( + IApplicationBuilder app, + IWebHostEnvironment env) + { + app.ConfigureRestApi(env, restApiOptions); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/DomainRegistration.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/DomainRegistration.verified.cs new file mode 100644 index 00000000..a4207dd3 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/DomainRegistration.verified.cs @@ -0,0 +1,12 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Domain; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class DomainRegistration +{ +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/GlobalUsings.verified.cs new file mode 100644 index 00000000..115399f8 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/GlobalUsings.verified.cs @@ -0,0 +1,11 @@ +global using System.CodeDom.Compiler; + +global using DemoSample.Api.Generated.Contracts.Accounts; +global using DemoSample.Api.Generated.Contracts.Addresses; +global using DemoSample.Api.Generated.Contracts.EventArgs; +global using DemoSample.Api.Generated.Contracts.Files; +global using DemoSample.Api.Generated.Contracts.Items; +global using DemoSample.Api.Generated.Contracts.Orders; +global using DemoSample.Api.Generated.Contracts.RouteWithDash; +global using DemoSample.Api.Generated.Contracts.Tasks; +global using DemoSample.Api.Generated.Contracts.Users; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Accounts/SetAccountNameHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Accounts/SetAccountNameHandler.verified.cs new file mode 100644 index 00000000..74011829 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Accounts/SetAccountNameHandler.verified.cs @@ -0,0 +1,18 @@ +namespace DemoSample.Domain.Handlers.Accounts; + +/// +/// Handler for operation request. +/// Description: Set name of account. +/// Operation: SetAccountName. +/// +public class SetAccountNameHandler : ISetAccountNameHandler +{ + public Task ExecuteAsync( + SetAccountNameParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for SetAccountNameHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Accounts/UpdateAccountNameHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Accounts/UpdateAccountNameHandler.verified.cs new file mode 100644 index 00000000..f16f7b71 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Accounts/UpdateAccountNameHandler.verified.cs @@ -0,0 +1,18 @@ +namespace DemoSample.Domain.Handlers.Accounts; + +/// +/// Handler for operation request. +/// Description: Update name of account. +/// Operation: UpdateAccountName. +/// +public class UpdateAccountNameHandler : IUpdateAccountNameHandler +{ + public Task ExecuteAsync( + UpdateAccountNameParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for UpdateAccountNameHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Addresses/GetAddressesByPostalCodesHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Addresses/GetAddressesByPostalCodesHandler.verified.cs new file mode 100644 index 00000000..11e35eb5 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Addresses/GetAddressesByPostalCodesHandler.verified.cs @@ -0,0 +1,18 @@ +namespace DemoSample.Domain.Handlers.Addresses; + +/// +/// Handler for operation request. +/// Description: Get addresses by postal code. +/// Operation: GetAddressesByPostalCodes. +/// +public class GetAddressesByPostalCodesHandler : IGetAddressesByPostalCodesHandler +{ + public Task ExecuteAsync( + GetAddressesByPostalCodesParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for GetAddressesByPostalCodesHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/EventArgs/GetEventArgByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/EventArgs/GetEventArgByIdHandler.verified.cs new file mode 100644 index 00000000..26d122c2 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/EventArgs/GetEventArgByIdHandler.verified.cs @@ -0,0 +1,18 @@ +namespace DemoSample.Domain.Handlers.EventArgs; + +/// +/// Handler for operation request. +/// Description: Get EventArgs By Id. +/// Operation: GetEventArgById. +/// +public class GetEventArgByIdHandler : IGetEventArgByIdHandler +{ + public Task ExecuteAsync( + GetEventArgByIdParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for GetEventArgByIdHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/EventArgs/GetEventArgsHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/EventArgs/GetEventArgsHandler.verified.cs new file mode 100644 index 00000000..871231a4 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/EventArgs/GetEventArgsHandler.verified.cs @@ -0,0 +1,15 @@ +namespace DemoSample.Domain.Handlers.EventArgs; + +/// +/// Handler for operation request. +/// Description: Get EventArgs List. +/// Operation: GetEventArgs. +/// +public class GetEventArgsHandler : IGetEventArgsHandler +{ + public Task ExecuteAsync( + CancellationToken cancellationToken = default) + { + throw new NotImplementedException("Add logic here for GetEventArgsHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Files/GetFileByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Files/GetFileByIdHandler.verified.cs new file mode 100644 index 00000000..c5b768bb --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Files/GetFileByIdHandler.verified.cs @@ -0,0 +1,18 @@ +namespace DemoSample.Domain.Handlers.Files; + +/// +/// Handler for operation request. +/// Description: Get File By Id. +/// Operation: GetFileById. +/// +public class GetFileByIdHandler : IGetFileByIdHandler +{ + public Task ExecuteAsync( + GetFileByIdParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for GetFileByIdHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Files/UploadMultiFilesAsFormDataHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Files/UploadMultiFilesAsFormDataHandler.verified.cs new file mode 100644 index 00000000..c9b60425 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Files/UploadMultiFilesAsFormDataHandler.verified.cs @@ -0,0 +1,18 @@ +namespace DemoSample.Domain.Handlers.Files; + +/// +/// Handler for operation request. +/// Description: Upload multi files as form data. +/// Operation: UploadMultiFilesAsFormData. +/// +public class UploadMultiFilesAsFormDataHandler : IUploadMultiFilesAsFormDataHandler +{ + public Task ExecuteAsync( + UploadMultiFilesAsFormDataParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for UploadMultiFilesAsFormDataHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Files/UploadSingleFileAsFormDataHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Files/UploadSingleFileAsFormDataHandler.verified.cs new file mode 100644 index 00000000..30b7bf72 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Files/UploadSingleFileAsFormDataHandler.verified.cs @@ -0,0 +1,18 @@ +namespace DemoSample.Domain.Handlers.Files; + +/// +/// Handler for operation request. +/// Description: Upload a file as OctetStream. +/// Operation: UploadSingleFileAsFormData. +/// +public class UploadSingleFileAsFormDataHandler : IUploadSingleFileAsFormDataHandler +{ + public Task ExecuteAsync( + UploadSingleFileAsFormDataParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for UploadSingleFileAsFormDataHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Files/UploadSingleObjectWithFileAsFormDataHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Files/UploadSingleObjectWithFileAsFormDataHandler.verified.cs new file mode 100644 index 00000000..bea71e5c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Files/UploadSingleObjectWithFileAsFormDataHandler.verified.cs @@ -0,0 +1,18 @@ +namespace DemoSample.Domain.Handlers.Files; + +/// +/// Handler for operation request. +/// Description: Upload a file as FormData. +/// Operation: UploadSingleObjectWithFileAsFormData. +/// +public class UploadSingleObjectWithFileAsFormDataHandler : IUploadSingleObjectWithFileAsFormDataHandler +{ + public Task ExecuteAsync( + UploadSingleObjectWithFileAsFormDataParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for UploadSingleObjectWithFileAsFormDataHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Files/UploadSingleObjectWithFilesAsFormDataHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Files/UploadSingleObjectWithFilesAsFormDataHandler.verified.cs new file mode 100644 index 00000000..2cbf5d1f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Files/UploadSingleObjectWithFilesAsFormDataHandler.verified.cs @@ -0,0 +1,18 @@ +namespace DemoSample.Domain.Handlers.Files; + +/// +/// Handler for operation request. +/// Description: Upload files as FormData. +/// Operation: UploadSingleObjectWithFilesAsFormData. +/// +public class UploadSingleObjectWithFilesAsFormDataHandler : IUploadSingleObjectWithFilesAsFormDataHandler +{ + public Task ExecuteAsync( + UploadSingleObjectWithFilesAsFormDataParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for UploadSingleObjectWithFilesAsFormDataHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Items/CreateItemHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Items/CreateItemHandler.verified.cs new file mode 100644 index 00000000..f7bc0b7a --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Items/CreateItemHandler.verified.cs @@ -0,0 +1,18 @@ +namespace DemoSample.Domain.Handlers.Items; + +/// +/// Handler for operation request. +/// Description: Create a new item. +/// Operation: CreateItem. +/// +public class CreateItemHandler : ICreateItemHandler +{ + public Task ExecuteAsync( + CreateItemParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for CreateItemHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Items/UpdateItemHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Items/UpdateItemHandler.verified.cs new file mode 100644 index 00000000..ab540578 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Items/UpdateItemHandler.verified.cs @@ -0,0 +1,18 @@ +namespace DemoSample.Domain.Handlers.Items; + +/// +/// Handler for operation request. +/// Description: Updates an item. +/// Operation: UpdateItem. +/// +public class UpdateItemHandler : IUpdateItemHandler +{ + public Task ExecuteAsync( + UpdateItemParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for UpdateItemHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Orders/GetOrderByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Orders/GetOrderByIdHandler.verified.cs new file mode 100644 index 00000000..bb191095 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Orders/GetOrderByIdHandler.verified.cs @@ -0,0 +1,18 @@ +namespace DemoSample.Domain.Handlers.Orders; + +/// +/// Handler for operation request. +/// Description: Get order by id. +/// Operation: GetOrderById. +/// +public class GetOrderByIdHandler : IGetOrderByIdHandler +{ + public Task ExecuteAsync( + GetOrderByIdParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for GetOrderByIdHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Orders/GetOrdersHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Orders/GetOrdersHandler.verified.cs new file mode 100644 index 00000000..0a6a1735 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Orders/GetOrdersHandler.verified.cs @@ -0,0 +1,18 @@ +namespace DemoSample.Domain.Handlers.Orders; + +/// +/// Handler for operation request. +/// Description: Get orders. +/// Operation: GetOrders. +/// +public class GetOrdersHandler : IGetOrdersHandler +{ + public Task ExecuteAsync( + GetOrdersParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for GetOrdersHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Orders/PatchOrdersIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Orders/PatchOrdersIdHandler.verified.cs new file mode 100644 index 00000000..b88929d7 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Orders/PatchOrdersIdHandler.verified.cs @@ -0,0 +1,18 @@ +namespace DemoSample.Domain.Handlers.Orders; + +/// +/// Handler for operation request. +/// Description: Update part of order by id. +/// Operation: PatchOrdersId. +/// +public class PatchOrdersIdHandler : IPatchOrdersIdHandler +{ + public Task ExecuteAsync( + PatchOrdersIdParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for PatchOrdersIdHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/RouteWithDash/GetRouteWithDashHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/RouteWithDash/GetRouteWithDashHandler.verified.cs new file mode 100644 index 00000000..28de0339 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/RouteWithDash/GetRouteWithDashHandler.verified.cs @@ -0,0 +1,15 @@ +namespace DemoSample.Domain.Handlers.RouteWithDash; + +/// +/// Handler for operation request. +/// Description: Your GET endpoint. +/// Operation: GetRouteWithDash. +/// +public class GetRouteWithDashHandler : IGetRouteWithDashHandler +{ + public Task ExecuteAsync( + CancellationToken cancellationToken = default) + { + throw new NotImplementedException("Add logic here for GetRouteWithDashHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Tasks/GetTasksHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Tasks/GetTasksHandler.verified.cs new file mode 100644 index 00000000..6f5a039e --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Tasks/GetTasksHandler.verified.cs @@ -0,0 +1,15 @@ +namespace DemoSample.Domain.Handlers.Tasks; + +/// +/// Handler for operation request. +/// Description: Returns tasks. +/// Operation: GetTasks. +/// +public class GetTasksHandler : IGetTasksHandler +{ + public Task ExecuteAsync( + CancellationToken cancellationToken = default) + { + throw new NotImplementedException("Add logic here for GetTasksHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Users/DeleteUserByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Users/DeleteUserByIdHandler.verified.cs new file mode 100644 index 00000000..43b0d40c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Users/DeleteUserByIdHandler.verified.cs @@ -0,0 +1,18 @@ +namespace DemoSample.Domain.Handlers.Users; + +/// +/// Handler for operation request. +/// Description: Delete user by id. +/// Operation: DeleteUserById. +/// +public class DeleteUserByIdHandler : IDeleteUserByIdHandler +{ + public Task ExecuteAsync( + DeleteUserByIdParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for DeleteUserByIdHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Users/GetUserByEmailHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Users/GetUserByEmailHandler.verified.cs new file mode 100644 index 00000000..ea1d73bf --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Users/GetUserByEmailHandler.verified.cs @@ -0,0 +1,18 @@ +namespace DemoSample.Domain.Handlers.Users; + +/// +/// Handler for operation request. +/// Description: Get user by email. +/// Operation: GetUserByEmail. +/// +public class GetUserByEmailHandler : IGetUserByEmailHandler +{ + public Task ExecuteAsync( + GetUserByEmailParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for GetUserByEmailHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Users/GetUserByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Users/GetUserByIdHandler.verified.cs new file mode 100644 index 00000000..a79a6d74 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Users/GetUserByIdHandler.verified.cs @@ -0,0 +1,18 @@ +namespace DemoSample.Domain.Handlers.Users; + +/// +/// Handler for operation request. +/// Description: Get user by id. +/// Operation: GetUserById. +/// +public class GetUserByIdHandler : IGetUserByIdHandler +{ + public Task ExecuteAsync( + GetUserByIdParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for GetUserByIdHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Users/GetUsersHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Users/GetUsersHandler.verified.cs new file mode 100644 index 00000000..1cec955a --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Users/GetUsersHandler.verified.cs @@ -0,0 +1,15 @@ +namespace DemoSample.Domain.Handlers.Users; + +/// +/// Handler for operation request. +/// Description: Get all users. +/// Operation: GetUsers. +/// +public class GetUsersHandler : IGetUsersHandler +{ + public Task ExecuteAsync( + CancellationToken cancellationToken = default) + { + throw new NotImplementedException("Add logic here for GetUsersHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Users/PostUserHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Users/PostUserHandler.verified.cs new file mode 100644 index 00000000..cd9593f7 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Users/PostUserHandler.verified.cs @@ -0,0 +1,18 @@ +namespace DemoSample.Domain.Handlers.Users; + +/// +/// Handler for operation request. +/// Description: Create a new user. +/// Operation: PostUser. +/// +public class PostUserHandler : IPostUserHandler +{ + public Task ExecuteAsync( + PostUserParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for PostUserHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Users/UpdateMyTestGenderHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Users/UpdateMyTestGenderHandler.verified.cs new file mode 100644 index 00000000..335364a9 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Users/UpdateMyTestGenderHandler.verified.cs @@ -0,0 +1,18 @@ +namespace DemoSample.Domain.Handlers.Users; + +/// +/// Handler for operation request. +/// Description: Update gender on a user. +/// Operation: UpdateMyTestGender. +/// +public class UpdateMyTestGenderHandler : IUpdateMyTestGenderHandler +{ + public Task ExecuteAsync( + UpdateMyTestGenderParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for UpdateMyTestGenderHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Users/UpdateUserByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Users/UpdateUserByIdHandler.verified.cs new file mode 100644 index 00000000..733d3253 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/src/DemoSample.Domain/Handlers/Users/UpdateUserByIdHandler.verified.cs @@ -0,0 +1,18 @@ +namespace DemoSample.Domain.Handlers.Users; + +/// +/// Handler for operation request. +/// Description: Update user by id. +/// Operation: UpdateUserById. +/// +public class UpdateUserByIdHandler : IUpdateUserByIdHandler +{ + public Task ExecuteAsync( + UpdateUserByIdParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for UpdateUserByIdHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Accounts/SetAccountNameHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Accounts/SetAccountNameHandlerStub.verified.cs new file mode 100644 index 00000000..54ed87c9 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Accounts/SetAccountNameHandlerStub.verified.cs @@ -0,0 +1,18 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Tests.Endpoints.Accounts; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class SetAccountNameHandlerStub : ISetAccountNameHandler +{ + public Task ExecuteAsync( + SetAccountNameParameters parameters, + CancellationToken cancellationToken = default) + { + return Task.FromResult(SetAccountNameResult.Ok("Hallo world")); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Accounts/SetAccountNameTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Accounts/SetAccountNameTests.verified.cs new file mode 100644 index 00000000..0195fd02 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Accounts/SetAccountNameTests.verified.cs @@ -0,0 +1,21 @@ +namespace DemoSample.Api.Tests.Endpoints.Accounts; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class SetAccountNameTests : WebApiControllerBaseTest +{ + public SetAccountNameTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Accounts/UpdateAccountNameHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Accounts/UpdateAccountNameHandlerStub.verified.cs new file mode 100644 index 00000000..47b107e5 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Accounts/UpdateAccountNameHandlerStub.verified.cs @@ -0,0 +1,18 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Tests.Endpoints.Accounts; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateAccountNameHandlerStub : IUpdateAccountNameHandler +{ + public Task ExecuteAsync( + UpdateAccountNameParameters parameters, + CancellationToken cancellationToken = default) + { + return Task.FromResult(UpdateAccountNameResult.Ok("Hallo world")); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Accounts/UpdateAccountNameTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Accounts/UpdateAccountNameTests.verified.cs new file mode 100644 index 00000000..f4884a2c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Accounts/UpdateAccountNameTests.verified.cs @@ -0,0 +1,21 @@ +namespace DemoSample.Api.Tests.Endpoints.Accounts; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class UpdateAccountNameTests : WebApiControllerBaseTest +{ + public UpdateAccountNameTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Addresses/GetAddressesByPostalCodesHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Addresses/GetAddressesByPostalCodesHandlerStub.verified.cs new file mode 100644 index 00000000..0eeeb4b4 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Addresses/GetAddressesByPostalCodesHandlerStub.verified.cs @@ -0,0 +1,20 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Tests.Endpoints.Addresses; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetAddressesByPostalCodesHandlerStub : IGetAddressesByPostalCodesHandler +{ + public Task ExecuteAsync( + GetAddressesByPostalCodesParameters parameters, + CancellationToken cancellationToken = default) + { + var data = new Fixture().Create>(); + + return Task.FromResult(GetAddressesByPostalCodesResult.Ok(data)); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Addresses/GetAddressesByPostalCodesTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Addresses/GetAddressesByPostalCodesTests.verified.cs new file mode 100644 index 00000000..dcef1894 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Addresses/GetAddressesByPostalCodesTests.verified.cs @@ -0,0 +1,21 @@ +namespace DemoSample.Api.Tests.Endpoints.Addresses; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class GetAddressesByPostalCodesTests : WebApiControllerBaseTest +{ + public GetAddressesByPostalCodesTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/EventArgs/GetEventArgByIdHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/EventArgs/GetEventArgByIdHandlerStub.verified.cs new file mode 100644 index 00000000..915772fe --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/EventArgs/GetEventArgByIdHandlerStub.verified.cs @@ -0,0 +1,20 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Tests.Endpoints.EventArgs; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetEventArgByIdHandlerStub : IGetEventArgByIdHandler +{ + public Task ExecuteAsync( + GetEventArgByIdParameters parameters, + CancellationToken cancellationToken = default) + { + var data = new Fixture().Create(); + + return Task.FromResult(GetEventArgByIdResult.Ok(data)); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/EventArgs/GetEventArgByIdTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/EventArgs/GetEventArgByIdTests.verified.cs new file mode 100644 index 00000000..139af5ba --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/EventArgs/GetEventArgByIdTests.verified.cs @@ -0,0 +1,21 @@ +namespace DemoSample.Api.Tests.Endpoints.EventArgs; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class GetEventArgByIdTests : WebApiControllerBaseTest +{ + public GetEventArgByIdTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/EventArgs/GetEventArgsHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/EventArgs/GetEventArgsHandlerStub.verified.cs new file mode 100644 index 00000000..c8a3fa3e --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/EventArgs/GetEventArgsHandlerStub.verified.cs @@ -0,0 +1,19 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Tests.Endpoints.EventArgs; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetEventArgsHandlerStub : IGetEventArgsHandler +{ + public Task ExecuteAsync( + CancellationToken cancellationToken = default) + { + var data = new Fixture().Create>(); + + return Task.FromResult(GetEventArgsResult.Ok(data)); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/EventArgs/GetEventArgsTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/EventArgs/GetEventArgsTests.verified.cs new file mode 100644 index 00000000..003d9acf --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/EventArgs/GetEventArgsTests.verified.cs @@ -0,0 +1,21 @@ +namespace DemoSample.Api.Tests.Endpoints.EventArgs; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class GetEventArgsTests : WebApiControllerBaseTest +{ + public GetEventArgsTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Files/GetFileByIdHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Files/GetFileByIdHandlerStub.verified.cs new file mode 100644 index 00000000..92e14e1a --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Files/GetFileByIdHandlerStub.verified.cs @@ -0,0 +1,19 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Tests.Endpoints.Files; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetFileByIdHandlerStub : IGetFileByIdHandler +{ + public Task ExecuteAsync( + GetFileByIdParameters parameters, + CancellationToken cancellationToken = default) + { + var bytes = Encoding.UTF8.GetBytes("Hello World"); + return Task.FromResult(GetFileByIdResult.Ok(bytes, "dummy.txt")); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Files/GetFileByIdTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Files/GetFileByIdTests.verified.cs new file mode 100644 index 00000000..324a172c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Files/GetFileByIdTests.verified.cs @@ -0,0 +1,21 @@ +namespace DemoSample.Api.Tests.Endpoints.Files; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class GetFileByIdTests : WebApiControllerBaseTest +{ + public GetFileByIdTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Files/UploadMultiFilesAsFormDataHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Files/UploadMultiFilesAsFormDataHandlerStub.verified.cs new file mode 100644 index 00000000..aa7d49c4 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Files/UploadMultiFilesAsFormDataHandlerStub.verified.cs @@ -0,0 +1,18 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Tests.Endpoints.Files; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UploadMultiFilesAsFormDataHandlerStub : IUploadMultiFilesAsFormDataHandler +{ + public Task ExecuteAsync( + UploadMultiFilesAsFormDataParameters parameters, + CancellationToken cancellationToken = default) + { + return Task.FromResult(UploadMultiFilesAsFormDataResult.Ok("Hallo world")); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Files/UploadMultiFilesAsFormDataTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Files/UploadMultiFilesAsFormDataTests.verified.cs new file mode 100644 index 00000000..cbee92da --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Files/UploadMultiFilesAsFormDataTests.verified.cs @@ -0,0 +1,21 @@ +namespace DemoSample.Api.Tests.Endpoints.Files; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class UploadMultiFilesAsFormDataTests : WebApiControllerBaseTest +{ + public UploadMultiFilesAsFormDataTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Files/UploadSingleFileAsFormDataHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Files/UploadSingleFileAsFormDataHandlerStub.verified.cs new file mode 100644 index 00000000..9fb5d157 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Files/UploadSingleFileAsFormDataHandlerStub.verified.cs @@ -0,0 +1,18 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Tests.Endpoints.Files; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UploadSingleFileAsFormDataHandlerStub : IUploadSingleFileAsFormDataHandler +{ + public Task ExecuteAsync( + UploadSingleFileAsFormDataParameters parameters, + CancellationToken cancellationToken = default) + { + return Task.FromResult(UploadSingleFileAsFormDataResult.Ok("Hallo world")); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Files/UploadSingleFileAsFormDataTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Files/UploadSingleFileAsFormDataTests.verified.cs new file mode 100644 index 00000000..d76dca89 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Files/UploadSingleFileAsFormDataTests.verified.cs @@ -0,0 +1,21 @@ +namespace DemoSample.Api.Tests.Endpoints.Files; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class UploadSingleFileAsFormDataTests : WebApiControllerBaseTest +{ + public UploadSingleFileAsFormDataTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Files/UploadSingleObjectWithFileAsFormDataHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Files/UploadSingleObjectWithFileAsFormDataHandlerStub.verified.cs new file mode 100644 index 00000000..40a4d378 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Files/UploadSingleObjectWithFileAsFormDataHandlerStub.verified.cs @@ -0,0 +1,18 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Tests.Endpoints.Files; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UploadSingleObjectWithFileAsFormDataHandlerStub : IUploadSingleObjectWithFileAsFormDataHandler +{ + public Task ExecuteAsync( + UploadSingleObjectWithFileAsFormDataParameters parameters, + CancellationToken cancellationToken = default) + { + return Task.FromResult(UploadSingleObjectWithFileAsFormDataResult.Ok("Hallo world")); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Files/UploadSingleObjectWithFileAsFormDataTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Files/UploadSingleObjectWithFileAsFormDataTests.verified.cs new file mode 100644 index 00000000..af984fe0 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Files/UploadSingleObjectWithFileAsFormDataTests.verified.cs @@ -0,0 +1,21 @@ +namespace DemoSample.Api.Tests.Endpoints.Files; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class UploadSingleObjectWithFileAsFormDataTests : WebApiControllerBaseTest +{ + public UploadSingleObjectWithFileAsFormDataTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Files/UploadSingleObjectWithFilesAsFormDataHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Files/UploadSingleObjectWithFilesAsFormDataHandlerStub.verified.cs new file mode 100644 index 00000000..bbc9a812 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Files/UploadSingleObjectWithFilesAsFormDataHandlerStub.verified.cs @@ -0,0 +1,18 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Tests.Endpoints.Files; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UploadSingleObjectWithFilesAsFormDataHandlerStub : IUploadSingleObjectWithFilesAsFormDataHandler +{ + public Task ExecuteAsync( + UploadSingleObjectWithFilesAsFormDataParameters parameters, + CancellationToken cancellationToken = default) + { + return Task.FromResult(UploadSingleObjectWithFilesAsFormDataResult.Ok("Hallo world")); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Files/UploadSingleObjectWithFilesAsFormDataTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Files/UploadSingleObjectWithFilesAsFormDataTests.verified.cs new file mode 100644 index 00000000..2b224503 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Files/UploadSingleObjectWithFilesAsFormDataTests.verified.cs @@ -0,0 +1,21 @@ +namespace DemoSample.Api.Tests.Endpoints.Files; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class UploadSingleObjectWithFilesAsFormDataTests : WebApiControllerBaseTest +{ + public UploadSingleObjectWithFilesAsFormDataTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Items/CreateItemHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Items/CreateItemHandlerStub.verified.cs new file mode 100644 index 00000000..42c8231f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Items/CreateItemHandlerStub.verified.cs @@ -0,0 +1,18 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Tests.Endpoints.Items; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class CreateItemHandlerStub : ICreateItemHandler +{ + public Task ExecuteAsync( + CreateItemParameters parameters, + CancellationToken cancellationToken = default) + { + return Task.FromResult(CreateItemResult.Ok("Hallo world")); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Items/CreateItemTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Items/CreateItemTests.verified.cs new file mode 100644 index 00000000..c6c5d0a6 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Items/CreateItemTests.verified.cs @@ -0,0 +1,21 @@ +namespace DemoSample.Api.Tests.Endpoints.Items; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class CreateItemTests : WebApiControllerBaseTest +{ + public CreateItemTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Items/UpdateItemHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Items/UpdateItemHandlerStub.verified.cs new file mode 100644 index 00000000..c3b0916b --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Items/UpdateItemHandlerStub.verified.cs @@ -0,0 +1,18 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Tests.Endpoints.Items; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateItemHandlerStub : IUpdateItemHandler +{ + public Task ExecuteAsync( + UpdateItemParameters parameters, + CancellationToken cancellationToken = default) + { + return Task.FromResult(UpdateItemResult.Ok(Guid.NewGuid())); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Items/UpdateItemTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Items/UpdateItemTests.verified.cs new file mode 100644 index 00000000..f57ec582 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Items/UpdateItemTests.verified.cs @@ -0,0 +1,21 @@ +namespace DemoSample.Api.Tests.Endpoints.Items; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class UpdateItemTests : WebApiControllerBaseTest +{ + public UpdateItemTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Orders/GetOrderByIdHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Orders/GetOrderByIdHandlerStub.verified.cs new file mode 100644 index 00000000..69b08995 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Orders/GetOrderByIdHandlerStub.verified.cs @@ -0,0 +1,20 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Tests.Endpoints.Orders; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetOrderByIdHandlerStub : IGetOrderByIdHandler +{ + public Task ExecuteAsync( + GetOrderByIdParameters parameters, + CancellationToken cancellationToken = default) + { + var data = new Fixture().Create(); + + return Task.FromResult(GetOrderByIdResult.Ok(data)); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Orders/GetOrderByIdTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Orders/GetOrderByIdTests.verified.cs new file mode 100644 index 00000000..c0e26b3f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Orders/GetOrderByIdTests.verified.cs @@ -0,0 +1,21 @@ +namespace DemoSample.Api.Tests.Endpoints.Orders; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class GetOrderByIdTests : WebApiControllerBaseTest +{ + public GetOrderByIdTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Orders/GetOrdersHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Orders/GetOrdersHandlerStub.verified.cs new file mode 100644 index 00000000..f0017248 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Orders/GetOrdersHandlerStub.verified.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Tests.Endpoints.Orders; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetOrdersHandlerStub : IGetOrdersHandler +{ + public Task ExecuteAsync( + GetOrdersParameters parameters, + CancellationToken cancellationToken = default) + { + var data = new Fixture().Create>(); + + var paginationData = new Pagination( + data, + parameters.PageSize, + parameters.QueryString, + parameters.ContinuationToken); + + return Task.FromResult(GetOrdersResult.Ok(paginationData)); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Orders/GetOrdersTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Orders/GetOrdersTests.verified.cs new file mode 100644 index 00000000..d71f3385 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Orders/GetOrdersTests.verified.cs @@ -0,0 +1,21 @@ +namespace DemoSample.Api.Tests.Endpoints.Orders; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class GetOrdersTests : WebApiControllerBaseTest +{ + public GetOrdersTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Orders/PatchOrdersIdHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Orders/PatchOrdersIdHandlerStub.verified.cs new file mode 100644 index 00000000..abfba40f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Orders/PatchOrdersIdHandlerStub.verified.cs @@ -0,0 +1,18 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Tests.Endpoints.Orders; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class PatchOrdersIdHandlerStub : IPatchOrdersIdHandler +{ + public Task ExecuteAsync( + PatchOrdersIdParameters parameters, + CancellationToken cancellationToken = default) + { + return Task.FromResult(PatchOrdersIdResult.Ok("Hallo world")); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Orders/PatchOrdersIdTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Orders/PatchOrdersIdTests.verified.cs new file mode 100644 index 00000000..6aeda555 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Orders/PatchOrdersIdTests.verified.cs @@ -0,0 +1,21 @@ +namespace DemoSample.Api.Tests.Endpoints.Orders; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class PatchOrdersIdTests : WebApiControllerBaseTest +{ + public PatchOrdersIdTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/RouteWithDash/GetRouteWithDashHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/RouteWithDash/GetRouteWithDashHandlerStub.verified.cs new file mode 100644 index 00000000..7de4ff14 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/RouteWithDash/GetRouteWithDashHandlerStub.verified.cs @@ -0,0 +1,17 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Tests.Endpoints.RouteWithDash; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetRouteWithDashHandlerStub : IGetRouteWithDashHandler +{ + public Task ExecuteAsync( + CancellationToken cancellationToken = default) + { + return Task.FromResult(GetRouteWithDashResult.Ok("Hallo world")); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/RouteWithDash/GetRouteWithDashTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/RouteWithDash/GetRouteWithDashTests.verified.cs new file mode 100644 index 00000000..39c353be --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/RouteWithDash/GetRouteWithDashTests.verified.cs @@ -0,0 +1,21 @@ +namespace DemoSample.Api.Tests.Endpoints.RouteWithDash; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class GetRouteWithDashTests : WebApiControllerBaseTest +{ + public GetRouteWithDashTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Tasks/GetTasksHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Tasks/GetTasksHandlerStub.verified.cs new file mode 100644 index 00000000..4de36cb4 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Tasks/GetTasksHandlerStub.verified.cs @@ -0,0 +1,19 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Tests.Endpoints.Tasks; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetTasksHandlerStub : DemoSample.Api.Generated.Contracts.Tasks.IGetTasksHandler +{ + public Task ExecuteAsync( + CancellationToken cancellationToken = default) + { + var data = new Fixture().Create>(); + + return Task.FromResult(DemoSample.Api.Generated.Contracts.Tasks.GetTasksResult.Ok(data)); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Tasks/GetTasksTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Tasks/GetTasksTests.verified.cs new file mode 100644 index 00000000..fecf4ccb --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Tasks/GetTasksTests.verified.cs @@ -0,0 +1,21 @@ +namespace DemoSample.Api.Tests.Endpoints.Tasks; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class GetTasksTests : WebApiControllerBaseTest +{ + public GetTasksTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Users/DeleteUserByIdHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Users/DeleteUserByIdHandlerStub.verified.cs new file mode 100644 index 00000000..7c743a82 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Users/DeleteUserByIdHandlerStub.verified.cs @@ -0,0 +1,18 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Tests.Endpoints.Users; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class DeleteUserByIdHandlerStub : IDeleteUserByIdHandler +{ + public Task ExecuteAsync( + DeleteUserByIdParameters parameters, + CancellationToken cancellationToken = default) + { + return Task.FromResult(DeleteUserByIdResult.Ok("Hallo world")); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Users/DeleteUserByIdTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Users/DeleteUserByIdTests.verified.cs new file mode 100644 index 00000000..5215a618 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Users/DeleteUserByIdTests.verified.cs @@ -0,0 +1,21 @@ +namespace DemoSample.Api.Tests.Endpoints.Users; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class DeleteUserByIdTests : WebApiControllerBaseTest +{ + public DeleteUserByIdTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Users/GetUserByEmailHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Users/GetUserByEmailHandlerStub.verified.cs new file mode 100644 index 00000000..b32e0041 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Users/GetUserByEmailHandlerStub.verified.cs @@ -0,0 +1,20 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Tests.Endpoints.Users; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetUserByEmailHandlerStub : IGetUserByEmailHandler +{ + public Task ExecuteAsync( + GetUserByEmailParameters parameters, + CancellationToken cancellationToken = default) + { + var data = new Fixture().Create(); + + return Task.FromResult(GetUserByEmailResult.Ok(data)); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Users/GetUserByEmailTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Users/GetUserByEmailTests.verified.cs new file mode 100644 index 00000000..0085538f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Users/GetUserByEmailTests.verified.cs @@ -0,0 +1,21 @@ +namespace DemoSample.Api.Tests.Endpoints.Users; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class GetUserByEmailTests : WebApiControllerBaseTest +{ + public GetUserByEmailTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Users/GetUserByIdHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Users/GetUserByIdHandlerStub.verified.cs new file mode 100644 index 00000000..aafcb762 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Users/GetUserByIdHandlerStub.verified.cs @@ -0,0 +1,20 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Tests.Endpoints.Users; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetUserByIdHandlerStub : IGetUserByIdHandler +{ + public Task ExecuteAsync( + GetUserByIdParameters parameters, + CancellationToken cancellationToken = default) + { + var data = new Fixture().Create(); + + return Task.FromResult(GetUserByIdResult.Ok(data)); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Users/GetUserByIdTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Users/GetUserByIdTests.verified.cs new file mode 100644 index 00000000..21cd40fb --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Users/GetUserByIdTests.verified.cs @@ -0,0 +1,21 @@ +namespace DemoSample.Api.Tests.Endpoints.Users; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class GetUserByIdTests : WebApiControllerBaseTest +{ + public GetUserByIdTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Users/GetUsersHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Users/GetUsersHandlerStub.verified.cs new file mode 100644 index 00000000..55c5a939 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Users/GetUsersHandlerStub.verified.cs @@ -0,0 +1,19 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Tests.Endpoints.Users; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetUsersHandlerStub : IGetUsersHandler +{ + public Task ExecuteAsync( + CancellationToken cancellationToken = default) + { + var data = new Fixture().Create>(); + + return Task.FromResult(GetUsersResult.Ok(data)); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Users/GetUsersTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Users/GetUsersTests.verified.cs new file mode 100644 index 00000000..99ea5ae4 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Users/GetUsersTests.verified.cs @@ -0,0 +1,21 @@ +namespace DemoSample.Api.Tests.Endpoints.Users; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class GetUsersTests : WebApiControllerBaseTest +{ + public GetUsersTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Users/PostUserHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Users/PostUserHandlerStub.verified.cs new file mode 100644 index 00000000..da0bc736 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Users/PostUserHandlerStub.verified.cs @@ -0,0 +1,18 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Tests.Endpoints.Users; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class PostUserHandlerStub : IPostUserHandler +{ + public Task ExecuteAsync( + PostUserParameters parameters, + CancellationToken cancellationToken = default) + { + return Task.FromResult(PostUserResult.Created()); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Users/PostUserTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Users/PostUserTests.verified.cs new file mode 100644 index 00000000..25989f91 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Users/PostUserTests.verified.cs @@ -0,0 +1,21 @@ +namespace DemoSample.Api.Tests.Endpoints.Users; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class PostUserTests : WebApiControllerBaseTest +{ + public PostUserTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Users/UpdateMyTestGenderHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Users/UpdateMyTestGenderHandlerStub.verified.cs new file mode 100644 index 00000000..076d3b7d --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Users/UpdateMyTestGenderHandlerStub.verified.cs @@ -0,0 +1,18 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Tests.Endpoints.Users; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateMyTestGenderHandlerStub : IUpdateMyTestGenderHandler +{ + public Task ExecuteAsync( + UpdateMyTestGenderParameters parameters, + CancellationToken cancellationToken = default) + { + return Task.FromResult(UpdateMyTestGenderResult.Ok("Hallo world")); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Users/UpdateMyTestGenderTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Users/UpdateMyTestGenderTests.verified.cs new file mode 100644 index 00000000..b6bcf1d1 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Users/UpdateMyTestGenderTests.verified.cs @@ -0,0 +1,21 @@ +namespace DemoSample.Api.Tests.Endpoints.Users; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class UpdateMyTestGenderTests : WebApiControllerBaseTest +{ + public UpdateMyTestGenderTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Users/UpdateUserByIdHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Users/UpdateUserByIdHandlerStub.verified.cs new file mode 100644 index 00000000..78efb17a --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Users/UpdateUserByIdHandlerStub.verified.cs @@ -0,0 +1,18 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Tests.Endpoints.Users; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateUserByIdHandlerStub : IUpdateUserByIdHandler +{ + public Task ExecuteAsync( + UpdateUserByIdParameters parameters, + CancellationToken cancellationToken = default) + { + return Task.FromResult(UpdateUserByIdResult.Ok("Hallo world")); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Users/UpdateUserByIdTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Users/UpdateUserByIdTests.verified.cs new file mode 100644 index 00000000..6bdc22eb --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/Endpoints/Users/UpdateUserByIdTests.verified.cs @@ -0,0 +1,21 @@ +namespace DemoSample.Api.Tests.Endpoints.Users; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class UpdateUserByIdTests : WebApiControllerBaseTest +{ + public UpdateUserByIdTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/GlobalUsings.verified.cs new file mode 100644 index 00000000..7c1f4a76 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/GlobalUsings.verified.cs @@ -0,0 +1,31 @@ +global using System.CodeDom.Compiler; +global using System.Reflection; +global using System.Text; +global using System.Text.Json; +global using System.Text.Json.Serialization; + +global using Atc.Rest.Options; +global using Atc.Rest.Results; +global using Atc.XUnit; + +global using AutoFixture; + +global using DemoSample.Api.Generated; +global using DemoSample.Api.Generated.Contracts; +global using DemoSample.Api.Generated.Contracts.Accounts; +global using DemoSample.Api.Generated.Contracts.Addresses; +global using DemoSample.Api.Generated.Contracts.EventArgs; +global using DemoSample.Api.Generated.Contracts.Files; +global using DemoSample.Api.Generated.Contracts.Items; +global using DemoSample.Api.Generated.Contracts.Orders; +global using DemoSample.Api.Generated.Contracts.RouteWithDash; +global using DemoSample.Api.Generated.Contracts.Users; + +global using Microsoft.AspNetCore.Hosting; +global using Microsoft.AspNetCore.Http; +global using Microsoft.AspNetCore.Mvc.Testing; +global using Microsoft.AspNetCore.TestHost; +global using Microsoft.Extensions.Configuration; +global using Microsoft.Extensions.DependencyInjection; + +global using Xunit; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/WebApiControllerBaseTest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/WebApiControllerBaseTest.verified.cs new file mode 100644 index 00000000..0136dbf6 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/WebApiControllerBaseTest.verified.cs @@ -0,0 +1,56 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Tests; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public abstract class WebApiControllerBaseTest : IClassFixture +{ + protected readonly WebApiStartupFactory Factory; + + protected readonly HttpClient HttpClient; + + protected readonly IConfiguration Configuration; + + protected static JsonSerializerOptions? JsonSerializerOptions; + + protected WebApiControllerBaseTest(WebApiStartupFactory fixture) + { + this.Factory = fixture; + this.HttpClient = this.Factory.CreateClient(); + this.Configuration = new ConfigurationBuilder().Build(); + JsonSerializerOptions = new JsonSerializerOptions + { + PropertyNameCaseInsensitive = true, + Converters = + { + new JsonStringEnumConverter() + }, + }; + } + + protected static StringContent ToJson(object data) + => new(JsonSerializer.Serialize(data, JsonSerializerOptions), Encoding.UTF8, "application/json"); + + protected static StringContent Json(string data) + => new(data, Encoding.UTF8, "application/json"); + + protected static IFormFile GetTestFile() + { + var bytes = Encoding.UTF8.GetBytes("Hello World"); + var stream = new MemoryStream(bytes); + var formFile = new FormFile(stream, 0, stream.Length, "dummy", "dummy.txt") + { + Headers = new HeaderDictionary(), + ContentType = "application/octet-stream", + }; + + return formFile; + } + + protected static List GetTestFiles() + => new() { GetTestFile(), GetTestFile() }; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/WebApiStartupFactory.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/WebApiStartupFactory.verified.cs new file mode 100644 index 00000000..19996e35 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Api.Tests/WebApiStartupFactory.verified.cs @@ -0,0 +1,40 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace DemoSample.Api.Tests; + +/// +/// Factory for bootstrapping in memory tests. +/// Includes options to override configuration and service collection using a partial class. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public partial class WebApiStartupFactory : WebApplicationFactory +{ + protected override void ConfigureWebHost(IWebHostBuilder builder) + { + builder.ConfigureAppConfiguration(config => + { + ModifyConfiguration(config); + var integrationConfig = new ConfigurationBuilder() + .AddJsonFile("appsettings.integrationtest.json") + .Build(); + config.AddConfiguration(integrationConfig); + }); + + builder.ConfigureTestServices(services => + { + ModifyServices(services); + services.AddSingleton(); + services.AutoRegistrateServices( + Assembly.GetAssembly(typeof(ApiRegistration))!, + Assembly.GetAssembly(typeof(WebApiStartupFactory))!); + }); + } + + partial void ModifyConfiguration(IConfigurationBuilder config); + + partial void ModifyServices(IServiceCollection services); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/GlobalUsings.verified.cs new file mode 100644 index 00000000..8c927eb7 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/GlobalUsings.verified.cs @@ -0,0 +1 @@ +global using Xunit; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Accounts/SetAccountNameHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Accounts/SetAccountNameHandlerTests.verified.cs new file mode 100644 index 00000000..1ea3a715 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Accounts/SetAccountNameHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace DemoSample.Domain.Tests.Handlers.Accounts; + +public class SetAccountNameHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Accounts/UpdateAccountNameHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Accounts/UpdateAccountNameHandlerTests.verified.cs new file mode 100644 index 00000000..0ba36057 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Accounts/UpdateAccountNameHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace DemoSample.Domain.Tests.Handlers.Accounts; + +public class UpdateAccountNameHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Addresses/GetAddressesByPostalCodesHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Addresses/GetAddressesByPostalCodesHandlerTests.verified.cs new file mode 100644 index 00000000..bd68ba9f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Addresses/GetAddressesByPostalCodesHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace DemoSample.Domain.Tests.Handlers.Addresses; + +public class GetAddressesByPostalCodesHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/EventArgs/GetEventArgByIdHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/EventArgs/GetEventArgByIdHandlerTests.verified.cs new file mode 100644 index 00000000..b1ac99da --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/EventArgs/GetEventArgByIdHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace DemoSample.Domain.Tests.Handlers.EventArgs; + +public class GetEventArgByIdHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/EventArgs/GetEventArgsHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/EventArgs/GetEventArgsHandlerTests.verified.cs new file mode 100644 index 00000000..9fd735c9 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/EventArgs/GetEventArgsHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace DemoSample.Domain.Tests.Handlers.EventArgs; + +public class GetEventArgsHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Files/GetFileByIdHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Files/GetFileByIdHandlerTests.verified.cs new file mode 100644 index 00000000..1cc73f77 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Files/GetFileByIdHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace DemoSample.Domain.Tests.Handlers.Files; + +public class GetFileByIdHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Files/UploadMultiFilesAsFormDataHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Files/UploadMultiFilesAsFormDataHandlerTests.verified.cs new file mode 100644 index 00000000..228ef2ed --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Files/UploadMultiFilesAsFormDataHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace DemoSample.Domain.Tests.Handlers.Files; + +public class UploadMultiFilesAsFormDataHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Files/UploadSingleFileAsFormDataHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Files/UploadSingleFileAsFormDataHandlerTests.verified.cs new file mode 100644 index 00000000..235feb67 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Files/UploadSingleFileAsFormDataHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace DemoSample.Domain.Tests.Handlers.Files; + +public class UploadSingleFileAsFormDataHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Files/UploadSingleObjectWithFileAsFormDataHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Files/UploadSingleObjectWithFileAsFormDataHandlerTests.verified.cs new file mode 100644 index 00000000..5b81d028 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Files/UploadSingleObjectWithFileAsFormDataHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace DemoSample.Domain.Tests.Handlers.Files; + +public class UploadSingleObjectWithFileAsFormDataHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Files/UploadSingleObjectWithFilesAsFormDataHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Files/UploadSingleObjectWithFilesAsFormDataHandlerTests.verified.cs new file mode 100644 index 00000000..1dc72c83 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Files/UploadSingleObjectWithFilesAsFormDataHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace DemoSample.Domain.Tests.Handlers.Files; + +public class UploadSingleObjectWithFilesAsFormDataHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Items/CreateItemHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Items/CreateItemHandlerTests.verified.cs new file mode 100644 index 00000000..46321c81 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Items/CreateItemHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace DemoSample.Domain.Tests.Handlers.Items; + +public class CreateItemHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Items/UpdateItemHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Items/UpdateItemHandlerTests.verified.cs new file mode 100644 index 00000000..6ed7d5e8 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Items/UpdateItemHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace DemoSample.Domain.Tests.Handlers.Items; + +public class UpdateItemHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Orders/GetOrderByIdHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Orders/GetOrderByIdHandlerTests.verified.cs new file mode 100644 index 00000000..38bc01cc --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Orders/GetOrderByIdHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace DemoSample.Domain.Tests.Handlers.Orders; + +public class GetOrderByIdHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Orders/GetOrdersHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Orders/GetOrdersHandlerTests.verified.cs new file mode 100644 index 00000000..b1dd6459 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Orders/GetOrdersHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace DemoSample.Domain.Tests.Handlers.Orders; + +public class GetOrdersHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Orders/PatchOrdersIdHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Orders/PatchOrdersIdHandlerTests.verified.cs new file mode 100644 index 00000000..6ae6caa4 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Orders/PatchOrdersIdHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace DemoSample.Domain.Tests.Handlers.Orders; + +public class PatchOrdersIdHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/RouteWithDash/GetRouteWithDashHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/RouteWithDash/GetRouteWithDashHandlerTests.verified.cs new file mode 100644 index 00000000..0e1c6b5d --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/RouteWithDash/GetRouteWithDashHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace DemoSample.Domain.Tests.Handlers.RouteWithDash; + +public class GetRouteWithDashHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Tasks/GetTasksHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Tasks/GetTasksHandlerTests.verified.cs new file mode 100644 index 00000000..e340c3bd --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Tasks/GetTasksHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace DemoSample.Domain.Tests.Handlers.Tasks; + +public class GetTasksHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Users/DeleteUserByIdHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Users/DeleteUserByIdHandlerTests.verified.cs new file mode 100644 index 00000000..89ec5c16 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Users/DeleteUserByIdHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace DemoSample.Domain.Tests.Handlers.Users; + +public class DeleteUserByIdHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Users/GetUserByEmailHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Users/GetUserByEmailHandlerTests.verified.cs new file mode 100644 index 00000000..cb39c5bc --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Users/GetUserByEmailHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace DemoSample.Domain.Tests.Handlers.Users; + +public class GetUserByEmailHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Users/GetUserByIdHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Users/GetUserByIdHandlerTests.verified.cs new file mode 100644 index 00000000..1a6be2e5 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Users/GetUserByIdHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace DemoSample.Domain.Tests.Handlers.Users; + +public class GetUserByIdHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Users/GetUsersHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Users/GetUsersHandlerTests.verified.cs new file mode 100644 index 00000000..98dc36bc --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Users/GetUsersHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace DemoSample.Domain.Tests.Handlers.Users; + +public class GetUsersHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Users/PostUserHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Users/PostUserHandlerTests.verified.cs new file mode 100644 index 00000000..617a93c3 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Users/PostUserHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace DemoSample.Domain.Tests.Handlers.Users; + +public class PostUserHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Users/UpdateMyTestGenderHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Users/UpdateMyTestGenderHandlerTests.verified.cs new file mode 100644 index 00000000..7dcc90af --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Users/UpdateMyTestGenderHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace DemoSample.Domain.Tests.Handlers.Users; + +public class UpdateMyTestGenderHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Users/UpdateUserByIdHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Users/UpdateUserByIdHandlerTests.verified.cs new file mode 100644 index 00000000..9859e9fd --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/DemoSample/VerifyServerAll/Mvc_WPD/test/DemoSample.Domain.Tests/Handlers/Users/UpdateUserByIdHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace DemoSample.Domain.Tests.Handlers.Users; + +public class UpdateUserByIdHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/ExAllResponseTypes.yaml b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/ExAllResponseTypes.yaml new file mode 100644 index 00000000..077f831d --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/ExAllResponseTypes.yaml @@ -0,0 +1,171 @@ +openapi: 3.0.0 +info: + title: Example-Response-Types + description: Example With All Response Types Api + version: '1.0' + contact: + name: atc-net A/S +servers: + - url: /api/v1 + description: Api version 1.0 +paths: + /example: + get: + summary: Example endpoint + description: Returns different responses based on the status code. + operationId: getExample + parameters: + - name: myEmail + in: query + description: The email for filter orders to retrieve + schema: + type: string + format: email + nullable: false + tags: + - test + responses: + '100': + description: Continue + '101': + description: Switching Protocols + '102': + description: Processing + '103': + description: Early Hints + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ExampleModel' + '201': + description: Created + '202': + description: Accepted + '203': + description: Non-Authoritative Information + '204': + description: No Content + '205': + description: Reset Content + '206': + description: Partial Content + '207': + description: Multi-Status + '208': + description: Already Reported + '226': + description: IM Used + '300': + description: Multiple Choices + '301': + description: Moved Permanently + '302': + description: Found + '303': + description: See Other + '304': + description: Not Modified + '305': + description: Use Proxy + '306': + description: Switch Proxy + '307': + description: Temporary Redirect + '308': + description: Permanent Redirect + '400': + description: Bad Request + '401': + description: Unauthorized + '402': + description: Payment Required + '403': + description: Forbidden + '404': + description: Not Found + '405': + description: Method Not Allowed + '406': + description: Not Acceptable + '407': + description: Proxy Authentication Required + '408': + description: Request Timeout + '409': + description: Conflict + '410': + description: Gone + '411': + description: Length Required + '412': + description: Precondition Failed + '413': + description: Payload Too Large + '414': + description: URI Too Long + '415': + description: Unsupported Media Type + '416': + description: Range Not Satisfiable + '417': + description: Expectation Failed + '418': + description: I'm a teapot + '421': + description: Misdirected Request + '422': + description: Unprocessable Entity + '423': + description: Locked + '424': + description: Failed Dependency + '425': + description: Too Early + '426': + description: Upgrade Required + '428': + description: Precondition Required + '429': + description: Too Many Requests + '431': + description: Request Header Fields Too Large + '451': + description: Unavailable For Legal Reasons + '500': + description: Internal Server Error + '501': + description: Not Implemented + '502': + description: Bad Gateway + '503': + description: Service Unavailable + '504': + description: Gateway Timeout + '505': + description: HTTP Version Not Supported + '506': + description: Variant Also Negotiates + '507': + description: Insufficient Storage + '508': + description: Loop Detected + '510': + description: Not Extended + '511': + description: Network Authentication Required +components: + schemas: + ExampleModel: + title: Example-Model + type: object + properties: + property1: + type: string + property2: + type: integer + property3: + type: boolean + responses: {} + requestBodies: {} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyClient/WOPD/src/ExAllResponseTypes.ApiClient.Generated/Contracts/Example/ExampleModel.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyClient/WOPD/src/ExAllResponseTypes.ApiClient.Generated/Contracts/Example/ExampleModel.verified.cs new file mode 100644 index 00000000..804f0093 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyClient/WOPD/src/ExAllResponseTypes.ApiClient.Generated/Contracts/Example/ExampleModel.verified.cs @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExAllResponseTypes.ApiClient.Generated.Contracts.Example; + +/// +/// Example-Model. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ExampleModel +{ + public string Property1 { get; set; } + + public int Property2 { get; set; } + + public bool Property3 { get; set; } + + /// + public override string ToString() + => $"{nameof(Property1)}: {Property1}, {nameof(Property2)}: {Property2}, {nameof(Property3)}: {Property3}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyClient/WOPD/src/ExAllResponseTypes.ApiClient.Generated/Contracts/Example/RequestParameters/GetExampleParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyClient/WOPD/src/ExAllResponseTypes.ApiClient.Generated/Contracts/Example/RequestParameters/GetExampleParameters.verified.cs new file mode 100644 index 00000000..bd06c9cd --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyClient/WOPD/src/ExAllResponseTypes.ApiClient.Generated/Contracts/Example/RequestParameters/GetExampleParameters.verified.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExAllResponseTypes.ApiClient.Generated.Contracts.Example; + +/// +/// Parameters for operation request. +/// Description: Example endpoint. +/// Operation: GetExample. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetExampleParameters +{ + /// + /// The email for filter orders to retrieve. + /// + /// + /// Email validation being enforced. + /// + [EmailAddress] + public string MyEmail { get; set; } + + /// + public override string ToString() + => $"{nameof(MyEmail)}: {MyEmail}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyClient/WOPD/src/ExAllResponseTypes.ApiClient.Generated/Endpoints/Example/GetExampleEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyClient/WOPD/src/ExAllResponseTypes.ApiClient.Generated/Endpoints/Example/GetExampleEndpoint.verified.cs new file mode 100644 index 00000000..e5f6a20a --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyClient/WOPD/src/ExAllResponseTypes.ApiClient.Generated/Endpoints/Example/GetExampleEndpoint.verified.cs @@ -0,0 +1,105 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExAllResponseTypes.ApiClient.Generated.Endpoints.Example; + +/// +/// Client Endpoint. +/// Description: Example endpoint. +/// Operation: GetExample. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetExampleEndpoint : IGetExampleEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public GetExampleEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + GetExampleParameters parameters, + string httpClientName = "ExAllResponseTypes-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/example"); + requestBuilder.WithQueryParameter("myEmail", parameters.MyEmail); + + using var requestMessage = requestBuilder.Build(HttpMethod.Get); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddErrorResponse(HttpStatusCode.Continue); + responseBuilder.AddErrorResponse(HttpStatusCode.SwitchingProtocols); + responseBuilder.AddErrorResponse(HttpStatusCode.Processing); + responseBuilder.AddErrorResponse(HttpStatusCode.EarlyHints); + responseBuilder.AddSuccessResponse(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.Created); + responseBuilder.AddErrorResponse(HttpStatusCode.Accepted); + responseBuilder.AddErrorResponse(HttpStatusCode.NonAuthoritativeInformation); + responseBuilder.AddErrorResponse(HttpStatusCode.NoContent); + responseBuilder.AddErrorResponse(HttpStatusCode.ResetContent); + responseBuilder.AddErrorResponse(HttpStatusCode.PartialContent); + responseBuilder.AddErrorResponse(HttpStatusCode.MultiStatus); + responseBuilder.AddErrorResponse(HttpStatusCode.AlreadyReported); + responseBuilder.AddErrorResponse(HttpStatusCode.IMUsed); + responseBuilder.AddErrorResponse(HttpStatusCode.MultipleChoices); + responseBuilder.AddErrorResponse(HttpStatusCode.MovedPermanently); + responseBuilder.AddErrorResponse(HttpStatusCode.Found); + responseBuilder.AddErrorResponse(HttpStatusCode.SeeOther); + responseBuilder.AddErrorResponse(HttpStatusCode.NotModified); + responseBuilder.AddErrorResponse(HttpStatusCode.UseProxy); + responseBuilder.AddErrorResponse(HttpStatusCode.Unused); + responseBuilder.AddErrorResponse(HttpStatusCode.RedirectKeepVerb); + responseBuilder.AddErrorResponse(HttpStatusCode.PermanentRedirect); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + responseBuilder.AddErrorResponse(HttpStatusCode.PaymentRequired); + responseBuilder.AddErrorResponse(HttpStatusCode.Forbidden); + responseBuilder.AddErrorResponse(HttpStatusCode.NotFound); + responseBuilder.AddErrorResponse(HttpStatusCode.MethodNotAllowed); + responseBuilder.AddErrorResponse(HttpStatusCode.NotAcceptable); + responseBuilder.AddErrorResponse(HttpStatusCode.ProxyAuthenticationRequired); + responseBuilder.AddErrorResponse(HttpStatusCode.RequestTimeout); + responseBuilder.AddErrorResponse(HttpStatusCode.Conflict); + responseBuilder.AddErrorResponse(HttpStatusCode.Gone); + responseBuilder.AddErrorResponse(HttpStatusCode.LengthRequired); + responseBuilder.AddErrorResponse(HttpStatusCode.PreconditionFailed); + responseBuilder.AddErrorResponse(HttpStatusCode.RequestEntityTooLarge); + responseBuilder.AddErrorResponse(HttpStatusCode.RequestUriTooLong); + responseBuilder.AddErrorResponse(HttpStatusCode.UnsupportedMediaType); + responseBuilder.AddErrorResponse(HttpStatusCode.RequestedRangeNotSatisfiable); + responseBuilder.AddErrorResponse(HttpStatusCode.ExpectationFailed); + responseBuilder.AddErrorResponse(HttpStatusCode.MisdirectedRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.UnprocessableEntity); + responseBuilder.AddErrorResponse(HttpStatusCode.Locked); + responseBuilder.AddErrorResponse(HttpStatusCode.FailedDependency); + responseBuilder.AddErrorResponse(HttpStatusCode.UpgradeRequired); + responseBuilder.AddErrorResponse(HttpStatusCode.PreconditionRequired); + responseBuilder.AddErrorResponse(HttpStatusCode.TooManyRequests); + responseBuilder.AddErrorResponse(HttpStatusCode.RequestHeaderFieldsTooLarge); + responseBuilder.AddErrorResponse(HttpStatusCode.UnavailableForLegalReasons); + responseBuilder.AddErrorResponse(HttpStatusCode.InternalServerError); + responseBuilder.AddErrorResponse(HttpStatusCode.NotImplemented); + responseBuilder.AddErrorResponse(HttpStatusCode.BadGateway); + responseBuilder.AddErrorResponse(HttpStatusCode.ServiceUnavailable); + responseBuilder.AddErrorResponse(HttpStatusCode.GatewayTimeout); + responseBuilder.AddErrorResponse(HttpStatusCode.HttpVersionNotSupported); + responseBuilder.AddErrorResponse(HttpStatusCode.VariantAlsoNegotiates); + responseBuilder.AddErrorResponse(HttpStatusCode.InsufficientStorage); + responseBuilder.AddErrorResponse(HttpStatusCode.LoopDetected); + responseBuilder.AddErrorResponse(HttpStatusCode.NotExtended); + responseBuilder.AddErrorResponse(HttpStatusCode.NetworkAuthenticationRequired); + return await responseBuilder.BuildResponseAsync(x => new GetExampleEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyClient/WOPD/src/ExAllResponseTypes.ApiClient.Generated/Endpoints/Example/GetExampleEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyClient/WOPD/src/ExAllResponseTypes.ApiClient.Generated/Endpoints/Example/GetExampleEndpointResult.verified.cs new file mode 100644 index 00000000..b0d06f62 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyClient/WOPD/src/ExAllResponseTypes.ApiClient.Generated/Endpoints/Example/GetExampleEndpointResult.verified.cs @@ -0,0 +1,504 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExAllResponseTypes.ApiClient.Generated.Endpoints.Example; + +/// +/// Client Endpoint result. +/// Description: Example endpoint. +/// Operation: GetExample. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetExampleEndpointResult : EndpointResponse, IGetExampleEndpointResult +{ + public GetExampleEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsContinue + => StatusCode == HttpStatusCode.Continue; + + public bool IsSwitchingProtocols + => StatusCode == HttpStatusCode.SwitchingProtocols; + + public bool IsProcessing + => StatusCode == HttpStatusCode.Processing; + + public bool IsEarlyHints + => StatusCode == HttpStatusCode.EarlyHints; + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsCreated + => StatusCode == HttpStatusCode.Created; + + public bool IsAccepted + => StatusCode == HttpStatusCode.Accepted; + + public bool IsNonAuthoritativeInformation + => StatusCode == HttpStatusCode.NonAuthoritativeInformation; + + public bool IsNoContent + => StatusCode == HttpStatusCode.NoContent; + + public bool IsResetContent + => StatusCode == HttpStatusCode.ResetContent; + + public bool IsPartialContent + => StatusCode == HttpStatusCode.PartialContent; + + public bool IsMultiStatus + => StatusCode == HttpStatusCode.MultiStatus; + + public bool IsAlreadyReported + => StatusCode == HttpStatusCode.AlreadyReported; + + public bool IsImUsed + => StatusCode == HttpStatusCode.IMUsed; + + public bool IsMultipleChoices + => StatusCode == HttpStatusCode.MultipleChoices; + + public bool IsMovedPermanently + => StatusCode == HttpStatusCode.MovedPermanently; + + public bool IsFound + => StatusCode == HttpStatusCode.Found; + + public bool IsSeeOther + => StatusCode == HttpStatusCode.SeeOther; + + public bool IsNotModified + => StatusCode == HttpStatusCode.NotModified; + + public bool IsUseProxy + => StatusCode == HttpStatusCode.UseProxy; + + public bool IsUnused + => StatusCode == HttpStatusCode.Unused; + + public bool IsRedirectKeepVerb + => StatusCode == HttpStatusCode.RedirectKeepVerb; + + public bool IsPermanentRedirect + => StatusCode == HttpStatusCode.PermanentRedirect; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public bool IsPaymentRequired + => StatusCode == HttpStatusCode.PaymentRequired; + + public bool IsForbidden + => StatusCode == HttpStatusCode.Forbidden; + + public bool IsNotFound + => StatusCode == HttpStatusCode.NotFound; + + public bool IsMethodNotAllowed + => StatusCode == HttpStatusCode.MethodNotAllowed; + + public bool IsNotAcceptable + => StatusCode == HttpStatusCode.NotAcceptable; + + public bool IsProxyAuthenticationRequired + => StatusCode == HttpStatusCode.ProxyAuthenticationRequired; + + public bool IsRequestTimeout + => StatusCode == HttpStatusCode.RequestTimeout; + + public bool IsConflict + => StatusCode == HttpStatusCode.Conflict; + + public bool IsGone + => StatusCode == HttpStatusCode.Gone; + + public bool IsLengthRequired + => StatusCode == HttpStatusCode.LengthRequired; + + public bool IsPreconditionFailed + => StatusCode == HttpStatusCode.PreconditionFailed; + + public bool IsRequestEntityTooLarge + => StatusCode == HttpStatusCode.RequestEntityTooLarge; + + public bool IsRequestUriTooLong + => StatusCode == HttpStatusCode.RequestUriTooLong; + + public bool IsUnsupportedMediaType + => StatusCode == HttpStatusCode.UnsupportedMediaType; + + public bool IsRequestedRangeNotSatisfiable + => StatusCode == HttpStatusCode.RequestedRangeNotSatisfiable; + + public bool IsExpectationFailed + => StatusCode == HttpStatusCode.ExpectationFailed; + + public bool IsMisdirectedRequest + => StatusCode == HttpStatusCode.MisdirectedRequest; + + public bool IsUnprocessableEntity + => StatusCode == HttpStatusCode.UnprocessableEntity; + + public bool IsLocked + => StatusCode == HttpStatusCode.Locked; + + public bool IsFailedDependency + => StatusCode == HttpStatusCode.FailedDependency; + + public bool IsUpgradeRequired + => StatusCode == HttpStatusCode.UpgradeRequired; + + public bool IsPreconditionRequired + => StatusCode == HttpStatusCode.PreconditionRequired; + + public bool IsTooManyRequests + => StatusCode == HttpStatusCode.TooManyRequests; + + public bool IsRequestHeaderFieldsTooLarge + => StatusCode == HttpStatusCode.RequestHeaderFieldsTooLarge; + + public bool IsUnavailableForLegalReasons + => StatusCode == HttpStatusCode.UnavailableForLegalReasons; + + public bool IsInternalServerError + => StatusCode == HttpStatusCode.InternalServerError; + + public bool IsNotImplemented + => StatusCode == HttpStatusCode.NotImplemented; + + public bool IsBadGateway + => StatusCode == HttpStatusCode.BadGateway; + + public bool IsServiceUnavailable + => StatusCode == HttpStatusCode.ServiceUnavailable; + + public bool IsGatewayTimeout + => StatusCode == HttpStatusCode.GatewayTimeout; + + public bool IsHttpVersionNotSupported + => StatusCode == HttpStatusCode.HttpVersionNotSupported; + + public bool IsVariantAlsoNegotiates + => StatusCode == HttpStatusCode.VariantAlsoNegotiates; + + public bool IsInsufficientStorage + => StatusCode == HttpStatusCode.InsufficientStorage; + + public bool IsLoopDetected + => StatusCode == HttpStatusCode.LoopDetected; + + public bool IsNotExtended + => StatusCode == HttpStatusCode.NotExtended; + + public bool IsNetworkAuthenticationRequired + => StatusCode == HttpStatusCode.NetworkAuthenticationRequired; + + public string? ContinueContent + => IsContinue && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsContinue property first."); + + public string? SwitchingProtocolsContent + => IsSwitchingProtocols && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsSwitchingProtocols property first."); + + public string? ProcessingContent + => IsProcessing && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsProcessing property first."); + + public ExampleModel OkContent + => IsOk && ContentObject is ExampleModel result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public string? CreatedContent + => IsCreated && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsCreated property first."); + + public string? AcceptedContent + => IsAccepted && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsAccepted property first."); + + public string? NonAuthoritativeInformationContent + => IsNonAuthoritativeInformation && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsNonAuthoritativeInformation property first."); + + public string? NoContentContent + => IsNoContent && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsNoContent property first."); + + public string? ResetContentContent + => IsResetContent && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsResetContent property first."); + + public string? PartialContentContent + => IsPartialContent && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsPartialContent property first."); + + public string? MultiStatusContent + => IsMultiStatus && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsMultiStatus property first."); + + public string? AlreadyReportedContent + => IsAlreadyReported && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsAlreadyReported property first."); + + public string? ImUsedContent + => IsImUsed && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsImUsed property first."); + + public string? MultipleChoicesContent + => IsMultipleChoices && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsMultipleChoices property first."); + + public string? MovedPermanentlyContent + => IsMovedPermanently && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsMovedPermanently property first."); + + public string? FoundContent + => IsFound && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsFound property first."); + + public string? SeeOtherContent + => IsSeeOther && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsSeeOther property first."); + + public string? NotModifiedContent + => IsNotModified && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsNotModified property first."); + + public string? UseProxyContent + => IsUseProxy && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUseProxy property first."); + + public string? UnusedContent + => IsUnused && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnused property first."); + + public string? RedirectKeepVerbContent + => IsRedirectKeepVerb && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsRedirectKeepVerb property first."); + + public string? PermanentRedirectContent + => IsPermanentRedirect && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsPermanentRedirect property first."); + + public string? BadRequestContent + => IsBadRequest && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public string? UnauthorizedContent + => IsUnauthorized && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); + + public string? PaymentRequiredContent + => IsPaymentRequired && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsPaymentRequired property first."); + + public string? ForbiddenContent + => IsForbidden && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsForbidden property first."); + + public string? NotFoundContent + => IsNotFound && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsNotFound property first."); + + public string? MethodNotAllowedContent + => IsMethodNotAllowed && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsMethodNotAllowed property first."); + + public string? NotAcceptableContent + => IsNotAcceptable && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsNotAcceptable property first."); + + public string? ProxyAuthenticationRequiredContent + => IsProxyAuthenticationRequired && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsProxyAuthenticationRequired property first."); + + public string? RequestTimeoutContent + => IsRequestTimeout && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsRequestTimeout property first."); + + public string? ConflictContent + => IsConflict && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsConflict property first."); + + public string? GoneContent + => IsGone && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsGone property first."); + + public string? LengthRequiredContent + => IsLengthRequired && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsLengthRequired property first."); + + public string? PreconditionFailedContent + => IsPreconditionFailed && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsPreconditionFailed property first."); + + public string? RequestEntityTooLargeContent + => IsRequestEntityTooLarge && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsRequestEntityTooLarge property first."); + + public string? RequestUriTooLongContent + => IsRequestUriTooLong && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsRequestUriTooLong property first."); + + public string? UnsupportedMediaTypeContent + => IsUnsupportedMediaType && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnsupportedMediaType property first."); + + public string? RequestedRangeNotSatisfiableContent + => IsRequestedRangeNotSatisfiable && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsRequestedRangeNotSatisfiable property first."); + + public string? ExpectationFailedContent + => IsExpectationFailed && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsExpectationFailed property first."); + + public string? MisdirectedRequestContent + => IsMisdirectedRequest && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsMisdirectedRequest property first."); + + public string? UnprocessableEntityContent + => IsUnprocessableEntity && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnprocessableEntity property first."); + + public string? LockedContent + => IsLocked && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsLocked property first."); + + public string? FailedDependencyContent + => IsFailedDependency && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsFailedDependency property first."); + + public string? UpgradeRequiredContent + => IsUpgradeRequired && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUpgradeRequired property first."); + + public string? PreconditionRequiredContent + => IsPreconditionRequired && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsPreconditionRequired property first."); + + public string? TooManyRequestsContent + => IsTooManyRequests && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsTooManyRequests property first."); + + public string? RequestHeaderFieldsTooLargeContent + => IsRequestHeaderFieldsTooLarge && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsRequestHeaderFieldsTooLarge property first."); + + public string? UnavailableForLegalReasonsContent + => IsUnavailableForLegalReasons && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnavailableForLegalReasons property first."); + + public string? InternalServerErrorContent + => IsInternalServerError && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsInternalServerError property first."); + + public string? NotImplementedContent + => IsNotImplemented && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsNotImplemented property first."); + + public string? BadGatewayContent + => IsBadGateway && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadGateway property first."); + + public string? ServiceUnavailableContent + => IsServiceUnavailable && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsServiceUnavailable property first."); + + public string? GatewayTimeoutContent + => IsGatewayTimeout && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsGatewayTimeout property first."); + + public string? HttpVersionNotSupportedContent + => IsHttpVersionNotSupported && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsHttpVersionNotSupported property first."); + + public string? VariantAlsoNegotiatesContent + => IsVariantAlsoNegotiates && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsVariantAlsoNegotiates property first."); + + public string? InsufficientStorageContent + => IsInsufficientStorage && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsInsufficientStorage property first."); + + public string? LoopDetectedContent + => IsLoopDetected && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsLoopDetected property first."); + + public string? NotExtendedContent + => IsNotExtended && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsNotExtended property first."); + + public string? NetworkAuthenticationRequiredContent + => IsNetworkAuthenticationRequired && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsNetworkAuthenticationRequired property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyClient/WOPD/src/ExAllResponseTypes.ApiClient.Generated/Endpoints/Example/Interfaces/IGetExampleEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyClient/WOPD/src/ExAllResponseTypes.ApiClient.Generated/Endpoints/Example/Interfaces/IGetExampleEndpoint.verified.cs new file mode 100644 index 00000000..3e269856 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyClient/WOPD/src/ExAllResponseTypes.ApiClient.Generated/Endpoints/Example/Interfaces/IGetExampleEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExAllResponseTypes.ApiClient.Generated.Endpoints.Example.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Example endpoint. +/// Operation: GetExample. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetExampleEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + GetExampleParameters parameters, + string httpClientName = "ExAllResponseTypes-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyClient/WOPD/src/ExAllResponseTypes.ApiClient.Generated/Endpoints/Example/Interfaces/IGetExampleEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyClient/WOPD/src/ExAllResponseTypes.ApiClient.Generated/Endpoints/Example/Interfaces/IGetExampleEndpointResult.verified.cs new file mode 100644 index 00000000..b37101b6 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyClient/WOPD/src/ExAllResponseTypes.ApiClient.Generated/Endpoints/Example/Interfaces/IGetExampleEndpointResult.verified.cs @@ -0,0 +1,259 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExAllResponseTypes.ApiClient.Generated.Endpoints.Example.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Example endpoint. +/// Operation: GetExample. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetExampleEndpointResult : IEndpointResponse +{ + + bool IsContinue { get; } + + bool IsSwitchingProtocols { get; } + + bool IsProcessing { get; } + + bool IsEarlyHints { get; } + + bool IsOk { get; } + + bool IsCreated { get; } + + bool IsAccepted { get; } + + bool IsNonAuthoritativeInformation { get; } + + bool IsNoContent { get; } + + bool IsResetContent { get; } + + bool IsPartialContent { get; } + + bool IsMultiStatus { get; } + + bool IsAlreadyReported { get; } + + bool IsImUsed { get; } + + bool IsMultipleChoices { get; } + + bool IsMovedPermanently { get; } + + bool IsFound { get; } + + bool IsSeeOther { get; } + + bool IsNotModified { get; } + + bool IsUseProxy { get; } + + bool IsUnused { get; } + + bool IsRedirectKeepVerb { get; } + + bool IsPermanentRedirect { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + bool IsPaymentRequired { get; } + + bool IsForbidden { get; } + + bool IsNotFound { get; } + + bool IsMethodNotAllowed { get; } + + bool IsNotAcceptable { get; } + + bool IsProxyAuthenticationRequired { get; } + + bool IsRequestTimeout { get; } + + bool IsConflict { get; } + + bool IsGone { get; } + + bool IsLengthRequired { get; } + + bool IsPreconditionFailed { get; } + + bool IsRequestEntityTooLarge { get; } + + bool IsRequestUriTooLong { get; } + + bool IsUnsupportedMediaType { get; } + + bool IsRequestedRangeNotSatisfiable { get; } + + bool IsExpectationFailed { get; } + + bool IsMisdirectedRequest { get; } + + bool IsUnprocessableEntity { get; } + + bool IsLocked { get; } + + bool IsFailedDependency { get; } + + bool IsUpgradeRequired { get; } + + bool IsPreconditionRequired { get; } + + bool IsTooManyRequests { get; } + + bool IsRequestHeaderFieldsTooLarge { get; } + + bool IsUnavailableForLegalReasons { get; } + + bool IsInternalServerError { get; } + + bool IsNotImplemented { get; } + + bool IsBadGateway { get; } + + bool IsServiceUnavailable { get; } + + bool IsGatewayTimeout { get; } + + bool IsHttpVersionNotSupported { get; } + + bool IsVariantAlsoNegotiates { get; } + + bool IsInsufficientStorage { get; } + + bool IsLoopDetected { get; } + + bool IsNotExtended { get; } + + bool IsNetworkAuthenticationRequired { get; } + + string? ContinueContent { get; } + + string? SwitchingProtocolsContent { get; } + + string? ProcessingContent { get; } + + ExampleModel OkContent { get; } + + string? CreatedContent { get; } + + string? AcceptedContent { get; } + + string? NonAuthoritativeInformationContent { get; } + + string? NoContentContent { get; } + + string? ResetContentContent { get; } + + string? PartialContentContent { get; } + + string? MultiStatusContent { get; } + + string? AlreadyReportedContent { get; } + + string? ImUsedContent { get; } + + string? MultipleChoicesContent { get; } + + string? MovedPermanentlyContent { get; } + + string? FoundContent { get; } + + string? SeeOtherContent { get; } + + string? NotModifiedContent { get; } + + string? UseProxyContent { get; } + + string? UnusedContent { get; } + + string? RedirectKeepVerbContent { get; } + + string? PermanentRedirectContent { get; } + + string? BadRequestContent { get; } + + string? UnauthorizedContent { get; } + + string? PaymentRequiredContent { get; } + + string? ForbiddenContent { get; } + + string? NotFoundContent { get; } + + string? MethodNotAllowedContent { get; } + + string? NotAcceptableContent { get; } + + string? ProxyAuthenticationRequiredContent { get; } + + string? RequestTimeoutContent { get; } + + string? ConflictContent { get; } + + string? GoneContent { get; } + + string? LengthRequiredContent { get; } + + string? PreconditionFailedContent { get; } + + string? RequestEntityTooLargeContent { get; } + + string? RequestUriTooLongContent { get; } + + string? UnsupportedMediaTypeContent { get; } + + string? RequestedRangeNotSatisfiableContent { get; } + + string? ExpectationFailedContent { get; } + + string? MisdirectedRequestContent { get; } + + string? UnprocessableEntityContent { get; } + + string? LockedContent { get; } + + string? FailedDependencyContent { get; } + + string? UpgradeRequiredContent { get; } + + string? PreconditionRequiredContent { get; } + + string? TooManyRequestsContent { get; } + + string? RequestHeaderFieldsTooLargeContent { get; } + + string? UnavailableForLegalReasonsContent { get; } + + string? InternalServerErrorContent { get; } + + string? NotImplementedContent { get; } + + string? BadGatewayContent { get; } + + string? ServiceUnavailableContent { get; } + + string? GatewayTimeoutContent { get; } + + string? HttpVersionNotSupportedContent { get; } + + string? VariantAlsoNegotiatesContent { get; } + + string? InsufficientStorageContent { get; } + + string? LoopDetectedContent { get; } + + string? NotExtendedContent { get; } + + string? NetworkAuthenticationRequiredContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyClient/WOPD/src/ExAllResponseTypes.ApiClient.Generated/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyClient/WOPD/src/ExAllResponseTypes.ApiClient.Generated/GlobalUsings.verified.cs new file mode 100644 index 00000000..8f8f8748 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyClient/WOPD/src/ExAllResponseTypes.ApiClient.Generated/GlobalUsings.verified.cs @@ -0,0 +1,15 @@ +global using System; +global using System.CodeDom.Compiler; +global using System.ComponentModel.DataAnnotations; +global using System.Net; +global using System.Net.Http; +global using System.Threading; +global using System.Threading.Tasks; + +global using Atc.Rest.Client; +global using Atc.Rest.Client.Builder; + +global using ExAllResponseTypes.ApiClient.Generated.Contracts.Example; +global using ExAllResponseTypes.ApiClient.Generated.Endpoints.Example.Interfaces; + +global using Microsoft.AspNetCore.Mvc; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyClient/WPD/src/ExAllResponseTypes.ApiClient.Generated/Contracts/Example/ExampleModel.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyClient/WPD/src/ExAllResponseTypes.ApiClient.Generated/Contracts/Example/ExampleModel.verified.cs new file mode 100644 index 00000000..804f0093 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyClient/WPD/src/ExAllResponseTypes.ApiClient.Generated/Contracts/Example/ExampleModel.verified.cs @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExAllResponseTypes.ApiClient.Generated.Contracts.Example; + +/// +/// Example-Model. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ExampleModel +{ + public string Property1 { get; set; } + + public int Property2 { get; set; } + + public bool Property3 { get; set; } + + /// + public override string ToString() + => $"{nameof(Property1)}: {Property1}, {nameof(Property2)}: {Property2}, {nameof(Property3)}: {Property3}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyClient/WPD/src/ExAllResponseTypes.ApiClient.Generated/Contracts/Example/RequestParameters/GetExampleParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyClient/WPD/src/ExAllResponseTypes.ApiClient.Generated/Contracts/Example/RequestParameters/GetExampleParameters.verified.cs new file mode 100644 index 00000000..bd06c9cd --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyClient/WPD/src/ExAllResponseTypes.ApiClient.Generated/Contracts/Example/RequestParameters/GetExampleParameters.verified.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExAllResponseTypes.ApiClient.Generated.Contracts.Example; + +/// +/// Parameters for operation request. +/// Description: Example endpoint. +/// Operation: GetExample. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetExampleParameters +{ + /// + /// The email for filter orders to retrieve. + /// + /// + /// Email validation being enforced. + /// + [EmailAddress] + public string MyEmail { get; set; } + + /// + public override string ToString() + => $"{nameof(MyEmail)}: {MyEmail}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyClient/WPD/src/ExAllResponseTypes.ApiClient.Generated/Endpoints/Example/GetExampleEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyClient/WPD/src/ExAllResponseTypes.ApiClient.Generated/Endpoints/Example/GetExampleEndpoint.verified.cs new file mode 100644 index 00000000..97ae02c9 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyClient/WPD/src/ExAllResponseTypes.ApiClient.Generated/Endpoints/Example/GetExampleEndpoint.verified.cs @@ -0,0 +1,105 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExAllResponseTypes.ApiClient.Generated.Endpoints.Example; + +/// +/// Client Endpoint. +/// Description: Example endpoint. +/// Operation: GetExample. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetExampleEndpoint : IGetExampleEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public GetExampleEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + GetExampleParameters parameters, + string httpClientName = "ExAllResponseTypes-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/example"); + requestBuilder.WithQueryParameter("myEmail", parameters.MyEmail); + + using var requestMessage = requestBuilder.Build(HttpMethod.Get); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddErrorResponse(HttpStatusCode.Continue); + responseBuilder.AddErrorResponse(HttpStatusCode.SwitchingProtocols); + responseBuilder.AddErrorResponse(HttpStatusCode.Processing); + responseBuilder.AddErrorResponse(HttpStatusCode.EarlyHints); + responseBuilder.AddSuccessResponse(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.Created); + responseBuilder.AddErrorResponse(HttpStatusCode.Accepted); + responseBuilder.AddErrorResponse(HttpStatusCode.NonAuthoritativeInformation); + responseBuilder.AddErrorResponse(HttpStatusCode.NoContent); + responseBuilder.AddErrorResponse(HttpStatusCode.ResetContent); + responseBuilder.AddErrorResponse(HttpStatusCode.PartialContent); + responseBuilder.AddErrorResponse(HttpStatusCode.MultiStatus); + responseBuilder.AddErrorResponse(HttpStatusCode.AlreadyReported); + responseBuilder.AddErrorResponse(HttpStatusCode.IMUsed); + responseBuilder.AddErrorResponse(HttpStatusCode.MultipleChoices); + responseBuilder.AddErrorResponse(HttpStatusCode.MovedPermanently); + responseBuilder.AddErrorResponse(HttpStatusCode.Found); + responseBuilder.AddErrorResponse(HttpStatusCode.SeeOther); + responseBuilder.AddErrorResponse(HttpStatusCode.NotModified); + responseBuilder.AddErrorResponse(HttpStatusCode.UseProxy); + responseBuilder.AddErrorResponse(HttpStatusCode.Unused); + responseBuilder.AddErrorResponse(HttpStatusCode.RedirectKeepVerb); + responseBuilder.AddErrorResponse(HttpStatusCode.PermanentRedirect); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + responseBuilder.AddErrorResponse(HttpStatusCode.PaymentRequired); + responseBuilder.AddErrorResponse(HttpStatusCode.Forbidden); + responseBuilder.AddErrorResponse(HttpStatusCode.NotFound); + responseBuilder.AddErrorResponse(HttpStatusCode.MethodNotAllowed); + responseBuilder.AddErrorResponse(HttpStatusCode.NotAcceptable); + responseBuilder.AddErrorResponse(HttpStatusCode.ProxyAuthenticationRequired); + responseBuilder.AddErrorResponse(HttpStatusCode.RequestTimeout); + responseBuilder.AddErrorResponse(HttpStatusCode.Conflict); + responseBuilder.AddErrorResponse(HttpStatusCode.Gone); + responseBuilder.AddErrorResponse(HttpStatusCode.LengthRequired); + responseBuilder.AddErrorResponse(HttpStatusCode.PreconditionFailed); + responseBuilder.AddErrorResponse(HttpStatusCode.RequestEntityTooLarge); + responseBuilder.AddErrorResponse(HttpStatusCode.RequestUriTooLong); + responseBuilder.AddErrorResponse(HttpStatusCode.UnsupportedMediaType); + responseBuilder.AddErrorResponse(HttpStatusCode.RequestedRangeNotSatisfiable); + responseBuilder.AddErrorResponse(HttpStatusCode.ExpectationFailed); + responseBuilder.AddErrorResponse(HttpStatusCode.MisdirectedRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.UnprocessableEntity); + responseBuilder.AddErrorResponse(HttpStatusCode.Locked); + responseBuilder.AddErrorResponse(HttpStatusCode.FailedDependency); + responseBuilder.AddErrorResponse(HttpStatusCode.UpgradeRequired); + responseBuilder.AddErrorResponse(HttpStatusCode.PreconditionRequired); + responseBuilder.AddErrorResponse(HttpStatusCode.TooManyRequests); + responseBuilder.AddErrorResponse(HttpStatusCode.RequestHeaderFieldsTooLarge); + responseBuilder.AddErrorResponse(HttpStatusCode.UnavailableForLegalReasons); + responseBuilder.AddErrorResponse(HttpStatusCode.InternalServerError); + responseBuilder.AddErrorResponse(HttpStatusCode.NotImplemented); + responseBuilder.AddErrorResponse(HttpStatusCode.BadGateway); + responseBuilder.AddErrorResponse(HttpStatusCode.ServiceUnavailable); + responseBuilder.AddErrorResponse(HttpStatusCode.GatewayTimeout); + responseBuilder.AddErrorResponse(HttpStatusCode.HttpVersionNotSupported); + responseBuilder.AddErrorResponse(HttpStatusCode.VariantAlsoNegotiates); + responseBuilder.AddErrorResponse(HttpStatusCode.InsufficientStorage); + responseBuilder.AddErrorResponse(HttpStatusCode.LoopDetected); + responseBuilder.AddErrorResponse(HttpStatusCode.NotExtended); + responseBuilder.AddErrorResponse(HttpStatusCode.NetworkAuthenticationRequired); + return await responseBuilder.BuildResponseAsync(x => new GetExampleEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyClient/WPD/src/ExAllResponseTypes.ApiClient.Generated/Endpoints/Example/GetExampleEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyClient/WPD/src/ExAllResponseTypes.ApiClient.Generated/Endpoints/Example/GetExampleEndpointResult.verified.cs new file mode 100644 index 00000000..3496c5db --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyClient/WPD/src/ExAllResponseTypes.ApiClient.Generated/Endpoints/Example/GetExampleEndpointResult.verified.cs @@ -0,0 +1,504 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExAllResponseTypes.ApiClient.Generated.Endpoints.Example; + +/// +/// Client Endpoint result. +/// Description: Example endpoint. +/// Operation: GetExample. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetExampleEndpointResult : EndpointResponse, IGetExampleEndpointResult +{ + public GetExampleEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsContinue + => StatusCode == HttpStatusCode.Continue; + + public bool IsSwitchingProtocols + => StatusCode == HttpStatusCode.SwitchingProtocols; + + public bool IsProcessing + => StatusCode == HttpStatusCode.Processing; + + public bool IsEarlyHints + => StatusCode == HttpStatusCode.EarlyHints; + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsCreated + => StatusCode == HttpStatusCode.Created; + + public bool IsAccepted + => StatusCode == HttpStatusCode.Accepted; + + public bool IsNonAuthoritativeInformation + => StatusCode == HttpStatusCode.NonAuthoritativeInformation; + + public bool IsNoContent + => StatusCode == HttpStatusCode.NoContent; + + public bool IsResetContent + => StatusCode == HttpStatusCode.ResetContent; + + public bool IsPartialContent + => StatusCode == HttpStatusCode.PartialContent; + + public bool IsMultiStatus + => StatusCode == HttpStatusCode.MultiStatus; + + public bool IsAlreadyReported + => StatusCode == HttpStatusCode.AlreadyReported; + + public bool IsImUsed + => StatusCode == HttpStatusCode.IMUsed; + + public bool IsMultipleChoices + => StatusCode == HttpStatusCode.MultipleChoices; + + public bool IsMovedPermanently + => StatusCode == HttpStatusCode.MovedPermanently; + + public bool IsFound + => StatusCode == HttpStatusCode.Found; + + public bool IsSeeOther + => StatusCode == HttpStatusCode.SeeOther; + + public bool IsNotModified + => StatusCode == HttpStatusCode.NotModified; + + public bool IsUseProxy + => StatusCode == HttpStatusCode.UseProxy; + + public bool IsUnused + => StatusCode == HttpStatusCode.Unused; + + public bool IsRedirectKeepVerb + => StatusCode == HttpStatusCode.RedirectKeepVerb; + + public bool IsPermanentRedirect + => StatusCode == HttpStatusCode.PermanentRedirect; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public bool IsPaymentRequired + => StatusCode == HttpStatusCode.PaymentRequired; + + public bool IsForbidden + => StatusCode == HttpStatusCode.Forbidden; + + public bool IsNotFound + => StatusCode == HttpStatusCode.NotFound; + + public bool IsMethodNotAllowed + => StatusCode == HttpStatusCode.MethodNotAllowed; + + public bool IsNotAcceptable + => StatusCode == HttpStatusCode.NotAcceptable; + + public bool IsProxyAuthenticationRequired + => StatusCode == HttpStatusCode.ProxyAuthenticationRequired; + + public bool IsRequestTimeout + => StatusCode == HttpStatusCode.RequestTimeout; + + public bool IsConflict + => StatusCode == HttpStatusCode.Conflict; + + public bool IsGone + => StatusCode == HttpStatusCode.Gone; + + public bool IsLengthRequired + => StatusCode == HttpStatusCode.LengthRequired; + + public bool IsPreconditionFailed + => StatusCode == HttpStatusCode.PreconditionFailed; + + public bool IsRequestEntityTooLarge + => StatusCode == HttpStatusCode.RequestEntityTooLarge; + + public bool IsRequestUriTooLong + => StatusCode == HttpStatusCode.RequestUriTooLong; + + public bool IsUnsupportedMediaType + => StatusCode == HttpStatusCode.UnsupportedMediaType; + + public bool IsRequestedRangeNotSatisfiable + => StatusCode == HttpStatusCode.RequestedRangeNotSatisfiable; + + public bool IsExpectationFailed + => StatusCode == HttpStatusCode.ExpectationFailed; + + public bool IsMisdirectedRequest + => StatusCode == HttpStatusCode.MisdirectedRequest; + + public bool IsUnprocessableEntity + => StatusCode == HttpStatusCode.UnprocessableEntity; + + public bool IsLocked + => StatusCode == HttpStatusCode.Locked; + + public bool IsFailedDependency + => StatusCode == HttpStatusCode.FailedDependency; + + public bool IsUpgradeRequired + => StatusCode == HttpStatusCode.UpgradeRequired; + + public bool IsPreconditionRequired + => StatusCode == HttpStatusCode.PreconditionRequired; + + public bool IsTooManyRequests + => StatusCode == HttpStatusCode.TooManyRequests; + + public bool IsRequestHeaderFieldsTooLarge + => StatusCode == HttpStatusCode.RequestHeaderFieldsTooLarge; + + public bool IsUnavailableForLegalReasons + => StatusCode == HttpStatusCode.UnavailableForLegalReasons; + + public bool IsInternalServerError + => StatusCode == HttpStatusCode.InternalServerError; + + public bool IsNotImplemented + => StatusCode == HttpStatusCode.NotImplemented; + + public bool IsBadGateway + => StatusCode == HttpStatusCode.BadGateway; + + public bool IsServiceUnavailable + => StatusCode == HttpStatusCode.ServiceUnavailable; + + public bool IsGatewayTimeout + => StatusCode == HttpStatusCode.GatewayTimeout; + + public bool IsHttpVersionNotSupported + => StatusCode == HttpStatusCode.HttpVersionNotSupported; + + public bool IsVariantAlsoNegotiates + => StatusCode == HttpStatusCode.VariantAlsoNegotiates; + + public bool IsInsufficientStorage + => StatusCode == HttpStatusCode.InsufficientStorage; + + public bool IsLoopDetected + => StatusCode == HttpStatusCode.LoopDetected; + + public bool IsNotExtended + => StatusCode == HttpStatusCode.NotExtended; + + public bool IsNetworkAuthenticationRequired + => StatusCode == HttpStatusCode.NetworkAuthenticationRequired; + + public ProblemDetails ContinueContent + => IsContinue && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsContinue property first."); + + public ProblemDetails SwitchingProtocolsContent + => IsSwitchingProtocols && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsSwitchingProtocols property first."); + + public ProblemDetails ProcessingContent + => IsProcessing && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsProcessing property first."); + + public ExampleModel OkContent + => IsOk && ContentObject is ExampleModel result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public ProblemDetails CreatedContent + => IsCreated && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsCreated property first."); + + public ProblemDetails AcceptedContent + => IsAccepted && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsAccepted property first."); + + public ProblemDetails NonAuthoritativeInformationContent + => IsNonAuthoritativeInformation && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsNonAuthoritativeInformation property first."); + + public ProblemDetails NoContentContent + => IsNoContent && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsNoContent property first."); + + public ProblemDetails ResetContentContent + => IsResetContent && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsResetContent property first."); + + public ProblemDetails PartialContentContent + => IsPartialContent && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsPartialContent property first."); + + public ProblemDetails MultiStatusContent + => IsMultiStatus && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsMultiStatus property first."); + + public ProblemDetails AlreadyReportedContent + => IsAlreadyReported && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsAlreadyReported property first."); + + public ProblemDetails ImUsedContent + => IsImUsed && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsImUsed property first."); + + public ProblemDetails MultipleChoicesContent + => IsMultipleChoices && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsMultipleChoices property first."); + + public ProblemDetails MovedPermanentlyContent + => IsMovedPermanently && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsMovedPermanently property first."); + + public ProblemDetails FoundContent + => IsFound && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsFound property first."); + + public ProblemDetails SeeOtherContent + => IsSeeOther && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsSeeOther property first."); + + public ProblemDetails NotModifiedContent + => IsNotModified && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsNotModified property first."); + + public ProblemDetails UseProxyContent + => IsUseProxy && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUseProxy property first."); + + public ProblemDetails UnusedContent + => IsUnused && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnused property first."); + + public ProblemDetails RedirectKeepVerbContent + => IsRedirectKeepVerb && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsRedirectKeepVerb property first."); + + public ProblemDetails PermanentRedirectContent + => IsPermanentRedirect && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsPermanentRedirect property first."); + + public ValidationProblemDetails BadRequestContent + => IsBadRequest && ContentObject is ValidationProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public ProblemDetails UnauthorizedContent + => IsUnauthorized && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); + + public ProblemDetails PaymentRequiredContent + => IsPaymentRequired && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsPaymentRequired property first."); + + public ProblemDetails ForbiddenContent + => IsForbidden && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsForbidden property first."); + + public ProblemDetails NotFoundContent + => IsNotFound && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsNotFound property first."); + + public ProblemDetails MethodNotAllowedContent + => IsMethodNotAllowed && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsMethodNotAllowed property first."); + + public ProblemDetails NotAcceptableContent + => IsNotAcceptable && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsNotAcceptable property first."); + + public ProblemDetails ProxyAuthenticationRequiredContent + => IsProxyAuthenticationRequired && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsProxyAuthenticationRequired property first."); + + public ProblemDetails RequestTimeoutContent + => IsRequestTimeout && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsRequestTimeout property first."); + + public ProblemDetails ConflictContent + => IsConflict && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsConflict property first."); + + public ProblemDetails GoneContent + => IsGone && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsGone property first."); + + public ProblemDetails LengthRequiredContent + => IsLengthRequired && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsLengthRequired property first."); + + public ProblemDetails PreconditionFailedContent + => IsPreconditionFailed && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsPreconditionFailed property first."); + + public ProblemDetails RequestEntityTooLargeContent + => IsRequestEntityTooLarge && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsRequestEntityTooLarge property first."); + + public ProblemDetails RequestUriTooLongContent + => IsRequestUriTooLong && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsRequestUriTooLong property first."); + + public ProblemDetails UnsupportedMediaTypeContent + => IsUnsupportedMediaType && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnsupportedMediaType property first."); + + public ProblemDetails RequestedRangeNotSatisfiableContent + => IsRequestedRangeNotSatisfiable && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsRequestedRangeNotSatisfiable property first."); + + public ProblemDetails ExpectationFailedContent + => IsExpectationFailed && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsExpectationFailed property first."); + + public ProblemDetails MisdirectedRequestContent + => IsMisdirectedRequest && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsMisdirectedRequest property first."); + + public ProblemDetails UnprocessableEntityContent + => IsUnprocessableEntity && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnprocessableEntity property first."); + + public ProblemDetails LockedContent + => IsLocked && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsLocked property first."); + + public ProblemDetails FailedDependencyContent + => IsFailedDependency && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsFailedDependency property first."); + + public ProblemDetails UpgradeRequiredContent + => IsUpgradeRequired && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUpgradeRequired property first."); + + public ProblemDetails PreconditionRequiredContent + => IsPreconditionRequired && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsPreconditionRequired property first."); + + public ProblemDetails TooManyRequestsContent + => IsTooManyRequests && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsTooManyRequests property first."); + + public ProblemDetails RequestHeaderFieldsTooLargeContent + => IsRequestHeaderFieldsTooLarge && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsRequestHeaderFieldsTooLarge property first."); + + public ProblemDetails UnavailableForLegalReasonsContent + => IsUnavailableForLegalReasons && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnavailableForLegalReasons property first."); + + public ProblemDetails InternalServerErrorContent + => IsInternalServerError && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsInternalServerError property first."); + + public ProblemDetails NotImplementedContent + => IsNotImplemented && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsNotImplemented property first."); + + public ProblemDetails BadGatewayContent + => IsBadGateway && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadGateway property first."); + + public ProblemDetails ServiceUnavailableContent + => IsServiceUnavailable && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsServiceUnavailable property first."); + + public ProblemDetails GatewayTimeoutContent + => IsGatewayTimeout && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsGatewayTimeout property first."); + + public ProblemDetails HttpVersionNotSupportedContent + => IsHttpVersionNotSupported && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsHttpVersionNotSupported property first."); + + public ProblemDetails VariantAlsoNegotiatesContent + => IsVariantAlsoNegotiates && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsVariantAlsoNegotiates property first."); + + public ProblemDetails InsufficientStorageContent + => IsInsufficientStorage && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsInsufficientStorage property first."); + + public ProblemDetails LoopDetectedContent + => IsLoopDetected && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsLoopDetected property first."); + + public ProblemDetails NotExtendedContent + => IsNotExtended && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsNotExtended property first."); + + public ProblemDetails NetworkAuthenticationRequiredContent + => IsNetworkAuthenticationRequired && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsNetworkAuthenticationRequired property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyClient/WPD/src/ExAllResponseTypes.ApiClient.Generated/Endpoints/Example/Interfaces/IGetExampleEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyClient/WPD/src/ExAllResponseTypes.ApiClient.Generated/Endpoints/Example/Interfaces/IGetExampleEndpoint.verified.cs new file mode 100644 index 00000000..3e269856 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyClient/WPD/src/ExAllResponseTypes.ApiClient.Generated/Endpoints/Example/Interfaces/IGetExampleEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExAllResponseTypes.ApiClient.Generated.Endpoints.Example.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Example endpoint. +/// Operation: GetExample. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetExampleEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + GetExampleParameters parameters, + string httpClientName = "ExAllResponseTypes-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyClient/WPD/src/ExAllResponseTypes.ApiClient.Generated/Endpoints/Example/Interfaces/IGetExampleEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyClient/WPD/src/ExAllResponseTypes.ApiClient.Generated/Endpoints/Example/Interfaces/IGetExampleEndpointResult.verified.cs new file mode 100644 index 00000000..641bbccc --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyClient/WPD/src/ExAllResponseTypes.ApiClient.Generated/Endpoints/Example/Interfaces/IGetExampleEndpointResult.verified.cs @@ -0,0 +1,259 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExAllResponseTypes.ApiClient.Generated.Endpoints.Example.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Example endpoint. +/// Operation: GetExample. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetExampleEndpointResult : IEndpointResponse +{ + + bool IsContinue { get; } + + bool IsSwitchingProtocols { get; } + + bool IsProcessing { get; } + + bool IsEarlyHints { get; } + + bool IsOk { get; } + + bool IsCreated { get; } + + bool IsAccepted { get; } + + bool IsNonAuthoritativeInformation { get; } + + bool IsNoContent { get; } + + bool IsResetContent { get; } + + bool IsPartialContent { get; } + + bool IsMultiStatus { get; } + + bool IsAlreadyReported { get; } + + bool IsImUsed { get; } + + bool IsMultipleChoices { get; } + + bool IsMovedPermanently { get; } + + bool IsFound { get; } + + bool IsSeeOther { get; } + + bool IsNotModified { get; } + + bool IsUseProxy { get; } + + bool IsUnused { get; } + + bool IsRedirectKeepVerb { get; } + + bool IsPermanentRedirect { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + bool IsPaymentRequired { get; } + + bool IsForbidden { get; } + + bool IsNotFound { get; } + + bool IsMethodNotAllowed { get; } + + bool IsNotAcceptable { get; } + + bool IsProxyAuthenticationRequired { get; } + + bool IsRequestTimeout { get; } + + bool IsConflict { get; } + + bool IsGone { get; } + + bool IsLengthRequired { get; } + + bool IsPreconditionFailed { get; } + + bool IsRequestEntityTooLarge { get; } + + bool IsRequestUriTooLong { get; } + + bool IsUnsupportedMediaType { get; } + + bool IsRequestedRangeNotSatisfiable { get; } + + bool IsExpectationFailed { get; } + + bool IsMisdirectedRequest { get; } + + bool IsUnprocessableEntity { get; } + + bool IsLocked { get; } + + bool IsFailedDependency { get; } + + bool IsUpgradeRequired { get; } + + bool IsPreconditionRequired { get; } + + bool IsTooManyRequests { get; } + + bool IsRequestHeaderFieldsTooLarge { get; } + + bool IsUnavailableForLegalReasons { get; } + + bool IsInternalServerError { get; } + + bool IsNotImplemented { get; } + + bool IsBadGateway { get; } + + bool IsServiceUnavailable { get; } + + bool IsGatewayTimeout { get; } + + bool IsHttpVersionNotSupported { get; } + + bool IsVariantAlsoNegotiates { get; } + + bool IsInsufficientStorage { get; } + + bool IsLoopDetected { get; } + + bool IsNotExtended { get; } + + bool IsNetworkAuthenticationRequired { get; } + + ProblemDetails ContinueContent { get; } + + ProblemDetails SwitchingProtocolsContent { get; } + + ProblemDetails ProcessingContent { get; } + + ExampleModel OkContent { get; } + + ProblemDetails CreatedContent { get; } + + ProblemDetails AcceptedContent { get; } + + ProblemDetails NonAuthoritativeInformationContent { get; } + + ProblemDetails NoContentContent { get; } + + ProblemDetails ResetContentContent { get; } + + ProblemDetails PartialContentContent { get; } + + ProblemDetails MultiStatusContent { get; } + + ProblemDetails AlreadyReportedContent { get; } + + ProblemDetails ImUsedContent { get; } + + ProblemDetails MultipleChoicesContent { get; } + + ProblemDetails MovedPermanentlyContent { get; } + + ProblemDetails FoundContent { get; } + + ProblemDetails SeeOtherContent { get; } + + ProblemDetails NotModifiedContent { get; } + + ProblemDetails UseProxyContent { get; } + + ProblemDetails UnusedContent { get; } + + ProblemDetails RedirectKeepVerbContent { get; } + + ProblemDetails PermanentRedirectContent { get; } + + ValidationProblemDetails BadRequestContent { get; } + + ProblemDetails UnauthorizedContent { get; } + + ProblemDetails PaymentRequiredContent { get; } + + ProblemDetails ForbiddenContent { get; } + + ProblemDetails NotFoundContent { get; } + + ProblemDetails MethodNotAllowedContent { get; } + + ProblemDetails NotAcceptableContent { get; } + + ProblemDetails ProxyAuthenticationRequiredContent { get; } + + ProblemDetails RequestTimeoutContent { get; } + + ProblemDetails ConflictContent { get; } + + ProblemDetails GoneContent { get; } + + ProblemDetails LengthRequiredContent { get; } + + ProblemDetails PreconditionFailedContent { get; } + + ProblemDetails RequestEntityTooLargeContent { get; } + + ProblemDetails RequestUriTooLongContent { get; } + + ProblemDetails UnsupportedMediaTypeContent { get; } + + ProblemDetails RequestedRangeNotSatisfiableContent { get; } + + ProblemDetails ExpectationFailedContent { get; } + + ProblemDetails MisdirectedRequestContent { get; } + + ProblemDetails UnprocessableEntityContent { get; } + + ProblemDetails LockedContent { get; } + + ProblemDetails FailedDependencyContent { get; } + + ProblemDetails UpgradeRequiredContent { get; } + + ProblemDetails PreconditionRequiredContent { get; } + + ProblemDetails TooManyRequestsContent { get; } + + ProblemDetails RequestHeaderFieldsTooLargeContent { get; } + + ProblemDetails UnavailableForLegalReasonsContent { get; } + + ProblemDetails InternalServerErrorContent { get; } + + ProblemDetails NotImplementedContent { get; } + + ProblemDetails BadGatewayContent { get; } + + ProblemDetails ServiceUnavailableContent { get; } + + ProblemDetails GatewayTimeoutContent { get; } + + ProblemDetails HttpVersionNotSupportedContent { get; } + + ProblemDetails VariantAlsoNegotiatesContent { get; } + + ProblemDetails InsufficientStorageContent { get; } + + ProblemDetails LoopDetectedContent { get; } + + ProblemDetails NotExtendedContent { get; } + + ProblemDetails NetworkAuthenticationRequiredContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyClient/WPD/src/ExAllResponseTypes.ApiClient.Generated/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyClient/WPD/src/ExAllResponseTypes.ApiClient.Generated/GlobalUsings.verified.cs new file mode 100644 index 00000000..8f8f8748 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyClient/WPD/src/ExAllResponseTypes.ApiClient.Generated/GlobalUsings.verified.cs @@ -0,0 +1,15 @@ +global using System; +global using System.CodeDom.Compiler; +global using System.ComponentModel.DataAnnotations; +global using System.Net; +global using System.Net.Http; +global using System.Threading; +global using System.Threading.Tasks; + +global using Atc.Rest.Client; +global using Atc.Rest.Client.Builder; + +global using ExAllResponseTypes.ApiClient.Generated.Contracts.Example; +global using ExAllResponseTypes.ApiClient.Generated.Endpoints.Example.Interfaces; + +global using Microsoft.AspNetCore.Mvc; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/src/ExAllResponseTypes.Api.Generated/ApiRegistration.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/src/ExAllResponseTypes.Api.Generated/ApiRegistration.verified.cs new file mode 100644 index 00000000..91c12a94 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/src/ExAllResponseTypes.Api.Generated/ApiRegistration.verified.cs @@ -0,0 +1,12 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExAllResponseTypes.Api.Generated; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ApiRegistration +{ +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/src/ExAllResponseTypes.Api.Generated/Contracts/Example/Interfaces/IGetExampleHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/src/ExAllResponseTypes.Api.Generated/Contracts/Example/Interfaces/IGetExampleHandler.verified.cs new file mode 100644 index 00000000..56acc51c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/src/ExAllResponseTypes.Api.Generated/Contracts/Example/Interfaces/IGetExampleHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExAllResponseTypes.Api.Generated.Contracts.Example; + +/// +/// Domain Interface for RequestHandler. +/// Description: Example endpoint. +/// Operation: GetExample. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetExampleHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + GetExampleParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/src/ExAllResponseTypes.Api.Generated/Contracts/Example/Models/ExampleModel.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/src/ExAllResponseTypes.Api.Generated/Contracts/Example/Models/ExampleModel.verified.cs new file mode 100644 index 00000000..ca50a292 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/src/ExAllResponseTypes.Api.Generated/Contracts/Example/Models/ExampleModel.verified.cs @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExAllResponseTypes.Api.Generated.Contracts.Example; + +/// +/// Example-Model. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ExampleModel +{ + public string Property1 { get; set; } + + public int Property2 { get; set; } + + public bool Property3 { get; set; } + + /// + public override string ToString() + => $"{nameof(Property1)}: {Property1}, {nameof(Property2)}: {Property2}, {nameof(Property3)}: {Property3}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/src/ExAllResponseTypes.Api.Generated/Contracts/Example/Parameters/GetExampleParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/src/ExAllResponseTypes.Api.Generated/Contracts/Example/Parameters/GetExampleParameters.verified.cs new file mode 100644 index 00000000..f606265b --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/src/ExAllResponseTypes.Api.Generated/Contracts/Example/Parameters/GetExampleParameters.verified.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExAllResponseTypes.Api.Generated.Contracts.Example; + +/// +/// Parameters for operation request. +/// Description: Example endpoint. +/// Operation: GetExample. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetExampleParameters +{ + /// + /// The email for filter orders to retrieve. + /// + /// + /// Email validation being enforced. + /// + [FromQuery(Name = "myEmail")] + [EmailAddress] + public string? MyEmail { get; set; } + + /// + public override string ToString() + => $"{nameof(MyEmail)}: {MyEmail}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/src/ExAllResponseTypes.Api.Generated/Contracts/Example/Results/GetExampleResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/src/ExAllResponseTypes.Api.Generated/Contracts/Example/Results/GetExampleResult.verified.cs new file mode 100644 index 00000000..48a95715 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/src/ExAllResponseTypes.Api.Generated/Contracts/Example/Results/GetExampleResult.verified.cs @@ -0,0 +1,384 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExAllResponseTypes.Api.Generated.Contracts.Example; + +/// +/// Results for operation request. +/// Description: Example endpoint. +/// Operation: GetExample. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetExampleResult : ResultBase +{ + private GetExampleResult(ActionResult result) : base(result) { } + + /// + /// 100 - Continue response. + /// + public static GetExampleResult Continue(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.Continue, message)); + + /// + /// 101 - SwitchingProtocols response. + /// + public static GetExampleResult SwitchingProtocols(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.SwitchingProtocols, message)); + + /// + /// 102 - Processing response. + /// + public static GetExampleResult Processing(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.Processing, message)); + + /// + /// 103 - EarlyHints response. + /// + public static GetExampleResult EarlyHints() + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.EarlyHints, string? message = null)); + + /// + /// 200 - Ok response. + /// + public static GetExampleResult Ok(ExampleModel response) + => new GetExampleResult(new OkObjectResult(response)); + + /// + /// 201 - Created response. + /// + public static GetExampleResult Created(string? uri = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.Created, uri)); + + /// + /// 202 - Accepted response. + /// + public static GetExampleResult Accepted(string? uri = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.Accepted, uri)); + + /// + /// 203 - NonAuthoritativeInformation response. + /// + public static GetExampleResult NonAuthoritativeInformation(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.NonAuthoritativeInformation, message)); + + /// + /// 204 - NoContent response. + /// + public static GetExampleResult NoContent(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.NoContent, message)); + + /// + /// 205 - ResetContent response. + /// + public static GetExampleResult ResetContent(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.ResetContent, message)); + + /// + /// 206 - PartialContent response. + /// + public static GetExampleResult PartialContent(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.PartialContent, message)); + + /// + /// 207 - MultiStatus response. + /// + public static GetExampleResult MultiStatus(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.MultiStatus, message)); + + /// + /// 208 - AlreadyReported response. + /// + public static GetExampleResult AlreadyReported(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.AlreadyReported, message)); + + /// + /// 226 - ImUsed response. + /// + public static GetExampleResult ImUsed(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.IMUsed, message)); + + /// + /// 300 - MultipleChoices response. + /// + public static GetExampleResult MultipleChoices(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.MultipleChoices, message)); + + /// + /// 301 - MovedPermanently response. + /// + public static GetExampleResult MovedPermanently(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.MovedPermanently, message)); + + /// + /// 302 - Found response. + /// + public static GetExampleResult Found(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.Found, message)); + + /// + /// 303 - SeeOther response. + /// + public static GetExampleResult SeeOther(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.SeeOther, message)); + + /// + /// 304 - NotModified response. + /// + public static GetExampleResult NotModified(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.NotModified, message)); + + /// + /// 305 - UseProxy response. + /// + public static GetExampleResult UseProxy(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.UseProxy, message)); + + /// + /// 306 - Unused response. + /// + public static GetExampleResult Unused(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.Unused, message)); + + /// + /// 307 - RedirectKeepVerb response. + /// + public static GetExampleResult RedirectKeepVerb(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.RedirectKeepVerb, message)); + + /// + /// 308 - PermanentRedirect response. + /// + public static GetExampleResult PermanentRedirect(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.PermanentRedirect, message)); + + /// + /// 400 - BadRequest response. + /// + public static GetExampleResult BadRequest(string? message = null) + => new GetExampleResult(new BadRequestObjectResult(message)); + + /// + /// 401 - Unauthorized response. + /// + public static GetExampleResult Unauthorized(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.Unauthorized, message)); + + /// + /// 402 - PaymentRequired response. + /// + public static GetExampleResult PaymentRequired(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.PaymentRequired, message)); + + /// + /// 403 - Forbidden response. + /// + public static GetExampleResult Forbidden(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.Forbidden, message)); + + /// + /// 404 - NotFound response. + /// + public static GetExampleResult NotFound(string? message = null) + => new GetExampleResult(new NotFoundObjectResult(message)); + + /// + /// 405 - MethodNotAllowed response. + /// + public static GetExampleResult MethodNotAllowed(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.MethodNotAllowed, message)); + + /// + /// 406 - NotAcceptable response. + /// + public static GetExampleResult NotAcceptable(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.NotAcceptable, message)); + + /// + /// 407 - ProxyAuthenticationRequired response. + /// + public static GetExampleResult ProxyAuthenticationRequired(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.ProxyAuthenticationRequired, message)); + + /// + /// 408 - RequestTimeout response. + /// + public static GetExampleResult RequestTimeout(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.RequestTimeout, message)); + + /// + /// 409 - Conflict response. + /// + public static GetExampleResult Conflict(string? message = null) + => new GetExampleResult(new ConflictObjectResult(message)); + + /// + /// 410 - Gone response. + /// + public static GetExampleResult Gone(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.Gone, message)); + + /// + /// 411 - LengthRequired response. + /// + public static GetExampleResult LengthRequired(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.LengthRequired, message)); + + /// + /// 412 - PreconditionFailed response. + /// + public static GetExampleResult PreconditionFailed(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.PreconditionFailed, message)); + + /// + /// 413 - RequestEntityTooLarge response. + /// + public static GetExampleResult RequestEntityTooLarge(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.RequestEntityTooLarge, message)); + + /// + /// 414 - RequestUriTooLong response. + /// + public static GetExampleResult RequestUriTooLong(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.RequestUriTooLong, message)); + + /// + /// 415 - UnsupportedMediaType response. + /// + public static GetExampleResult UnsupportedMediaType(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.UnsupportedMediaType, message)); + + /// + /// 416 - RequestedRangeNotSatisfiable response. + /// + public static GetExampleResult RequestedRangeNotSatisfiable(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.RequestedRangeNotSatisfiable, message)); + + /// + /// 417 - ExpectationFailed response. + /// + public static GetExampleResult ExpectationFailed(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.ExpectationFailed, message)); + + /// + /// 421 - MisdirectedRequest response. + /// + public static GetExampleResult MisdirectedRequest(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.MisdirectedRequest, message)); + + /// + /// 422 - UnprocessableEntity response. + /// + public static GetExampleResult UnprocessableEntity(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.UnprocessableEntity, message)); + + /// + /// 423 - Locked response. + /// + public static GetExampleResult Locked(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.Locked, message)); + + /// + /// 424 - FailedDependency response. + /// + public static GetExampleResult FailedDependency(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.FailedDependency, message)); + + /// + /// 426 - UpgradeRequired response. + /// + public static GetExampleResult UpgradeRequired(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.UpgradeRequired, message)); + + /// + /// 428 - PreconditionRequired response. + /// + public static GetExampleResult PreconditionRequired(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.PreconditionRequired, message)); + + /// + /// 429 - TooManyRequests response. + /// + public static GetExampleResult TooManyRequests(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.TooManyRequests, message)); + + /// + /// 431 - RequestHeaderFieldsTooLarge response. + /// + public static GetExampleResult RequestHeaderFieldsTooLarge(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.RequestHeaderFieldsTooLarge, message)); + + /// + /// 451 - UnavailableForLegalReasons response. + /// + public static GetExampleResult UnavailableForLegalReasons(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.UnavailableForLegalReasons, message)); + + /// + /// 500 - InternalServerError response. + /// + public static GetExampleResult InternalServerError(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.InternalServerError, message)); + + /// + /// 501 - NotImplemented response. + /// + public static GetExampleResult NotImplemented(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.NotImplemented, message)); + + /// + /// 502 - BadGateway response. + /// + public static GetExampleResult BadGateway(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.BadGateway, message)); + + /// + /// 503 - ServiceUnavailable response. + /// + public static GetExampleResult ServiceUnavailable(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.ServiceUnavailable, message)); + + /// + /// 504 - GatewayTimeout response. + /// + public static GetExampleResult GatewayTimeout(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.GatewayTimeout, message)); + + /// + /// 505 - HttpVersionNotSupported response. + /// + public static GetExampleResult HttpVersionNotSupported(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.HttpVersionNotSupported, message)); + + /// + /// 506 - VariantAlsoNegotiates response. + /// + public static GetExampleResult VariantAlsoNegotiates(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.VariantAlsoNegotiates, message)); + + /// + /// 507 - InsufficientStorage response. + /// + public static GetExampleResult InsufficientStorage(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.InsufficientStorage, message)); + + /// + /// 508 - LoopDetected response. + /// + public static GetExampleResult LoopDetected(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.LoopDetected, message)); + + /// + /// 510 - NotExtended response. + /// + public static GetExampleResult NotExtended(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.NotExtended, message)); + + /// + /// 511 - NetworkAuthenticationRequired response. + /// + public static GetExampleResult NetworkAuthenticationRequired(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.NetworkAuthenticationRequired, message)); +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/src/ExAllResponseTypes.Api.Generated/Endpoints/ExampleController.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/src/ExAllResponseTypes.Api.Generated/Endpoints/ExampleController.verified.cs new file mode 100644 index 00000000..865eaaa3 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/src/ExAllResponseTypes.Api.Generated/Endpoints/ExampleController.verified.cs @@ -0,0 +1,89 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExAllResponseTypes.Api.Generated.Endpoints; + +/// +/// Endpoint definitions. +/// +[Authorize] +[ApiController] +[Route("/api/v1/example")] +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public sealed class ExampleController : ControllerBase +{ + /// + /// Description: Example endpoint. + /// Operation: GetExample. + /// + [HttpGet] + [ProducesResponseType(StatusCodes.Status100Continue)] + [ProducesResponseType(StatusCodes.Status101SwitchingProtocols)] + [ProducesResponseType(StatusCodes.Status102Processing)] + [ProducesResponseType(103)] + [ProducesResponseType(typeof(ExampleModel), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(string), StatusCodes.Status201Created)] + [ProducesResponseType(typeof(string), StatusCodes.Status202Accepted)] + [ProducesResponseType(StatusCodes.Status203NonAuthoritative)] + [ProducesResponseType(StatusCodes.Status204NoContent)] + [ProducesResponseType(StatusCodes.Status205ResetContent)] + [ProducesResponseType(StatusCodes.Status206PartialContent)] + [ProducesResponseType(StatusCodes.Status207MultiStatus)] + [ProducesResponseType(StatusCodes.Status208AlreadyReported)] + [ProducesResponseType(StatusCodes.Status226IMUsed)] + [ProducesResponseType(StatusCodes.Status300MultipleChoices)] + [ProducesResponseType(StatusCodes.Status301MovedPermanently)] + [ProducesResponseType(StatusCodes.Status302Found)] + [ProducesResponseType(StatusCodes.Status303SeeOther)] + [ProducesResponseType(StatusCodes.Status304NotModified)] + [ProducesResponseType(StatusCodes.Status305UseProxy)] + [ProducesResponseType(StatusCodes.Status306SwitchProxy)] + [ProducesResponseType(StatusCodes.Status307TemporaryRedirect)] + [ProducesResponseType(StatusCodes.Status308PermanentRedirect)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(StatusCodes.Status402PaymentRequired)] + [ProducesResponseType(StatusCodes.Status403Forbidden)] + [ProducesResponseType(typeof(string), StatusCodes.Status404NotFound)] + [ProducesResponseType(StatusCodes.Status405MethodNotAllowed)] + [ProducesResponseType(StatusCodes.Status406NotAcceptable)] + [ProducesResponseType(StatusCodes.Status407ProxyAuthenticationRequired)] + [ProducesResponseType(StatusCodes.Status408RequestTimeout)] + [ProducesResponseType(typeof(string), StatusCodes.Status409Conflict)] + [ProducesResponseType(StatusCodes.Status410Gone)] + [ProducesResponseType(StatusCodes.Status411LengthRequired)] + [ProducesResponseType(StatusCodes.Status412PreconditionFailed)] + [ProducesResponseType(StatusCodes.Status413RequestEntityTooLarge)] + [ProducesResponseType(StatusCodes.Status414RequestUriTooLong)] + [ProducesResponseType(StatusCodes.Status415UnsupportedMediaType)] + [ProducesResponseType(StatusCodes.Status416RequestedRangeNotSatisfiable)] + [ProducesResponseType(StatusCodes.Status417ExpectationFailed)] + [ProducesResponseType(StatusCodes.Status421MisdirectedRequest)] + [ProducesResponseType(StatusCodes.Status422UnprocessableEntity)] + [ProducesResponseType(StatusCodes.Status423Locked)] + [ProducesResponseType(StatusCodes.Status424FailedDependency)] + [ProducesResponseType(StatusCodes.Status426UpgradeRequired)] + [ProducesResponseType(StatusCodes.Status428PreconditionRequired)] + [ProducesResponseType(StatusCodes.Status429TooManyRequests)] + [ProducesResponseType(StatusCodes.Status431RequestHeaderFieldsTooLarge)] + [ProducesResponseType(StatusCodes.Status451UnavailableForLegalReasons)] + [ProducesResponseType(typeof(string), StatusCodes.Status500InternalServerError)] + [ProducesResponseType(StatusCodes.Status501NotImplemented)] + [ProducesResponseType(StatusCodes.Status502BadGateway)] + [ProducesResponseType(StatusCodes.Status503ServiceUnavailable)] + [ProducesResponseType(StatusCodes.Status504GatewayTimeout)] + [ProducesResponseType(StatusCodes.Status505HttpVersionNotsupported)] + [ProducesResponseType(StatusCodes.Status506VariantAlsoNegotiates)] + [ProducesResponseType(StatusCodes.Status507InsufficientStorage)] + [ProducesResponseType(StatusCodes.Status508LoopDetected)] + [ProducesResponseType(StatusCodes.Status510NotExtended)] + [ProducesResponseType(StatusCodes.Status511NetworkAuthenticationRequired)] + public async Task GetExample( + GetExampleParameters parameters, + [FromServices] IGetExampleHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/src/ExAllResponseTypes.Api.Generated/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/src/ExAllResponseTypes.Api.Generated/GlobalUsings.verified.cs new file mode 100644 index 00000000..78a0dd43 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/src/ExAllResponseTypes.Api.Generated/GlobalUsings.verified.cs @@ -0,0 +1,11 @@ +global using System.CodeDom.Compiler; +global using System.ComponentModel.DataAnnotations; +global using System.Net; + +global using Atc.Rest.Results; + +global using ExAllResponseTypes.Api.Generated.Contracts.Example; + +global using Microsoft.AspNetCore.Authorization; +global using Microsoft.AspNetCore.Http; +global using Microsoft.AspNetCore.Mvc; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/src/ExAllResponseTypes.Api/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/src/ExAllResponseTypes.Api/GlobalUsings.verified.cs new file mode 100644 index 00000000..fdb0d96c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/src/ExAllResponseTypes.Api/GlobalUsings.verified.cs @@ -0,0 +1,15 @@ +global using System.CodeDom.Compiler; +global using System.Reflection; + +global using Asp.Versioning.ApiExplorer; + +global using Atc.Rest.Extended.Options; + +global using ExAllResponseTypes.Api.Generated; +global using ExAllResponseTypes.Api.Options; +global using ExAllResponseTypes.Domain; + +global using Microsoft.Extensions.Options; +global using Microsoft.OpenApi.Models; + +global using Swashbuckle.AspNetCore.SwaggerGen; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/src/ExAllResponseTypes.Api/Options/ConfigureSwaggerDocOptions.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/src/ExAllResponseTypes.Api/Options/ConfigureSwaggerDocOptions.verified.cs new file mode 100644 index 00000000..f85855df --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/src/ExAllResponseTypes.Api/Options/ConfigureSwaggerDocOptions.verified.cs @@ -0,0 +1,39 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExAllResponseTypes.Api.Options; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ConfigureSwaggerDocOptions : IConfigureOptions +{ + private readonly IApiVersionDescriptionProvider provider; + + public ConfigureSwaggerDocOptions( + IApiVersionDescriptionProvider provider) + => this.provider = provider; + + public void Configure( + SwaggerGenOptions options) + { + foreach (var version in provider.ApiVersionDescriptions) + { + options.SwaggerDoc( + version.GroupName, + new OpenApiInfo + { + Version = "1.0", + Title = "Example-Response-Types", + Description = "Example With All Response Types Api", + Contact = new OpenApiContact + { + Name = "atc-net A/S", + }, + }); + } + + options.IncludeXmlComments(Path.ChangeExtension(GetType().Assembly.Location, "xml")); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/src/ExAllResponseTypes.Api/Program.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/src/ExAllResponseTypes.Api/Program.verified.cs new file mode 100644 index 00000000..6fa8e824 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/src/ExAllResponseTypes.Api/Program.verified.cs @@ -0,0 +1,23 @@ +namespace ExAllResponseTypes.Api; + +public static class Program +{ + public static void Main(string[] args) + { + CreateHostBuilder(args) + .Build() + .Run(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) + { + var builder = Host + .CreateDefaultBuilder(args) + .ConfigureWebHostDefaults(webBuilder => + { + webBuilder.UseStartup(); + }); + + return builder; + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/src/ExAllResponseTypes.Api/Startup.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/src/ExAllResponseTypes.Api/Startup.verified.cs new file mode 100644 index 00000000..e28818fb --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/src/ExAllResponseTypes.Api/Startup.verified.cs @@ -0,0 +1,38 @@ +namespace ExAllResponseTypes.Api; + +public class Startup +{ + private readonly RestApiExtendedOptions restApiOptions; + + public Startup( + IConfiguration configuration) + { + Configuration = configuration; + restApiOptions = new RestApiExtendedOptions + { + // TODO: Remove/out-comment/set to false this for production scenarios! + AllowAnonymousAccessForDevelopment = true, + }; + + restApiOptions.AddAssemblyPairs( + Assembly.GetAssembly(typeof(ApiRegistration)), + Assembly.GetAssembly(typeof(DomainRegistration))); + } + + public IConfiguration Configuration { get; } + + public void ConfigureServices( + IServiceCollection services) + { + services.ConfigureOptions(); + + services.AddRestApi(restApiOptions, Configuration); + } + + public void Configure( + IApplicationBuilder app, + IWebHostEnvironment env) + { + app.ConfigureRestApi(env, restApiOptions); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/src/ExAllResponseTypes.Domain/DomainRegistration.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/src/ExAllResponseTypes.Domain/DomainRegistration.verified.cs new file mode 100644 index 00000000..b8958116 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/src/ExAllResponseTypes.Domain/DomainRegistration.verified.cs @@ -0,0 +1,12 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExAllResponseTypes.Domain; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class DomainRegistration +{ +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/src/ExAllResponseTypes.Domain/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/src/ExAllResponseTypes.Domain/GlobalUsings.verified.cs new file mode 100644 index 00000000..c75f892b --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/src/ExAllResponseTypes.Domain/GlobalUsings.verified.cs @@ -0,0 +1,3 @@ +global using System.CodeDom.Compiler; + +global using ExAllResponseTypes.Api.Generated.Contracts.Example; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/src/ExAllResponseTypes.Domain/Handlers/Example/GetExampleHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/src/ExAllResponseTypes.Domain/Handlers/Example/GetExampleHandler.verified.cs new file mode 100644 index 00000000..f8659325 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/src/ExAllResponseTypes.Domain/Handlers/Example/GetExampleHandler.verified.cs @@ -0,0 +1,18 @@ +namespace ExAllResponseTypes.Domain.Handlers.Example; + +/// +/// Handler for operation request. +/// Description: Example endpoint. +/// Operation: GetExample. +/// +public class GetExampleHandler : IGetExampleHandler +{ + public Task ExecuteAsync( + GetExampleParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for GetExampleHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/test/ExAllResponseTypes.Api.Tests/Endpoints/Example/GetExampleHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/test/ExAllResponseTypes.Api.Tests/Endpoints/Example/GetExampleHandlerStub.verified.cs new file mode 100644 index 00000000..2f850d4c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/test/ExAllResponseTypes.Api.Tests/Endpoints/Example/GetExampleHandlerStub.verified.cs @@ -0,0 +1,20 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExAllResponseTypes.Api.Tests.Endpoints.Example; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetExampleHandlerStub : IGetExampleHandler +{ + public Task ExecuteAsync( + GetExampleParameters parameters, + CancellationToken cancellationToken = default) + { + var data = new Fixture().Create(); + + return Task.FromResult(GetExampleResult.Ok(data)); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/test/ExAllResponseTypes.Api.Tests/Endpoints/Example/GetExampleTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/test/ExAllResponseTypes.Api.Tests/Endpoints/Example/GetExampleTests.verified.cs new file mode 100644 index 00000000..23e46961 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/test/ExAllResponseTypes.Api.Tests/Endpoints/Example/GetExampleTests.verified.cs @@ -0,0 +1,21 @@ +namespace ExAllResponseTypes.Api.Tests.Endpoints.Example; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class GetExampleTests : WebApiControllerBaseTest +{ + public GetExampleTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/test/ExAllResponseTypes.Api.Tests/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/test/ExAllResponseTypes.Api.Tests/GlobalUsings.verified.cs new file mode 100644 index 00000000..8d0f3684 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/test/ExAllResponseTypes.Api.Tests/GlobalUsings.verified.cs @@ -0,0 +1,22 @@ +global using System.CodeDom.Compiler; +global using System.Reflection; +global using System.Text; +global using System.Text.Json; +global using System.Text.Json.Serialization; + +global using Atc.Rest.Options; +global using Atc.XUnit; + +global using AutoFixture; + +global using ExAllResponseTypes.Api.Generated; +global using ExAllResponseTypes.Api.Generated.Contracts.Example; + +global using Microsoft.AspNetCore.Hosting; +global using Microsoft.AspNetCore.Http; +global using Microsoft.AspNetCore.Mvc.Testing; +global using Microsoft.AspNetCore.TestHost; +global using Microsoft.Extensions.Configuration; +global using Microsoft.Extensions.DependencyInjection; + +global using Xunit; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/test/ExAllResponseTypes.Api.Tests/WebApiControllerBaseTest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/test/ExAllResponseTypes.Api.Tests/WebApiControllerBaseTest.verified.cs new file mode 100644 index 00000000..d558bfd3 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/test/ExAllResponseTypes.Api.Tests/WebApiControllerBaseTest.verified.cs @@ -0,0 +1,56 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExAllResponseTypes.Api.Tests; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public abstract class WebApiControllerBaseTest : IClassFixture +{ + protected readonly WebApiStartupFactory Factory; + + protected readonly HttpClient HttpClient; + + protected readonly IConfiguration Configuration; + + protected static JsonSerializerOptions? JsonSerializerOptions; + + protected WebApiControllerBaseTest(WebApiStartupFactory fixture) + { + this.Factory = fixture; + this.HttpClient = this.Factory.CreateClient(); + this.Configuration = new ConfigurationBuilder().Build(); + JsonSerializerOptions = new JsonSerializerOptions + { + PropertyNameCaseInsensitive = true, + Converters = + { + new JsonStringEnumConverter() + }, + }; + } + + protected static StringContent ToJson(object data) + => new(JsonSerializer.Serialize(data, JsonSerializerOptions), Encoding.UTF8, "application/json"); + + protected static StringContent Json(string data) + => new(data, Encoding.UTF8, "application/json"); + + protected static IFormFile GetTestFile() + { + var bytes = Encoding.UTF8.GetBytes("Hello World"); + var stream = new MemoryStream(bytes); + var formFile = new FormFile(stream, 0, stream.Length, "dummy", "dummy.txt") + { + Headers = new HeaderDictionary(), + ContentType = "application/octet-stream", + }; + + return formFile; + } + + protected static List GetTestFiles() + => new() { GetTestFile(), GetTestFile() }; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/test/ExAllResponseTypes.Api.Tests/WebApiStartupFactory.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/test/ExAllResponseTypes.Api.Tests/WebApiStartupFactory.verified.cs new file mode 100644 index 00000000..aece5169 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/test/ExAllResponseTypes.Api.Tests/WebApiStartupFactory.verified.cs @@ -0,0 +1,40 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExAllResponseTypes.Api.Tests; + +/// +/// Factory for bootstrapping in memory tests. +/// Includes options to override configuration and service collection using a partial class. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public partial class WebApiStartupFactory : WebApplicationFactory +{ + protected override void ConfigureWebHost(IWebHostBuilder builder) + { + builder.ConfigureAppConfiguration(config => + { + ModifyConfiguration(config); + var integrationConfig = new ConfigurationBuilder() + .AddJsonFile("appsettings.integrationtest.json") + .Build(); + config.AddConfiguration(integrationConfig); + }); + + builder.ConfigureTestServices(services => + { + ModifyServices(services); + services.AddSingleton(); + services.AutoRegistrateServices( + Assembly.GetAssembly(typeof(ApiRegistration))!, + Assembly.GetAssembly(typeof(WebApiStartupFactory))!); + }); + } + + partial void ModifyConfiguration(IConfigurationBuilder config); + + partial void ModifyServices(IServiceCollection services); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/test/ExAllResponseTypes.Domain.Tests/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/test/ExAllResponseTypes.Domain.Tests/GlobalUsings.verified.cs new file mode 100644 index 00000000..8c927eb7 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/test/ExAllResponseTypes.Domain.Tests/GlobalUsings.verified.cs @@ -0,0 +1 @@ +global using Xunit; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/test/ExAllResponseTypes.Domain.Tests/Handlers/Example/GetExampleHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/test/ExAllResponseTypes.Domain.Tests/Handlers/Example/GetExampleHandlerTests.verified.cs new file mode 100644 index 00000000..a1ac7c3c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WOPD/test/ExAllResponseTypes.Domain.Tests/Handlers/Example/GetExampleHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace ExAllResponseTypes.Domain.Tests.Handlers.Example; + +public class GetExampleHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/src/ExAllResponseTypes.Api.Generated/ApiRegistration.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/src/ExAllResponseTypes.Api.Generated/ApiRegistration.verified.cs new file mode 100644 index 00000000..91c12a94 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/src/ExAllResponseTypes.Api.Generated/ApiRegistration.verified.cs @@ -0,0 +1,12 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExAllResponseTypes.Api.Generated; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ApiRegistration +{ +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/src/ExAllResponseTypes.Api.Generated/Contracts/Example/Interfaces/IGetExampleHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/src/ExAllResponseTypes.Api.Generated/Contracts/Example/Interfaces/IGetExampleHandler.verified.cs new file mode 100644 index 00000000..56acc51c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/src/ExAllResponseTypes.Api.Generated/Contracts/Example/Interfaces/IGetExampleHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExAllResponseTypes.Api.Generated.Contracts.Example; + +/// +/// Domain Interface for RequestHandler. +/// Description: Example endpoint. +/// Operation: GetExample. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetExampleHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + GetExampleParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/src/ExAllResponseTypes.Api.Generated/Contracts/Example/Models/ExampleModel.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/src/ExAllResponseTypes.Api.Generated/Contracts/Example/Models/ExampleModel.verified.cs new file mode 100644 index 00000000..ca50a292 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/src/ExAllResponseTypes.Api.Generated/Contracts/Example/Models/ExampleModel.verified.cs @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExAllResponseTypes.Api.Generated.Contracts.Example; + +/// +/// Example-Model. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ExampleModel +{ + public string Property1 { get; set; } + + public int Property2 { get; set; } + + public bool Property3 { get; set; } + + /// + public override string ToString() + => $"{nameof(Property1)}: {Property1}, {nameof(Property2)}: {Property2}, {nameof(Property3)}: {Property3}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/src/ExAllResponseTypes.Api.Generated/Contracts/Example/Parameters/GetExampleParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/src/ExAllResponseTypes.Api.Generated/Contracts/Example/Parameters/GetExampleParameters.verified.cs new file mode 100644 index 00000000..f606265b --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/src/ExAllResponseTypes.Api.Generated/Contracts/Example/Parameters/GetExampleParameters.verified.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExAllResponseTypes.Api.Generated.Contracts.Example; + +/// +/// Parameters for operation request. +/// Description: Example endpoint. +/// Operation: GetExample. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetExampleParameters +{ + /// + /// The email for filter orders to retrieve. + /// + /// + /// Email validation being enforced. + /// + [FromQuery(Name = "myEmail")] + [EmailAddress] + public string? MyEmail { get; set; } + + /// + public override string ToString() + => $"{nameof(MyEmail)}: {MyEmail}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/src/ExAllResponseTypes.Api.Generated/Contracts/Example/Results/GetExampleResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/src/ExAllResponseTypes.Api.Generated/Contracts/Example/Results/GetExampleResult.verified.cs new file mode 100644 index 00000000..4fb8ac53 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/src/ExAllResponseTypes.Api.Generated/Contracts/Example/Results/GetExampleResult.verified.cs @@ -0,0 +1,384 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExAllResponseTypes.Api.Generated.Contracts.Example; + +/// +/// Results for operation request. +/// Description: Example endpoint. +/// Operation: GetExample. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetExampleResult : ResultBase +{ + private GetExampleResult(ActionResult result) : base(result) { } + + /// + /// 100 - Continue response. + /// + public static GetExampleResult Continue(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.Continue, message)); + + /// + /// 101 - SwitchingProtocols response. + /// + public static GetExampleResult SwitchingProtocols(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.SwitchingProtocols, message)); + + /// + /// 102 - Processing response. + /// + public static GetExampleResult Processing(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.Processing, message)); + + /// + /// 103 - EarlyHints response. + /// + public static GetExampleResult EarlyHints() + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.EarlyHints)); + + /// + /// 200 - Ok response. + /// + public static GetExampleResult Ok(ExampleModel response) + => new GetExampleResult(new OkObjectResult(response)); + + /// + /// 201 - Created response. + /// + public static GetExampleResult Created(string? uri = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.Created, uri)); + + /// + /// 202 - Accepted response. + /// + public static GetExampleResult Accepted(string? uri = null) + => new GetExampleResult(ResultFactory.CreateContentResult(HttpStatusCode.Accepted, uri)); + + /// + /// 203 - NonAuthoritativeInformation response. + /// + public static GetExampleResult NonAuthoritativeInformation(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.NonAuthoritativeInformation, message)); + + /// + /// 204 - NoContent response. + /// + public static GetExampleResult NoContent(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.NoContent, message)); + + /// + /// 205 - ResetContent response. + /// + public static GetExampleResult ResetContent(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.ResetContent, message)); + + /// + /// 206 - PartialContent response. + /// + public static GetExampleResult PartialContent(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.PartialContent, message)); + + /// + /// 207 - MultiStatus response. + /// + public static GetExampleResult MultiStatus(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.MultiStatus, message)); + + /// + /// 208 - AlreadyReported response. + /// + public static GetExampleResult AlreadyReported(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.AlreadyReported, message)); + + /// + /// 226 - ImUsed response. + /// + public static GetExampleResult ImUsed(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.IMUsed, message)); + + /// + /// 300 - MultipleChoices response. + /// + public static GetExampleResult MultipleChoices(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.MultipleChoices, message)); + + /// + /// 301 - MovedPermanently response. + /// + public static GetExampleResult MovedPermanently(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.MovedPermanently, message)); + + /// + /// 302 - Found response. + /// + public static GetExampleResult Found(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.Found, message)); + + /// + /// 303 - SeeOther response. + /// + public static GetExampleResult SeeOther(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.SeeOther, message)); + + /// + /// 304 - NotModified response. + /// + public static GetExampleResult NotModified(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.NotModified, message)); + + /// + /// 305 - UseProxy response. + /// + public static GetExampleResult UseProxy(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.UseProxy, message)); + + /// + /// 306 - Unused response. + /// + public static GetExampleResult Unused(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.Unused, message)); + + /// + /// 307 - RedirectKeepVerb response. + /// + public static GetExampleResult RedirectKeepVerb(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.RedirectKeepVerb, message)); + + /// + /// 308 - PermanentRedirect response. + /// + public static GetExampleResult PermanentRedirect(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.PermanentRedirect, message)); + + /// + /// 400 - BadRequest response. + /// + public static GetExampleResult BadRequest(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithValidationProblemDetails(HttpStatusCode.BadRequest, message)); + + /// + /// 401 - Unauthorized response. + /// + public static GetExampleResult Unauthorized(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.Unauthorized, message)); + + /// + /// 402 - PaymentRequired response. + /// + public static GetExampleResult PaymentRequired(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.PaymentRequired, message)); + + /// + /// 403 - Forbidden response. + /// + public static GetExampleResult Forbidden(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.Forbidden, message)); + + /// + /// 404 - NotFound response. + /// + public static GetExampleResult NotFound(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.NotFound, message)); + + /// + /// 405 - MethodNotAllowed response. + /// + public static GetExampleResult MethodNotAllowed(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.MethodNotAllowed, message)); + + /// + /// 406 - NotAcceptable response. + /// + public static GetExampleResult NotAcceptable(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.NotAcceptable, message)); + + /// + /// 407 - ProxyAuthenticationRequired response. + /// + public static GetExampleResult ProxyAuthenticationRequired(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.ProxyAuthenticationRequired, message)); + + /// + /// 408 - RequestTimeout response. + /// + public static GetExampleResult RequestTimeout(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.RequestTimeout, message)); + + /// + /// 409 - Conflict response. + /// + public static GetExampleResult Conflict(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.Conflict, message)); + + /// + /// 410 - Gone response. + /// + public static GetExampleResult Gone(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.Gone, message)); + + /// + /// 411 - LengthRequired response. + /// + public static GetExampleResult LengthRequired(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.LengthRequired, message)); + + /// + /// 412 - PreconditionFailed response. + /// + public static GetExampleResult PreconditionFailed(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.PreconditionFailed, message)); + + /// + /// 413 - RequestEntityTooLarge response. + /// + public static GetExampleResult RequestEntityTooLarge(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.RequestEntityTooLarge, message)); + + /// + /// 414 - RequestUriTooLong response. + /// + public static GetExampleResult RequestUriTooLong(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.RequestUriTooLong, message)); + + /// + /// 415 - UnsupportedMediaType response. + /// + public static GetExampleResult UnsupportedMediaType(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.UnsupportedMediaType, message)); + + /// + /// 416 - RequestedRangeNotSatisfiable response. + /// + public static GetExampleResult RequestedRangeNotSatisfiable(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.RequestedRangeNotSatisfiable, message)); + + /// + /// 417 - ExpectationFailed response. + /// + public static GetExampleResult ExpectationFailed(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.ExpectationFailed, message)); + + /// + /// 421 - MisdirectedRequest response. + /// + public static GetExampleResult MisdirectedRequest(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.MisdirectedRequest, message)); + + /// + /// 422 - UnprocessableEntity response. + /// + public static GetExampleResult UnprocessableEntity(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.UnprocessableEntity, message)); + + /// + /// 423 - Locked response. + /// + public static GetExampleResult Locked(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.Locked, message)); + + /// + /// 424 - FailedDependency response. + /// + public static GetExampleResult FailedDependency(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.FailedDependency, message)); + + /// + /// 426 - UpgradeRequired response. + /// + public static GetExampleResult UpgradeRequired(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.UpgradeRequired, message)); + + /// + /// 428 - PreconditionRequired response. + /// + public static GetExampleResult PreconditionRequired(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.PreconditionRequired, message)); + + /// + /// 429 - TooManyRequests response. + /// + public static GetExampleResult TooManyRequests(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.TooManyRequests, message)); + + /// + /// 431 - RequestHeaderFieldsTooLarge response. + /// + public static GetExampleResult RequestHeaderFieldsTooLarge(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.RequestHeaderFieldsTooLarge, message)); + + /// + /// 451 - UnavailableForLegalReasons response. + /// + public static GetExampleResult UnavailableForLegalReasons(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.UnavailableForLegalReasons, message)); + + /// + /// 500 - InternalServerError response. + /// + public static GetExampleResult InternalServerError(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.InternalServerError, message)); + + /// + /// 501 - NotImplemented response. + /// + public static GetExampleResult NotImplemented(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.NotImplemented, message)); + + /// + /// 502 - BadGateway response. + /// + public static GetExampleResult BadGateway(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.BadGateway, message)); + + /// + /// 503 - ServiceUnavailable response. + /// + public static GetExampleResult ServiceUnavailable(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.ServiceUnavailable, message)); + + /// + /// 504 - GatewayTimeout response. + /// + public static GetExampleResult GatewayTimeout(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.GatewayTimeout, message)); + + /// + /// 505 - HttpVersionNotSupported response. + /// + public static GetExampleResult HttpVersionNotSupported(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.HttpVersionNotSupported, message)); + + /// + /// 506 - VariantAlsoNegotiates response. + /// + public static GetExampleResult VariantAlsoNegotiates(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.VariantAlsoNegotiates, message)); + + /// + /// 507 - InsufficientStorage response. + /// + public static GetExampleResult InsufficientStorage(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.InsufficientStorage, message)); + + /// + /// 508 - LoopDetected response. + /// + public static GetExampleResult LoopDetected(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.LoopDetected, message)); + + /// + /// 510 - NotExtended response. + /// + public static GetExampleResult NotExtended(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.NotExtended, message)); + + /// + /// 511 - NetworkAuthenticationRequired response. + /// + public static GetExampleResult NetworkAuthenticationRequired(string? message = null) + => new GetExampleResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.NetworkAuthenticationRequired, message)); +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/src/ExAllResponseTypes.Api.Generated/Endpoints/ExampleController.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/src/ExAllResponseTypes.Api.Generated/Endpoints/ExampleController.verified.cs new file mode 100644 index 00000000..5b1cdac5 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/src/ExAllResponseTypes.Api.Generated/Endpoints/ExampleController.verified.cs @@ -0,0 +1,89 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExAllResponseTypes.Api.Generated.Endpoints; + +/// +/// Endpoint definitions. +/// +[Authorize] +[ApiController] +[Route("/api/v1/example")] +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public sealed class ExampleController : ControllerBase +{ + /// + /// Description: Example endpoint. + /// Operation: GetExample. + /// + [HttpGet] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status100Continue)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status101SwitchingProtocols)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status102Processing)] + [ProducesResponseType(typeof(ProblemDetails), 103)] + [ProducesResponseType(typeof(ExampleModel), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status201Created)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status202Accepted)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status203NonAuthoritative)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status204NoContent)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status205ResetContent)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status206PartialContent)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status207MultiStatus)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status208AlreadyReported)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status226IMUsed)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status300MultipleChoices)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status301MovedPermanently)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status302Found)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status303SeeOther)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status304NotModified)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status305UseProxy)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status306SwitchProxy)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status307TemporaryRedirect)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status308PermanentRedirect)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status402PaymentRequired)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status403Forbidden)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status405MethodNotAllowed)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status406NotAcceptable)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status407ProxyAuthenticationRequired)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status408RequestTimeout)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status409Conflict)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status410Gone)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status411LengthRequired)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status412PreconditionFailed)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status413RequestEntityTooLarge)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status414RequestUriTooLong)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status415UnsupportedMediaType)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status416RequestedRangeNotSatisfiable)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status417ExpectationFailed)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status421MisdirectedRequest)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status422UnprocessableEntity)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status423Locked)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status424FailedDependency)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status426UpgradeRequired)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status428PreconditionRequired)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status429TooManyRequests)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status431RequestHeaderFieldsTooLarge)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status451UnavailableForLegalReasons)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status500InternalServerError)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status501NotImplemented)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status502BadGateway)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status503ServiceUnavailable)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status504GatewayTimeout)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status505HttpVersionNotsupported)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status506VariantAlsoNegotiates)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status507InsufficientStorage)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status508LoopDetected)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status510NotExtended)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status511NetworkAuthenticationRequired)] + public async Task GetExample( + GetExampleParameters parameters, + [FromServices] IGetExampleHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/src/ExAllResponseTypes.Api.Generated/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/src/ExAllResponseTypes.Api.Generated/GlobalUsings.verified.cs new file mode 100644 index 00000000..78a0dd43 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/src/ExAllResponseTypes.Api.Generated/GlobalUsings.verified.cs @@ -0,0 +1,11 @@ +global using System.CodeDom.Compiler; +global using System.ComponentModel.DataAnnotations; +global using System.Net; + +global using Atc.Rest.Results; + +global using ExAllResponseTypes.Api.Generated.Contracts.Example; + +global using Microsoft.AspNetCore.Authorization; +global using Microsoft.AspNetCore.Http; +global using Microsoft.AspNetCore.Mvc; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/src/ExAllResponseTypes.Api/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/src/ExAllResponseTypes.Api/GlobalUsings.verified.cs new file mode 100644 index 00000000..fdb0d96c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/src/ExAllResponseTypes.Api/GlobalUsings.verified.cs @@ -0,0 +1,15 @@ +global using System.CodeDom.Compiler; +global using System.Reflection; + +global using Asp.Versioning.ApiExplorer; + +global using Atc.Rest.Extended.Options; + +global using ExAllResponseTypes.Api.Generated; +global using ExAllResponseTypes.Api.Options; +global using ExAllResponseTypes.Domain; + +global using Microsoft.Extensions.Options; +global using Microsoft.OpenApi.Models; + +global using Swashbuckle.AspNetCore.SwaggerGen; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/src/ExAllResponseTypes.Api/Options/ConfigureSwaggerDocOptions.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/src/ExAllResponseTypes.Api/Options/ConfigureSwaggerDocOptions.verified.cs new file mode 100644 index 00000000..f85855df --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/src/ExAllResponseTypes.Api/Options/ConfigureSwaggerDocOptions.verified.cs @@ -0,0 +1,39 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExAllResponseTypes.Api.Options; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ConfigureSwaggerDocOptions : IConfigureOptions +{ + private readonly IApiVersionDescriptionProvider provider; + + public ConfigureSwaggerDocOptions( + IApiVersionDescriptionProvider provider) + => this.provider = provider; + + public void Configure( + SwaggerGenOptions options) + { + foreach (var version in provider.ApiVersionDescriptions) + { + options.SwaggerDoc( + version.GroupName, + new OpenApiInfo + { + Version = "1.0", + Title = "Example-Response-Types", + Description = "Example With All Response Types Api", + Contact = new OpenApiContact + { + Name = "atc-net A/S", + }, + }); + } + + options.IncludeXmlComments(Path.ChangeExtension(GetType().Assembly.Location, "xml")); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/src/ExAllResponseTypes.Api/Program.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/src/ExAllResponseTypes.Api/Program.verified.cs new file mode 100644 index 00000000..6fa8e824 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/src/ExAllResponseTypes.Api/Program.verified.cs @@ -0,0 +1,23 @@ +namespace ExAllResponseTypes.Api; + +public static class Program +{ + public static void Main(string[] args) + { + CreateHostBuilder(args) + .Build() + .Run(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) + { + var builder = Host + .CreateDefaultBuilder(args) + .ConfigureWebHostDefaults(webBuilder => + { + webBuilder.UseStartup(); + }); + + return builder; + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/src/ExAllResponseTypes.Api/Startup.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/src/ExAllResponseTypes.Api/Startup.verified.cs new file mode 100644 index 00000000..e28818fb --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/src/ExAllResponseTypes.Api/Startup.verified.cs @@ -0,0 +1,38 @@ +namespace ExAllResponseTypes.Api; + +public class Startup +{ + private readonly RestApiExtendedOptions restApiOptions; + + public Startup( + IConfiguration configuration) + { + Configuration = configuration; + restApiOptions = new RestApiExtendedOptions + { + // TODO: Remove/out-comment/set to false this for production scenarios! + AllowAnonymousAccessForDevelopment = true, + }; + + restApiOptions.AddAssemblyPairs( + Assembly.GetAssembly(typeof(ApiRegistration)), + Assembly.GetAssembly(typeof(DomainRegistration))); + } + + public IConfiguration Configuration { get; } + + public void ConfigureServices( + IServiceCollection services) + { + services.ConfigureOptions(); + + services.AddRestApi(restApiOptions, Configuration); + } + + public void Configure( + IApplicationBuilder app, + IWebHostEnvironment env) + { + app.ConfigureRestApi(env, restApiOptions); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/src/ExAllResponseTypes.Domain/DomainRegistration.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/src/ExAllResponseTypes.Domain/DomainRegistration.verified.cs new file mode 100644 index 00000000..b8958116 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/src/ExAllResponseTypes.Domain/DomainRegistration.verified.cs @@ -0,0 +1,12 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExAllResponseTypes.Domain; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class DomainRegistration +{ +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/src/ExAllResponseTypes.Domain/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/src/ExAllResponseTypes.Domain/GlobalUsings.verified.cs new file mode 100644 index 00000000..c75f892b --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/src/ExAllResponseTypes.Domain/GlobalUsings.verified.cs @@ -0,0 +1,3 @@ +global using System.CodeDom.Compiler; + +global using ExAllResponseTypes.Api.Generated.Contracts.Example; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/src/ExAllResponseTypes.Domain/Handlers/Example/GetExampleHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/src/ExAllResponseTypes.Domain/Handlers/Example/GetExampleHandler.verified.cs new file mode 100644 index 00000000..f8659325 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/src/ExAllResponseTypes.Domain/Handlers/Example/GetExampleHandler.verified.cs @@ -0,0 +1,18 @@ +namespace ExAllResponseTypes.Domain.Handlers.Example; + +/// +/// Handler for operation request. +/// Description: Example endpoint. +/// Operation: GetExample. +/// +public class GetExampleHandler : IGetExampleHandler +{ + public Task ExecuteAsync( + GetExampleParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for GetExampleHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/test/ExAllResponseTypes.Api.Tests/Endpoints/Example/GetExampleHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/test/ExAllResponseTypes.Api.Tests/Endpoints/Example/GetExampleHandlerStub.verified.cs new file mode 100644 index 00000000..2f850d4c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/test/ExAllResponseTypes.Api.Tests/Endpoints/Example/GetExampleHandlerStub.verified.cs @@ -0,0 +1,20 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExAllResponseTypes.Api.Tests.Endpoints.Example; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetExampleHandlerStub : IGetExampleHandler +{ + public Task ExecuteAsync( + GetExampleParameters parameters, + CancellationToken cancellationToken = default) + { + var data = new Fixture().Create(); + + return Task.FromResult(GetExampleResult.Ok(data)); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/test/ExAllResponseTypes.Api.Tests/Endpoints/Example/GetExampleTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/test/ExAllResponseTypes.Api.Tests/Endpoints/Example/GetExampleTests.verified.cs new file mode 100644 index 00000000..23e46961 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/test/ExAllResponseTypes.Api.Tests/Endpoints/Example/GetExampleTests.verified.cs @@ -0,0 +1,21 @@ +namespace ExAllResponseTypes.Api.Tests.Endpoints.Example; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class GetExampleTests : WebApiControllerBaseTest +{ + public GetExampleTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/test/ExAllResponseTypes.Api.Tests/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/test/ExAllResponseTypes.Api.Tests/GlobalUsings.verified.cs new file mode 100644 index 00000000..8d0f3684 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/test/ExAllResponseTypes.Api.Tests/GlobalUsings.verified.cs @@ -0,0 +1,22 @@ +global using System.CodeDom.Compiler; +global using System.Reflection; +global using System.Text; +global using System.Text.Json; +global using System.Text.Json.Serialization; + +global using Atc.Rest.Options; +global using Atc.XUnit; + +global using AutoFixture; + +global using ExAllResponseTypes.Api.Generated; +global using ExAllResponseTypes.Api.Generated.Contracts.Example; + +global using Microsoft.AspNetCore.Hosting; +global using Microsoft.AspNetCore.Http; +global using Microsoft.AspNetCore.Mvc.Testing; +global using Microsoft.AspNetCore.TestHost; +global using Microsoft.Extensions.Configuration; +global using Microsoft.Extensions.DependencyInjection; + +global using Xunit; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/test/ExAllResponseTypes.Api.Tests/WebApiControllerBaseTest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/test/ExAllResponseTypes.Api.Tests/WebApiControllerBaseTest.verified.cs new file mode 100644 index 00000000..d558bfd3 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/test/ExAllResponseTypes.Api.Tests/WebApiControllerBaseTest.verified.cs @@ -0,0 +1,56 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExAllResponseTypes.Api.Tests; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public abstract class WebApiControllerBaseTest : IClassFixture +{ + protected readonly WebApiStartupFactory Factory; + + protected readonly HttpClient HttpClient; + + protected readonly IConfiguration Configuration; + + protected static JsonSerializerOptions? JsonSerializerOptions; + + protected WebApiControllerBaseTest(WebApiStartupFactory fixture) + { + this.Factory = fixture; + this.HttpClient = this.Factory.CreateClient(); + this.Configuration = new ConfigurationBuilder().Build(); + JsonSerializerOptions = new JsonSerializerOptions + { + PropertyNameCaseInsensitive = true, + Converters = + { + new JsonStringEnumConverter() + }, + }; + } + + protected static StringContent ToJson(object data) + => new(JsonSerializer.Serialize(data, JsonSerializerOptions), Encoding.UTF8, "application/json"); + + protected static StringContent Json(string data) + => new(data, Encoding.UTF8, "application/json"); + + protected static IFormFile GetTestFile() + { + var bytes = Encoding.UTF8.GetBytes("Hello World"); + var stream = new MemoryStream(bytes); + var formFile = new FormFile(stream, 0, stream.Length, "dummy", "dummy.txt") + { + Headers = new HeaderDictionary(), + ContentType = "application/octet-stream", + }; + + return formFile; + } + + protected static List GetTestFiles() + => new() { GetTestFile(), GetTestFile() }; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/test/ExAllResponseTypes.Api.Tests/WebApiStartupFactory.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/test/ExAllResponseTypes.Api.Tests/WebApiStartupFactory.verified.cs new file mode 100644 index 00000000..aece5169 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/test/ExAllResponseTypes.Api.Tests/WebApiStartupFactory.verified.cs @@ -0,0 +1,40 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExAllResponseTypes.Api.Tests; + +/// +/// Factory for bootstrapping in memory tests. +/// Includes options to override configuration and service collection using a partial class. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public partial class WebApiStartupFactory : WebApplicationFactory +{ + protected override void ConfigureWebHost(IWebHostBuilder builder) + { + builder.ConfigureAppConfiguration(config => + { + ModifyConfiguration(config); + var integrationConfig = new ConfigurationBuilder() + .AddJsonFile("appsettings.integrationtest.json") + .Build(); + config.AddConfiguration(integrationConfig); + }); + + builder.ConfigureTestServices(services => + { + ModifyServices(services); + services.AddSingleton(); + services.AutoRegistrateServices( + Assembly.GetAssembly(typeof(ApiRegistration))!, + Assembly.GetAssembly(typeof(WebApiStartupFactory))!); + }); + } + + partial void ModifyConfiguration(IConfigurationBuilder config); + + partial void ModifyServices(IServiceCollection services); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/test/ExAllResponseTypes.Domain.Tests/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/test/ExAllResponseTypes.Domain.Tests/GlobalUsings.verified.cs new file mode 100644 index 00000000..8c927eb7 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/test/ExAllResponseTypes.Domain.Tests/GlobalUsings.verified.cs @@ -0,0 +1 @@ +global using Xunit; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/test/ExAllResponseTypes.Domain.Tests/Handlers/Example/GetExampleHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/test/ExAllResponseTypes.Domain.Tests/Handlers/Example/GetExampleHandlerTests.verified.cs new file mode 100644 index 00000000..a1ac7c3c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExAllResponseTypes/VerifyServerAll/Mvc_WPD/test/ExAllResponseTypes.Domain.Tests/Handlers/Example/GetExampleHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace ExAllResponseTypes.Domain.Tests.Handlers.Example; + +public class GetExampleHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/GenericPaginationApi.yaml b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/ExGenericPagination.yaml similarity index 100% rename from test/Atc.Rest.ApiGenerator.CLI.Tests/GenericPaginationApi/GenericPaginationApi.yaml rename to test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/ExGenericPagination.yaml diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WOPD/src/ExGenericPagination.ApiClient.Generated/Contracts/Cats/Cat.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WOPD/src/ExGenericPagination.ApiClient.Generated/Contracts/Cats/Cat.verified.cs new file mode 100644 index 00000000..14c64f46 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WOPD/src/ExGenericPagination.ApiClient.Generated/Contracts/Cats/Cat.verified.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.ApiClient.Generated.Contracts.Cats; + +/// +/// Cat. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Cat +{ + public int Id { get; set; } + + public string Name { get; set; } + + public string ServantName { get; set; } + + public string FavoriteFish { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(Name)}: {Name}, {nameof(ServantName)}: {ServantName}, {nameof(FavoriteFish)}: {FavoriteFish}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WOPD/src/ExGenericPagination.ApiClient.Generated/Contracts/Cats/RequestParameters/GetCatsParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WOPD/src/ExGenericPagination.ApiClient.Generated/Contracts/Cats/RequestParameters/GetCatsParameters.verified.cs new file mode 100644 index 00000000..38cf4d35 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WOPD/src/ExGenericPagination.ApiClient.Generated/Contracts/Cats/RequestParameters/GetCatsParameters.verified.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.ApiClient.Generated.Contracts.Cats; + +/// +/// Parameters for operation request. +/// Description: Find all cats. +/// Operation: GetCats. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetCatsParameters +{ + [Required] + public int PageSize { get; set; } = 10; + + [Required] + public int PageIndex { get; set; } = 0; + + [Required] + public string QueryString { get; set; } + + /// + public override string ToString() + => $"{nameof(PageSize)}: {PageSize}, {nameof(PageIndex)}: {PageIndex}, {nameof(QueryString)}: {QueryString}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WOPD/src/ExGenericPagination.ApiClient.Generated/Contracts/Dogs/Dog.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WOPD/src/ExGenericPagination.ApiClient.Generated/Contracts/Dogs/Dog.verified.cs new file mode 100644 index 00000000..240da211 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WOPD/src/ExGenericPagination.ApiClient.Generated/Contracts/Dogs/Dog.verified.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.ApiClient.Generated.Contracts.Dogs; + +/// +/// Dog. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Dog +{ + public int Id { get; set; } + + public string Name { get; set; } + + public string OwnerName { get; set; } + + public string FavoriteToy { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(Name)}: {Name}, {nameof(OwnerName)}: {OwnerName}, {nameof(FavoriteToy)}: {FavoriteToy}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WOPD/src/ExGenericPagination.ApiClient.Generated/Contracts/Dogs/RequestParameters/GetDogsParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WOPD/src/ExGenericPagination.ApiClient.Generated/Contracts/Dogs/RequestParameters/GetDogsParameters.verified.cs new file mode 100644 index 00000000..5816d9b1 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WOPD/src/ExGenericPagination.ApiClient.Generated/Contracts/Dogs/RequestParameters/GetDogsParameters.verified.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.ApiClient.Generated.Contracts.Dogs; + +/// +/// Parameters for operation request. +/// Description: Find all dogs. +/// Operation: GetDogs. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetDogsParameters +{ + [Required] + public int PageSize { get; set; } = 10; + + [Required] + public int PageIndex { get; set; } = 0; + + [Required] + public string QueryString { get; set; } + + /// + public override string ToString() + => $"{nameof(PageSize)}: {PageSize}, {nameof(PageIndex)}: {PageIndex}, {nameof(QueryString)}: {QueryString}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WOPD/src/ExGenericPagination.ApiClient.Generated/Contracts/_Shared/PaginatedResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WOPD/src/ExGenericPagination.ApiClient.Generated/Contracts/_Shared/PaginatedResult.verified.cs new file mode 100644 index 00000000..ba3b3d8d --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WOPD/src/ExGenericPagination.ApiClient.Generated/Contracts/_Shared/PaginatedResult.verified.cs @@ -0,0 +1,32 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.ApiClient.Generated.Contracts; + +/// +/// PaginatedResult. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class PaginatedResult +{ + public int PageSize { get; set; } = 10; + + public int PageIndex { get; set; } + + public string? QueryString { get; set; } + + public string? ContinuationToken { get; set; } + + public int Count { get; set; } + + public int TotalCount { get; set; } + + public List Results { get; set; } = new List(); + + /// + public override string ToString() + => $"{nameof(PageSize)}: {PageSize}, {nameof(PageIndex)}: {PageIndex}, {nameof(QueryString)}: {QueryString}, {nameof(ContinuationToken)}: {ContinuationToken}, {nameof(Count)}: {Count}, {nameof(TotalCount)}: {TotalCount}, {nameof(Results)}.Count: {Results?.Count ?? 0}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WOPD/src/ExGenericPagination.ApiClient.Generated/Endpoints/Cats/GetCatsEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WOPD/src/ExGenericPagination.ApiClient.Generated/Endpoints/Cats/GetCatsEndpoint.verified.cs new file mode 100644 index 00000000..674518e9 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WOPD/src/ExGenericPagination.ApiClient.Generated/Endpoints/Cats/GetCatsEndpoint.verified.cs @@ -0,0 +1,49 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.ApiClient.Generated.Endpoints.Cats; + +/// +/// Client Endpoint. +/// Description: Find all cats. +/// Operation: GetCats. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetCatsEndpoint : IGetCatsEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public GetCatsEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + GetCatsParameters parameters, + string httpClientName = "ExGenericPagination-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/cats"); + requestBuilder.WithQueryParameter("pageSize", parameters.PageSize); + requestBuilder.WithQueryParameter("pageIndex", parameters.PageIndex); + requestBuilder.WithQueryParameter("queryString", parameters.QueryString); + + using var requestMessage = requestBuilder.Build(HttpMethod.Get); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse>(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + return await responseBuilder.BuildResponseAsync(x => new GetCatsEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WOPD/src/ExGenericPagination.ApiClient.Generated/Endpoints/Cats/GetCatsEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WOPD/src/ExGenericPagination.ApiClient.Generated/Endpoints/Cats/GetCatsEndpointResult.verified.cs new file mode 100644 index 00000000..5e669538 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WOPD/src/ExGenericPagination.ApiClient.Generated/Endpoints/Cats/GetCatsEndpointResult.verified.cs @@ -0,0 +1,45 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.ApiClient.Generated.Endpoints.Cats; + +/// +/// Client Endpoint result. +/// Description: Find all cats. +/// Operation: GetCats. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetCatsEndpointResult : EndpointResponse, IGetCatsEndpointResult +{ + public GetCatsEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public PaginatedResult OkContent + => IsOk && ContentObject is PaginatedResult result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public string? BadRequestContent + => IsBadRequest && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public string? UnauthorizedContent + => IsUnauthorized && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WOPD/src/ExGenericPagination.ApiClient.Generated/Endpoints/Cats/Interfaces/IGetCatsEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WOPD/src/ExGenericPagination.ApiClient.Generated/Endpoints/Cats/Interfaces/IGetCatsEndpoint.verified.cs new file mode 100644 index 00000000..f03320ff --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WOPD/src/ExGenericPagination.ApiClient.Generated/Endpoints/Cats/Interfaces/IGetCatsEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.ApiClient.Generated.Endpoints.Cats.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Find all cats. +/// Operation: GetCats. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetCatsEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + GetCatsParameters parameters, + string httpClientName = "ExGenericPagination-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WOPD/src/ExGenericPagination.ApiClient.Generated/Endpoints/Cats/Interfaces/IGetCatsEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WOPD/src/ExGenericPagination.ApiClient.Generated/Endpoints/Cats/Interfaces/IGetCatsEndpointResult.verified.cs new file mode 100644 index 00000000..bcd1305c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WOPD/src/ExGenericPagination.ApiClient.Generated/Endpoints/Cats/Interfaces/IGetCatsEndpointResult.verified.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.ApiClient.Generated.Endpoints.Cats.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Find all cats. +/// Operation: GetCats. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetCatsEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + PaginatedResult OkContent { get; } + + string? BadRequestContent { get; } + + string? UnauthorizedContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WOPD/src/ExGenericPagination.ApiClient.Generated/Endpoints/Dogs/GetDogsEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WOPD/src/ExGenericPagination.ApiClient.Generated/Endpoints/Dogs/GetDogsEndpoint.verified.cs new file mode 100644 index 00000000..5506c3d1 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WOPD/src/ExGenericPagination.ApiClient.Generated/Endpoints/Dogs/GetDogsEndpoint.verified.cs @@ -0,0 +1,49 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.ApiClient.Generated.Endpoints.Dogs; + +/// +/// Client Endpoint. +/// Description: Find all dogs. +/// Operation: GetDogs. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetDogsEndpoint : IGetDogsEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public GetDogsEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + GetDogsParameters parameters, + string httpClientName = "ExGenericPagination-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/dogs"); + requestBuilder.WithQueryParameter("pageSize", parameters.PageSize); + requestBuilder.WithQueryParameter("pageIndex", parameters.PageIndex); + requestBuilder.WithQueryParameter("queryString", parameters.QueryString); + + using var requestMessage = requestBuilder.Build(HttpMethod.Get); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse>(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + return await responseBuilder.BuildResponseAsync(x => new GetDogsEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WOPD/src/ExGenericPagination.ApiClient.Generated/Endpoints/Dogs/GetDogsEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WOPD/src/ExGenericPagination.ApiClient.Generated/Endpoints/Dogs/GetDogsEndpointResult.verified.cs new file mode 100644 index 00000000..e1321fb2 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WOPD/src/ExGenericPagination.ApiClient.Generated/Endpoints/Dogs/GetDogsEndpointResult.verified.cs @@ -0,0 +1,45 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.ApiClient.Generated.Endpoints.Dogs; + +/// +/// Client Endpoint result. +/// Description: Find all dogs. +/// Operation: GetDogs. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetDogsEndpointResult : EndpointResponse, IGetDogsEndpointResult +{ + public GetDogsEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public PaginatedResult OkContent + => IsOk && ContentObject is PaginatedResult result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public string? BadRequestContent + => IsBadRequest && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public string? UnauthorizedContent + => IsUnauthorized && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WOPD/src/ExGenericPagination.ApiClient.Generated/Endpoints/Dogs/Interfaces/IGetDogsEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WOPD/src/ExGenericPagination.ApiClient.Generated/Endpoints/Dogs/Interfaces/IGetDogsEndpoint.verified.cs new file mode 100644 index 00000000..de425b81 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WOPD/src/ExGenericPagination.ApiClient.Generated/Endpoints/Dogs/Interfaces/IGetDogsEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.ApiClient.Generated.Endpoints.Dogs.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Find all dogs. +/// Operation: GetDogs. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetDogsEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + GetDogsParameters parameters, + string httpClientName = "ExGenericPagination-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WOPD/src/ExGenericPagination.ApiClient.Generated/Endpoints/Dogs/Interfaces/IGetDogsEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WOPD/src/ExGenericPagination.ApiClient.Generated/Endpoints/Dogs/Interfaces/IGetDogsEndpointResult.verified.cs new file mode 100644 index 00000000..82de70ec --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WOPD/src/ExGenericPagination.ApiClient.Generated/Endpoints/Dogs/Interfaces/IGetDogsEndpointResult.verified.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.ApiClient.Generated.Endpoints.Dogs.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Find all dogs. +/// Operation: GetDogs. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetDogsEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + PaginatedResult OkContent { get; } + + string? BadRequestContent { get; } + + string? UnauthorizedContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WOPD/src/ExGenericPagination.ApiClient.Generated/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WOPD/src/ExGenericPagination.ApiClient.Generated/GlobalUsings.verified.cs new file mode 100644 index 00000000..76e74e04 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WOPD/src/ExGenericPagination.ApiClient.Generated/GlobalUsings.verified.cs @@ -0,0 +1,18 @@ +global using System; +global using System.CodeDom.Compiler; +global using System.ComponentModel.DataAnnotations; +global using System.Net; +global using System.Net.Http; +global using System.Threading; +global using System.Threading.Tasks; + +global using Atc.Rest.Client; +global using Atc.Rest.Client.Builder; + +global using ExGenericPagination.ApiClient.Generated.Contracts; +global using ExGenericPagination.ApiClient.Generated.Contracts.Cats; +global using ExGenericPagination.ApiClient.Generated.Contracts.Dogs; +global using ExGenericPagination.ApiClient.Generated.Endpoints.Cats.Interfaces; +global using ExGenericPagination.ApiClient.Generated.Endpoints.Dogs.Interfaces; + +global using Microsoft.AspNetCore.Mvc; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WPD/src/ExGenericPagination.ApiClient.Generated/Contracts/Cats/Cat.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WPD/src/ExGenericPagination.ApiClient.Generated/Contracts/Cats/Cat.verified.cs new file mode 100644 index 00000000..14c64f46 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WPD/src/ExGenericPagination.ApiClient.Generated/Contracts/Cats/Cat.verified.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.ApiClient.Generated.Contracts.Cats; + +/// +/// Cat. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Cat +{ + public int Id { get; set; } + + public string Name { get; set; } + + public string ServantName { get; set; } + + public string FavoriteFish { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(Name)}: {Name}, {nameof(ServantName)}: {ServantName}, {nameof(FavoriteFish)}: {FavoriteFish}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WPD/src/ExGenericPagination.ApiClient.Generated/Contracts/Cats/RequestParameters/GetCatsParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WPD/src/ExGenericPagination.ApiClient.Generated/Contracts/Cats/RequestParameters/GetCatsParameters.verified.cs new file mode 100644 index 00000000..38cf4d35 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WPD/src/ExGenericPagination.ApiClient.Generated/Contracts/Cats/RequestParameters/GetCatsParameters.verified.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.ApiClient.Generated.Contracts.Cats; + +/// +/// Parameters for operation request. +/// Description: Find all cats. +/// Operation: GetCats. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetCatsParameters +{ + [Required] + public int PageSize { get; set; } = 10; + + [Required] + public int PageIndex { get; set; } = 0; + + [Required] + public string QueryString { get; set; } + + /// + public override string ToString() + => $"{nameof(PageSize)}: {PageSize}, {nameof(PageIndex)}: {PageIndex}, {nameof(QueryString)}: {QueryString}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WPD/src/ExGenericPagination.ApiClient.Generated/Contracts/Dogs/Dog.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WPD/src/ExGenericPagination.ApiClient.Generated/Contracts/Dogs/Dog.verified.cs new file mode 100644 index 00000000..240da211 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WPD/src/ExGenericPagination.ApiClient.Generated/Contracts/Dogs/Dog.verified.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.ApiClient.Generated.Contracts.Dogs; + +/// +/// Dog. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Dog +{ + public int Id { get; set; } + + public string Name { get; set; } + + public string OwnerName { get; set; } + + public string FavoriteToy { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(Name)}: {Name}, {nameof(OwnerName)}: {OwnerName}, {nameof(FavoriteToy)}: {FavoriteToy}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WPD/src/ExGenericPagination.ApiClient.Generated/Contracts/Dogs/RequestParameters/GetDogsParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WPD/src/ExGenericPagination.ApiClient.Generated/Contracts/Dogs/RequestParameters/GetDogsParameters.verified.cs new file mode 100644 index 00000000..5816d9b1 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WPD/src/ExGenericPagination.ApiClient.Generated/Contracts/Dogs/RequestParameters/GetDogsParameters.verified.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.ApiClient.Generated.Contracts.Dogs; + +/// +/// Parameters for operation request. +/// Description: Find all dogs. +/// Operation: GetDogs. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetDogsParameters +{ + [Required] + public int PageSize { get; set; } = 10; + + [Required] + public int PageIndex { get; set; } = 0; + + [Required] + public string QueryString { get; set; } + + /// + public override string ToString() + => $"{nameof(PageSize)}: {PageSize}, {nameof(PageIndex)}: {PageIndex}, {nameof(QueryString)}: {QueryString}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WPD/src/ExGenericPagination.ApiClient.Generated/Contracts/_Shared/PaginatedResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WPD/src/ExGenericPagination.ApiClient.Generated/Contracts/_Shared/PaginatedResult.verified.cs new file mode 100644 index 00000000..ba3b3d8d --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WPD/src/ExGenericPagination.ApiClient.Generated/Contracts/_Shared/PaginatedResult.verified.cs @@ -0,0 +1,32 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.ApiClient.Generated.Contracts; + +/// +/// PaginatedResult. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class PaginatedResult +{ + public int PageSize { get; set; } = 10; + + public int PageIndex { get; set; } + + public string? QueryString { get; set; } + + public string? ContinuationToken { get; set; } + + public int Count { get; set; } + + public int TotalCount { get; set; } + + public List Results { get; set; } = new List(); + + /// + public override string ToString() + => $"{nameof(PageSize)}: {PageSize}, {nameof(PageIndex)}: {PageIndex}, {nameof(QueryString)}: {QueryString}, {nameof(ContinuationToken)}: {ContinuationToken}, {nameof(Count)}: {Count}, {nameof(TotalCount)}: {TotalCount}, {nameof(Results)}.Count: {Results?.Count ?? 0}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WPD/src/ExGenericPagination.ApiClient.Generated/Endpoints/Cats/GetCatsEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WPD/src/ExGenericPagination.ApiClient.Generated/Endpoints/Cats/GetCatsEndpoint.verified.cs new file mode 100644 index 00000000..f76db805 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WPD/src/ExGenericPagination.ApiClient.Generated/Endpoints/Cats/GetCatsEndpoint.verified.cs @@ -0,0 +1,49 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.ApiClient.Generated.Endpoints.Cats; + +/// +/// Client Endpoint. +/// Description: Find all cats. +/// Operation: GetCats. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetCatsEndpoint : IGetCatsEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public GetCatsEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + GetCatsParameters parameters, + string httpClientName = "ExGenericPagination-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/cats"); + requestBuilder.WithQueryParameter("pageSize", parameters.PageSize); + requestBuilder.WithQueryParameter("pageIndex", parameters.PageIndex); + requestBuilder.WithQueryParameter("queryString", parameters.QueryString); + + using var requestMessage = requestBuilder.Build(HttpMethod.Get); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse>(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + return await responseBuilder.BuildResponseAsync(x => new GetCatsEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WPD/src/ExGenericPagination.ApiClient.Generated/Endpoints/Cats/GetCatsEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WPD/src/ExGenericPagination.ApiClient.Generated/Endpoints/Cats/GetCatsEndpointResult.verified.cs new file mode 100644 index 00000000..4013e38c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WPD/src/ExGenericPagination.ApiClient.Generated/Endpoints/Cats/GetCatsEndpointResult.verified.cs @@ -0,0 +1,45 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.ApiClient.Generated.Endpoints.Cats; + +/// +/// Client Endpoint result. +/// Description: Find all cats. +/// Operation: GetCats. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetCatsEndpointResult : EndpointResponse, IGetCatsEndpointResult +{ + public GetCatsEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public PaginatedResult OkContent + => IsOk && ContentObject is PaginatedResult result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public ValidationProblemDetails BadRequestContent + => IsBadRequest && ContentObject is ValidationProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public ProblemDetails UnauthorizedContent + => IsUnauthorized && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WPD/src/ExGenericPagination.ApiClient.Generated/Endpoints/Cats/Interfaces/IGetCatsEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WPD/src/ExGenericPagination.ApiClient.Generated/Endpoints/Cats/Interfaces/IGetCatsEndpoint.verified.cs new file mode 100644 index 00000000..f03320ff --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WPD/src/ExGenericPagination.ApiClient.Generated/Endpoints/Cats/Interfaces/IGetCatsEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.ApiClient.Generated.Endpoints.Cats.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Find all cats. +/// Operation: GetCats. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetCatsEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + GetCatsParameters parameters, + string httpClientName = "ExGenericPagination-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WPD/src/ExGenericPagination.ApiClient.Generated/Endpoints/Cats/Interfaces/IGetCatsEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WPD/src/ExGenericPagination.ApiClient.Generated/Endpoints/Cats/Interfaces/IGetCatsEndpointResult.verified.cs new file mode 100644 index 00000000..a0f29edd --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WPD/src/ExGenericPagination.ApiClient.Generated/Endpoints/Cats/Interfaces/IGetCatsEndpointResult.verified.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.ApiClient.Generated.Endpoints.Cats.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Find all cats. +/// Operation: GetCats. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetCatsEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + PaginatedResult OkContent { get; } + + ValidationProblemDetails BadRequestContent { get; } + + ProblemDetails UnauthorizedContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WPD/src/ExGenericPagination.ApiClient.Generated/Endpoints/Dogs/GetDogsEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WPD/src/ExGenericPagination.ApiClient.Generated/Endpoints/Dogs/GetDogsEndpoint.verified.cs new file mode 100644 index 00000000..6f1305b7 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WPD/src/ExGenericPagination.ApiClient.Generated/Endpoints/Dogs/GetDogsEndpoint.verified.cs @@ -0,0 +1,49 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.ApiClient.Generated.Endpoints.Dogs; + +/// +/// Client Endpoint. +/// Description: Find all dogs. +/// Operation: GetDogs. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetDogsEndpoint : IGetDogsEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public GetDogsEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + GetDogsParameters parameters, + string httpClientName = "ExGenericPagination-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/dogs"); + requestBuilder.WithQueryParameter("pageSize", parameters.PageSize); + requestBuilder.WithQueryParameter("pageIndex", parameters.PageIndex); + requestBuilder.WithQueryParameter("queryString", parameters.QueryString); + + using var requestMessage = requestBuilder.Build(HttpMethod.Get); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse>(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + return await responseBuilder.BuildResponseAsync(x => new GetDogsEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WPD/src/ExGenericPagination.ApiClient.Generated/Endpoints/Dogs/GetDogsEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WPD/src/ExGenericPagination.ApiClient.Generated/Endpoints/Dogs/GetDogsEndpointResult.verified.cs new file mode 100644 index 00000000..1338d451 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WPD/src/ExGenericPagination.ApiClient.Generated/Endpoints/Dogs/GetDogsEndpointResult.verified.cs @@ -0,0 +1,45 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.ApiClient.Generated.Endpoints.Dogs; + +/// +/// Client Endpoint result. +/// Description: Find all dogs. +/// Operation: GetDogs. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetDogsEndpointResult : EndpointResponse, IGetDogsEndpointResult +{ + public GetDogsEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public PaginatedResult OkContent + => IsOk && ContentObject is PaginatedResult result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public ValidationProblemDetails BadRequestContent + => IsBadRequest && ContentObject is ValidationProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public ProblemDetails UnauthorizedContent + => IsUnauthorized && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WPD/src/ExGenericPagination.ApiClient.Generated/Endpoints/Dogs/Interfaces/IGetDogsEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WPD/src/ExGenericPagination.ApiClient.Generated/Endpoints/Dogs/Interfaces/IGetDogsEndpoint.verified.cs new file mode 100644 index 00000000..de425b81 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WPD/src/ExGenericPagination.ApiClient.Generated/Endpoints/Dogs/Interfaces/IGetDogsEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.ApiClient.Generated.Endpoints.Dogs.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Find all dogs. +/// Operation: GetDogs. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetDogsEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + GetDogsParameters parameters, + string httpClientName = "ExGenericPagination-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WPD/src/ExGenericPagination.ApiClient.Generated/Endpoints/Dogs/Interfaces/IGetDogsEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WPD/src/ExGenericPagination.ApiClient.Generated/Endpoints/Dogs/Interfaces/IGetDogsEndpointResult.verified.cs new file mode 100644 index 00000000..c621298b --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WPD/src/ExGenericPagination.ApiClient.Generated/Endpoints/Dogs/Interfaces/IGetDogsEndpointResult.verified.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.ApiClient.Generated.Endpoints.Dogs.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Find all dogs. +/// Operation: GetDogs. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetDogsEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + PaginatedResult OkContent { get; } + + ValidationProblemDetails BadRequestContent { get; } + + ProblemDetails UnauthorizedContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WPD/src/ExGenericPagination.ApiClient.Generated/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WPD/src/ExGenericPagination.ApiClient.Generated/GlobalUsings.verified.cs new file mode 100644 index 00000000..76e74e04 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyClient/WPD/src/ExGenericPagination.ApiClient.Generated/GlobalUsings.verified.cs @@ -0,0 +1,18 @@ +global using System; +global using System.CodeDom.Compiler; +global using System.ComponentModel.DataAnnotations; +global using System.Net; +global using System.Net.Http; +global using System.Threading; +global using System.Threading.Tasks; + +global using Atc.Rest.Client; +global using Atc.Rest.Client.Builder; + +global using ExGenericPagination.ApiClient.Generated.Contracts; +global using ExGenericPagination.ApiClient.Generated.Contracts.Cats; +global using ExGenericPagination.ApiClient.Generated.Contracts.Dogs; +global using ExGenericPagination.ApiClient.Generated.Endpoints.Cats.Interfaces; +global using ExGenericPagination.ApiClient.Generated.Endpoints.Dogs.Interfaces; + +global using Microsoft.AspNetCore.Mvc; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Api.Generated/ApiRegistration.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Api.Generated/ApiRegistration.verified.cs new file mode 100644 index 00000000..ed85f4ce --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Api.Generated/ApiRegistration.verified.cs @@ -0,0 +1,12 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.Api.Generated; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ApiRegistration +{ +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Api.Generated/Contracts/Cats/Interfaces/IGetCatsHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Api.Generated/Contracts/Cats/Interfaces/IGetCatsHandler.verified.cs new file mode 100644 index 00000000..63214339 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Api.Generated/Contracts/Cats/Interfaces/IGetCatsHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.Api.Generated.Contracts.Cats; + +/// +/// Domain Interface for RequestHandler. +/// Description: Find all cats. +/// Operation: GetCats. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetCatsHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + GetCatsParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Api.Generated/Contracts/Cats/Models/Cat.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Api.Generated/Contracts/Cats/Models/Cat.verified.cs new file mode 100644 index 00000000..ba36668d --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Api.Generated/Contracts/Cats/Models/Cat.verified.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.Api.Generated.Contracts.Cats; + +/// +/// Cat. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Cat +{ + public int Id { get; set; } + + public string Name { get; set; } + + public string ServantName { get; set; } + + public string FavoriteFish { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(Name)}: {Name}, {nameof(ServantName)}: {ServantName}, {nameof(FavoriteFish)}: {FavoriteFish}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Api.Generated/Contracts/Cats/Parameters/GetCatsParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Api.Generated/Contracts/Cats/Parameters/GetCatsParameters.verified.cs new file mode 100644 index 00000000..b5811910 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Api.Generated/Contracts/Cats/Parameters/GetCatsParameters.verified.cs @@ -0,0 +1,32 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.Api.Generated.Contracts.Cats; + +/// +/// Parameters for operation request. +/// Description: Find all cats. +/// Operation: GetCats. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetCatsParameters +{ + [FromQuery(Name = "pageSize")] + [Required] + public int PageSize { get; set; } = 10; + + [FromQuery(Name = "pageIndex")] + [Required] + public int PageIndex { get; set; } = 0; + + [FromQuery(Name = "queryString")] + [Required] + public string QueryString { get; set; } + + /// + public override string ToString() + => $"{nameof(PageSize)}: {PageSize}, {nameof(PageIndex)}: {PageIndex}, {nameof(QueryString)}: {QueryString}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Api.Generated/Contracts/Cats/Results/GetCatsResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Api.Generated/Contracts/Cats/Results/GetCatsResult.verified.cs new file mode 100644 index 00000000..c5ab1a02 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Api.Generated/Contracts/Cats/Results/GetCatsResult.verified.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.Api.Generated.Contracts.Cats; + +/// +/// Results for operation request. +/// Description: Find all cats. +/// Operation: GetCats. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetCatsResult : ResultBase +{ + private GetCatsResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static GetCatsResult Ok(PaginatedResult response) + => new GetCatsResult(new OkObjectResult(response)); + + /// + /// Performs an implicit conversion from GetCatsResult to ActionResult. + /// + public static implicit operator GetCatsResult(PaginatedResult response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Api.Generated/Contracts/Dogs/Interfaces/IGetDogsHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Api.Generated/Contracts/Dogs/Interfaces/IGetDogsHandler.verified.cs new file mode 100644 index 00000000..33db47ad --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Api.Generated/Contracts/Dogs/Interfaces/IGetDogsHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.Api.Generated.Contracts.Dogs; + +/// +/// Domain Interface for RequestHandler. +/// Description: Find all dogs. +/// Operation: GetDogs. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetDogsHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + GetDogsParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Api.Generated/Contracts/Dogs/Models/Dog.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Api.Generated/Contracts/Dogs/Models/Dog.verified.cs new file mode 100644 index 00000000..348cc5cb --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Api.Generated/Contracts/Dogs/Models/Dog.verified.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.Api.Generated.Contracts.Dogs; + +/// +/// Dog. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Dog +{ + public int Id { get; set; } + + public string Name { get; set; } + + public string OwnerName { get; set; } + + public string FavoriteToy { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(Name)}: {Name}, {nameof(OwnerName)}: {OwnerName}, {nameof(FavoriteToy)}: {FavoriteToy}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Api.Generated/Contracts/Dogs/Parameters/GetDogsParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Api.Generated/Contracts/Dogs/Parameters/GetDogsParameters.verified.cs new file mode 100644 index 00000000..d172a5c2 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Api.Generated/Contracts/Dogs/Parameters/GetDogsParameters.verified.cs @@ -0,0 +1,32 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.Api.Generated.Contracts.Dogs; + +/// +/// Parameters for operation request. +/// Description: Find all dogs. +/// Operation: GetDogs. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetDogsParameters +{ + [FromQuery(Name = "pageSize")] + [Required] + public int PageSize { get; set; } = 10; + + [FromQuery(Name = "pageIndex")] + [Required] + public int PageIndex { get; set; } = 0; + + [FromQuery(Name = "queryString")] + [Required] + public string QueryString { get; set; } + + /// + public override string ToString() + => $"{nameof(PageSize)}: {PageSize}, {nameof(PageIndex)}: {PageIndex}, {nameof(QueryString)}: {QueryString}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Api.Generated/Contracts/Dogs/Results/GetDogsResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Api.Generated/Contracts/Dogs/Results/GetDogsResult.verified.cs new file mode 100644 index 00000000..2c0614eb --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Api.Generated/Contracts/Dogs/Results/GetDogsResult.verified.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.Api.Generated.Contracts.Dogs; + +/// +/// Results for operation request. +/// Description: Find all dogs. +/// Operation: GetDogs. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetDogsResult : ResultBase +{ + private GetDogsResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static GetDogsResult Ok(PaginatedResult response) + => new GetDogsResult(new OkObjectResult(response)); + + /// + /// Performs an implicit conversion from GetDogsResult to ActionResult. + /// + public static implicit operator GetDogsResult(PaginatedResult response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Api.Generated/Contracts/_Shared/PaginatedResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Api.Generated/Contracts/_Shared/PaginatedResult.verified.cs new file mode 100644 index 00000000..f5abdf7b --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Api.Generated/Contracts/_Shared/PaginatedResult.verified.cs @@ -0,0 +1,32 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.Api.Generated.Contracts; + +/// +/// PaginatedResult. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class PaginatedResult +{ + public int PageSize { get; set; } = 10; + + public int PageIndex { get; set; } + + public string? QueryString { get; set; } + + public string? ContinuationToken { get; set; } + + public int Count { get; set; } + + public int TotalCount { get; set; } + + public List Results { get; set; } = new List(); + + /// + public override string ToString() + => $"{nameof(PageSize)}: {PageSize}, {nameof(PageIndex)}: {PageIndex}, {nameof(QueryString)}: {QueryString}, {nameof(ContinuationToken)}: {ContinuationToken}, {nameof(Count)}: {Count}, {nameof(TotalCount)}: {TotalCount}, {nameof(Results)}.Count: {Results?.Count ?? 0}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Api.Generated/Endpoints/CatsController.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Api.Generated/Endpoints/CatsController.verified.cs new file mode 100644 index 00000000..3d019a4a --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Api.Generated/Endpoints/CatsController.verified.cs @@ -0,0 +1,31 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.Api.Generated.Endpoints; + +/// +/// Endpoint definitions. +/// +[Authorize] +[ApiController] +[Route("/api/v1/cats")] +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public sealed class CatsController : ControllerBase +{ + /// + /// Description: Find all cats. + /// Operation: GetCats. + /// + [HttpGet] + [ProducesResponseType(typeof(PaginatedResult), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + public async Task GetCats( + GetCatsParameters parameters, + [FromServices] IGetCatsHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Api.Generated/Endpoints/DogsController.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Api.Generated/Endpoints/DogsController.verified.cs new file mode 100644 index 00000000..38a14e80 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Api.Generated/Endpoints/DogsController.verified.cs @@ -0,0 +1,31 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.Api.Generated.Endpoints; + +/// +/// Endpoint definitions. +/// +[Authorize] +[ApiController] +[Route("/api/v1/dogs")] +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public sealed class DogsController : ControllerBase +{ + /// + /// Description: Find all dogs. + /// Operation: GetDogs. + /// + [HttpGet] + [ProducesResponseType(typeof(PaginatedResult), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + public async Task GetDogs( + GetDogsParameters parameters, + [FromServices] IGetDogsHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Api.Generated/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Api.Generated/GlobalUsings.verified.cs new file mode 100644 index 00000000..86e2110c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Api.Generated/GlobalUsings.verified.cs @@ -0,0 +1,13 @@ +global using System.CodeDom.Compiler; +global using System.ComponentModel.DataAnnotations; +global using System.Net; + +global using Atc.Rest.Results; + +global using ExGenericPagination.Api.Generated.Contracts; +global using ExGenericPagination.Api.Generated.Contracts.Cats; +global using ExGenericPagination.Api.Generated.Contracts.Dogs; + +global using Microsoft.AspNetCore.Authorization; +global using Microsoft.AspNetCore.Http; +global using Microsoft.AspNetCore.Mvc; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Api/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Api/GlobalUsings.verified.cs new file mode 100644 index 00000000..0ca1f549 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Api/GlobalUsings.verified.cs @@ -0,0 +1,15 @@ +global using System.CodeDom.Compiler; +global using System.Reflection; + +global using Asp.Versioning.ApiExplorer; + +global using Atc.Rest.Extended.Options; + +global using ExGenericPagination.Api.Generated; +global using ExGenericPagination.Api.Options; +global using ExGenericPagination.Domain; + +global using Microsoft.Extensions.Options; +global using Microsoft.OpenApi.Models; + +global using Swashbuckle.AspNetCore.SwaggerGen; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Api/Options/ConfigureSwaggerDocOptions.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Api/Options/ConfigureSwaggerDocOptions.verified.cs new file mode 100644 index 00000000..58d874de --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Api/Options/ConfigureSwaggerDocOptions.verified.cs @@ -0,0 +1,39 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.Api.Options; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ConfigureSwaggerDocOptions : IConfigureOptions +{ + private readonly IApiVersionDescriptionProvider provider; + + public ConfigureSwaggerDocOptions( + IApiVersionDescriptionProvider provider) + => this.provider = provider; + + public void Configure( + SwaggerGenOptions options) + { + foreach (var version in provider.ApiVersionDescriptions) + { + options.SwaggerDoc( + version.GroupName, + new OpenApiInfo + { + Version = "1.0", + Title = "Generic Pagination Api", + Description = "Generic Pagination Api - SingleFileVersion", + Contact = new OpenApiContact + { + Name = "atc-net A/S", + }, + }); + } + + options.IncludeXmlComments(Path.ChangeExtension(GetType().Assembly.Location, "xml")); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Api/Program.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Api/Program.verified.cs new file mode 100644 index 00000000..e79c8013 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Api/Program.verified.cs @@ -0,0 +1,23 @@ +namespace ExGenericPagination.Api; + +public static class Program +{ + public static void Main(string[] args) + { + CreateHostBuilder(args) + .Build() + .Run(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) + { + var builder = Host + .CreateDefaultBuilder(args) + .ConfigureWebHostDefaults(webBuilder => + { + webBuilder.UseStartup(); + }); + + return builder; + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Api/Startup.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Api/Startup.verified.cs new file mode 100644 index 00000000..f19cd67d --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Api/Startup.verified.cs @@ -0,0 +1,38 @@ +namespace ExGenericPagination.Api; + +public class Startup +{ + private readonly RestApiExtendedOptions restApiOptions; + + public Startup( + IConfiguration configuration) + { + Configuration = configuration; + restApiOptions = new RestApiExtendedOptions + { + // TODO: Remove/out-comment/set to false this for production scenarios! + AllowAnonymousAccessForDevelopment = true, + }; + + restApiOptions.AddAssemblyPairs( + Assembly.GetAssembly(typeof(ApiRegistration)), + Assembly.GetAssembly(typeof(DomainRegistration))); + } + + public IConfiguration Configuration { get; } + + public void ConfigureServices( + IServiceCollection services) + { + services.ConfigureOptions(); + + services.AddRestApi(restApiOptions, Configuration); + } + + public void Configure( + IApplicationBuilder app, + IWebHostEnvironment env) + { + app.ConfigureRestApi(env, restApiOptions); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Domain/DomainRegistration.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Domain/DomainRegistration.verified.cs new file mode 100644 index 00000000..6fc6f66d --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Domain/DomainRegistration.verified.cs @@ -0,0 +1,12 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.Domain; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class DomainRegistration +{ +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Domain/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Domain/GlobalUsings.verified.cs new file mode 100644 index 00000000..b10fc7aa --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Domain/GlobalUsings.verified.cs @@ -0,0 +1,4 @@ +global using System.CodeDom.Compiler; + +global using ExGenericPagination.Api.Generated.Contracts.Cats; +global using ExGenericPagination.Api.Generated.Contracts.Dogs; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Domain/Handlers/Cats/GetCatsHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Domain/Handlers/Cats/GetCatsHandler.verified.cs new file mode 100644 index 00000000..5255bec4 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Domain/Handlers/Cats/GetCatsHandler.verified.cs @@ -0,0 +1,18 @@ +namespace ExGenericPagination.Domain.Handlers.Cats; + +/// +/// Handler for operation request. +/// Description: Find all cats. +/// Operation: GetCats. +/// +public class GetCatsHandler : IGetCatsHandler +{ + public Task ExecuteAsync( + GetCatsParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for GetCatsHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Domain/Handlers/Dogs/GetDogsHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Domain/Handlers/Dogs/GetDogsHandler.verified.cs new file mode 100644 index 00000000..9e41e6a7 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/src/ExGenericPagination.Domain/Handlers/Dogs/GetDogsHandler.verified.cs @@ -0,0 +1,18 @@ +namespace ExGenericPagination.Domain.Handlers.Dogs; + +/// +/// Handler for operation request. +/// Description: Find all dogs. +/// Operation: GetDogs. +/// +public class GetDogsHandler : IGetDogsHandler +{ + public Task ExecuteAsync( + GetDogsParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for GetDogsHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/test/ExGenericPagination.Api.Tests/Endpoints/Cats/GetCatsHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/test/ExGenericPagination.Api.Tests/Endpoints/Cats/GetCatsHandlerStub.verified.cs new file mode 100644 index 00000000..9fbde33d --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/test/ExGenericPagination.Api.Tests/Endpoints/Cats/GetCatsHandlerStub.verified.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.Api.Tests.Endpoints.Cats; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetCatsHandlerStub : IGetCatsHandler +{ + public Task ExecuteAsync( + GetCatsParameters parameters, + CancellationToken cancellationToken = default) + { + var data = new Fixture().Create>(); + + var paginationData = new PaginatedResult(); + + return Task.FromResult(GetCatsResult.Ok(paginationData)); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/test/ExGenericPagination.Api.Tests/Endpoints/Cats/GetCatsTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/test/ExGenericPagination.Api.Tests/Endpoints/Cats/GetCatsTests.verified.cs new file mode 100644 index 00000000..7ea0a48d --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/test/ExGenericPagination.Api.Tests/Endpoints/Cats/GetCatsTests.verified.cs @@ -0,0 +1,21 @@ +namespace ExGenericPagination.Api.Tests.Endpoints.Cats; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class GetCatsTests : WebApiControllerBaseTest +{ + public GetCatsTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/test/ExGenericPagination.Api.Tests/Endpoints/Dogs/GetDogsHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/test/ExGenericPagination.Api.Tests/Endpoints/Dogs/GetDogsHandlerStub.verified.cs new file mode 100644 index 00000000..22f0d49e --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/test/ExGenericPagination.Api.Tests/Endpoints/Dogs/GetDogsHandlerStub.verified.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.Api.Tests.Endpoints.Dogs; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetDogsHandlerStub : IGetDogsHandler +{ + public Task ExecuteAsync( + GetDogsParameters parameters, + CancellationToken cancellationToken = default) + { + var data = new Fixture().Create>(); + + var paginationData = new PaginatedResult(); + + return Task.FromResult(GetDogsResult.Ok(paginationData)); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/test/ExGenericPagination.Api.Tests/Endpoints/Dogs/GetDogsTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/test/ExGenericPagination.Api.Tests/Endpoints/Dogs/GetDogsTests.verified.cs new file mode 100644 index 00000000..7e357eff --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/test/ExGenericPagination.Api.Tests/Endpoints/Dogs/GetDogsTests.verified.cs @@ -0,0 +1,21 @@ +namespace ExGenericPagination.Api.Tests.Endpoints.Dogs; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class GetDogsTests : WebApiControllerBaseTest +{ + public GetDogsTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/test/ExGenericPagination.Api.Tests/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/test/ExGenericPagination.Api.Tests/GlobalUsings.verified.cs new file mode 100644 index 00000000..65a79d72 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/test/ExGenericPagination.Api.Tests/GlobalUsings.verified.cs @@ -0,0 +1,24 @@ +global using System.CodeDom.Compiler; +global using System.Reflection; +global using System.Text; +global using System.Text.Json; +global using System.Text.Json.Serialization; + +global using Atc.Rest.Options; +global using Atc.XUnit; + +global using AutoFixture; + +global using ExGenericPagination.Api.Generated; +global using ExGenericPagination.Api.Generated.Contracts; +global using ExGenericPagination.Api.Generated.Contracts.Cats; +global using ExGenericPagination.Api.Generated.Contracts.Dogs; + +global using Microsoft.AspNetCore.Hosting; +global using Microsoft.AspNetCore.Http; +global using Microsoft.AspNetCore.Mvc.Testing; +global using Microsoft.AspNetCore.TestHost; +global using Microsoft.Extensions.Configuration; +global using Microsoft.Extensions.DependencyInjection; + +global using Xunit; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/test/ExGenericPagination.Api.Tests/WebApiControllerBaseTest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/test/ExGenericPagination.Api.Tests/WebApiControllerBaseTest.verified.cs new file mode 100644 index 00000000..5c7410ef --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/test/ExGenericPagination.Api.Tests/WebApiControllerBaseTest.verified.cs @@ -0,0 +1,56 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.Api.Tests; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public abstract class WebApiControllerBaseTest : IClassFixture +{ + protected readonly WebApiStartupFactory Factory; + + protected readonly HttpClient HttpClient; + + protected readonly IConfiguration Configuration; + + protected static JsonSerializerOptions? JsonSerializerOptions; + + protected WebApiControllerBaseTest(WebApiStartupFactory fixture) + { + this.Factory = fixture; + this.HttpClient = this.Factory.CreateClient(); + this.Configuration = new ConfigurationBuilder().Build(); + JsonSerializerOptions = new JsonSerializerOptions + { + PropertyNameCaseInsensitive = true, + Converters = + { + new JsonStringEnumConverter() + }, + }; + } + + protected static StringContent ToJson(object data) + => new(JsonSerializer.Serialize(data, JsonSerializerOptions), Encoding.UTF8, "application/json"); + + protected static StringContent Json(string data) + => new(data, Encoding.UTF8, "application/json"); + + protected static IFormFile GetTestFile() + { + var bytes = Encoding.UTF8.GetBytes("Hello World"); + var stream = new MemoryStream(bytes); + var formFile = new FormFile(stream, 0, stream.Length, "dummy", "dummy.txt") + { + Headers = new HeaderDictionary(), + ContentType = "application/octet-stream", + }; + + return formFile; + } + + protected static List GetTestFiles() + => new() { GetTestFile(), GetTestFile() }; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/test/ExGenericPagination.Api.Tests/WebApiStartupFactory.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/test/ExGenericPagination.Api.Tests/WebApiStartupFactory.verified.cs new file mode 100644 index 00000000..e295e764 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/test/ExGenericPagination.Api.Tests/WebApiStartupFactory.verified.cs @@ -0,0 +1,40 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.Api.Tests; + +/// +/// Factory for bootstrapping in memory tests. +/// Includes options to override configuration and service collection using a partial class. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public partial class WebApiStartupFactory : WebApplicationFactory +{ + protected override void ConfigureWebHost(IWebHostBuilder builder) + { + builder.ConfigureAppConfiguration(config => + { + ModifyConfiguration(config); + var integrationConfig = new ConfigurationBuilder() + .AddJsonFile("appsettings.integrationtest.json") + .Build(); + config.AddConfiguration(integrationConfig); + }); + + builder.ConfigureTestServices(services => + { + ModifyServices(services); + services.AddSingleton(); + services.AutoRegistrateServices( + Assembly.GetAssembly(typeof(ApiRegistration))!, + Assembly.GetAssembly(typeof(WebApiStartupFactory))!); + }); + } + + partial void ModifyConfiguration(IConfigurationBuilder config); + + partial void ModifyServices(IServiceCollection services); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/test/ExGenericPagination.Domain.Tests/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/test/ExGenericPagination.Domain.Tests/GlobalUsings.verified.cs new file mode 100644 index 00000000..8c927eb7 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/test/ExGenericPagination.Domain.Tests/GlobalUsings.verified.cs @@ -0,0 +1 @@ +global using Xunit; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/test/ExGenericPagination.Domain.Tests/Handlers/Cats/GetCatsHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/test/ExGenericPagination.Domain.Tests/Handlers/Cats/GetCatsHandlerTests.verified.cs new file mode 100644 index 00000000..6d1a3b4f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/test/ExGenericPagination.Domain.Tests/Handlers/Cats/GetCatsHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace ExGenericPagination.Domain.Tests.Handlers.Cats; + +public class GetCatsHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/test/ExGenericPagination.Domain.Tests/Handlers/Dogs/GetDogsHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/test/ExGenericPagination.Domain.Tests/Handlers/Dogs/GetDogsHandlerTests.verified.cs new file mode 100644 index 00000000..ad3d52bb --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WOPD/test/ExGenericPagination.Domain.Tests/Handlers/Dogs/GetDogsHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace ExGenericPagination.Domain.Tests.Handlers.Dogs; + +public class GetDogsHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Api.Generated/ApiRegistration.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Api.Generated/ApiRegistration.verified.cs new file mode 100644 index 00000000..ed85f4ce --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Api.Generated/ApiRegistration.verified.cs @@ -0,0 +1,12 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.Api.Generated; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ApiRegistration +{ +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Api.Generated/Contracts/Cats/Interfaces/IGetCatsHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Api.Generated/Contracts/Cats/Interfaces/IGetCatsHandler.verified.cs new file mode 100644 index 00000000..63214339 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Api.Generated/Contracts/Cats/Interfaces/IGetCatsHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.Api.Generated.Contracts.Cats; + +/// +/// Domain Interface for RequestHandler. +/// Description: Find all cats. +/// Operation: GetCats. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetCatsHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + GetCatsParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Api.Generated/Contracts/Cats/Models/Cat.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Api.Generated/Contracts/Cats/Models/Cat.verified.cs new file mode 100644 index 00000000..ba36668d --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Api.Generated/Contracts/Cats/Models/Cat.verified.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.Api.Generated.Contracts.Cats; + +/// +/// Cat. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Cat +{ + public int Id { get; set; } + + public string Name { get; set; } + + public string ServantName { get; set; } + + public string FavoriteFish { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(Name)}: {Name}, {nameof(ServantName)}: {ServantName}, {nameof(FavoriteFish)}: {FavoriteFish}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Api.Generated/Contracts/Cats/Parameters/GetCatsParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Api.Generated/Contracts/Cats/Parameters/GetCatsParameters.verified.cs new file mode 100644 index 00000000..b5811910 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Api.Generated/Contracts/Cats/Parameters/GetCatsParameters.verified.cs @@ -0,0 +1,32 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.Api.Generated.Contracts.Cats; + +/// +/// Parameters for operation request. +/// Description: Find all cats. +/// Operation: GetCats. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetCatsParameters +{ + [FromQuery(Name = "pageSize")] + [Required] + public int PageSize { get; set; } = 10; + + [FromQuery(Name = "pageIndex")] + [Required] + public int PageIndex { get; set; } = 0; + + [FromQuery(Name = "queryString")] + [Required] + public string QueryString { get; set; } + + /// + public override string ToString() + => $"{nameof(PageSize)}: {PageSize}, {nameof(PageIndex)}: {PageIndex}, {nameof(QueryString)}: {QueryString}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Api.Generated/Contracts/Cats/Results/GetCatsResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Api.Generated/Contracts/Cats/Results/GetCatsResult.verified.cs new file mode 100644 index 00000000..c5ab1a02 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Api.Generated/Contracts/Cats/Results/GetCatsResult.verified.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.Api.Generated.Contracts.Cats; + +/// +/// Results for operation request. +/// Description: Find all cats. +/// Operation: GetCats. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetCatsResult : ResultBase +{ + private GetCatsResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static GetCatsResult Ok(PaginatedResult response) + => new GetCatsResult(new OkObjectResult(response)); + + /// + /// Performs an implicit conversion from GetCatsResult to ActionResult. + /// + public static implicit operator GetCatsResult(PaginatedResult response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Api.Generated/Contracts/Dogs/Interfaces/IGetDogsHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Api.Generated/Contracts/Dogs/Interfaces/IGetDogsHandler.verified.cs new file mode 100644 index 00000000..33db47ad --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Api.Generated/Contracts/Dogs/Interfaces/IGetDogsHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.Api.Generated.Contracts.Dogs; + +/// +/// Domain Interface for RequestHandler. +/// Description: Find all dogs. +/// Operation: GetDogs. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetDogsHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + GetDogsParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Api.Generated/Contracts/Dogs/Models/Dog.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Api.Generated/Contracts/Dogs/Models/Dog.verified.cs new file mode 100644 index 00000000..348cc5cb --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Api.Generated/Contracts/Dogs/Models/Dog.verified.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.Api.Generated.Contracts.Dogs; + +/// +/// Dog. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Dog +{ + public int Id { get; set; } + + public string Name { get; set; } + + public string OwnerName { get; set; } + + public string FavoriteToy { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(Name)}: {Name}, {nameof(OwnerName)}: {OwnerName}, {nameof(FavoriteToy)}: {FavoriteToy}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Api.Generated/Contracts/Dogs/Parameters/GetDogsParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Api.Generated/Contracts/Dogs/Parameters/GetDogsParameters.verified.cs new file mode 100644 index 00000000..d172a5c2 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Api.Generated/Contracts/Dogs/Parameters/GetDogsParameters.verified.cs @@ -0,0 +1,32 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.Api.Generated.Contracts.Dogs; + +/// +/// Parameters for operation request. +/// Description: Find all dogs. +/// Operation: GetDogs. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetDogsParameters +{ + [FromQuery(Name = "pageSize")] + [Required] + public int PageSize { get; set; } = 10; + + [FromQuery(Name = "pageIndex")] + [Required] + public int PageIndex { get; set; } = 0; + + [FromQuery(Name = "queryString")] + [Required] + public string QueryString { get; set; } + + /// + public override string ToString() + => $"{nameof(PageSize)}: {PageSize}, {nameof(PageIndex)}: {PageIndex}, {nameof(QueryString)}: {QueryString}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Api.Generated/Contracts/Dogs/Results/GetDogsResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Api.Generated/Contracts/Dogs/Results/GetDogsResult.verified.cs new file mode 100644 index 00000000..2c0614eb --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Api.Generated/Contracts/Dogs/Results/GetDogsResult.verified.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.Api.Generated.Contracts.Dogs; + +/// +/// Results for operation request. +/// Description: Find all dogs. +/// Operation: GetDogs. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetDogsResult : ResultBase +{ + private GetDogsResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static GetDogsResult Ok(PaginatedResult response) + => new GetDogsResult(new OkObjectResult(response)); + + /// + /// Performs an implicit conversion from GetDogsResult to ActionResult. + /// + public static implicit operator GetDogsResult(PaginatedResult response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Api.Generated/Contracts/_Shared/PaginatedResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Api.Generated/Contracts/_Shared/PaginatedResult.verified.cs new file mode 100644 index 00000000..f5abdf7b --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Api.Generated/Contracts/_Shared/PaginatedResult.verified.cs @@ -0,0 +1,32 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.Api.Generated.Contracts; + +/// +/// PaginatedResult. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class PaginatedResult +{ + public int PageSize { get; set; } = 10; + + public int PageIndex { get; set; } + + public string? QueryString { get; set; } + + public string? ContinuationToken { get; set; } + + public int Count { get; set; } + + public int TotalCount { get; set; } + + public List Results { get; set; } = new List(); + + /// + public override string ToString() + => $"{nameof(PageSize)}: {PageSize}, {nameof(PageIndex)}: {PageIndex}, {nameof(QueryString)}: {QueryString}, {nameof(ContinuationToken)}: {ContinuationToken}, {nameof(Count)}: {Count}, {nameof(TotalCount)}: {TotalCount}, {nameof(Results)}.Count: {Results?.Count ?? 0}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Api.Generated/Endpoints/CatsController.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Api.Generated/Endpoints/CatsController.verified.cs new file mode 100644 index 00000000..c7873de5 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Api.Generated/Endpoints/CatsController.verified.cs @@ -0,0 +1,31 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.Api.Generated.Endpoints; + +/// +/// Endpoint definitions. +/// +[Authorize] +[ApiController] +[Route("/api/v1/cats")] +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public sealed class CatsController : ControllerBase +{ + /// + /// Description: Find all cats. + /// Operation: GetCats. + /// + [HttpGet] + [ProducesResponseType(typeof(PaginatedResult), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] + public async Task GetCats( + GetCatsParameters parameters, + [FromServices] IGetCatsHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Api.Generated/Endpoints/DogsController.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Api.Generated/Endpoints/DogsController.verified.cs new file mode 100644 index 00000000..9a82f28a --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Api.Generated/Endpoints/DogsController.verified.cs @@ -0,0 +1,31 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.Api.Generated.Endpoints; + +/// +/// Endpoint definitions. +/// +[Authorize] +[ApiController] +[Route("/api/v1/dogs")] +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public sealed class DogsController : ControllerBase +{ + /// + /// Description: Find all dogs. + /// Operation: GetDogs. + /// + [HttpGet] + [ProducesResponseType(typeof(PaginatedResult), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] + public async Task GetDogs( + GetDogsParameters parameters, + [FromServices] IGetDogsHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Api.Generated/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Api.Generated/GlobalUsings.verified.cs new file mode 100644 index 00000000..86e2110c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Api.Generated/GlobalUsings.verified.cs @@ -0,0 +1,13 @@ +global using System.CodeDom.Compiler; +global using System.ComponentModel.DataAnnotations; +global using System.Net; + +global using Atc.Rest.Results; + +global using ExGenericPagination.Api.Generated.Contracts; +global using ExGenericPagination.Api.Generated.Contracts.Cats; +global using ExGenericPagination.Api.Generated.Contracts.Dogs; + +global using Microsoft.AspNetCore.Authorization; +global using Microsoft.AspNetCore.Http; +global using Microsoft.AspNetCore.Mvc; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Api/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Api/GlobalUsings.verified.cs new file mode 100644 index 00000000..0ca1f549 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Api/GlobalUsings.verified.cs @@ -0,0 +1,15 @@ +global using System.CodeDom.Compiler; +global using System.Reflection; + +global using Asp.Versioning.ApiExplorer; + +global using Atc.Rest.Extended.Options; + +global using ExGenericPagination.Api.Generated; +global using ExGenericPagination.Api.Options; +global using ExGenericPagination.Domain; + +global using Microsoft.Extensions.Options; +global using Microsoft.OpenApi.Models; + +global using Swashbuckle.AspNetCore.SwaggerGen; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Api/Options/ConfigureSwaggerDocOptions.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Api/Options/ConfigureSwaggerDocOptions.verified.cs new file mode 100644 index 00000000..58d874de --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Api/Options/ConfigureSwaggerDocOptions.verified.cs @@ -0,0 +1,39 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.Api.Options; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ConfigureSwaggerDocOptions : IConfigureOptions +{ + private readonly IApiVersionDescriptionProvider provider; + + public ConfigureSwaggerDocOptions( + IApiVersionDescriptionProvider provider) + => this.provider = provider; + + public void Configure( + SwaggerGenOptions options) + { + foreach (var version in provider.ApiVersionDescriptions) + { + options.SwaggerDoc( + version.GroupName, + new OpenApiInfo + { + Version = "1.0", + Title = "Generic Pagination Api", + Description = "Generic Pagination Api - SingleFileVersion", + Contact = new OpenApiContact + { + Name = "atc-net A/S", + }, + }); + } + + options.IncludeXmlComments(Path.ChangeExtension(GetType().Assembly.Location, "xml")); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Api/Program.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Api/Program.verified.cs new file mode 100644 index 00000000..e79c8013 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Api/Program.verified.cs @@ -0,0 +1,23 @@ +namespace ExGenericPagination.Api; + +public static class Program +{ + public static void Main(string[] args) + { + CreateHostBuilder(args) + .Build() + .Run(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) + { + var builder = Host + .CreateDefaultBuilder(args) + .ConfigureWebHostDefaults(webBuilder => + { + webBuilder.UseStartup(); + }); + + return builder; + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Api/Startup.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Api/Startup.verified.cs new file mode 100644 index 00000000..f19cd67d --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Api/Startup.verified.cs @@ -0,0 +1,38 @@ +namespace ExGenericPagination.Api; + +public class Startup +{ + private readonly RestApiExtendedOptions restApiOptions; + + public Startup( + IConfiguration configuration) + { + Configuration = configuration; + restApiOptions = new RestApiExtendedOptions + { + // TODO: Remove/out-comment/set to false this for production scenarios! + AllowAnonymousAccessForDevelopment = true, + }; + + restApiOptions.AddAssemblyPairs( + Assembly.GetAssembly(typeof(ApiRegistration)), + Assembly.GetAssembly(typeof(DomainRegistration))); + } + + public IConfiguration Configuration { get; } + + public void ConfigureServices( + IServiceCollection services) + { + services.ConfigureOptions(); + + services.AddRestApi(restApiOptions, Configuration); + } + + public void Configure( + IApplicationBuilder app, + IWebHostEnvironment env) + { + app.ConfigureRestApi(env, restApiOptions); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Domain/DomainRegistration.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Domain/DomainRegistration.verified.cs new file mode 100644 index 00000000..6fc6f66d --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Domain/DomainRegistration.verified.cs @@ -0,0 +1,12 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.Domain; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class DomainRegistration +{ +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Domain/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Domain/GlobalUsings.verified.cs new file mode 100644 index 00000000..b10fc7aa --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Domain/GlobalUsings.verified.cs @@ -0,0 +1,4 @@ +global using System.CodeDom.Compiler; + +global using ExGenericPagination.Api.Generated.Contracts.Cats; +global using ExGenericPagination.Api.Generated.Contracts.Dogs; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Domain/Handlers/Cats/GetCatsHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Domain/Handlers/Cats/GetCatsHandler.verified.cs new file mode 100644 index 00000000..5255bec4 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Domain/Handlers/Cats/GetCatsHandler.verified.cs @@ -0,0 +1,18 @@ +namespace ExGenericPagination.Domain.Handlers.Cats; + +/// +/// Handler for operation request. +/// Description: Find all cats. +/// Operation: GetCats. +/// +public class GetCatsHandler : IGetCatsHandler +{ + public Task ExecuteAsync( + GetCatsParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for GetCatsHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Domain/Handlers/Dogs/GetDogsHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Domain/Handlers/Dogs/GetDogsHandler.verified.cs new file mode 100644 index 00000000..9e41e6a7 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/src/ExGenericPagination.Domain/Handlers/Dogs/GetDogsHandler.verified.cs @@ -0,0 +1,18 @@ +namespace ExGenericPagination.Domain.Handlers.Dogs; + +/// +/// Handler for operation request. +/// Description: Find all dogs. +/// Operation: GetDogs. +/// +public class GetDogsHandler : IGetDogsHandler +{ + public Task ExecuteAsync( + GetDogsParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for GetDogsHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/test/ExGenericPagination.Api.Tests/Endpoints/Cats/GetCatsHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/test/ExGenericPagination.Api.Tests/Endpoints/Cats/GetCatsHandlerStub.verified.cs new file mode 100644 index 00000000..9fbde33d --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/test/ExGenericPagination.Api.Tests/Endpoints/Cats/GetCatsHandlerStub.verified.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.Api.Tests.Endpoints.Cats; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetCatsHandlerStub : IGetCatsHandler +{ + public Task ExecuteAsync( + GetCatsParameters parameters, + CancellationToken cancellationToken = default) + { + var data = new Fixture().Create>(); + + var paginationData = new PaginatedResult(); + + return Task.FromResult(GetCatsResult.Ok(paginationData)); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/test/ExGenericPagination.Api.Tests/Endpoints/Cats/GetCatsTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/test/ExGenericPagination.Api.Tests/Endpoints/Cats/GetCatsTests.verified.cs new file mode 100644 index 00000000..7ea0a48d --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/test/ExGenericPagination.Api.Tests/Endpoints/Cats/GetCatsTests.verified.cs @@ -0,0 +1,21 @@ +namespace ExGenericPagination.Api.Tests.Endpoints.Cats; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class GetCatsTests : WebApiControllerBaseTest +{ + public GetCatsTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/test/ExGenericPagination.Api.Tests/Endpoints/Dogs/GetDogsHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/test/ExGenericPagination.Api.Tests/Endpoints/Dogs/GetDogsHandlerStub.verified.cs new file mode 100644 index 00000000..22f0d49e --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/test/ExGenericPagination.Api.Tests/Endpoints/Dogs/GetDogsHandlerStub.verified.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.Api.Tests.Endpoints.Dogs; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetDogsHandlerStub : IGetDogsHandler +{ + public Task ExecuteAsync( + GetDogsParameters parameters, + CancellationToken cancellationToken = default) + { + var data = new Fixture().Create>(); + + var paginationData = new PaginatedResult(); + + return Task.FromResult(GetDogsResult.Ok(paginationData)); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/test/ExGenericPagination.Api.Tests/Endpoints/Dogs/GetDogsTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/test/ExGenericPagination.Api.Tests/Endpoints/Dogs/GetDogsTests.verified.cs new file mode 100644 index 00000000..7e357eff --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/test/ExGenericPagination.Api.Tests/Endpoints/Dogs/GetDogsTests.verified.cs @@ -0,0 +1,21 @@ +namespace ExGenericPagination.Api.Tests.Endpoints.Dogs; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class GetDogsTests : WebApiControllerBaseTest +{ + public GetDogsTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/test/ExGenericPagination.Api.Tests/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/test/ExGenericPagination.Api.Tests/GlobalUsings.verified.cs new file mode 100644 index 00000000..65a79d72 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/test/ExGenericPagination.Api.Tests/GlobalUsings.verified.cs @@ -0,0 +1,24 @@ +global using System.CodeDom.Compiler; +global using System.Reflection; +global using System.Text; +global using System.Text.Json; +global using System.Text.Json.Serialization; + +global using Atc.Rest.Options; +global using Atc.XUnit; + +global using AutoFixture; + +global using ExGenericPagination.Api.Generated; +global using ExGenericPagination.Api.Generated.Contracts; +global using ExGenericPagination.Api.Generated.Contracts.Cats; +global using ExGenericPagination.Api.Generated.Contracts.Dogs; + +global using Microsoft.AspNetCore.Hosting; +global using Microsoft.AspNetCore.Http; +global using Microsoft.AspNetCore.Mvc.Testing; +global using Microsoft.AspNetCore.TestHost; +global using Microsoft.Extensions.Configuration; +global using Microsoft.Extensions.DependencyInjection; + +global using Xunit; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/test/ExGenericPagination.Api.Tests/WebApiControllerBaseTest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/test/ExGenericPagination.Api.Tests/WebApiControllerBaseTest.verified.cs new file mode 100644 index 00000000..5c7410ef --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/test/ExGenericPagination.Api.Tests/WebApiControllerBaseTest.verified.cs @@ -0,0 +1,56 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.Api.Tests; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public abstract class WebApiControllerBaseTest : IClassFixture +{ + protected readonly WebApiStartupFactory Factory; + + protected readonly HttpClient HttpClient; + + protected readonly IConfiguration Configuration; + + protected static JsonSerializerOptions? JsonSerializerOptions; + + protected WebApiControllerBaseTest(WebApiStartupFactory fixture) + { + this.Factory = fixture; + this.HttpClient = this.Factory.CreateClient(); + this.Configuration = new ConfigurationBuilder().Build(); + JsonSerializerOptions = new JsonSerializerOptions + { + PropertyNameCaseInsensitive = true, + Converters = + { + new JsonStringEnumConverter() + }, + }; + } + + protected static StringContent ToJson(object data) + => new(JsonSerializer.Serialize(data, JsonSerializerOptions), Encoding.UTF8, "application/json"); + + protected static StringContent Json(string data) + => new(data, Encoding.UTF8, "application/json"); + + protected static IFormFile GetTestFile() + { + var bytes = Encoding.UTF8.GetBytes("Hello World"); + var stream = new MemoryStream(bytes); + var formFile = new FormFile(stream, 0, stream.Length, "dummy", "dummy.txt") + { + Headers = new HeaderDictionary(), + ContentType = "application/octet-stream", + }; + + return formFile; + } + + protected static List GetTestFiles() + => new() { GetTestFile(), GetTestFile() }; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/test/ExGenericPagination.Api.Tests/WebApiStartupFactory.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/test/ExGenericPagination.Api.Tests/WebApiStartupFactory.verified.cs new file mode 100644 index 00000000..e295e764 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/test/ExGenericPagination.Api.Tests/WebApiStartupFactory.verified.cs @@ -0,0 +1,40 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExGenericPagination.Api.Tests; + +/// +/// Factory for bootstrapping in memory tests. +/// Includes options to override configuration and service collection using a partial class. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public partial class WebApiStartupFactory : WebApplicationFactory +{ + protected override void ConfigureWebHost(IWebHostBuilder builder) + { + builder.ConfigureAppConfiguration(config => + { + ModifyConfiguration(config); + var integrationConfig = new ConfigurationBuilder() + .AddJsonFile("appsettings.integrationtest.json") + .Build(); + config.AddConfiguration(integrationConfig); + }); + + builder.ConfigureTestServices(services => + { + ModifyServices(services); + services.AddSingleton(); + services.AutoRegistrateServices( + Assembly.GetAssembly(typeof(ApiRegistration))!, + Assembly.GetAssembly(typeof(WebApiStartupFactory))!); + }); + } + + partial void ModifyConfiguration(IConfigurationBuilder config); + + partial void ModifyServices(IServiceCollection services); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/test/ExGenericPagination.Domain.Tests/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/test/ExGenericPagination.Domain.Tests/GlobalUsings.verified.cs new file mode 100644 index 00000000..8c927eb7 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/test/ExGenericPagination.Domain.Tests/GlobalUsings.verified.cs @@ -0,0 +1 @@ +global using Xunit; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/test/ExGenericPagination.Domain.Tests/Handlers/Cats/GetCatsHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/test/ExGenericPagination.Domain.Tests/Handlers/Cats/GetCatsHandlerTests.verified.cs new file mode 100644 index 00000000..6d1a3b4f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/test/ExGenericPagination.Domain.Tests/Handlers/Cats/GetCatsHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace ExGenericPagination.Domain.Tests.Handlers.Cats; + +public class GetCatsHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/test/ExGenericPagination.Domain.Tests/Handlers/Dogs/GetDogsHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/test/ExGenericPagination.Domain.Tests/Handlers/Dogs/GetDogsHandlerTests.verified.cs new file mode 100644 index 00000000..ad3d52bb --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExGenericPagination/VerifyServerAll/Mvc_WPD/test/ExGenericPagination.Domain.Tests/Handlers/Dogs/GetDogsHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace ExGenericPagination.Domain.Tests.Handlers.Dogs; + +public class GetDogsHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/TestUnit.Task.NsApi.yaml b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/ExNsWithTask.yaml similarity index 100% rename from test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/TestUnit.Task.NsApi.yaml rename to test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/ExNsWithTask.yaml diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Contracts/EventArgs/EventArgs.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Contracts/EventArgs/EventArgs.verified.cs new file mode 100644 index 00000000..0a3e1f61 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Contracts/EventArgs/EventArgs.verified.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Contracts.EventArgs; + +/// +/// EventArgs. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class EventArgs +{ + public Guid Id { get; set; } + + public string EventName { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(EventName)}: {EventName}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Contracts/EventArgs/RequestParameters/GetEventArgByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Contracts/EventArgs/RequestParameters/GetEventArgByIdParameters.verified.cs new file mode 100644 index 00000000..373ec84b --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Contracts/EventArgs/RequestParameters/GetEventArgByIdParameters.verified.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Contracts.EventArgs; + +/// +/// Parameters for operation request. +/// Description: Get EventArgs By Id. +/// Operation: GetEventArgById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetEventArgByIdParameters +{ + /// + /// The id of the eventArgs. + /// + [Required] + public string Id { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Contracts/Orders/Order.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Contracts/Orders/Order.verified.cs new file mode 100644 index 00000000..5e07885b --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Contracts/Orders/Order.verified.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Contracts.Orders; + +/// +/// A single order. +/// Hallo description with multiline and no ending dot. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Order +{ + public Guid Id { get; set; } + + public string Description { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(Description)}: {Description}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Contracts/Orders/RequestParameters/GetOrderByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Contracts/Orders/RequestParameters/GetOrderByIdParameters.verified.cs new file mode 100644 index 00000000..43fad259 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Contracts/Orders/RequestParameters/GetOrderByIdParameters.verified.cs @@ -0,0 +1,35 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Contracts.Orders; + +/// +/// Parameters for operation request. +/// Description: Get order by id. +/// Operation: GetOrderById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetOrderByIdParameters +{ + /// + /// The id of the order. + /// + [Required] + public Guid Id { get; set; } + + /// + /// The email for filter orders to retrieve. + /// + /// + /// Email validation being enforced. + /// + [EmailAddress] + public string? MyEmail { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(MyEmail)}: {MyEmail}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Contracts/Orders/RequestParameters/GetOrdersParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Contracts/Orders/RequestParameters/GetOrdersParameters.verified.cs new file mode 100644 index 00000000..95ee13bf --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Contracts/Orders/RequestParameters/GetOrdersParameters.verified.cs @@ -0,0 +1,38 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Contracts.Orders; + +/// +/// Parameters for operation request. +/// Description: Get orders. +/// Operation: GetOrders. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetOrdersParameters +{ + /// + /// The numbers of items to return. + /// + [Required] + [Range(1, 100)] + public int PageSize { get; set; } = 10; + + /// + /// The number of items to skip before starting to collect the result set. + /// + [Range(0, 2147483647)] + public int PageIndex { get; set; } = 0; + + /// + /// The continuation token. + /// + public string? ContinuationToken { get; set; } + + /// + public override string ToString() + => $"{nameof(PageSize)}: {PageSize}, {nameof(PageIndex)}: {PageIndex}, {nameof(ContinuationToken)}: {ContinuationToken}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Contracts/Tasks/Task.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Contracts/Tasks/Task.verified.cs new file mode 100644 index 00000000..f143a922 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Contracts/Tasks/Task.verified.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Contracts.Tasks; + +/// +/// Describes a single task. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Task +{ + public Guid Id { get; set; } + + public string Name { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(Name)}: {Name}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Contracts/Tasks/Tasks.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Contracts/Tasks/Tasks.verified.cs new file mode 100644 index 00000000..c80a2cac --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Contracts/Tasks/Tasks.verified.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Contracts.Tasks; + +/// +/// Contains a list of Tasks. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Tasks +{ + /// + /// A list of Task. + /// + public List TaskList { get; set; } = new List(); + + /// + public override string ToString() + => $"{nameof(TaskList)}.Count: {TaskList?.Count ?? 0}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Contracts/TestUnits/RequestParameters/ListTestUnitsParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Contracts/TestUnits/RequestParameters/ListTestUnitsParameters.verified.cs new file mode 100644 index 00000000..1102558b --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Contracts/TestUnits/RequestParameters/ListTestUnitsParameters.verified.cs @@ -0,0 +1,38 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Contracts.TestUnits; + +/// +/// Parameters for operation request. +/// Description: List test units. +/// Operation: ListTestUnits. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ListTestUnitsParameters +{ + /// + /// The numbers of items to return. + /// + [Required] + [Range(1, 100)] + public int PageSize { get; set; } = 10; + + /// + /// The number of items to skip before starting to collect the result set. + /// + [Range(0, 2147483647)] + public int PageIndex { get; set; } = 0; + + /// + /// The continuation token. + /// + public string? ContinuationToken { get; set; } + + /// + public override string ToString() + => $"{nameof(PageSize)}: {PageSize}, {nameof(PageIndex)}: {PageIndex}, {nameof(ContinuationToken)}: {ContinuationToken}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Contracts/TestUnits/TestUnit.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Contracts/TestUnits/TestUnit.verified.cs new file mode 100644 index 00000000..14943597 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Contracts/TestUnits/TestUnit.verified.cs @@ -0,0 +1,20 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Contracts.TestUnits; + +/// +/// TestUnit. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class TestUnit +{ + public Guid Id { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Contracts/_Shared/PaginationResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Contracts/_Shared/PaginationResult.verified.cs new file mode 100644 index 00000000..c80c5818 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Contracts/_Shared/PaginationResult.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Contracts; + +/// +/// An item result subset of a data query. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class PaginationResult +{ + public int PageSize { get; set; } + + /// + /// Token to indicate next result set. + /// + public string? ContinuationToken { get; set; } + + public List Results { get; set; } = new List(); + + /// + public override string ToString() + => $"{nameof(PageSize)}: {PageSize}, {nameof(ContinuationToken)}: {ContinuationToken}, {nameof(Results)}.Count: {Results?.Count ?? 0}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/EventArgs/GetEventArgByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/EventArgs/GetEventArgByIdEndpoint.verified.cs new file mode 100644 index 00000000..4cd32e56 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/EventArgs/GetEventArgByIdEndpoint.verified.cs @@ -0,0 +1,48 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Endpoints.EventArgs; + +/// +/// Client Endpoint. +/// Description: Get EventArgs By Id. +/// Operation: GetEventArgById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetEventArgByIdEndpoint : IGetEventArgByIdEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public GetEventArgByIdEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + GetEventArgByIdParameters parameters, + string httpClientName = "ExNsWithTask-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/eventArgs/{id}"); + requestBuilder.WithPathParameter("id", parameters.Id); + + using var requestMessage = requestBuilder.Build(HttpMethod.Get); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + responseBuilder.AddErrorResponse(HttpStatusCode.NotFound); + return await responseBuilder.BuildResponseAsync(x => new GetEventArgByIdEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/EventArgs/GetEventArgByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/EventArgs/GetEventArgByIdEndpointResult.verified.cs new file mode 100644 index 00000000..6b43a7eb --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/EventArgs/GetEventArgByIdEndpointResult.verified.cs @@ -0,0 +1,53 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Endpoints.EventArgs; + +/// +/// Client Endpoint result. +/// Description: Get EventArgs By Id. +/// Operation: GetEventArgById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetEventArgByIdEndpointResult : EndpointResponse, IGetEventArgByIdEndpointResult +{ + public GetEventArgByIdEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public bool IsNotFound + => StatusCode == HttpStatusCode.NotFound; + + public EventArgs OkContent + => IsOk && ContentObject is EventArgs result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public string? BadRequestContent + => IsBadRequest && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public string? UnauthorizedContent + => IsUnauthorized && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); + + public string? NotFoundContent + => IsNotFound && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsNotFound property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/EventArgs/GetEventArgsEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/EventArgs/GetEventArgsEndpoint.verified.cs new file mode 100644 index 00000000..9c6a609a --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/EventArgs/GetEventArgsEndpoint.verified.cs @@ -0,0 +1,44 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Endpoints.EventArgs; + +/// +/// Client Endpoint. +/// Description: Get EventArgs List. +/// Operation: GetEventArgs. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetEventArgsEndpoint : IGetEventArgsEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public GetEventArgsEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + string httpClientName = "ExNsWithTask-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/eventArgs"); + + using var requestMessage = requestBuilder.Build(HttpMethod.Get); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse>(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + return await responseBuilder.BuildResponseAsync(x => new GetEventArgsEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/EventArgs/GetEventArgsEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/EventArgs/GetEventArgsEndpointResult.verified.cs new file mode 100644 index 00000000..20324fb5 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/EventArgs/GetEventArgsEndpointResult.verified.cs @@ -0,0 +1,37 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Endpoints.EventArgs; + +/// +/// Client Endpoint result. +/// Description: Get EventArgs List. +/// Operation: GetEventArgs. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetEventArgsEndpointResult : EndpointResponse, IGetEventArgsEndpointResult +{ + public GetEventArgsEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public IEnumerable OkContent + => IsOk && ContentObject is IEnumerable result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public string? UnauthorizedContent + => IsUnauthorized && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgByIdEndpoint.verified.cs new file mode 100644 index 00000000..f420df06 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgByIdEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Endpoints.EventArgs.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Get EventArgs By Id. +/// Operation: GetEventArgById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetEventArgByIdEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + GetEventArgByIdParameters parameters, + string httpClientName = "ExNsWithTask-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgByIdEndpointResult.verified.cs new file mode 100644 index 00000000..5e2e6cc9 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgByIdEndpointResult.verified.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Endpoints.EventArgs.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Get EventArgs By Id. +/// Operation: GetEventArgById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetEventArgByIdEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + bool IsNotFound { get; } + + EventArgs OkContent { get; } + + string? BadRequestContent { get; } + + string? UnauthorizedContent { get; } + + string? NotFoundContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgsEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgsEndpoint.verified.cs new file mode 100644 index 00000000..e790969c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgsEndpoint.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Endpoints.EventArgs.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Get EventArgs List. +/// Operation: GetEventArgs. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetEventArgsEndpoint +{ + /// + /// Execute method. + /// + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + string httpClientName = "ExNsWithTask-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgsEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgsEndpointResult.verified.cs new file mode 100644 index 00000000..31c2424b --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgsEndpointResult.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Endpoints.EventArgs.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Get EventArgs List. +/// Operation: GetEventArgs. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetEventArgsEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsUnauthorized { get; } + + IEnumerable OkContent { get; } + + string? UnauthorizedContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Orders/GetOrderByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Orders/GetOrderByIdEndpoint.verified.cs new file mode 100644 index 00000000..c216bad0 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Orders/GetOrderByIdEndpoint.verified.cs @@ -0,0 +1,49 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Endpoints.Orders; + +/// +/// Client Endpoint. +/// Description: Get order by id. +/// Operation: GetOrderById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetOrderByIdEndpoint : IGetOrderByIdEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public GetOrderByIdEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + GetOrderByIdParameters parameters, + string httpClientName = "ExNsWithTask-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/orders/{id}"); + requestBuilder.WithPathParameter("id", parameters.Id); + requestBuilder.WithQueryParameter("myEmail", parameters.MyEmail); + + using var requestMessage = requestBuilder.Build(HttpMethod.Get); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + responseBuilder.AddErrorResponse(HttpStatusCode.NotFound); + return await responseBuilder.BuildResponseAsync(x => new GetOrderByIdEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Orders/GetOrderByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Orders/GetOrderByIdEndpointResult.verified.cs new file mode 100644 index 00000000..5baa75a5 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Orders/GetOrderByIdEndpointResult.verified.cs @@ -0,0 +1,53 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Endpoints.Orders; + +/// +/// Client Endpoint result. +/// Description: Get order by id. +/// Operation: GetOrderById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetOrderByIdEndpointResult : EndpointResponse, IGetOrderByIdEndpointResult +{ + public GetOrderByIdEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public bool IsNotFound + => StatusCode == HttpStatusCode.NotFound; + + public Order OkContent + => IsOk && ContentObject is Order result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public string? BadRequestContent + => IsBadRequest && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public string? UnauthorizedContent + => IsUnauthorized && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); + + public string? NotFoundContent + => IsNotFound && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsNotFound property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Orders/GetOrdersEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Orders/GetOrdersEndpoint.verified.cs new file mode 100644 index 00000000..c5ceed63 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Orders/GetOrdersEndpoint.verified.cs @@ -0,0 +1,50 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Endpoints.Orders; + +/// +/// Client Endpoint. +/// Description: Get orders. +/// Operation: GetOrders. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetOrdersEndpoint : IGetOrdersEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public GetOrdersEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + GetOrdersParameters parameters, + string httpClientName = "ExNsWithTask-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/orders"); + requestBuilder.WithQueryParameter("pageSize", parameters.PageSize); + requestBuilder.WithQueryParameter("pageIndex", parameters.PageIndex); + requestBuilder.WithQueryParameter("continuationToken", parameters.ContinuationToken); + + using var requestMessage = requestBuilder.Build(HttpMethod.Get); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse>(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + responseBuilder.AddErrorResponse(HttpStatusCode.NotFound); + return await responseBuilder.BuildResponseAsync(x => new GetOrdersEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Orders/GetOrdersEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Orders/GetOrdersEndpointResult.verified.cs new file mode 100644 index 00000000..783c1dd2 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Orders/GetOrdersEndpointResult.verified.cs @@ -0,0 +1,53 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Endpoints.Orders; + +/// +/// Client Endpoint result. +/// Description: Get orders. +/// Operation: GetOrders. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetOrdersEndpointResult : EndpointResponse, IGetOrdersEndpointResult +{ + public GetOrdersEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public bool IsNotFound + => StatusCode == HttpStatusCode.NotFound; + + public PaginationResult OkContent + => IsOk && ContentObject is PaginationResult result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public string? BadRequestContent + => IsBadRequest && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public string? UnauthorizedContent + => IsUnauthorized && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); + + public string? NotFoundContent + => IsNotFound && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsNotFound property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrderByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrderByIdEndpoint.verified.cs new file mode 100644 index 00000000..a4780c9e --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrderByIdEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Endpoints.Orders.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Get order by id. +/// Operation: GetOrderById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetOrderByIdEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + GetOrderByIdParameters parameters, + string httpClientName = "ExNsWithTask-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrderByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrderByIdEndpointResult.verified.cs new file mode 100644 index 00000000..b1d9e3f0 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrderByIdEndpointResult.verified.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Endpoints.Orders.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Get order by id. +/// Operation: GetOrderById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetOrderByIdEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + bool IsNotFound { get; } + + Order OkContent { get; } + + string? BadRequestContent { get; } + + string? UnauthorizedContent { get; } + + string? NotFoundContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrdersEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrdersEndpoint.verified.cs new file mode 100644 index 00000000..5f5095d8 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrdersEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Endpoints.Orders.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Get orders. +/// Operation: GetOrders. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetOrdersEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + GetOrdersParameters parameters, + string httpClientName = "ExNsWithTask-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrdersEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrdersEndpointResult.verified.cs new file mode 100644 index 00000000..987e6549 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrdersEndpointResult.verified.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Endpoints.Orders.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Get orders. +/// Operation: GetOrders. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetOrdersEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + bool IsNotFound { get; } + + PaginationResult OkContent { get; } + + string? BadRequestContent { get; } + + string? UnauthorizedContent { get; } + + string? NotFoundContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Tasks/GetTasksEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Tasks/GetTasksEndpoint.verified.cs new file mode 100644 index 00000000..b72f891e --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Tasks/GetTasksEndpoint.verified.cs @@ -0,0 +1,44 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Endpoints.Tasks; + +/// +/// Client Endpoint. +/// Description: Returns tasks. +/// Operation: GetTasks. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetTasksEndpoint : IGetTasksEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public GetTasksEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + string httpClientName = "ExNsWithTask-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/tasks"); + + using var requestMessage = requestBuilder.Build(HttpMethod.Get); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse>(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + return await responseBuilder.BuildResponseAsync(x => new GetTasksEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Tasks/GetTasksEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Tasks/GetTasksEndpointResult.verified.cs new file mode 100644 index 00000000..38677cd8 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Tasks/GetTasksEndpointResult.verified.cs @@ -0,0 +1,37 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Endpoints.Tasks; + +/// +/// Client Endpoint result. +/// Description: Returns tasks. +/// Operation: GetTasks. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetTasksEndpointResult : EndpointResponse, IGetTasksEndpointResult +{ + public GetTasksEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public IEnumerable OkContent + => IsOk && ContentObject is IEnumerable result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public string? UnauthorizedContent + => IsUnauthorized && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Tasks/Interfaces/IGetTasksEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Tasks/Interfaces/IGetTasksEndpoint.verified.cs new file mode 100644 index 00000000..ff42fe17 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Tasks/Interfaces/IGetTasksEndpoint.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Endpoints.Tasks.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Returns tasks. +/// Operation: GetTasks. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetTasksEndpoint +{ + /// + /// Execute method. + /// + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + string httpClientName = "ExNsWithTask-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Tasks/Interfaces/IGetTasksEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Tasks/Interfaces/IGetTasksEndpointResult.verified.cs new file mode 100644 index 00000000..df40eda5 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Tasks/Interfaces/IGetTasksEndpointResult.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Endpoints.Tasks.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Returns tasks. +/// Operation: GetTasks. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetTasksEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsUnauthorized { get; } + + IEnumerable OkContent { get; } + + string? UnauthorizedContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/TestUnits/Interfaces/IListTestUnitsEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/TestUnits/Interfaces/IListTestUnitsEndpoint.verified.cs new file mode 100644 index 00000000..6e5ce686 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/TestUnits/Interfaces/IListTestUnitsEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Endpoints.TestUnits.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: List test units. +/// Operation: ListTestUnits. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IListTestUnitsEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + ListTestUnitsParameters parameters, + string httpClientName = "ExNsWithTask-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/TestUnits/Interfaces/IListTestUnitsEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/TestUnits/Interfaces/IListTestUnitsEndpointResult.verified.cs new file mode 100644 index 00000000..8fe4978a --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/TestUnits/Interfaces/IListTestUnitsEndpointResult.verified.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Endpoints.TestUnits.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: List test units. +/// Operation: ListTestUnits. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IListTestUnitsEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + PaginationResult OkContent { get; } + + string? BadRequestContent { get; } + + string? UnauthorizedContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/TestUnits/ListTestUnitsEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/TestUnits/ListTestUnitsEndpoint.verified.cs new file mode 100644 index 00000000..7a905b35 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/TestUnits/ListTestUnitsEndpoint.verified.cs @@ -0,0 +1,49 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Endpoints.TestUnits; + +/// +/// Client Endpoint. +/// Description: List test units. +/// Operation: ListTestUnits. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ListTestUnitsEndpoint : IListTestUnitsEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public ListTestUnitsEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + ListTestUnitsParameters parameters, + string httpClientName = "ExNsWithTask-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/test-units"); + requestBuilder.WithQueryParameter("pageSize", parameters.PageSize); + requestBuilder.WithQueryParameter("pageIndex", parameters.PageIndex); + requestBuilder.WithQueryParameter("continuationToken", parameters.ContinuationToken); + + using var requestMessage = requestBuilder.Build(HttpMethod.Get); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse>(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + return await responseBuilder.BuildResponseAsync(x => new ListTestUnitsEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/TestUnits/ListTestUnitsEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/TestUnits/ListTestUnitsEndpointResult.verified.cs new file mode 100644 index 00000000..a43eb852 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/TestUnits/ListTestUnitsEndpointResult.verified.cs @@ -0,0 +1,45 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Endpoints.TestUnits; + +/// +/// Client Endpoint result. +/// Description: List test units. +/// Operation: ListTestUnits. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ListTestUnitsEndpointResult : EndpointResponse, IListTestUnitsEndpointResult +{ + public ListTestUnitsEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public PaginationResult OkContent + => IsOk && ContentObject is PaginationResult result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public string? BadRequestContent + => IsBadRequest && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public string? UnauthorizedContent + => IsUnauthorized && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/GlobalUsings.verified.cs new file mode 100644 index 00000000..7b76232d --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WOPD/src/ExNsWithTask.ApiClient.Generated/GlobalUsings.verified.cs @@ -0,0 +1,23 @@ +global using System; +global using System.CodeDom.Compiler; +global using System.Collections.Generic; +global using System.ComponentModel.DataAnnotations; +global using System.Net; +global using System.Net.Http; +global using System.Threading; +global using System.Threading.Tasks; + +global using Atc.Rest.Client; +global using Atc.Rest.Client.Builder; + +global using ExNsWithTask.ApiClient.Generated.Contracts; +global using ExNsWithTask.ApiClient.Generated.Contracts.EventArgs; +global using ExNsWithTask.ApiClient.Generated.Contracts.Orders; +global using ExNsWithTask.ApiClient.Generated.Contracts.Tasks; +global using ExNsWithTask.ApiClient.Generated.Contracts.TestUnits; +global using ExNsWithTask.ApiClient.Generated.Endpoints.EventArgs.Interfaces; +global using ExNsWithTask.ApiClient.Generated.Endpoints.Orders.Interfaces; +global using ExNsWithTask.ApiClient.Generated.Endpoints.Tasks.Interfaces; +global using ExNsWithTask.ApiClient.Generated.Endpoints.TestUnits.Interfaces; + +global using Microsoft.AspNetCore.Mvc; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Contracts/EventArgs/EventArgs.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Contracts/EventArgs/EventArgs.verified.cs new file mode 100644 index 00000000..0a3e1f61 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Contracts/EventArgs/EventArgs.verified.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Contracts.EventArgs; + +/// +/// EventArgs. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class EventArgs +{ + public Guid Id { get; set; } + + public string EventName { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(EventName)}: {EventName}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Contracts/EventArgs/RequestParameters/GetEventArgByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Contracts/EventArgs/RequestParameters/GetEventArgByIdParameters.verified.cs new file mode 100644 index 00000000..373ec84b --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Contracts/EventArgs/RequestParameters/GetEventArgByIdParameters.verified.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Contracts.EventArgs; + +/// +/// Parameters for operation request. +/// Description: Get EventArgs By Id. +/// Operation: GetEventArgById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetEventArgByIdParameters +{ + /// + /// The id of the eventArgs. + /// + [Required] + public string Id { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Contracts/Orders/Order.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Contracts/Orders/Order.verified.cs new file mode 100644 index 00000000..5e07885b --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Contracts/Orders/Order.verified.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Contracts.Orders; + +/// +/// A single order. +/// Hallo description with multiline and no ending dot. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Order +{ + public Guid Id { get; set; } + + public string Description { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(Description)}: {Description}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Contracts/Orders/RequestParameters/GetOrderByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Contracts/Orders/RequestParameters/GetOrderByIdParameters.verified.cs new file mode 100644 index 00000000..43fad259 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Contracts/Orders/RequestParameters/GetOrderByIdParameters.verified.cs @@ -0,0 +1,35 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Contracts.Orders; + +/// +/// Parameters for operation request. +/// Description: Get order by id. +/// Operation: GetOrderById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetOrderByIdParameters +{ + /// + /// The id of the order. + /// + [Required] + public Guid Id { get; set; } + + /// + /// The email for filter orders to retrieve. + /// + /// + /// Email validation being enforced. + /// + [EmailAddress] + public string? MyEmail { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(MyEmail)}: {MyEmail}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Contracts/Orders/RequestParameters/GetOrdersParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Contracts/Orders/RequestParameters/GetOrdersParameters.verified.cs new file mode 100644 index 00000000..95ee13bf --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Contracts/Orders/RequestParameters/GetOrdersParameters.verified.cs @@ -0,0 +1,38 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Contracts.Orders; + +/// +/// Parameters for operation request. +/// Description: Get orders. +/// Operation: GetOrders. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetOrdersParameters +{ + /// + /// The numbers of items to return. + /// + [Required] + [Range(1, 100)] + public int PageSize { get; set; } = 10; + + /// + /// The number of items to skip before starting to collect the result set. + /// + [Range(0, 2147483647)] + public int PageIndex { get; set; } = 0; + + /// + /// The continuation token. + /// + public string? ContinuationToken { get; set; } + + /// + public override string ToString() + => $"{nameof(PageSize)}: {PageSize}, {nameof(PageIndex)}: {PageIndex}, {nameof(ContinuationToken)}: {ContinuationToken}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Contracts/Tasks/Task.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Contracts/Tasks/Task.verified.cs new file mode 100644 index 00000000..f143a922 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Contracts/Tasks/Task.verified.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Contracts.Tasks; + +/// +/// Describes a single task. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Task +{ + public Guid Id { get; set; } + + public string Name { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(Name)}: {Name}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Contracts/Tasks/Tasks.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Contracts/Tasks/Tasks.verified.cs new file mode 100644 index 00000000..c80a2cac --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Contracts/Tasks/Tasks.verified.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Contracts.Tasks; + +/// +/// Contains a list of Tasks. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Tasks +{ + /// + /// A list of Task. + /// + public List TaskList { get; set; } = new List(); + + /// + public override string ToString() + => $"{nameof(TaskList)}.Count: {TaskList?.Count ?? 0}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Contracts/TestUnits/RequestParameters/ListTestUnitsParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Contracts/TestUnits/RequestParameters/ListTestUnitsParameters.verified.cs new file mode 100644 index 00000000..1102558b --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Contracts/TestUnits/RequestParameters/ListTestUnitsParameters.verified.cs @@ -0,0 +1,38 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Contracts.TestUnits; + +/// +/// Parameters for operation request. +/// Description: List test units. +/// Operation: ListTestUnits. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ListTestUnitsParameters +{ + /// + /// The numbers of items to return. + /// + [Required] + [Range(1, 100)] + public int PageSize { get; set; } = 10; + + /// + /// The number of items to skip before starting to collect the result set. + /// + [Range(0, 2147483647)] + public int PageIndex { get; set; } = 0; + + /// + /// The continuation token. + /// + public string? ContinuationToken { get; set; } + + /// + public override string ToString() + => $"{nameof(PageSize)}: {PageSize}, {nameof(PageIndex)}: {PageIndex}, {nameof(ContinuationToken)}: {ContinuationToken}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Contracts/TestUnits/TestUnit.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Contracts/TestUnits/TestUnit.verified.cs new file mode 100644 index 00000000..14943597 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Contracts/TestUnits/TestUnit.verified.cs @@ -0,0 +1,20 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Contracts.TestUnits; + +/// +/// TestUnit. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class TestUnit +{ + public Guid Id { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Contracts/_Shared/PaginationResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Contracts/_Shared/PaginationResult.verified.cs new file mode 100644 index 00000000..c80c5818 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Contracts/_Shared/PaginationResult.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Contracts; + +/// +/// An item result subset of a data query. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class PaginationResult +{ + public int PageSize { get; set; } + + /// + /// Token to indicate next result set. + /// + public string? ContinuationToken { get; set; } + + public List Results { get; set; } = new List(); + + /// + public override string ToString() + => $"{nameof(PageSize)}: {PageSize}, {nameof(ContinuationToken)}: {ContinuationToken}, {nameof(Results)}.Count: {Results?.Count ?? 0}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/EventArgs/GetEventArgByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/EventArgs/GetEventArgByIdEndpoint.verified.cs new file mode 100644 index 00000000..2c99f71b --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/EventArgs/GetEventArgByIdEndpoint.verified.cs @@ -0,0 +1,48 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Endpoints.EventArgs; + +/// +/// Client Endpoint. +/// Description: Get EventArgs By Id. +/// Operation: GetEventArgById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetEventArgByIdEndpoint : IGetEventArgByIdEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public GetEventArgByIdEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + GetEventArgByIdParameters parameters, + string httpClientName = "ExNsWithTask-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/eventArgs/{id}"); + requestBuilder.WithPathParameter("id", parameters.Id); + + using var requestMessage = requestBuilder.Build(HttpMethod.Get); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + responseBuilder.AddErrorResponse(HttpStatusCode.NotFound); + return await responseBuilder.BuildResponseAsync(x => new GetEventArgByIdEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/EventArgs/GetEventArgByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/EventArgs/GetEventArgByIdEndpointResult.verified.cs new file mode 100644 index 00000000..b6e0ec80 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/EventArgs/GetEventArgByIdEndpointResult.verified.cs @@ -0,0 +1,53 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Endpoints.EventArgs; + +/// +/// Client Endpoint result. +/// Description: Get EventArgs By Id. +/// Operation: GetEventArgById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetEventArgByIdEndpointResult : EndpointResponse, IGetEventArgByIdEndpointResult +{ + public GetEventArgByIdEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public bool IsNotFound + => StatusCode == HttpStatusCode.NotFound; + + public EventArgs OkContent + => IsOk && ContentObject is EventArgs result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public ValidationProblemDetails BadRequestContent + => IsBadRequest && ContentObject is ValidationProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public ProblemDetails UnauthorizedContent + => IsUnauthorized && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); + + public ProblemDetails NotFoundContent + => IsNotFound && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsNotFound property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/EventArgs/GetEventArgsEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/EventArgs/GetEventArgsEndpoint.verified.cs new file mode 100644 index 00000000..564e48fb --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/EventArgs/GetEventArgsEndpoint.verified.cs @@ -0,0 +1,44 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Endpoints.EventArgs; + +/// +/// Client Endpoint. +/// Description: Get EventArgs List. +/// Operation: GetEventArgs. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetEventArgsEndpoint : IGetEventArgsEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public GetEventArgsEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + string httpClientName = "ExNsWithTask-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/eventArgs"); + + using var requestMessage = requestBuilder.Build(HttpMethod.Get); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse>(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + return await responseBuilder.BuildResponseAsync(x => new GetEventArgsEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/EventArgs/GetEventArgsEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/EventArgs/GetEventArgsEndpointResult.verified.cs new file mode 100644 index 00000000..d1644512 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/EventArgs/GetEventArgsEndpointResult.verified.cs @@ -0,0 +1,37 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Endpoints.EventArgs; + +/// +/// Client Endpoint result. +/// Description: Get EventArgs List. +/// Operation: GetEventArgs. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetEventArgsEndpointResult : EndpointResponse, IGetEventArgsEndpointResult +{ + public GetEventArgsEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public IEnumerable OkContent + => IsOk && ContentObject is IEnumerable result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public ProblemDetails UnauthorizedContent + => IsUnauthorized && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgByIdEndpoint.verified.cs new file mode 100644 index 00000000..f420df06 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgByIdEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Endpoints.EventArgs.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Get EventArgs By Id. +/// Operation: GetEventArgById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetEventArgByIdEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + GetEventArgByIdParameters parameters, + string httpClientName = "ExNsWithTask-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgByIdEndpointResult.verified.cs new file mode 100644 index 00000000..81baed8f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgByIdEndpointResult.verified.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Endpoints.EventArgs.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Get EventArgs By Id. +/// Operation: GetEventArgById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetEventArgByIdEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + bool IsNotFound { get; } + + EventArgs OkContent { get; } + + ValidationProblemDetails BadRequestContent { get; } + + ProblemDetails UnauthorizedContent { get; } + + ProblemDetails NotFoundContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgsEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgsEndpoint.verified.cs new file mode 100644 index 00000000..e790969c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgsEndpoint.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Endpoints.EventArgs.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Get EventArgs List. +/// Operation: GetEventArgs. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetEventArgsEndpoint +{ + /// + /// Execute method. + /// + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + string httpClientName = "ExNsWithTask-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgsEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgsEndpointResult.verified.cs new file mode 100644 index 00000000..ec5a59b2 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgsEndpointResult.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Endpoints.EventArgs.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Get EventArgs List. +/// Operation: GetEventArgs. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetEventArgsEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsUnauthorized { get; } + + IEnumerable OkContent { get; } + + ProblemDetails UnauthorizedContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Orders/GetOrderByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Orders/GetOrderByIdEndpoint.verified.cs new file mode 100644 index 00000000..886b24da --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Orders/GetOrderByIdEndpoint.verified.cs @@ -0,0 +1,49 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Endpoints.Orders; + +/// +/// Client Endpoint. +/// Description: Get order by id. +/// Operation: GetOrderById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetOrderByIdEndpoint : IGetOrderByIdEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public GetOrderByIdEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + GetOrderByIdParameters parameters, + string httpClientName = "ExNsWithTask-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/orders/{id}"); + requestBuilder.WithPathParameter("id", parameters.Id); + requestBuilder.WithQueryParameter("myEmail", parameters.MyEmail); + + using var requestMessage = requestBuilder.Build(HttpMethod.Get); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + responseBuilder.AddErrorResponse(HttpStatusCode.NotFound); + return await responseBuilder.BuildResponseAsync(x => new GetOrderByIdEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Orders/GetOrderByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Orders/GetOrderByIdEndpointResult.verified.cs new file mode 100644 index 00000000..8e841354 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Orders/GetOrderByIdEndpointResult.verified.cs @@ -0,0 +1,53 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Endpoints.Orders; + +/// +/// Client Endpoint result. +/// Description: Get order by id. +/// Operation: GetOrderById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetOrderByIdEndpointResult : EndpointResponse, IGetOrderByIdEndpointResult +{ + public GetOrderByIdEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public bool IsNotFound + => StatusCode == HttpStatusCode.NotFound; + + public Order OkContent + => IsOk && ContentObject is Order result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public ValidationProblemDetails BadRequestContent + => IsBadRequest && ContentObject is ValidationProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public ProblemDetails UnauthorizedContent + => IsUnauthorized && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); + + public ProblemDetails NotFoundContent + => IsNotFound && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsNotFound property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Orders/GetOrdersEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Orders/GetOrdersEndpoint.verified.cs new file mode 100644 index 00000000..670e4ee7 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Orders/GetOrdersEndpoint.verified.cs @@ -0,0 +1,50 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Endpoints.Orders; + +/// +/// Client Endpoint. +/// Description: Get orders. +/// Operation: GetOrders. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetOrdersEndpoint : IGetOrdersEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public GetOrdersEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + GetOrdersParameters parameters, + string httpClientName = "ExNsWithTask-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/orders"); + requestBuilder.WithQueryParameter("pageSize", parameters.PageSize); + requestBuilder.WithQueryParameter("pageIndex", parameters.PageIndex); + requestBuilder.WithQueryParameter("continuationToken", parameters.ContinuationToken); + + using var requestMessage = requestBuilder.Build(HttpMethod.Get); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse>(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + responseBuilder.AddErrorResponse(HttpStatusCode.NotFound); + return await responseBuilder.BuildResponseAsync(x => new GetOrdersEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Orders/GetOrdersEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Orders/GetOrdersEndpointResult.verified.cs new file mode 100644 index 00000000..68dd2b60 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Orders/GetOrdersEndpointResult.verified.cs @@ -0,0 +1,53 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Endpoints.Orders; + +/// +/// Client Endpoint result. +/// Description: Get orders. +/// Operation: GetOrders. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetOrdersEndpointResult : EndpointResponse, IGetOrdersEndpointResult +{ + public GetOrdersEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public bool IsNotFound + => StatusCode == HttpStatusCode.NotFound; + + public PaginationResult OkContent + => IsOk && ContentObject is PaginationResult result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public ValidationProblemDetails BadRequestContent + => IsBadRequest && ContentObject is ValidationProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public ProblemDetails UnauthorizedContent + => IsUnauthorized && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); + + public ProblemDetails NotFoundContent + => IsNotFound && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsNotFound property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrderByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrderByIdEndpoint.verified.cs new file mode 100644 index 00000000..a4780c9e --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrderByIdEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Endpoints.Orders.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Get order by id. +/// Operation: GetOrderById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetOrderByIdEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + GetOrderByIdParameters parameters, + string httpClientName = "ExNsWithTask-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrderByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrderByIdEndpointResult.verified.cs new file mode 100644 index 00000000..0e46f994 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrderByIdEndpointResult.verified.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Endpoints.Orders.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Get order by id. +/// Operation: GetOrderById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetOrderByIdEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + bool IsNotFound { get; } + + Order OkContent { get; } + + ValidationProblemDetails BadRequestContent { get; } + + ProblemDetails UnauthorizedContent { get; } + + ProblemDetails NotFoundContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrdersEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrdersEndpoint.verified.cs new file mode 100644 index 00000000..5f5095d8 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrdersEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Endpoints.Orders.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Get orders. +/// Operation: GetOrders. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetOrdersEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + GetOrdersParameters parameters, + string httpClientName = "ExNsWithTask-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrdersEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrdersEndpointResult.verified.cs new file mode 100644 index 00000000..fe6cb466 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrdersEndpointResult.verified.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Endpoints.Orders.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Get orders. +/// Operation: GetOrders. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetOrdersEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + bool IsNotFound { get; } + + PaginationResult OkContent { get; } + + ValidationProblemDetails BadRequestContent { get; } + + ProblemDetails UnauthorizedContent { get; } + + ProblemDetails NotFoundContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Tasks/GetTasksEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Tasks/GetTasksEndpoint.verified.cs new file mode 100644 index 00000000..2ba31d53 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Tasks/GetTasksEndpoint.verified.cs @@ -0,0 +1,44 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Endpoints.Tasks; + +/// +/// Client Endpoint. +/// Description: Returns tasks. +/// Operation: GetTasks. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetTasksEndpoint : IGetTasksEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public GetTasksEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + string httpClientName = "ExNsWithTask-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/tasks"); + + using var requestMessage = requestBuilder.Build(HttpMethod.Get); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse>(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + return await responseBuilder.BuildResponseAsync(x => new GetTasksEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Tasks/GetTasksEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Tasks/GetTasksEndpointResult.verified.cs new file mode 100644 index 00000000..bf882939 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Tasks/GetTasksEndpointResult.verified.cs @@ -0,0 +1,37 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Endpoints.Tasks; + +/// +/// Client Endpoint result. +/// Description: Returns tasks. +/// Operation: GetTasks. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetTasksEndpointResult : EndpointResponse, IGetTasksEndpointResult +{ + public GetTasksEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public IEnumerable OkContent + => IsOk && ContentObject is IEnumerable result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public ProblemDetails UnauthorizedContent + => IsUnauthorized && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Tasks/Interfaces/IGetTasksEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Tasks/Interfaces/IGetTasksEndpoint.verified.cs new file mode 100644 index 00000000..ff42fe17 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Tasks/Interfaces/IGetTasksEndpoint.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Endpoints.Tasks.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Returns tasks. +/// Operation: GetTasks. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetTasksEndpoint +{ + /// + /// Execute method. + /// + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + string httpClientName = "ExNsWithTask-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Tasks/Interfaces/IGetTasksEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Tasks/Interfaces/IGetTasksEndpointResult.verified.cs new file mode 100644 index 00000000..4f1735b2 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/Tasks/Interfaces/IGetTasksEndpointResult.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Endpoints.Tasks.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Returns tasks. +/// Operation: GetTasks. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetTasksEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsUnauthorized { get; } + + IEnumerable OkContent { get; } + + ProblemDetails UnauthorizedContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/TestUnits/Interfaces/IListTestUnitsEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/TestUnits/Interfaces/IListTestUnitsEndpoint.verified.cs new file mode 100644 index 00000000..6e5ce686 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/TestUnits/Interfaces/IListTestUnitsEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Endpoints.TestUnits.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: List test units. +/// Operation: ListTestUnits. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IListTestUnitsEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + ListTestUnitsParameters parameters, + string httpClientName = "ExNsWithTask-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/TestUnits/Interfaces/IListTestUnitsEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/TestUnits/Interfaces/IListTestUnitsEndpointResult.verified.cs new file mode 100644 index 00000000..19b83274 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/TestUnits/Interfaces/IListTestUnitsEndpointResult.verified.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Endpoints.TestUnits.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: List test units. +/// Operation: ListTestUnits. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IListTestUnitsEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + PaginationResult OkContent { get; } + + ValidationProblemDetails BadRequestContent { get; } + + ProblemDetails UnauthorizedContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/TestUnits/ListTestUnitsEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/TestUnits/ListTestUnitsEndpoint.verified.cs new file mode 100644 index 00000000..db41c096 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/TestUnits/ListTestUnitsEndpoint.verified.cs @@ -0,0 +1,49 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Endpoints.TestUnits; + +/// +/// Client Endpoint. +/// Description: List test units. +/// Operation: ListTestUnits. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ListTestUnitsEndpoint : IListTestUnitsEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public ListTestUnitsEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + ListTestUnitsParameters parameters, + string httpClientName = "ExNsWithTask-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/test-units"); + requestBuilder.WithQueryParameter("pageSize", parameters.PageSize); + requestBuilder.WithQueryParameter("pageIndex", parameters.PageIndex); + requestBuilder.WithQueryParameter("continuationToken", parameters.ContinuationToken); + + using var requestMessage = requestBuilder.Build(HttpMethod.Get); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse>(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + return await responseBuilder.BuildResponseAsync(x => new ListTestUnitsEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/TestUnits/ListTestUnitsEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/TestUnits/ListTestUnitsEndpointResult.verified.cs new file mode 100644 index 00000000..b5609053 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/Endpoints/TestUnits/ListTestUnitsEndpointResult.verified.cs @@ -0,0 +1,45 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.ApiClient.Generated.Endpoints.TestUnits; + +/// +/// Client Endpoint result. +/// Description: List test units. +/// Operation: ListTestUnits. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ListTestUnitsEndpointResult : EndpointResponse, IListTestUnitsEndpointResult +{ + public ListTestUnitsEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public PaginationResult OkContent + => IsOk && ContentObject is PaginationResult result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public ValidationProblemDetails BadRequestContent + => IsBadRequest && ContentObject is ValidationProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public ProblemDetails UnauthorizedContent + => IsUnauthorized && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/GlobalUsings.verified.cs new file mode 100644 index 00000000..7b76232d --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyClient/WPD/src/ExNsWithTask.ApiClient.Generated/GlobalUsings.verified.cs @@ -0,0 +1,23 @@ +global using System; +global using System.CodeDom.Compiler; +global using System.Collections.Generic; +global using System.ComponentModel.DataAnnotations; +global using System.Net; +global using System.Net.Http; +global using System.Threading; +global using System.Threading.Tasks; + +global using Atc.Rest.Client; +global using Atc.Rest.Client.Builder; + +global using ExNsWithTask.ApiClient.Generated.Contracts; +global using ExNsWithTask.ApiClient.Generated.Contracts.EventArgs; +global using ExNsWithTask.ApiClient.Generated.Contracts.Orders; +global using ExNsWithTask.ApiClient.Generated.Contracts.Tasks; +global using ExNsWithTask.ApiClient.Generated.Contracts.TestUnits; +global using ExNsWithTask.ApiClient.Generated.Endpoints.EventArgs.Interfaces; +global using ExNsWithTask.ApiClient.Generated.Endpoints.Orders.Interfaces; +global using ExNsWithTask.ApiClient.Generated.Endpoints.Tasks.Interfaces; +global using ExNsWithTask.ApiClient.Generated.Endpoints.TestUnits.Interfaces; + +global using Microsoft.AspNetCore.Mvc; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/ApiRegistration.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/ApiRegistration.verified.cs new file mode 100644 index 00000000..63be4c4e --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/ApiRegistration.verified.cs @@ -0,0 +1,12 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Generated; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ApiRegistration +{ +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/EventArgs/Interfaces/IGetEventArgByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/EventArgs/Interfaces/IGetEventArgByIdHandler.verified.cs new file mode 100644 index 00000000..6e776c0f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/EventArgs/Interfaces/IGetEventArgByIdHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Generated.Contracts.EventArgs; + +/// +/// Domain Interface for RequestHandler. +/// Description: Get EventArgs By Id. +/// Operation: GetEventArgById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetEventArgByIdHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + GetEventArgByIdParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/EventArgs/Interfaces/IGetEventArgsHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/EventArgs/Interfaces/IGetEventArgsHandler.verified.cs new file mode 100644 index 00000000..1f4ba388 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/EventArgs/Interfaces/IGetEventArgsHandler.verified.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Generated.Contracts.EventArgs; + +/// +/// Domain Interface for RequestHandler. +/// Description: Get EventArgs List. +/// Operation: GetEventArgs. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetEventArgsHandler +{ + /// + /// Execute method. + /// + /// The cancellation token. + Task ExecuteAsync( + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/EventArgs/Models/EventArgs.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/EventArgs/Models/EventArgs.verified.cs new file mode 100644 index 00000000..302c759b --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/EventArgs/Models/EventArgs.verified.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Generated.Contracts.EventArgs; + +/// +/// EventArgs. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class EventArgs +{ + public Guid Id { get; set; } + + public string EventName { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(EventName)}: {EventName}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/EventArgs/Parameters/GetEventArgByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/EventArgs/Parameters/GetEventArgByIdParameters.verified.cs new file mode 100644 index 00000000..f1fe6d40 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/EventArgs/Parameters/GetEventArgByIdParameters.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Generated.Contracts.EventArgs; + +/// +/// Parameters for operation request. +/// Description: Get EventArgs By Id. +/// Operation: GetEventArgById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetEventArgByIdParameters +{ + /// + /// The id of the eventArgs. + /// + [FromRoute(Name = "id")] + [Required] + public string Id { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/EventArgs/Results/GetEventArgByIdResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/EventArgs/Results/GetEventArgByIdResult.verified.cs new file mode 100644 index 00000000..f22e6ecd --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/EventArgs/Results/GetEventArgByIdResult.verified.cs @@ -0,0 +1,36 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Generated.Contracts.EventArgs; + +/// +/// Results for operation request. +/// Description: Get EventArgs By Id. +/// Operation: GetEventArgById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetEventArgByIdResult : ResultBase +{ + private GetEventArgByIdResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static GetEventArgByIdResult Ok(EventArgs response) + => new GetEventArgByIdResult(new OkObjectResult(response)); + + /// + /// 404 - NotFound response. + /// + public static GetEventArgByIdResult NotFound(string? message = null) + => new GetEventArgByIdResult(new NotFoundObjectResult(message)); + + /// + /// Performs an implicit conversion from GetEventArgByIdResult to ActionResult. + /// + public static implicit operator GetEventArgByIdResult(EventArgs response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/EventArgs/Results/GetEventArgsResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/EventArgs/Results/GetEventArgsResult.verified.cs new file mode 100644 index 00000000..f3726737 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/EventArgs/Results/GetEventArgsResult.verified.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Generated.Contracts.EventArgs; + +/// +/// Results for operation request. +/// Description: Get EventArgs List. +/// Operation: GetEventArgs. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetEventArgsResult : ResultBase +{ + private GetEventArgsResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static GetEventArgsResult Ok(IEnumerable response) + => new GetEventArgsResult(new OkObjectResult(response ?? Enumerable.Empty())); + + /// + /// Performs an implicit conversion from GetEventArgsResult to ActionResult. + /// + public static implicit operator GetEventArgsResult(List response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/Orders/Interfaces/IGetOrderByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/Orders/Interfaces/IGetOrderByIdHandler.verified.cs new file mode 100644 index 00000000..2c15e254 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/Orders/Interfaces/IGetOrderByIdHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Generated.Contracts.Orders; + +/// +/// Domain Interface for RequestHandler. +/// Description: Get order by id. +/// Operation: GetOrderById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetOrderByIdHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + GetOrderByIdParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/Orders/Interfaces/IGetOrdersHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/Orders/Interfaces/IGetOrdersHandler.verified.cs new file mode 100644 index 00000000..d6ceb57e --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/Orders/Interfaces/IGetOrdersHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Generated.Contracts.Orders; + +/// +/// Domain Interface for RequestHandler. +/// Description: Get orders. +/// Operation: GetOrders. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetOrdersHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + GetOrdersParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/Orders/Models/Order.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/Orders/Models/Order.verified.cs new file mode 100644 index 00000000..181cccfc --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/Orders/Models/Order.verified.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Generated.Contracts.Orders; + +/// +/// A single order. +/// Hallo description with multiline and no ending dot. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Order +{ + public Guid Id { get; set; } + + public string Description { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(Description)}: {Description}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/Orders/Parameters/GetOrderByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/Orders/Parameters/GetOrderByIdParameters.verified.cs new file mode 100644 index 00000000..fb1a51d0 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/Orders/Parameters/GetOrderByIdParameters.verified.cs @@ -0,0 +1,37 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Generated.Contracts.Orders; + +/// +/// Parameters for operation request. +/// Description: Get order by id. +/// Operation: GetOrderById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetOrderByIdParameters +{ + /// + /// The id of the order. + /// + [FromRoute(Name = "id")] + [Required] + public Guid Id { get; set; } + + /// + /// The email for filter orders to retrieve. + /// + /// + /// Email validation being enforced. + /// + [FromQuery(Name = "myEmail")] + [EmailAddress] + public string? MyEmail { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(MyEmail)}: {MyEmail}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/Orders/Parameters/GetOrdersParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/Orders/Parameters/GetOrdersParameters.verified.cs new file mode 100644 index 00000000..e8f808a4 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/Orders/Parameters/GetOrdersParameters.verified.cs @@ -0,0 +1,41 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Generated.Contracts.Orders; + +/// +/// Parameters for operation request. +/// Description: Get orders. +/// Operation: GetOrders. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetOrdersParameters +{ + /// + /// The numbers of items to return. + /// + [FromQuery(Name = "pageSize")] + [Required] + [Range(1, 100)] + public int PageSize { get; set; } = 10; + + /// + /// The number of items to skip before starting to collect the result set. + /// + [FromQuery(Name = "pageIndex")] + [Range(0, 2147483647)] + public int PageIndex { get; set; } = 0; + + /// + /// The continuation token. + /// + [FromQuery(Name = "continuationToken")] + public string? ContinuationToken { get; set; } + + /// + public override string ToString() + => $"{nameof(PageSize)}: {PageSize}, {nameof(PageIndex)}: {PageIndex}, {nameof(ContinuationToken)}: {ContinuationToken}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/Orders/Results/GetOrderByIdResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/Orders/Results/GetOrderByIdResult.verified.cs new file mode 100644 index 00000000..ffae96c3 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/Orders/Results/GetOrderByIdResult.verified.cs @@ -0,0 +1,36 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Generated.Contracts.Orders; + +/// +/// Results for operation request. +/// Description: Get order by id. +/// Operation: GetOrderById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetOrderByIdResult : ResultBase +{ + private GetOrderByIdResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static GetOrderByIdResult Ok(Order response) + => new GetOrderByIdResult(new OkObjectResult(response)); + + /// + /// 404 - NotFound response. + /// + public static GetOrderByIdResult NotFound(string? message = null) + => new GetOrderByIdResult(new NotFoundObjectResult(message)); + + /// + /// Performs an implicit conversion from GetOrderByIdResult to ActionResult. + /// + public static implicit operator GetOrderByIdResult(Order response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/Orders/Results/GetOrdersResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/Orders/Results/GetOrdersResult.verified.cs new file mode 100644 index 00000000..47fd0471 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/Orders/Results/GetOrdersResult.verified.cs @@ -0,0 +1,36 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Generated.Contracts.Orders; + +/// +/// Results for operation request. +/// Description: Get orders. +/// Operation: GetOrders. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetOrdersResult : ResultBase +{ + private GetOrdersResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static GetOrdersResult Ok(PaginationResult response) + => new GetOrdersResult(new OkObjectResult(response)); + + /// + /// 404 - NotFound response. + /// + public static GetOrdersResult NotFound(string? message = null) + => new GetOrdersResult(new NotFoundObjectResult(message)); + + /// + /// Performs an implicit conversion from GetOrdersResult to ActionResult. + /// + public static implicit operator GetOrdersResult(PaginationResult response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/Tasks/Interfaces/IGetTasksHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/Tasks/Interfaces/IGetTasksHandler.verified.cs new file mode 100644 index 00000000..9e88d6e3 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/Tasks/Interfaces/IGetTasksHandler.verified.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Generated.Contracts.Tasks; + +/// +/// Domain Interface for RequestHandler. +/// Description: Returns tasks. +/// Operation: GetTasks. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetTasksHandler +{ + /// + /// Execute method. + /// + /// The cancellation token. + Task ExecuteAsync( + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/Tasks/Models/Task.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/Tasks/Models/Task.verified.cs new file mode 100644 index 00000000..ead4a570 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/Tasks/Models/Task.verified.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Generated.Contracts.Tasks; + +/// +/// Describes a single task. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Task +{ + public Guid Id { get; set; } + + public string Name { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(Name)}: {Name}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/Tasks/Models/Tasks.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/Tasks/Models/Tasks.verified.cs new file mode 100644 index 00000000..f02a8b6f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/Tasks/Models/Tasks.verified.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Generated.Contracts.Tasks; + +/// +/// Contains a list of Tasks. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Tasks +{ + /// + /// A list of Task. + /// + public List TaskList { get; set; } = new List(); + + /// + public override string ToString() + => $"{nameof(TaskList)}.Count: {TaskList?.Count ?? 0}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/Tasks/Results/GetTasksResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/Tasks/Results/GetTasksResult.verified.cs new file mode 100644 index 00000000..b4a17e50 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/Tasks/Results/GetTasksResult.verified.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Generated.Contracts.Tasks; + +/// +/// Results for operation request. +/// Description: Returns tasks. +/// Operation: GetTasks. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetTasksResult : ResultBase +{ + private GetTasksResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static GetTasksResult Ok(IEnumerable response) + => new GetTasksResult(new OkObjectResult(response ?? Enumerable.Empty())); + + /// + /// Performs an implicit conversion from GetTasksResult to ActionResult. + /// + public static implicit operator GetTasksResult(List response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/TestUnits/Interfaces/IListTestUnitsHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/TestUnits/Interfaces/IListTestUnitsHandler.verified.cs new file mode 100644 index 00000000..2dfa5ac6 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/TestUnits/Interfaces/IListTestUnitsHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Generated.Contracts.TestUnits; + +/// +/// Domain Interface for RequestHandler. +/// Description: List test units. +/// Operation: ListTestUnits. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IListTestUnitsHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + ListTestUnitsParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/TestUnits/Models/TestUnit.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/TestUnits/Models/TestUnit.verified.cs new file mode 100644 index 00000000..5d70cad0 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/TestUnits/Models/TestUnit.verified.cs @@ -0,0 +1,20 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Generated.Contracts.TestUnits; + +/// +/// TestUnit. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class TestUnit +{ + public Guid Id { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/TestUnits/Parameters/ListTestUnitsParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/TestUnits/Parameters/ListTestUnitsParameters.verified.cs new file mode 100644 index 00000000..4a269ebf --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/TestUnits/Parameters/ListTestUnitsParameters.verified.cs @@ -0,0 +1,41 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Generated.Contracts.TestUnits; + +/// +/// Parameters for operation request. +/// Description: List test units. +/// Operation: ListTestUnits. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ListTestUnitsParameters +{ + /// + /// The numbers of items to return. + /// + [FromQuery(Name = "pageSize")] + [Required] + [Range(1, 100)] + public int PageSize { get; set; } = 10; + + /// + /// The number of items to skip before starting to collect the result set. + /// + [FromQuery(Name = "pageIndex")] + [Range(0, 2147483647)] + public int PageIndex { get; set; } = 0; + + /// + /// The continuation token. + /// + [FromQuery(Name = "continuationToken")] + public string? ContinuationToken { get; set; } + + /// + public override string ToString() + => $"{nameof(PageSize)}: {PageSize}, {nameof(PageIndex)}: {PageIndex}, {nameof(ContinuationToken)}: {ContinuationToken}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/TestUnits/Results/ListTestUnitsResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/TestUnits/Results/ListTestUnitsResult.verified.cs new file mode 100644 index 00000000..76479b93 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/TestUnits/Results/ListTestUnitsResult.verified.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Generated.Contracts.TestUnits; + +/// +/// Results for operation request. +/// Description: List test units. +/// Operation: ListTestUnits. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ListTestUnitsResult : ResultBase +{ + private ListTestUnitsResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static ListTestUnitsResult Ok(PaginationResult response) + => new ListTestUnitsResult(new OkObjectResult(response)); + + /// + /// Performs an implicit conversion from ListTestUnitsResult to ActionResult. + /// + public static implicit operator ListTestUnitsResult(PaginationResult response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/_Shared/PaginationResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/_Shared/PaginationResult.verified.cs new file mode 100644 index 00000000..821b6d11 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Contracts/_Shared/PaginationResult.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Generated.Contracts; + +/// +/// An item result subset of a data query. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class PaginationResult +{ + public int PageSize { get; set; } + + /// + /// Token to indicate next result set. + /// + public string? ContinuationToken { get; set; } + + public List Results { get; set; } = new List(); + + /// + public override string ToString() + => $"{nameof(PageSize)}: {PageSize}, {nameof(ContinuationToken)}: {ContinuationToken}, {nameof(Results)}.Count: {Results?.Count ?? 0}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Endpoints/EventArgsController.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Endpoints/EventArgsController.verified.cs new file mode 100644 index 00000000..5c334eac --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Endpoints/EventArgsController.verified.cs @@ -0,0 +1,44 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Generated.Endpoints; + +/// +/// Endpoint definitions. +/// +[Authorize] +[ApiController] +[Route("/api/v1/eventArgs")] +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public sealed class EventArgsController : ControllerBase +{ + /// + /// Description: Get EventArgs List. + /// Operation: GetEventArgs. + /// + [HttpGet] + [ProducesResponseType(typeof(IEnumerable), StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + public async Task GetEventArgs( + [FromServices] IGetEventArgsHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(cancellationToken); + + /// + /// Description: Get EventArgs By Id. + /// Operation: GetEventArgById. + /// + [HttpGet("{id}")] + [ProducesResponseType(typeof(Contracts.EventArgs.EventArgs), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(typeof(string), StatusCodes.Status404NotFound)] + public async Task GetEventArgById( + GetEventArgByIdParameters parameters, + [FromServices] IGetEventArgByIdHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Endpoints/OrdersController.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Endpoints/OrdersController.verified.cs new file mode 100644 index 00000000..3977cc59 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Endpoints/OrdersController.verified.cs @@ -0,0 +1,47 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Generated.Endpoints; + +/// +/// Endpoint definitions. +/// +[Authorize] +[ApiController] +[Route("/api/v1/orders")] +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public sealed class OrdersController : ControllerBase +{ + /// + /// Description: Get orders. + /// Operation: GetOrders. + /// + [HttpGet] + [ProducesResponseType(typeof(PaginationResult), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(typeof(string), StatusCodes.Status404NotFound)] + public async Task GetOrders( + GetOrdersParameters parameters, + [FromServices] IGetOrdersHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); + + /// + /// Description: Get order by id. + /// Operation: GetOrderById. + /// + [HttpGet("{id}")] + [ProducesResponseType(typeof(Order), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(typeof(string), StatusCodes.Status404NotFound)] + public async Task GetOrderById( + GetOrderByIdParameters parameters, + [FromServices] IGetOrderByIdHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Endpoints/TasksController.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Endpoints/TasksController.verified.cs new file mode 100644 index 00000000..0c07a8ed --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Endpoints/TasksController.verified.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Generated.Endpoints; + +/// +/// Endpoint definitions. +/// +[Authorize] +[ApiController] +[Route("/api/v1/tasks")] +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public sealed class TasksController : ControllerBase +{ + /// + /// Description: Returns tasks. + /// Operation: GetTasks. + /// + [HttpGet] + [ProducesResponseType(typeof(IEnumerable), StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + public async Task GetTasks( + [FromServices] IGetTasksHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(cancellationToken); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Endpoints/TestUnitsController.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Endpoints/TestUnitsController.verified.cs new file mode 100644 index 00000000..e58004e2 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/Endpoints/TestUnitsController.verified.cs @@ -0,0 +1,31 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Generated.Endpoints; + +/// +/// Endpoint definitions. +/// +[Authorize] +[ApiController] +[Route("/api/v1/test-units")] +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public sealed class TestUnitsController : ControllerBase +{ + /// + /// Description: List test units. + /// Operation: ListTestUnits. + /// + [HttpGet] + [ProducesResponseType(typeof(PaginationResult), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + public async Task ListTestUnits( + ListTestUnitsParameters parameters, + [FromServices] IListTestUnitsHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/GlobalUsings.verified.cs new file mode 100644 index 00000000..edabafb9 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api.Generated/GlobalUsings.verified.cs @@ -0,0 +1,15 @@ +global using System.CodeDom.Compiler; +global using System.ComponentModel.DataAnnotations; +global using System.Net; + +global using Atc.Rest.Results; + +global using ExNsWithTask.Api.Generated.Contracts; +global using ExNsWithTask.Api.Generated.Contracts.EventArgs; +global using ExNsWithTask.Api.Generated.Contracts.Orders; +global using ExNsWithTask.Api.Generated.Contracts.Tasks; +global using ExNsWithTask.Api.Generated.Contracts.TestUnits; + +global using Microsoft.AspNetCore.Authorization; +global using Microsoft.AspNetCore.Http; +global using Microsoft.AspNetCore.Mvc; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api/GlobalUsings.verified.cs new file mode 100644 index 00000000..1c5813ab --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api/GlobalUsings.verified.cs @@ -0,0 +1,15 @@ +global using System.CodeDom.Compiler; +global using System.Reflection; + +global using Asp.Versioning.ApiExplorer; + +global using Atc.Rest.Extended.Options; + +global using ExNsWithTask.Api.Generated; +global using ExNsWithTask.Api.Options; +global using ExNsWithTask.Domain; + +global using Microsoft.Extensions.Options; +global using Microsoft.OpenApi.Models; + +global using Swashbuckle.AspNetCore.SwaggerGen; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api/Options/ConfigureSwaggerDocOptions.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api/Options/ConfigureSwaggerDocOptions.verified.cs new file mode 100644 index 00000000..aac49593 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api/Options/ConfigureSwaggerDocOptions.verified.cs @@ -0,0 +1,39 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Options; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ConfigureSwaggerDocOptions : IConfigureOptions +{ + private readonly IApiVersionDescriptionProvider provider; + + public ConfigureSwaggerDocOptions( + IApiVersionDescriptionProvider provider) + => this.provider = provider; + + public void Configure( + SwaggerGenOptions options) + { + foreach (var version in provider.ApiVersionDescriptions) + { + options.SwaggerDoc( + version.GroupName, + new OpenApiInfo + { + Version = "1.0", + Title = "TestUnit Task Ns Api", + Description = "TestUnit Task Ns Api - SingleFileVersion", + Contact = new OpenApiContact + { + Name = "atc-net A/S", + }, + }); + } + + options.IncludeXmlComments(Path.ChangeExtension(GetType().Assembly.Location, "xml")); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api/Program.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api/Program.verified.cs new file mode 100644 index 00000000..d5b02894 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api/Program.verified.cs @@ -0,0 +1,23 @@ +namespace ExNsWithTask.Api; + +public static class Program +{ + public static void Main(string[] args) + { + CreateHostBuilder(args) + .Build() + .Run(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) + { + var builder = Host + .CreateDefaultBuilder(args) + .ConfigureWebHostDefaults(webBuilder => + { + webBuilder.UseStartup(); + }); + + return builder; + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api/Startup.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api/Startup.verified.cs new file mode 100644 index 00000000..22399ffd --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Api/Startup.verified.cs @@ -0,0 +1,38 @@ +namespace ExNsWithTask.Api; + +public class Startup +{ + private readonly RestApiExtendedOptions restApiOptions; + + public Startup( + IConfiguration configuration) + { + Configuration = configuration; + restApiOptions = new RestApiExtendedOptions + { + // TODO: Remove/out-comment/set to false this for production scenarios! + AllowAnonymousAccessForDevelopment = true, + }; + + restApiOptions.AddAssemblyPairs( + Assembly.GetAssembly(typeof(ApiRegistration)), + Assembly.GetAssembly(typeof(DomainRegistration))); + } + + public IConfiguration Configuration { get; } + + public void ConfigureServices( + IServiceCollection services) + { + services.ConfigureOptions(); + + services.AddRestApi(restApiOptions, Configuration); + } + + public void Configure( + IApplicationBuilder app, + IWebHostEnvironment env) + { + app.ConfigureRestApi(env, restApiOptions); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Domain/DomainRegistration.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Domain/DomainRegistration.verified.cs new file mode 100644 index 00000000..f467069a --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Domain/DomainRegistration.verified.cs @@ -0,0 +1,12 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Domain; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class DomainRegistration +{ +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Domain/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Domain/GlobalUsings.verified.cs new file mode 100644 index 00000000..b072a423 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Domain/GlobalUsings.verified.cs @@ -0,0 +1,6 @@ +global using System.CodeDom.Compiler; + +global using ExNsWithTask.Api.Generated.Contracts.EventArgs; +global using ExNsWithTask.Api.Generated.Contracts.Orders; +global using ExNsWithTask.Api.Generated.Contracts.Tasks; +global using ExNsWithTask.Api.Generated.Contracts.TestUnits; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Domain/Handlers/EventArgs/GetEventArgByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Domain/Handlers/EventArgs/GetEventArgByIdHandler.verified.cs new file mode 100644 index 00000000..2f96253e --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Domain/Handlers/EventArgs/GetEventArgByIdHandler.verified.cs @@ -0,0 +1,18 @@ +namespace ExNsWithTask.Domain.Handlers.EventArgs; + +/// +/// Handler for operation request. +/// Description: Get EventArgs By Id. +/// Operation: GetEventArgById. +/// +public class GetEventArgByIdHandler : IGetEventArgByIdHandler +{ + public Task ExecuteAsync( + GetEventArgByIdParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for GetEventArgByIdHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Domain/Handlers/EventArgs/GetEventArgsHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Domain/Handlers/EventArgs/GetEventArgsHandler.verified.cs new file mode 100644 index 00000000..ad8c8665 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Domain/Handlers/EventArgs/GetEventArgsHandler.verified.cs @@ -0,0 +1,15 @@ +namespace ExNsWithTask.Domain.Handlers.EventArgs; + +/// +/// Handler for operation request. +/// Description: Get EventArgs List. +/// Operation: GetEventArgs. +/// +public class GetEventArgsHandler : IGetEventArgsHandler +{ + public Task ExecuteAsync( + CancellationToken cancellationToken = default) + { + throw new NotImplementedException("Add logic here for GetEventArgsHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Domain/Handlers/Orders/GetOrderByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Domain/Handlers/Orders/GetOrderByIdHandler.verified.cs new file mode 100644 index 00000000..f7f4a412 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Domain/Handlers/Orders/GetOrderByIdHandler.verified.cs @@ -0,0 +1,18 @@ +namespace ExNsWithTask.Domain.Handlers.Orders; + +/// +/// Handler for operation request. +/// Description: Get order by id. +/// Operation: GetOrderById. +/// +public class GetOrderByIdHandler : IGetOrderByIdHandler +{ + public Task ExecuteAsync( + GetOrderByIdParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for GetOrderByIdHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Domain/Handlers/Orders/GetOrdersHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Domain/Handlers/Orders/GetOrdersHandler.verified.cs new file mode 100644 index 00000000..26a1f595 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Domain/Handlers/Orders/GetOrdersHandler.verified.cs @@ -0,0 +1,18 @@ +namespace ExNsWithTask.Domain.Handlers.Orders; + +/// +/// Handler for operation request. +/// Description: Get orders. +/// Operation: GetOrders. +/// +public class GetOrdersHandler : IGetOrdersHandler +{ + public Task ExecuteAsync( + GetOrdersParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for GetOrdersHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Domain/Handlers/Tasks/GetTasksHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Domain/Handlers/Tasks/GetTasksHandler.verified.cs new file mode 100644 index 00000000..f5f86e79 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Domain/Handlers/Tasks/GetTasksHandler.verified.cs @@ -0,0 +1,15 @@ +namespace ExNsWithTask.Domain.Handlers.Tasks; + +/// +/// Handler for operation request. +/// Description: Returns tasks. +/// Operation: GetTasks. +/// +public class GetTasksHandler : IGetTasksHandler +{ + public Task ExecuteAsync( + CancellationToken cancellationToken = default) + { + throw new NotImplementedException("Add logic here for GetTasksHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Domain/Handlers/TestUnits/ListTestUnitsHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Domain/Handlers/TestUnits/ListTestUnitsHandler.verified.cs new file mode 100644 index 00000000..942fb53a --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/src/ExNsWithTask.Domain/Handlers/TestUnits/ListTestUnitsHandler.verified.cs @@ -0,0 +1,18 @@ +namespace ExNsWithTask.Domain.Handlers.TestUnits; + +/// +/// Handler for operation request. +/// Description: List test units. +/// Operation: ListTestUnits. +/// +public class ListTestUnitsHandler : IListTestUnitsHandler +{ + public Task ExecuteAsync( + ListTestUnitsParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for ListTestUnitsHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Api.Tests/Endpoints/EventArgs/GetEventArgByIdHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Api.Tests/Endpoints/EventArgs/GetEventArgByIdHandlerStub.verified.cs new file mode 100644 index 00000000..87dd34fb --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Api.Tests/Endpoints/EventArgs/GetEventArgByIdHandlerStub.verified.cs @@ -0,0 +1,20 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Tests.Endpoints.EventArgs; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetEventArgByIdHandlerStub : IGetEventArgByIdHandler +{ + public Task ExecuteAsync( + GetEventArgByIdParameters parameters, + CancellationToken cancellationToken = default) + { + var data = new Fixture().Create(); + + return Task.FromResult(GetEventArgByIdResult.Ok(data)); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Api.Tests/Endpoints/EventArgs/GetEventArgByIdTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Api.Tests/Endpoints/EventArgs/GetEventArgByIdTests.verified.cs new file mode 100644 index 00000000..68d375e8 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Api.Tests/Endpoints/EventArgs/GetEventArgByIdTests.verified.cs @@ -0,0 +1,21 @@ +namespace ExNsWithTask.Api.Tests.Endpoints.EventArgs; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class GetEventArgByIdTests : WebApiControllerBaseTest +{ + public GetEventArgByIdTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Api.Tests/Endpoints/EventArgs/GetEventArgsHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Api.Tests/Endpoints/EventArgs/GetEventArgsHandlerStub.verified.cs new file mode 100644 index 00000000..9e62c04f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Api.Tests/Endpoints/EventArgs/GetEventArgsHandlerStub.verified.cs @@ -0,0 +1,19 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Tests.Endpoints.EventArgs; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetEventArgsHandlerStub : IGetEventArgsHandler +{ + public Task ExecuteAsync( + CancellationToken cancellationToken = default) + { + var data = new Fixture().Create>(); + + return Task.FromResult(GetEventArgsResult.Ok(data)); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Api.Tests/Endpoints/EventArgs/GetEventArgsTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Api.Tests/Endpoints/EventArgs/GetEventArgsTests.verified.cs new file mode 100644 index 00000000..e3a6c044 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Api.Tests/Endpoints/EventArgs/GetEventArgsTests.verified.cs @@ -0,0 +1,21 @@ +namespace ExNsWithTask.Api.Tests.Endpoints.EventArgs; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class GetEventArgsTests : WebApiControllerBaseTest +{ + public GetEventArgsTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Api.Tests/Endpoints/Orders/GetOrderByIdHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Api.Tests/Endpoints/Orders/GetOrderByIdHandlerStub.verified.cs new file mode 100644 index 00000000..42bf16c8 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Api.Tests/Endpoints/Orders/GetOrderByIdHandlerStub.verified.cs @@ -0,0 +1,20 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Tests.Endpoints.Orders; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetOrderByIdHandlerStub : IGetOrderByIdHandler +{ + public Task ExecuteAsync( + GetOrderByIdParameters parameters, + CancellationToken cancellationToken = default) + { + var data = new Fixture().Create(); + + return Task.FromResult(GetOrderByIdResult.Ok(data)); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Api.Tests/Endpoints/Orders/GetOrderByIdTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Api.Tests/Endpoints/Orders/GetOrderByIdTests.verified.cs new file mode 100644 index 00000000..905f3cb4 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Api.Tests/Endpoints/Orders/GetOrderByIdTests.verified.cs @@ -0,0 +1,21 @@ +namespace ExNsWithTask.Api.Tests.Endpoints.Orders; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class GetOrderByIdTests : WebApiControllerBaseTest +{ + public GetOrderByIdTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Api.Tests/Endpoints/Orders/GetOrdersHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Api.Tests/Endpoints/Orders/GetOrdersHandlerStub.verified.cs new file mode 100644 index 00000000..b052336e --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Api.Tests/Endpoints/Orders/GetOrdersHandlerStub.verified.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Tests.Endpoints.Orders; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetOrdersHandlerStub : IGetOrdersHandler +{ + public Task ExecuteAsync( + GetOrdersParameters parameters, + CancellationToken cancellationToken = default) + { + var data = new Fixture().Create>(); + + var paginationData = new PaginationResult(); + + return Task.FromResult(GetOrdersResult.Ok(paginationData)); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Api.Tests/Endpoints/Orders/GetOrdersTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Api.Tests/Endpoints/Orders/GetOrdersTests.verified.cs new file mode 100644 index 00000000..c48268fb --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Api.Tests/Endpoints/Orders/GetOrdersTests.verified.cs @@ -0,0 +1,21 @@ +namespace ExNsWithTask.Api.Tests.Endpoints.Orders; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class GetOrdersTests : WebApiControllerBaseTest +{ + public GetOrdersTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Api.Tests/Endpoints/Tasks/GetTasksHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Api.Tests/Endpoints/Tasks/GetTasksHandlerStub.verified.cs new file mode 100644 index 00000000..1660556b --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Api.Tests/Endpoints/Tasks/GetTasksHandlerStub.verified.cs @@ -0,0 +1,19 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Tests.Endpoints.Tasks; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetTasksHandlerStub : ExNsWithTask.Api.Generated.Contracts.Tasks.IGetTasksHandler +{ + public Task ExecuteAsync( + CancellationToken cancellationToken = default) + { + var data = new Fixture().Create>(); + + return Task.FromResult(ExNsWithTask.Api.Generated.Contracts.Tasks.GetTasksResult.Ok(data)); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Api.Tests/Endpoints/Tasks/GetTasksTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Api.Tests/Endpoints/Tasks/GetTasksTests.verified.cs new file mode 100644 index 00000000..07430e38 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Api.Tests/Endpoints/Tasks/GetTasksTests.verified.cs @@ -0,0 +1,21 @@ +namespace ExNsWithTask.Api.Tests.Endpoints.Tasks; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class GetTasksTests : WebApiControllerBaseTest +{ + public GetTasksTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Api.Tests/Endpoints/TestUnits/ListTestUnitsHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Api.Tests/Endpoints/TestUnits/ListTestUnitsHandlerStub.verified.cs new file mode 100644 index 00000000..d8d0b7f5 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Api.Tests/Endpoints/TestUnits/ListTestUnitsHandlerStub.verified.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Tests.Endpoints.TestUnits; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ListTestUnitsHandlerStub : IListTestUnitsHandler +{ + public Task ExecuteAsync( + ListTestUnitsParameters parameters, + CancellationToken cancellationToken = default) + { + var data = new Fixture().Create>(); + + var paginationData = new PaginationResult(); + + return Task.FromResult(ListTestUnitsResult.Ok(paginationData)); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Api.Tests/Endpoints/TestUnits/ListTestUnitsTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Api.Tests/Endpoints/TestUnits/ListTestUnitsTests.verified.cs new file mode 100644 index 00000000..f86240d5 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Api.Tests/Endpoints/TestUnits/ListTestUnitsTests.verified.cs @@ -0,0 +1,21 @@ +namespace ExNsWithTask.Api.Tests.Endpoints.TestUnits; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class ListTestUnitsTests : WebApiControllerBaseTest +{ + public ListTestUnitsTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Api.Tests/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Api.Tests/GlobalUsings.verified.cs new file mode 100644 index 00000000..722ab382 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Api.Tests/GlobalUsings.verified.cs @@ -0,0 +1,25 @@ +global using System.CodeDom.Compiler; +global using System.Reflection; +global using System.Text; +global using System.Text.Json; +global using System.Text.Json.Serialization; + +global using Atc.Rest.Options; +global using Atc.XUnit; + +global using AutoFixture; + +global using ExNsWithTask.Api.Generated; +global using ExNsWithTask.Api.Generated.Contracts; +global using ExNsWithTask.Api.Generated.Contracts.EventArgs; +global using ExNsWithTask.Api.Generated.Contracts.Orders; +global using ExNsWithTask.Api.Generated.Contracts.TestUnits; + +global using Microsoft.AspNetCore.Hosting; +global using Microsoft.AspNetCore.Http; +global using Microsoft.AspNetCore.Mvc.Testing; +global using Microsoft.AspNetCore.TestHost; +global using Microsoft.Extensions.Configuration; +global using Microsoft.Extensions.DependencyInjection; + +global using Xunit; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Api.Tests/WebApiControllerBaseTest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Api.Tests/WebApiControllerBaseTest.verified.cs new file mode 100644 index 00000000..b2105119 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Api.Tests/WebApiControllerBaseTest.verified.cs @@ -0,0 +1,56 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Tests; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public abstract class WebApiControllerBaseTest : IClassFixture +{ + protected readonly WebApiStartupFactory Factory; + + protected readonly HttpClient HttpClient; + + protected readonly IConfiguration Configuration; + + protected static JsonSerializerOptions? JsonSerializerOptions; + + protected WebApiControllerBaseTest(WebApiStartupFactory fixture) + { + this.Factory = fixture; + this.HttpClient = this.Factory.CreateClient(); + this.Configuration = new ConfigurationBuilder().Build(); + JsonSerializerOptions = new JsonSerializerOptions + { + PropertyNameCaseInsensitive = true, + Converters = + { + new JsonStringEnumConverter() + }, + }; + } + + protected static StringContent ToJson(object data) + => new(JsonSerializer.Serialize(data, JsonSerializerOptions), Encoding.UTF8, "application/json"); + + protected static StringContent Json(string data) + => new(data, Encoding.UTF8, "application/json"); + + protected static IFormFile GetTestFile() + { + var bytes = Encoding.UTF8.GetBytes("Hello World"); + var stream = new MemoryStream(bytes); + var formFile = new FormFile(stream, 0, stream.Length, "dummy", "dummy.txt") + { + Headers = new HeaderDictionary(), + ContentType = "application/octet-stream", + }; + + return formFile; + } + + protected static List GetTestFiles() + => new() { GetTestFile(), GetTestFile() }; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Api.Tests/WebApiStartupFactory.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Api.Tests/WebApiStartupFactory.verified.cs new file mode 100644 index 00000000..b03c4169 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Api.Tests/WebApiStartupFactory.verified.cs @@ -0,0 +1,40 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Tests; + +/// +/// Factory for bootstrapping in memory tests. +/// Includes options to override configuration and service collection using a partial class. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public partial class WebApiStartupFactory : WebApplicationFactory +{ + protected override void ConfigureWebHost(IWebHostBuilder builder) + { + builder.ConfigureAppConfiguration(config => + { + ModifyConfiguration(config); + var integrationConfig = new ConfigurationBuilder() + .AddJsonFile("appsettings.integrationtest.json") + .Build(); + config.AddConfiguration(integrationConfig); + }); + + builder.ConfigureTestServices(services => + { + ModifyServices(services); + services.AddSingleton(); + services.AutoRegistrateServices( + Assembly.GetAssembly(typeof(ApiRegistration))!, + Assembly.GetAssembly(typeof(WebApiStartupFactory))!); + }); + } + + partial void ModifyConfiguration(IConfigurationBuilder config); + + partial void ModifyServices(IServiceCollection services); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Domain.Tests/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Domain.Tests/GlobalUsings.verified.cs new file mode 100644 index 00000000..8c927eb7 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Domain.Tests/GlobalUsings.verified.cs @@ -0,0 +1 @@ +global using Xunit; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Domain.Tests/Handlers/EventArgs/GetEventArgByIdHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Domain.Tests/Handlers/EventArgs/GetEventArgByIdHandlerTests.verified.cs new file mode 100644 index 00000000..32a16755 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Domain.Tests/Handlers/EventArgs/GetEventArgByIdHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace ExNsWithTask.Domain.Tests.Handlers.EventArgs; + +public class GetEventArgByIdHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Domain.Tests/Handlers/EventArgs/GetEventArgsHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Domain.Tests/Handlers/EventArgs/GetEventArgsHandlerTests.verified.cs new file mode 100644 index 00000000..096c3c27 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Domain.Tests/Handlers/EventArgs/GetEventArgsHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace ExNsWithTask.Domain.Tests.Handlers.EventArgs; + +public class GetEventArgsHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Domain.Tests/Handlers/Orders/GetOrderByIdHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Domain.Tests/Handlers/Orders/GetOrderByIdHandlerTests.verified.cs new file mode 100644 index 00000000..4ae95214 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Domain.Tests/Handlers/Orders/GetOrderByIdHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace ExNsWithTask.Domain.Tests.Handlers.Orders; + +public class GetOrderByIdHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Domain.Tests/Handlers/Orders/GetOrdersHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Domain.Tests/Handlers/Orders/GetOrdersHandlerTests.verified.cs new file mode 100644 index 00000000..effe97ba --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Domain.Tests/Handlers/Orders/GetOrdersHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace ExNsWithTask.Domain.Tests.Handlers.Orders; + +public class GetOrdersHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Domain.Tests/Handlers/Tasks/GetTasksHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Domain.Tests/Handlers/Tasks/GetTasksHandlerTests.verified.cs new file mode 100644 index 00000000..a1e28224 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Domain.Tests/Handlers/Tasks/GetTasksHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace ExNsWithTask.Domain.Tests.Handlers.Tasks; + +public class GetTasksHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Domain.Tests/Handlers/TestUnits/ListTestUnitsHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Domain.Tests/Handlers/TestUnits/ListTestUnitsHandlerTests.verified.cs new file mode 100644 index 00000000..3e2d825d --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WOPD/test/ExNsWithTask.Domain.Tests/Handlers/TestUnits/ListTestUnitsHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace ExNsWithTask.Domain.Tests.Handlers.TestUnits; + +public class ListTestUnitsHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/ApiRegistration.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/ApiRegistration.verified.cs new file mode 100644 index 00000000..63be4c4e --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/ApiRegistration.verified.cs @@ -0,0 +1,12 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Generated; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ApiRegistration +{ +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/EventArgs/Interfaces/IGetEventArgByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/EventArgs/Interfaces/IGetEventArgByIdHandler.verified.cs new file mode 100644 index 00000000..6e776c0f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/EventArgs/Interfaces/IGetEventArgByIdHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Generated.Contracts.EventArgs; + +/// +/// Domain Interface for RequestHandler. +/// Description: Get EventArgs By Id. +/// Operation: GetEventArgById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetEventArgByIdHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + GetEventArgByIdParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/EventArgs/Interfaces/IGetEventArgsHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/EventArgs/Interfaces/IGetEventArgsHandler.verified.cs new file mode 100644 index 00000000..1f4ba388 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/EventArgs/Interfaces/IGetEventArgsHandler.verified.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Generated.Contracts.EventArgs; + +/// +/// Domain Interface for RequestHandler. +/// Description: Get EventArgs List. +/// Operation: GetEventArgs. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetEventArgsHandler +{ + /// + /// Execute method. + /// + /// The cancellation token. + Task ExecuteAsync( + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/EventArgs/Models/EventArgs.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/EventArgs/Models/EventArgs.verified.cs new file mode 100644 index 00000000..302c759b --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/EventArgs/Models/EventArgs.verified.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Generated.Contracts.EventArgs; + +/// +/// EventArgs. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class EventArgs +{ + public Guid Id { get; set; } + + public string EventName { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(EventName)}: {EventName}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/EventArgs/Parameters/GetEventArgByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/EventArgs/Parameters/GetEventArgByIdParameters.verified.cs new file mode 100644 index 00000000..f1fe6d40 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/EventArgs/Parameters/GetEventArgByIdParameters.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Generated.Contracts.EventArgs; + +/// +/// Parameters for operation request. +/// Description: Get EventArgs By Id. +/// Operation: GetEventArgById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetEventArgByIdParameters +{ + /// + /// The id of the eventArgs. + /// + [FromRoute(Name = "id")] + [Required] + public string Id { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/EventArgs/Results/GetEventArgByIdResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/EventArgs/Results/GetEventArgByIdResult.verified.cs new file mode 100644 index 00000000..9031ecc7 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/EventArgs/Results/GetEventArgByIdResult.verified.cs @@ -0,0 +1,36 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Generated.Contracts.EventArgs; + +/// +/// Results for operation request. +/// Description: Get EventArgs By Id. +/// Operation: GetEventArgById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetEventArgByIdResult : ResultBase +{ + private GetEventArgByIdResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static GetEventArgByIdResult Ok(EventArgs response) + => new GetEventArgByIdResult(new OkObjectResult(response)); + + /// + /// 404 - NotFound response. + /// + public static GetEventArgByIdResult NotFound(string? message = null) + => new GetEventArgByIdResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.NotFound, message)); + + /// + /// Performs an implicit conversion from GetEventArgByIdResult to ActionResult. + /// + public static implicit operator GetEventArgByIdResult(EventArgs response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/EventArgs/Results/GetEventArgsResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/EventArgs/Results/GetEventArgsResult.verified.cs new file mode 100644 index 00000000..f3726737 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/EventArgs/Results/GetEventArgsResult.verified.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Generated.Contracts.EventArgs; + +/// +/// Results for operation request. +/// Description: Get EventArgs List. +/// Operation: GetEventArgs. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetEventArgsResult : ResultBase +{ + private GetEventArgsResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static GetEventArgsResult Ok(IEnumerable response) + => new GetEventArgsResult(new OkObjectResult(response ?? Enumerable.Empty())); + + /// + /// Performs an implicit conversion from GetEventArgsResult to ActionResult. + /// + public static implicit operator GetEventArgsResult(List response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/Orders/Interfaces/IGetOrderByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/Orders/Interfaces/IGetOrderByIdHandler.verified.cs new file mode 100644 index 00000000..2c15e254 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/Orders/Interfaces/IGetOrderByIdHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Generated.Contracts.Orders; + +/// +/// Domain Interface for RequestHandler. +/// Description: Get order by id. +/// Operation: GetOrderById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetOrderByIdHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + GetOrderByIdParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/Orders/Interfaces/IGetOrdersHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/Orders/Interfaces/IGetOrdersHandler.verified.cs new file mode 100644 index 00000000..d6ceb57e --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/Orders/Interfaces/IGetOrdersHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Generated.Contracts.Orders; + +/// +/// Domain Interface for RequestHandler. +/// Description: Get orders. +/// Operation: GetOrders. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetOrdersHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + GetOrdersParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/Orders/Models/Order.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/Orders/Models/Order.verified.cs new file mode 100644 index 00000000..181cccfc --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/Orders/Models/Order.verified.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Generated.Contracts.Orders; + +/// +/// A single order. +/// Hallo description with multiline and no ending dot. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Order +{ + public Guid Id { get; set; } + + public string Description { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(Description)}: {Description}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/Orders/Parameters/GetOrderByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/Orders/Parameters/GetOrderByIdParameters.verified.cs new file mode 100644 index 00000000..fb1a51d0 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/Orders/Parameters/GetOrderByIdParameters.verified.cs @@ -0,0 +1,37 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Generated.Contracts.Orders; + +/// +/// Parameters for operation request. +/// Description: Get order by id. +/// Operation: GetOrderById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetOrderByIdParameters +{ + /// + /// The id of the order. + /// + [FromRoute(Name = "id")] + [Required] + public Guid Id { get; set; } + + /// + /// The email for filter orders to retrieve. + /// + /// + /// Email validation being enforced. + /// + [FromQuery(Name = "myEmail")] + [EmailAddress] + public string? MyEmail { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(MyEmail)}: {MyEmail}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/Orders/Parameters/GetOrdersParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/Orders/Parameters/GetOrdersParameters.verified.cs new file mode 100644 index 00000000..e8f808a4 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/Orders/Parameters/GetOrdersParameters.verified.cs @@ -0,0 +1,41 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Generated.Contracts.Orders; + +/// +/// Parameters for operation request. +/// Description: Get orders. +/// Operation: GetOrders. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetOrdersParameters +{ + /// + /// The numbers of items to return. + /// + [FromQuery(Name = "pageSize")] + [Required] + [Range(1, 100)] + public int PageSize { get; set; } = 10; + + /// + /// The number of items to skip before starting to collect the result set. + /// + [FromQuery(Name = "pageIndex")] + [Range(0, 2147483647)] + public int PageIndex { get; set; } = 0; + + /// + /// The continuation token. + /// + [FromQuery(Name = "continuationToken")] + public string? ContinuationToken { get; set; } + + /// + public override string ToString() + => $"{nameof(PageSize)}: {PageSize}, {nameof(PageIndex)}: {PageIndex}, {nameof(ContinuationToken)}: {ContinuationToken}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/Orders/Results/GetOrderByIdResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/Orders/Results/GetOrderByIdResult.verified.cs new file mode 100644 index 00000000..d4d519c4 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/Orders/Results/GetOrderByIdResult.verified.cs @@ -0,0 +1,36 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Generated.Contracts.Orders; + +/// +/// Results for operation request. +/// Description: Get order by id. +/// Operation: GetOrderById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetOrderByIdResult : ResultBase +{ + private GetOrderByIdResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static GetOrderByIdResult Ok(Order response) + => new GetOrderByIdResult(new OkObjectResult(response)); + + /// + /// 404 - NotFound response. + /// + public static GetOrderByIdResult NotFound(string? message = null) + => new GetOrderByIdResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.NotFound, message)); + + /// + /// Performs an implicit conversion from GetOrderByIdResult to ActionResult. + /// + public static implicit operator GetOrderByIdResult(Order response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/Orders/Results/GetOrdersResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/Orders/Results/GetOrdersResult.verified.cs new file mode 100644 index 00000000..aeec30b8 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/Orders/Results/GetOrdersResult.verified.cs @@ -0,0 +1,36 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Generated.Contracts.Orders; + +/// +/// Results for operation request. +/// Description: Get orders. +/// Operation: GetOrders. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetOrdersResult : ResultBase +{ + private GetOrdersResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static GetOrdersResult Ok(PaginationResult response) + => new GetOrdersResult(new OkObjectResult(response)); + + /// + /// 404 - NotFound response. + /// + public static GetOrdersResult NotFound(string? message = null) + => new GetOrdersResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.NotFound, message)); + + /// + /// Performs an implicit conversion from GetOrdersResult to ActionResult. + /// + public static implicit operator GetOrdersResult(PaginationResult response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/Tasks/Interfaces/IGetTasksHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/Tasks/Interfaces/IGetTasksHandler.verified.cs new file mode 100644 index 00000000..9e88d6e3 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/Tasks/Interfaces/IGetTasksHandler.verified.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Generated.Contracts.Tasks; + +/// +/// Domain Interface for RequestHandler. +/// Description: Returns tasks. +/// Operation: GetTasks. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetTasksHandler +{ + /// + /// Execute method. + /// + /// The cancellation token. + Task ExecuteAsync( + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/Tasks/Models/Task.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/Tasks/Models/Task.verified.cs new file mode 100644 index 00000000..ead4a570 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/Tasks/Models/Task.verified.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Generated.Contracts.Tasks; + +/// +/// Describes a single task. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Task +{ + public Guid Id { get; set; } + + public string Name { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(Name)}: {Name}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/Tasks/Models/Tasks.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/Tasks/Models/Tasks.verified.cs new file mode 100644 index 00000000..f02a8b6f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/Tasks/Models/Tasks.verified.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Generated.Contracts.Tasks; + +/// +/// Contains a list of Tasks. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Tasks +{ + /// + /// A list of Task. + /// + public List TaskList { get; set; } = new List(); + + /// + public override string ToString() + => $"{nameof(TaskList)}.Count: {TaskList?.Count ?? 0}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/Tasks/Results/GetTasksResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/Tasks/Results/GetTasksResult.verified.cs new file mode 100644 index 00000000..b4a17e50 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/Tasks/Results/GetTasksResult.verified.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Generated.Contracts.Tasks; + +/// +/// Results for operation request. +/// Description: Returns tasks. +/// Operation: GetTasks. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetTasksResult : ResultBase +{ + private GetTasksResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static GetTasksResult Ok(IEnumerable response) + => new GetTasksResult(new OkObjectResult(response ?? Enumerable.Empty())); + + /// + /// Performs an implicit conversion from GetTasksResult to ActionResult. + /// + public static implicit operator GetTasksResult(List response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/TestUnits/Interfaces/IListTestUnitsHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/TestUnits/Interfaces/IListTestUnitsHandler.verified.cs new file mode 100644 index 00000000..2dfa5ac6 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/TestUnits/Interfaces/IListTestUnitsHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Generated.Contracts.TestUnits; + +/// +/// Domain Interface for RequestHandler. +/// Description: List test units. +/// Operation: ListTestUnits. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IListTestUnitsHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + ListTestUnitsParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/TestUnits/Models/TestUnit.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/TestUnits/Models/TestUnit.verified.cs new file mode 100644 index 00000000..5d70cad0 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/TestUnits/Models/TestUnit.verified.cs @@ -0,0 +1,20 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Generated.Contracts.TestUnits; + +/// +/// TestUnit. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class TestUnit +{ + public Guid Id { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/TestUnits/Parameters/ListTestUnitsParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/TestUnits/Parameters/ListTestUnitsParameters.verified.cs new file mode 100644 index 00000000..4a269ebf --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/TestUnits/Parameters/ListTestUnitsParameters.verified.cs @@ -0,0 +1,41 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Generated.Contracts.TestUnits; + +/// +/// Parameters for operation request. +/// Description: List test units. +/// Operation: ListTestUnits. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ListTestUnitsParameters +{ + /// + /// The numbers of items to return. + /// + [FromQuery(Name = "pageSize")] + [Required] + [Range(1, 100)] + public int PageSize { get; set; } = 10; + + /// + /// The number of items to skip before starting to collect the result set. + /// + [FromQuery(Name = "pageIndex")] + [Range(0, 2147483647)] + public int PageIndex { get; set; } = 0; + + /// + /// The continuation token. + /// + [FromQuery(Name = "continuationToken")] + public string? ContinuationToken { get; set; } + + /// + public override string ToString() + => $"{nameof(PageSize)}: {PageSize}, {nameof(PageIndex)}: {PageIndex}, {nameof(ContinuationToken)}: {ContinuationToken}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/TestUnits/Results/ListTestUnitsResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/TestUnits/Results/ListTestUnitsResult.verified.cs new file mode 100644 index 00000000..76479b93 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/TestUnits/Results/ListTestUnitsResult.verified.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Generated.Contracts.TestUnits; + +/// +/// Results for operation request. +/// Description: List test units. +/// Operation: ListTestUnits. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ListTestUnitsResult : ResultBase +{ + private ListTestUnitsResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static ListTestUnitsResult Ok(PaginationResult response) + => new ListTestUnitsResult(new OkObjectResult(response)); + + /// + /// Performs an implicit conversion from ListTestUnitsResult to ActionResult. + /// + public static implicit operator ListTestUnitsResult(PaginationResult response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/_Shared/PaginationResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/_Shared/PaginationResult.verified.cs new file mode 100644 index 00000000..821b6d11 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Contracts/_Shared/PaginationResult.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Generated.Contracts; + +/// +/// An item result subset of a data query. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class PaginationResult +{ + public int PageSize { get; set; } + + /// + /// Token to indicate next result set. + /// + public string? ContinuationToken { get; set; } + + public List Results { get; set; } = new List(); + + /// + public override string ToString() + => $"{nameof(PageSize)}: {PageSize}, {nameof(ContinuationToken)}: {ContinuationToken}, {nameof(Results)}.Count: {Results?.Count ?? 0}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Endpoints/EventArgsController.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Endpoints/EventArgsController.verified.cs new file mode 100644 index 00000000..4b4315f2 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Endpoints/EventArgsController.verified.cs @@ -0,0 +1,44 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Generated.Endpoints; + +/// +/// Endpoint definitions. +/// +[Authorize] +[ApiController] +[Route("/api/v1/eventArgs")] +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public sealed class EventArgsController : ControllerBase +{ + /// + /// Description: Get EventArgs List. + /// Operation: GetEventArgs. + /// + [HttpGet] + [ProducesResponseType(typeof(IEnumerable), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] + public async Task GetEventArgs( + [FromServices] IGetEventArgsHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(cancellationToken); + + /// + /// Description: Get EventArgs By Id. + /// Operation: GetEventArgById. + /// + [HttpGet("{id}")] + [ProducesResponseType(typeof(Contracts.EventArgs.EventArgs), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] + public async Task GetEventArgById( + GetEventArgByIdParameters parameters, + [FromServices] IGetEventArgByIdHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Endpoints/OrdersController.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Endpoints/OrdersController.verified.cs new file mode 100644 index 00000000..e71fe2a1 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Endpoints/OrdersController.verified.cs @@ -0,0 +1,47 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Generated.Endpoints; + +/// +/// Endpoint definitions. +/// +[Authorize] +[ApiController] +[Route("/api/v1/orders")] +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public sealed class OrdersController : ControllerBase +{ + /// + /// Description: Get orders. + /// Operation: GetOrders. + /// + [HttpGet] + [ProducesResponseType(typeof(PaginationResult), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] + public async Task GetOrders( + GetOrdersParameters parameters, + [FromServices] IGetOrdersHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); + + /// + /// Description: Get order by id. + /// Operation: GetOrderById. + /// + [HttpGet("{id}")] + [ProducesResponseType(typeof(Order), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] + public async Task GetOrderById( + GetOrderByIdParameters parameters, + [FromServices] IGetOrderByIdHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Endpoints/TasksController.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Endpoints/TasksController.verified.cs new file mode 100644 index 00000000..5c0a2ce2 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Endpoints/TasksController.verified.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Generated.Endpoints; + +/// +/// Endpoint definitions. +/// +[Authorize] +[ApiController] +[Route("/api/v1/tasks")] +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public sealed class TasksController : ControllerBase +{ + /// + /// Description: Returns tasks. + /// Operation: GetTasks. + /// + [HttpGet] + [ProducesResponseType(typeof(IEnumerable), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] + public async Task GetTasks( + [FromServices] IGetTasksHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(cancellationToken); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Endpoints/TestUnitsController.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Endpoints/TestUnitsController.verified.cs new file mode 100644 index 00000000..504013a8 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/Endpoints/TestUnitsController.verified.cs @@ -0,0 +1,31 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Generated.Endpoints; + +/// +/// Endpoint definitions. +/// +[Authorize] +[ApiController] +[Route("/api/v1/test-units")] +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public sealed class TestUnitsController : ControllerBase +{ + /// + /// Description: List test units. + /// Operation: ListTestUnits. + /// + [HttpGet] + [ProducesResponseType(typeof(PaginationResult), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] + public async Task ListTestUnits( + ListTestUnitsParameters parameters, + [FromServices] IListTestUnitsHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/GlobalUsings.verified.cs new file mode 100644 index 00000000..edabafb9 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api.Generated/GlobalUsings.verified.cs @@ -0,0 +1,15 @@ +global using System.CodeDom.Compiler; +global using System.ComponentModel.DataAnnotations; +global using System.Net; + +global using Atc.Rest.Results; + +global using ExNsWithTask.Api.Generated.Contracts; +global using ExNsWithTask.Api.Generated.Contracts.EventArgs; +global using ExNsWithTask.Api.Generated.Contracts.Orders; +global using ExNsWithTask.Api.Generated.Contracts.Tasks; +global using ExNsWithTask.Api.Generated.Contracts.TestUnits; + +global using Microsoft.AspNetCore.Authorization; +global using Microsoft.AspNetCore.Http; +global using Microsoft.AspNetCore.Mvc; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api/GlobalUsings.verified.cs new file mode 100644 index 00000000..1c5813ab --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api/GlobalUsings.verified.cs @@ -0,0 +1,15 @@ +global using System.CodeDom.Compiler; +global using System.Reflection; + +global using Asp.Versioning.ApiExplorer; + +global using Atc.Rest.Extended.Options; + +global using ExNsWithTask.Api.Generated; +global using ExNsWithTask.Api.Options; +global using ExNsWithTask.Domain; + +global using Microsoft.Extensions.Options; +global using Microsoft.OpenApi.Models; + +global using Swashbuckle.AspNetCore.SwaggerGen; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api/Options/ConfigureSwaggerDocOptions.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api/Options/ConfigureSwaggerDocOptions.verified.cs new file mode 100644 index 00000000..aac49593 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api/Options/ConfigureSwaggerDocOptions.verified.cs @@ -0,0 +1,39 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Options; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ConfigureSwaggerDocOptions : IConfigureOptions +{ + private readonly IApiVersionDescriptionProvider provider; + + public ConfigureSwaggerDocOptions( + IApiVersionDescriptionProvider provider) + => this.provider = provider; + + public void Configure( + SwaggerGenOptions options) + { + foreach (var version in provider.ApiVersionDescriptions) + { + options.SwaggerDoc( + version.GroupName, + new OpenApiInfo + { + Version = "1.0", + Title = "TestUnit Task Ns Api", + Description = "TestUnit Task Ns Api - SingleFileVersion", + Contact = new OpenApiContact + { + Name = "atc-net A/S", + }, + }); + } + + options.IncludeXmlComments(Path.ChangeExtension(GetType().Assembly.Location, "xml")); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api/Program.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api/Program.verified.cs new file mode 100644 index 00000000..d5b02894 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api/Program.verified.cs @@ -0,0 +1,23 @@ +namespace ExNsWithTask.Api; + +public static class Program +{ + public static void Main(string[] args) + { + CreateHostBuilder(args) + .Build() + .Run(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) + { + var builder = Host + .CreateDefaultBuilder(args) + .ConfigureWebHostDefaults(webBuilder => + { + webBuilder.UseStartup(); + }); + + return builder; + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api/Startup.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api/Startup.verified.cs new file mode 100644 index 00000000..22399ffd --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Api/Startup.verified.cs @@ -0,0 +1,38 @@ +namespace ExNsWithTask.Api; + +public class Startup +{ + private readonly RestApiExtendedOptions restApiOptions; + + public Startup( + IConfiguration configuration) + { + Configuration = configuration; + restApiOptions = new RestApiExtendedOptions + { + // TODO: Remove/out-comment/set to false this for production scenarios! + AllowAnonymousAccessForDevelopment = true, + }; + + restApiOptions.AddAssemblyPairs( + Assembly.GetAssembly(typeof(ApiRegistration)), + Assembly.GetAssembly(typeof(DomainRegistration))); + } + + public IConfiguration Configuration { get; } + + public void ConfigureServices( + IServiceCollection services) + { + services.ConfigureOptions(); + + services.AddRestApi(restApiOptions, Configuration); + } + + public void Configure( + IApplicationBuilder app, + IWebHostEnvironment env) + { + app.ConfigureRestApi(env, restApiOptions); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Domain/DomainRegistration.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Domain/DomainRegistration.verified.cs new file mode 100644 index 00000000..f467069a --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Domain/DomainRegistration.verified.cs @@ -0,0 +1,12 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Domain; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class DomainRegistration +{ +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Domain/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Domain/GlobalUsings.verified.cs new file mode 100644 index 00000000..b072a423 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Domain/GlobalUsings.verified.cs @@ -0,0 +1,6 @@ +global using System.CodeDom.Compiler; + +global using ExNsWithTask.Api.Generated.Contracts.EventArgs; +global using ExNsWithTask.Api.Generated.Contracts.Orders; +global using ExNsWithTask.Api.Generated.Contracts.Tasks; +global using ExNsWithTask.Api.Generated.Contracts.TestUnits; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Domain/Handlers/EventArgs/GetEventArgByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Domain/Handlers/EventArgs/GetEventArgByIdHandler.verified.cs new file mode 100644 index 00000000..2f96253e --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Domain/Handlers/EventArgs/GetEventArgByIdHandler.verified.cs @@ -0,0 +1,18 @@ +namespace ExNsWithTask.Domain.Handlers.EventArgs; + +/// +/// Handler for operation request. +/// Description: Get EventArgs By Id. +/// Operation: GetEventArgById. +/// +public class GetEventArgByIdHandler : IGetEventArgByIdHandler +{ + public Task ExecuteAsync( + GetEventArgByIdParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for GetEventArgByIdHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Domain/Handlers/EventArgs/GetEventArgsHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Domain/Handlers/EventArgs/GetEventArgsHandler.verified.cs new file mode 100644 index 00000000..ad8c8665 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Domain/Handlers/EventArgs/GetEventArgsHandler.verified.cs @@ -0,0 +1,15 @@ +namespace ExNsWithTask.Domain.Handlers.EventArgs; + +/// +/// Handler for operation request. +/// Description: Get EventArgs List. +/// Operation: GetEventArgs. +/// +public class GetEventArgsHandler : IGetEventArgsHandler +{ + public Task ExecuteAsync( + CancellationToken cancellationToken = default) + { + throw new NotImplementedException("Add logic here for GetEventArgsHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Domain/Handlers/Orders/GetOrderByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Domain/Handlers/Orders/GetOrderByIdHandler.verified.cs new file mode 100644 index 00000000..f7f4a412 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Domain/Handlers/Orders/GetOrderByIdHandler.verified.cs @@ -0,0 +1,18 @@ +namespace ExNsWithTask.Domain.Handlers.Orders; + +/// +/// Handler for operation request. +/// Description: Get order by id. +/// Operation: GetOrderById. +/// +public class GetOrderByIdHandler : IGetOrderByIdHandler +{ + public Task ExecuteAsync( + GetOrderByIdParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for GetOrderByIdHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Domain/Handlers/Orders/GetOrdersHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Domain/Handlers/Orders/GetOrdersHandler.verified.cs new file mode 100644 index 00000000..26a1f595 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Domain/Handlers/Orders/GetOrdersHandler.verified.cs @@ -0,0 +1,18 @@ +namespace ExNsWithTask.Domain.Handlers.Orders; + +/// +/// Handler for operation request. +/// Description: Get orders. +/// Operation: GetOrders. +/// +public class GetOrdersHandler : IGetOrdersHandler +{ + public Task ExecuteAsync( + GetOrdersParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for GetOrdersHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Domain/Handlers/Tasks/GetTasksHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Domain/Handlers/Tasks/GetTasksHandler.verified.cs new file mode 100644 index 00000000..f5f86e79 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Domain/Handlers/Tasks/GetTasksHandler.verified.cs @@ -0,0 +1,15 @@ +namespace ExNsWithTask.Domain.Handlers.Tasks; + +/// +/// Handler for operation request. +/// Description: Returns tasks. +/// Operation: GetTasks. +/// +public class GetTasksHandler : IGetTasksHandler +{ + public Task ExecuteAsync( + CancellationToken cancellationToken = default) + { + throw new NotImplementedException("Add logic here for GetTasksHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Domain/Handlers/TestUnits/ListTestUnitsHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Domain/Handlers/TestUnits/ListTestUnitsHandler.verified.cs new file mode 100644 index 00000000..942fb53a --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/src/ExNsWithTask.Domain/Handlers/TestUnits/ListTestUnitsHandler.verified.cs @@ -0,0 +1,18 @@ +namespace ExNsWithTask.Domain.Handlers.TestUnits; + +/// +/// Handler for operation request. +/// Description: List test units. +/// Operation: ListTestUnits. +/// +public class ListTestUnitsHandler : IListTestUnitsHandler +{ + public Task ExecuteAsync( + ListTestUnitsParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for ListTestUnitsHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Api.Tests/Endpoints/EventArgs/GetEventArgByIdHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Api.Tests/Endpoints/EventArgs/GetEventArgByIdHandlerStub.verified.cs new file mode 100644 index 00000000..87dd34fb --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Api.Tests/Endpoints/EventArgs/GetEventArgByIdHandlerStub.verified.cs @@ -0,0 +1,20 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Tests.Endpoints.EventArgs; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetEventArgByIdHandlerStub : IGetEventArgByIdHandler +{ + public Task ExecuteAsync( + GetEventArgByIdParameters parameters, + CancellationToken cancellationToken = default) + { + var data = new Fixture().Create(); + + return Task.FromResult(GetEventArgByIdResult.Ok(data)); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Api.Tests/Endpoints/EventArgs/GetEventArgByIdTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Api.Tests/Endpoints/EventArgs/GetEventArgByIdTests.verified.cs new file mode 100644 index 00000000..68d375e8 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Api.Tests/Endpoints/EventArgs/GetEventArgByIdTests.verified.cs @@ -0,0 +1,21 @@ +namespace ExNsWithTask.Api.Tests.Endpoints.EventArgs; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class GetEventArgByIdTests : WebApiControllerBaseTest +{ + public GetEventArgByIdTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Api.Tests/Endpoints/EventArgs/GetEventArgsHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Api.Tests/Endpoints/EventArgs/GetEventArgsHandlerStub.verified.cs new file mode 100644 index 00000000..9e62c04f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Api.Tests/Endpoints/EventArgs/GetEventArgsHandlerStub.verified.cs @@ -0,0 +1,19 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Tests.Endpoints.EventArgs; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetEventArgsHandlerStub : IGetEventArgsHandler +{ + public Task ExecuteAsync( + CancellationToken cancellationToken = default) + { + var data = new Fixture().Create>(); + + return Task.FromResult(GetEventArgsResult.Ok(data)); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Api.Tests/Endpoints/EventArgs/GetEventArgsTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Api.Tests/Endpoints/EventArgs/GetEventArgsTests.verified.cs new file mode 100644 index 00000000..e3a6c044 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Api.Tests/Endpoints/EventArgs/GetEventArgsTests.verified.cs @@ -0,0 +1,21 @@ +namespace ExNsWithTask.Api.Tests.Endpoints.EventArgs; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class GetEventArgsTests : WebApiControllerBaseTest +{ + public GetEventArgsTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Api.Tests/Endpoints/Orders/GetOrderByIdHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Api.Tests/Endpoints/Orders/GetOrderByIdHandlerStub.verified.cs new file mode 100644 index 00000000..42bf16c8 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Api.Tests/Endpoints/Orders/GetOrderByIdHandlerStub.verified.cs @@ -0,0 +1,20 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Tests.Endpoints.Orders; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetOrderByIdHandlerStub : IGetOrderByIdHandler +{ + public Task ExecuteAsync( + GetOrderByIdParameters parameters, + CancellationToken cancellationToken = default) + { + var data = new Fixture().Create(); + + return Task.FromResult(GetOrderByIdResult.Ok(data)); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Api.Tests/Endpoints/Orders/GetOrderByIdTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Api.Tests/Endpoints/Orders/GetOrderByIdTests.verified.cs new file mode 100644 index 00000000..905f3cb4 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Api.Tests/Endpoints/Orders/GetOrderByIdTests.verified.cs @@ -0,0 +1,21 @@ +namespace ExNsWithTask.Api.Tests.Endpoints.Orders; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class GetOrderByIdTests : WebApiControllerBaseTest +{ + public GetOrderByIdTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Api.Tests/Endpoints/Orders/GetOrdersHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Api.Tests/Endpoints/Orders/GetOrdersHandlerStub.verified.cs new file mode 100644 index 00000000..b052336e --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Api.Tests/Endpoints/Orders/GetOrdersHandlerStub.verified.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Tests.Endpoints.Orders; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetOrdersHandlerStub : IGetOrdersHandler +{ + public Task ExecuteAsync( + GetOrdersParameters parameters, + CancellationToken cancellationToken = default) + { + var data = new Fixture().Create>(); + + var paginationData = new PaginationResult(); + + return Task.FromResult(GetOrdersResult.Ok(paginationData)); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Api.Tests/Endpoints/Orders/GetOrdersTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Api.Tests/Endpoints/Orders/GetOrdersTests.verified.cs new file mode 100644 index 00000000..c48268fb --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Api.Tests/Endpoints/Orders/GetOrdersTests.verified.cs @@ -0,0 +1,21 @@ +namespace ExNsWithTask.Api.Tests.Endpoints.Orders; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class GetOrdersTests : WebApiControllerBaseTest +{ + public GetOrdersTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Api.Tests/Endpoints/Tasks/GetTasksHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Api.Tests/Endpoints/Tasks/GetTasksHandlerStub.verified.cs new file mode 100644 index 00000000..1660556b --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Api.Tests/Endpoints/Tasks/GetTasksHandlerStub.verified.cs @@ -0,0 +1,19 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Tests.Endpoints.Tasks; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetTasksHandlerStub : ExNsWithTask.Api.Generated.Contracts.Tasks.IGetTasksHandler +{ + public Task ExecuteAsync( + CancellationToken cancellationToken = default) + { + var data = new Fixture().Create>(); + + return Task.FromResult(ExNsWithTask.Api.Generated.Contracts.Tasks.GetTasksResult.Ok(data)); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Api.Tests/Endpoints/Tasks/GetTasksTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Api.Tests/Endpoints/Tasks/GetTasksTests.verified.cs new file mode 100644 index 00000000..07430e38 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Api.Tests/Endpoints/Tasks/GetTasksTests.verified.cs @@ -0,0 +1,21 @@ +namespace ExNsWithTask.Api.Tests.Endpoints.Tasks; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class GetTasksTests : WebApiControllerBaseTest +{ + public GetTasksTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Api.Tests/Endpoints/TestUnits/ListTestUnitsHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Api.Tests/Endpoints/TestUnits/ListTestUnitsHandlerStub.verified.cs new file mode 100644 index 00000000..d8d0b7f5 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Api.Tests/Endpoints/TestUnits/ListTestUnitsHandlerStub.verified.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Tests.Endpoints.TestUnits; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ListTestUnitsHandlerStub : IListTestUnitsHandler +{ + public Task ExecuteAsync( + ListTestUnitsParameters parameters, + CancellationToken cancellationToken = default) + { + var data = new Fixture().Create>(); + + var paginationData = new PaginationResult(); + + return Task.FromResult(ListTestUnitsResult.Ok(paginationData)); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Api.Tests/Endpoints/TestUnits/ListTestUnitsTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Api.Tests/Endpoints/TestUnits/ListTestUnitsTests.verified.cs new file mode 100644 index 00000000..f86240d5 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Api.Tests/Endpoints/TestUnits/ListTestUnitsTests.verified.cs @@ -0,0 +1,21 @@ +namespace ExNsWithTask.Api.Tests.Endpoints.TestUnits; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class ListTestUnitsTests : WebApiControllerBaseTest +{ + public ListTestUnitsTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Api.Tests/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Api.Tests/GlobalUsings.verified.cs new file mode 100644 index 00000000..722ab382 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Api.Tests/GlobalUsings.verified.cs @@ -0,0 +1,25 @@ +global using System.CodeDom.Compiler; +global using System.Reflection; +global using System.Text; +global using System.Text.Json; +global using System.Text.Json.Serialization; + +global using Atc.Rest.Options; +global using Atc.XUnit; + +global using AutoFixture; + +global using ExNsWithTask.Api.Generated; +global using ExNsWithTask.Api.Generated.Contracts; +global using ExNsWithTask.Api.Generated.Contracts.EventArgs; +global using ExNsWithTask.Api.Generated.Contracts.Orders; +global using ExNsWithTask.Api.Generated.Contracts.TestUnits; + +global using Microsoft.AspNetCore.Hosting; +global using Microsoft.AspNetCore.Http; +global using Microsoft.AspNetCore.Mvc.Testing; +global using Microsoft.AspNetCore.TestHost; +global using Microsoft.Extensions.Configuration; +global using Microsoft.Extensions.DependencyInjection; + +global using Xunit; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Api.Tests/WebApiControllerBaseTest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Api.Tests/WebApiControllerBaseTest.verified.cs new file mode 100644 index 00000000..b2105119 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Api.Tests/WebApiControllerBaseTest.verified.cs @@ -0,0 +1,56 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Tests; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public abstract class WebApiControllerBaseTest : IClassFixture +{ + protected readonly WebApiStartupFactory Factory; + + protected readonly HttpClient HttpClient; + + protected readonly IConfiguration Configuration; + + protected static JsonSerializerOptions? JsonSerializerOptions; + + protected WebApiControllerBaseTest(WebApiStartupFactory fixture) + { + this.Factory = fixture; + this.HttpClient = this.Factory.CreateClient(); + this.Configuration = new ConfigurationBuilder().Build(); + JsonSerializerOptions = new JsonSerializerOptions + { + PropertyNameCaseInsensitive = true, + Converters = + { + new JsonStringEnumConverter() + }, + }; + } + + protected static StringContent ToJson(object data) + => new(JsonSerializer.Serialize(data, JsonSerializerOptions), Encoding.UTF8, "application/json"); + + protected static StringContent Json(string data) + => new(data, Encoding.UTF8, "application/json"); + + protected static IFormFile GetTestFile() + { + var bytes = Encoding.UTF8.GetBytes("Hello World"); + var stream = new MemoryStream(bytes); + var formFile = new FormFile(stream, 0, stream.Length, "dummy", "dummy.txt") + { + Headers = new HeaderDictionary(), + ContentType = "application/octet-stream", + }; + + return formFile; + } + + protected static List GetTestFiles() + => new() { GetTestFile(), GetTestFile() }; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Api.Tests/WebApiStartupFactory.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Api.Tests/WebApiStartupFactory.verified.cs new file mode 100644 index 00000000..b03c4169 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Api.Tests/WebApiStartupFactory.verified.cs @@ -0,0 +1,40 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExNsWithTask.Api.Tests; + +/// +/// Factory for bootstrapping in memory tests. +/// Includes options to override configuration and service collection using a partial class. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public partial class WebApiStartupFactory : WebApplicationFactory +{ + protected override void ConfigureWebHost(IWebHostBuilder builder) + { + builder.ConfigureAppConfiguration(config => + { + ModifyConfiguration(config); + var integrationConfig = new ConfigurationBuilder() + .AddJsonFile("appsettings.integrationtest.json") + .Build(); + config.AddConfiguration(integrationConfig); + }); + + builder.ConfigureTestServices(services => + { + ModifyServices(services); + services.AddSingleton(); + services.AutoRegistrateServices( + Assembly.GetAssembly(typeof(ApiRegistration))!, + Assembly.GetAssembly(typeof(WebApiStartupFactory))!); + }); + } + + partial void ModifyConfiguration(IConfigurationBuilder config); + + partial void ModifyServices(IServiceCollection services); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Domain.Tests/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Domain.Tests/GlobalUsings.verified.cs new file mode 100644 index 00000000..8c927eb7 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Domain.Tests/GlobalUsings.verified.cs @@ -0,0 +1 @@ +global using Xunit; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Domain.Tests/Handlers/EventArgs/GetEventArgByIdHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Domain.Tests/Handlers/EventArgs/GetEventArgByIdHandlerTests.verified.cs new file mode 100644 index 00000000..32a16755 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Domain.Tests/Handlers/EventArgs/GetEventArgByIdHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace ExNsWithTask.Domain.Tests.Handlers.EventArgs; + +public class GetEventArgByIdHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Domain.Tests/Handlers/EventArgs/GetEventArgsHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Domain.Tests/Handlers/EventArgs/GetEventArgsHandlerTests.verified.cs new file mode 100644 index 00000000..096c3c27 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Domain.Tests/Handlers/EventArgs/GetEventArgsHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace ExNsWithTask.Domain.Tests.Handlers.EventArgs; + +public class GetEventArgsHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Domain.Tests/Handlers/Orders/GetOrderByIdHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Domain.Tests/Handlers/Orders/GetOrderByIdHandlerTests.verified.cs new file mode 100644 index 00000000..4ae95214 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Domain.Tests/Handlers/Orders/GetOrderByIdHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace ExNsWithTask.Domain.Tests.Handlers.Orders; + +public class GetOrderByIdHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Domain.Tests/Handlers/Orders/GetOrdersHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Domain.Tests/Handlers/Orders/GetOrdersHandlerTests.verified.cs new file mode 100644 index 00000000..effe97ba --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Domain.Tests/Handlers/Orders/GetOrdersHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace ExNsWithTask.Domain.Tests.Handlers.Orders; + +public class GetOrdersHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Domain.Tests/Handlers/Tasks/GetTasksHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Domain.Tests/Handlers/Tasks/GetTasksHandlerTests.verified.cs new file mode 100644 index 00000000..a1e28224 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Domain.Tests/Handlers/Tasks/GetTasksHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace ExNsWithTask.Domain.Tests.Handlers.Tasks; + +public class GetTasksHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Domain.Tests/Handlers/TestUnits/ListTestUnitsHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Domain.Tests/Handlers/TestUnits/ListTestUnitsHandlerTests.verified.cs new file mode 100644 index 00000000..3e2d825d --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExNsWithTask/VerifyServerAll/Mvc_WPD/test/ExNsWithTask.Domain.Tests/Handlers/TestUnits/ListTestUnitsHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace ExNsWithTask.Domain.Tests.Handlers.TestUnits; + +public class ListTestUnitsHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/DemoUsersApi.yaml b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/ExUsers.yaml similarity index 100% rename from test/Atc.Rest.ApiGenerator.CLI.Tests/DemoUsersApi/DemoUsersApi.yaml rename to test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/ExUsers.yaml diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Contracts/Users/Address.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Contracts/Users/Address.verified.cs new file mode 100644 index 00000000..4c23835a --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Contracts/Users/Address.verified.cs @@ -0,0 +1,32 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Contracts.Users; + +/// +/// Address. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Address +{ + [StringLength(255)] + public string StreetName { get; set; } + + public string StreetNumber { get; set; } + + public string PostalCode { get; set; } + + public string CityName { get; set; } + + /// + /// Country. + /// + public Country MyCountry { get; set; } + + /// + public override string ToString() + => $"{nameof(StreetName)}: {StreetName}, {nameof(StreetNumber)}: {StreetNumber}, {nameof(PostalCode)}: {PostalCode}, {nameof(CityName)}: {CityName}, {nameof(MyCountry)}: ({MyCountry})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Contracts/Users/Country.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Contracts/Users/Country.verified.cs new file mode 100644 index 00000000..732f9b9c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Contracts/Users/Country.verified.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Contracts.Users; + +/// +/// Country. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Country +{ + [Required] + public string Name { get; set; } + + [Required] + [MinLength(2)] + [MaxLength(2)] + [RegularExpression("^[A-Za-z]{2}$")] + public string Alpha2Code { get; set; } + + [Required] + [MinLength(3)] + [MaxLength(3)] + [RegularExpression("^[A-Za-z]{3}$")] + public string Alpha3Code { get; set; } + + /// + public override string ToString() + => $"{nameof(Name)}: {Name}, {nameof(Alpha2Code)}: {Alpha2Code}, {nameof(Alpha3Code)}: {Alpha3Code}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Contracts/Users/CreateUserRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Contracts/Users/CreateUserRequest.verified.cs new file mode 100644 index 00000000..fb77f973 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Contracts/Users/CreateUserRequest.verified.cs @@ -0,0 +1,56 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Contracts.Users; + +/// +/// Request to create a user. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class CreateUserRequest +{ + [Required] + public string FirstName { get; set; } + + [Required] + public string LastName { get; set; } + + public DateTimeOffset? MyNullableDateTime { get; set; } + + [Required] + public DateTimeOffset MyDateTime { get; set; } + + /// + /// Undefined description. + /// + /// + /// Email validation being enforced. + /// + [Required] + [EmailAddress] + public string Email { get; set; } + + /// + /// Undefined description. + /// + /// + /// Url validation being enforced. + /// + [Uri] + public Uri Homepage { get; set; } + + /// + /// GenderType. + /// + [Required] + public GenderType Gender { get; set; } + + public Address? MyNullableAddress { get; set; } + + /// + public override string ToString() + => $"{nameof(FirstName)}: {FirstName}, {nameof(LastName)}: {LastName}, {nameof(MyNullableDateTime)}: ({MyNullableDateTime}), {nameof(MyDateTime)}: ({MyDateTime}), {nameof(Email)}: {Email}, {nameof(Homepage)}: ({Homepage}), {nameof(Gender)}: {Gender}, {nameof(MyNullableAddress)}: ({MyNullableAddress})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Contracts/Users/RequestParameters/DeleteUserByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Contracts/Users/RequestParameters/DeleteUserByIdParameters.verified.cs new file mode 100644 index 00000000..e2ea43a8 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Contracts/Users/RequestParameters/DeleteUserByIdParameters.verified.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Contracts.Users; + +/// +/// Parameters for operation request. +/// Description: Delete user by id. +/// Operation: DeleteUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class DeleteUserByIdParameters +{ + /// + /// Id of the user. + /// + [Required] + public Guid Id { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Contracts/Users/RequestParameters/GetUserByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Contracts/Users/RequestParameters/GetUserByIdParameters.verified.cs new file mode 100644 index 00000000..a7866703 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Contracts/Users/RequestParameters/GetUserByIdParameters.verified.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Contracts.Users; + +/// +/// Parameters for operation request. +/// Description: Get user by id. +/// Operation: GetUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetUserByIdParameters +{ + /// + /// Id of the user. + /// + [Required] + public Guid Id { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Contracts/Users/RequestParameters/PostUserParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Contracts/Users/RequestParameters/PostUserParameters.verified.cs new file mode 100644 index 00000000..36011ed4 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Contracts/Users/RequestParameters/PostUserParameters.verified.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Contracts.Users; + +/// +/// Parameters for operation request. +/// Description: Create a new user. +/// Operation: PostUser. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class PostUserParameters +{ + /// + /// Request to create a user. + /// + [Required] + public CreateUserRequest Request { get; set; } + + /// + public override string ToString() + => $"{nameof(Request)}: ({Request})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Contracts/Users/RequestParameters/UpdateUserByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Contracts/Users/RequestParameters/UpdateUserByIdParameters.verified.cs new file mode 100644 index 00000000..9f52a0ac --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Contracts/Users/RequestParameters/UpdateUserByIdParameters.verified.cs @@ -0,0 +1,32 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Contracts.Users; + +/// +/// Parameters for operation request. +/// Description: Update user by id. +/// Operation: UpdateUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateUserByIdParameters +{ + /// + /// Id of the user. + /// + [Required] + public Guid Id { get; set; } + + /// + /// Request to update a user. + /// + [Required] + public UpdateUserRequest Request { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(Request)}: ({Request})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Contracts/Users/UpdateUserRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Contracts/Users/UpdateUserRequest.verified.cs new file mode 100644 index 00000000..ad9c07ef --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Contracts/Users/UpdateUserRequest.verified.cs @@ -0,0 +1,36 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Contracts.Users; + +/// +/// Request to update a user. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateUserRequest +{ + public string FirstName { get; set; } + + public string LastName { get; set; } + + /// + /// Undefined description. + /// + /// + /// Email validation being enforced. + /// + [EmailAddress] + public string Email { get; set; } + + /// + /// GenderType. + /// + public GenderType Gender { get; set; } + + /// + public override string ToString() + => $"{nameof(FirstName)}: {FirstName}, {nameof(LastName)}: {LastName}, {nameof(Email)}: {Email}, {nameof(Gender)}: {Gender}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Contracts/Users/User.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Contracts/Users/User.verified.cs new file mode 100644 index 00000000..35aca578 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Contracts/Users/User.verified.cs @@ -0,0 +1,57 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Contracts.Users; + +/// +/// A single user. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class User +{ + public Guid Id { get; set; } + + /// + /// GenderType. + /// + public GenderType Gender { get; set; } + + public string FirstName { get; set; } + + public string LastName { get; set; } + + /// + /// Undefined description. + /// + /// + /// Email validation being enforced. + /// + [EmailAddress] + public string Email { get; set; } + + /// + /// Undefined description. + /// + /// + /// Url validation being enforced. + /// + [Uri] + public Uri Homepage { get; set; } + + /// + /// Address. + /// + public Address HomeAddress { get; set; } + + /// + /// Address. + /// + public Address CompanyAddress { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(Gender)}: {Gender}, {nameof(FirstName)}: {FirstName}, {nameof(LastName)}: {LastName}, {nameof(Email)}: {Email}, {nameof(Homepage)}: ({Homepage}), {nameof(HomeAddress)}: ({HomeAddress}), {nameof(CompanyAddress)}: ({CompanyAddress})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Contracts/Users/Users.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Contracts/Users/Users.verified.cs new file mode 100644 index 00000000..f9baafbd --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Contracts/Users/Users.verified.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Contracts.Users; + +/// +/// A list of users. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Users +{ + /// + /// A list of User. + /// + public List UserList { get; set; } = new List(); + + /// + public override string ToString() + => $"{nameof(UserList)}.Count: {UserList?.Count ?? 0}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Contracts/_EnumerationTypes/GenderType.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Contracts/_EnumerationTypes/GenderType.verified.cs new file mode 100644 index 00000000..7aed2fb6 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Contracts/_EnumerationTypes/GenderType.verified.cs @@ -0,0 +1,19 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Contracts; + +/// +/// Enumeration: GenderType. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public enum GenderType +{ + None, + NonBinary, + Male, + Female, +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/DeleteUserByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/DeleteUserByIdEndpoint.verified.cs new file mode 100644 index 00000000..769e969d --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/DeleteUserByIdEndpoint.verified.cs @@ -0,0 +1,49 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Endpoints.Users; + +/// +/// Client Endpoint. +/// Description: Delete user by id. +/// Operation: DeleteUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class DeleteUserByIdEndpoint : IDeleteUserByIdEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public DeleteUserByIdEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + DeleteUserByIdParameters parameters, + string httpClientName = "ExUsers-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/users/{id}"); + requestBuilder.WithPathParameter("id", parameters.Id); + + using var requestMessage = requestBuilder.Build(HttpMethod.Delete); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + responseBuilder.AddErrorResponse(HttpStatusCode.NotFound); + responseBuilder.AddErrorResponse(HttpStatusCode.Conflict); + return await responseBuilder.BuildResponseAsync(x => new DeleteUserByIdEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/DeleteUserByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/DeleteUserByIdEndpointResult.verified.cs new file mode 100644 index 00000000..bd400b85 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/DeleteUserByIdEndpointResult.verified.cs @@ -0,0 +1,61 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Endpoints.Users; + +/// +/// Client Endpoint result. +/// Description: Delete user by id. +/// Operation: DeleteUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class DeleteUserByIdEndpointResult : EndpointResponse, IDeleteUserByIdEndpointResult +{ + public DeleteUserByIdEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public bool IsNotFound + => StatusCode == HttpStatusCode.NotFound; + + public bool IsConflict + => StatusCode == HttpStatusCode.Conflict; + + public string? OkContent + => IsOk && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public string? BadRequestContent + => IsBadRequest && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public string? UnauthorizedContent + => IsUnauthorized && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); + + public string? NotFoundContent + => IsNotFound && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsNotFound property first."); + + public string? ConflictContent + => IsConflict && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsConflict property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/GetUserByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/GetUserByIdEndpoint.verified.cs new file mode 100644 index 00000000..5c633ea7 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/GetUserByIdEndpoint.verified.cs @@ -0,0 +1,49 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Endpoints.Users; + +/// +/// Client Endpoint. +/// Description: Get user by id. +/// Operation: GetUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetUserByIdEndpoint : IGetUserByIdEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public GetUserByIdEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + GetUserByIdParameters parameters, + string httpClientName = "ExUsers-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/users/{id}"); + requestBuilder.WithPathParameter("id", parameters.Id); + + using var requestMessage = requestBuilder.Build(HttpMethod.Get); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + responseBuilder.AddErrorResponse(HttpStatusCode.NotFound); + responseBuilder.AddErrorResponse(HttpStatusCode.Conflict); + return await responseBuilder.BuildResponseAsync(x => new GetUserByIdEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/GetUserByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/GetUserByIdEndpointResult.verified.cs new file mode 100644 index 00000000..e0717e5f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/GetUserByIdEndpointResult.verified.cs @@ -0,0 +1,61 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Endpoints.Users; + +/// +/// Client Endpoint result. +/// Description: Get user by id. +/// Operation: GetUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetUserByIdEndpointResult : EndpointResponse, IGetUserByIdEndpointResult +{ + public GetUserByIdEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public bool IsNotFound + => StatusCode == HttpStatusCode.NotFound; + + public bool IsConflict + => StatusCode == HttpStatusCode.Conflict; + + public User OkContent + => IsOk && ContentObject is User result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public string? BadRequestContent + => IsBadRequest && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public string? UnauthorizedContent + => IsUnauthorized && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); + + public string? NotFoundContent + => IsNotFound && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsNotFound property first."); + + public string? ConflictContent + => IsConflict && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsConflict property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/GetUsersEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/GetUsersEndpoint.verified.cs new file mode 100644 index 00000000..6a416be8 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/GetUsersEndpoint.verified.cs @@ -0,0 +1,45 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Endpoints.Users; + +/// +/// Client Endpoint. +/// Description: Get all users. +/// Operation: GetUsers. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetUsersEndpoint : IGetUsersEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public GetUsersEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + string httpClientName = "ExUsers-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/users"); + + using var requestMessage = requestBuilder.Build(HttpMethod.Get); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse>(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + responseBuilder.AddErrorResponse(HttpStatusCode.Conflict); + return await responseBuilder.BuildResponseAsync(x => new GetUsersEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/GetUsersEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/GetUsersEndpointResult.verified.cs new file mode 100644 index 00000000..11b8eed9 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/GetUsersEndpointResult.verified.cs @@ -0,0 +1,45 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Endpoints.Users; + +/// +/// Client Endpoint result. +/// Description: Get all users. +/// Operation: GetUsers. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetUsersEndpointResult : EndpointResponse, IGetUsersEndpointResult +{ + public GetUsersEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public bool IsConflict + => StatusCode == HttpStatusCode.Conflict; + + public IEnumerable OkContent + => IsOk && ContentObject is IEnumerable result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public string? UnauthorizedContent + => IsUnauthorized && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); + + public string? ConflictContent + => IsConflict && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsConflict property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IDeleteUserByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IDeleteUserByIdEndpoint.verified.cs new file mode 100644 index 00000000..e3d4af6a --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IDeleteUserByIdEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Endpoints.Users.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Delete user by id. +/// Operation: DeleteUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IDeleteUserByIdEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + DeleteUserByIdParameters parameters, + string httpClientName = "ExUsers-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IDeleteUserByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IDeleteUserByIdEndpointResult.verified.cs new file mode 100644 index 00000000..a2888b10 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IDeleteUserByIdEndpointResult.verified.cs @@ -0,0 +1,37 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Endpoints.Users.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Delete user by id. +/// Operation: DeleteUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IDeleteUserByIdEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + bool IsNotFound { get; } + + bool IsConflict { get; } + + string? OkContent { get; } + + string? BadRequestContent { get; } + + string? UnauthorizedContent { get; } + + string? NotFoundContent { get; } + + string? ConflictContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUserByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUserByIdEndpoint.verified.cs new file mode 100644 index 00000000..e66b23fd --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUserByIdEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Endpoints.Users.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Get user by id. +/// Operation: GetUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetUserByIdEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + GetUserByIdParameters parameters, + string httpClientName = "ExUsers-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUserByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUserByIdEndpointResult.verified.cs new file mode 100644 index 00000000..fe1cc743 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUserByIdEndpointResult.verified.cs @@ -0,0 +1,37 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Endpoints.Users.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Get user by id. +/// Operation: GetUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetUserByIdEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + bool IsNotFound { get; } + + bool IsConflict { get; } + + User OkContent { get; } + + string? BadRequestContent { get; } + + string? UnauthorizedContent { get; } + + string? NotFoundContent { get; } + + string? ConflictContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUsersEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUsersEndpoint.verified.cs new file mode 100644 index 00000000..3a398c2a --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUsersEndpoint.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Endpoints.Users.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Get all users. +/// Operation: GetUsers. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetUsersEndpoint +{ + /// + /// Execute method. + /// + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + string httpClientName = "ExUsers-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUsersEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUsersEndpointResult.verified.cs new file mode 100644 index 00000000..bd3e70cc --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUsersEndpointResult.verified.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Endpoints.Users.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Get all users. +/// Operation: GetUsers. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetUsersEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsUnauthorized { get; } + + bool IsConflict { get; } + + IEnumerable OkContent { get; } + + string? UnauthorizedContent { get; } + + string? ConflictContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IPostUserEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IPostUserEndpoint.verified.cs new file mode 100644 index 00000000..d74f600a --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IPostUserEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Endpoints.Users.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Create a new user. +/// Operation: PostUser. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IPostUserEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + PostUserParameters parameters, + string httpClientName = "ExUsers-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IPostUserEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IPostUserEndpointResult.verified.cs new file mode 100644 index 00000000..a23577a7 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IPostUserEndpointResult.verified.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Endpoints.Users.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Create a new user. +/// Operation: PostUser. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IPostUserEndpointResult : IEndpointResponse +{ + + bool IsCreated { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + bool IsConflict { get; } + + string? CreatedContent { get; } + + string? BadRequestContent { get; } + + string? UnauthorizedContent { get; } + + string? ConflictContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IUpdateUserByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IUpdateUserByIdEndpoint.verified.cs new file mode 100644 index 00000000..297afecb --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IUpdateUserByIdEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Endpoints.Users.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Update user by id. +/// Operation: UpdateUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IUpdateUserByIdEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + UpdateUserByIdParameters parameters, + string httpClientName = "ExUsers-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IUpdateUserByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IUpdateUserByIdEndpointResult.verified.cs new file mode 100644 index 00000000..a2e438c3 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IUpdateUserByIdEndpointResult.verified.cs @@ -0,0 +1,37 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Endpoints.Users.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Update user by id. +/// Operation: UpdateUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IUpdateUserByIdEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + bool IsNotFound { get; } + + bool IsConflict { get; } + + string? OkContent { get; } + + string? BadRequestContent { get; } + + string? UnauthorizedContent { get; } + + string? NotFoundContent { get; } + + string? ConflictContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/PostUserEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/PostUserEndpoint.verified.cs new file mode 100644 index 00000000..7854291c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/PostUserEndpoint.verified.cs @@ -0,0 +1,48 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Endpoints.Users; + +/// +/// Client Endpoint. +/// Description: Create a new user. +/// Operation: PostUser. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class PostUserEndpoint : IPostUserEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public PostUserEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + PostUserParameters parameters, + string httpClientName = "ExUsers-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/users"); + requestBuilder.WithBody(parameters.Request); + + using var requestMessage = requestBuilder.Build(HttpMethod.Post); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddErrorResponse(HttpStatusCode.Created); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + responseBuilder.AddErrorResponse(HttpStatusCode.Conflict); + return await responseBuilder.BuildResponseAsync(x => new PostUserEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/PostUserEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/PostUserEndpointResult.verified.cs new file mode 100644 index 00000000..d2ddafd4 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/PostUserEndpointResult.verified.cs @@ -0,0 +1,53 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Endpoints.Users; + +/// +/// Client Endpoint result. +/// Description: Create a new user. +/// Operation: PostUser. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class PostUserEndpointResult : EndpointResponse, IPostUserEndpointResult +{ + public PostUserEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsCreated + => StatusCode == HttpStatusCode.Created; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public bool IsConflict + => StatusCode == HttpStatusCode.Conflict; + + public string? CreatedContent + => IsCreated && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsCreated property first."); + + public string? BadRequestContent + => IsBadRequest && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public string? UnauthorizedContent + => IsUnauthorized && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); + + public string? ConflictContent + => IsConflict && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsConflict property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/UpdateUserByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/UpdateUserByIdEndpoint.verified.cs new file mode 100644 index 00000000..512fa57c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/UpdateUserByIdEndpoint.verified.cs @@ -0,0 +1,50 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Endpoints.Users; + +/// +/// Client Endpoint. +/// Description: Update user by id. +/// Operation: UpdateUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateUserByIdEndpoint : IUpdateUserByIdEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public UpdateUserByIdEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + UpdateUserByIdParameters parameters, + string httpClientName = "ExUsers-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/users/{id}"); + requestBuilder.WithPathParameter("id", parameters.Id); + requestBuilder.WithBody(parameters.Request); + + using var requestMessage = requestBuilder.Build(HttpMethod.Put); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + responseBuilder.AddErrorResponse(HttpStatusCode.NotFound); + responseBuilder.AddErrorResponse(HttpStatusCode.Conflict); + return await responseBuilder.BuildResponseAsync(x => new UpdateUserByIdEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/UpdateUserByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/UpdateUserByIdEndpointResult.verified.cs new file mode 100644 index 00000000..3021a5a7 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/UpdateUserByIdEndpointResult.verified.cs @@ -0,0 +1,61 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Endpoints.Users; + +/// +/// Client Endpoint result. +/// Description: Update user by id. +/// Operation: UpdateUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateUserByIdEndpointResult : EndpointResponse, IUpdateUserByIdEndpointResult +{ + public UpdateUserByIdEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public bool IsNotFound + => StatusCode == HttpStatusCode.NotFound; + + public bool IsConflict + => StatusCode == HttpStatusCode.Conflict; + + public string? OkContent + => IsOk && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public string? BadRequestContent + => IsBadRequest && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public string? UnauthorizedContent + => IsUnauthorized && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); + + public string? NotFoundContent + => IsNotFound && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsNotFound property first."); + + public string? ConflictContent + => IsConflict && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsConflict property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/GlobalUsings.verified.cs new file mode 100644 index 00000000..3637c8d3 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WOPD/src/ExUsers.ApiClient.Generated/GlobalUsings.verified.cs @@ -0,0 +1,17 @@ +global using System; +global using System.CodeDom.Compiler; +global using System.Collections.Generic; +global using System.ComponentModel.DataAnnotations; +global using System.Net; +global using System.Net.Http; +global using System.Threading; +global using System.Threading.Tasks; + +global using Atc.Rest.Client; +global using Atc.Rest.Client.Builder; + +global using ExUsers.ApiClient.Generated.Contracts; +global using ExUsers.ApiClient.Generated.Contracts.Users; +global using ExUsers.ApiClient.Generated.Endpoints.Users.Interfaces; + +global using Microsoft.AspNetCore.Mvc; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Contracts/Users/Address.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Contracts/Users/Address.verified.cs new file mode 100644 index 00000000..4c23835a --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Contracts/Users/Address.verified.cs @@ -0,0 +1,32 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Contracts.Users; + +/// +/// Address. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Address +{ + [StringLength(255)] + public string StreetName { get; set; } + + public string StreetNumber { get; set; } + + public string PostalCode { get; set; } + + public string CityName { get; set; } + + /// + /// Country. + /// + public Country MyCountry { get; set; } + + /// + public override string ToString() + => $"{nameof(StreetName)}: {StreetName}, {nameof(StreetNumber)}: {StreetNumber}, {nameof(PostalCode)}: {PostalCode}, {nameof(CityName)}: {CityName}, {nameof(MyCountry)}: ({MyCountry})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Contracts/Users/Country.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Contracts/Users/Country.verified.cs new file mode 100644 index 00000000..732f9b9c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Contracts/Users/Country.verified.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Contracts.Users; + +/// +/// Country. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Country +{ + [Required] + public string Name { get; set; } + + [Required] + [MinLength(2)] + [MaxLength(2)] + [RegularExpression("^[A-Za-z]{2}$")] + public string Alpha2Code { get; set; } + + [Required] + [MinLength(3)] + [MaxLength(3)] + [RegularExpression("^[A-Za-z]{3}$")] + public string Alpha3Code { get; set; } + + /// + public override string ToString() + => $"{nameof(Name)}: {Name}, {nameof(Alpha2Code)}: {Alpha2Code}, {nameof(Alpha3Code)}: {Alpha3Code}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Contracts/Users/CreateUserRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Contracts/Users/CreateUserRequest.verified.cs new file mode 100644 index 00000000..fb77f973 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Contracts/Users/CreateUserRequest.verified.cs @@ -0,0 +1,56 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Contracts.Users; + +/// +/// Request to create a user. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class CreateUserRequest +{ + [Required] + public string FirstName { get; set; } + + [Required] + public string LastName { get; set; } + + public DateTimeOffset? MyNullableDateTime { get; set; } + + [Required] + public DateTimeOffset MyDateTime { get; set; } + + /// + /// Undefined description. + /// + /// + /// Email validation being enforced. + /// + [Required] + [EmailAddress] + public string Email { get; set; } + + /// + /// Undefined description. + /// + /// + /// Url validation being enforced. + /// + [Uri] + public Uri Homepage { get; set; } + + /// + /// GenderType. + /// + [Required] + public GenderType Gender { get; set; } + + public Address? MyNullableAddress { get; set; } + + /// + public override string ToString() + => $"{nameof(FirstName)}: {FirstName}, {nameof(LastName)}: {LastName}, {nameof(MyNullableDateTime)}: ({MyNullableDateTime}), {nameof(MyDateTime)}: ({MyDateTime}), {nameof(Email)}: {Email}, {nameof(Homepage)}: ({Homepage}), {nameof(Gender)}: {Gender}, {nameof(MyNullableAddress)}: ({MyNullableAddress})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Contracts/Users/RequestParameters/DeleteUserByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Contracts/Users/RequestParameters/DeleteUserByIdParameters.verified.cs new file mode 100644 index 00000000..e2ea43a8 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Contracts/Users/RequestParameters/DeleteUserByIdParameters.verified.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Contracts.Users; + +/// +/// Parameters for operation request. +/// Description: Delete user by id. +/// Operation: DeleteUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class DeleteUserByIdParameters +{ + /// + /// Id of the user. + /// + [Required] + public Guid Id { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Contracts/Users/RequestParameters/GetUserByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Contracts/Users/RequestParameters/GetUserByIdParameters.verified.cs new file mode 100644 index 00000000..a7866703 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Contracts/Users/RequestParameters/GetUserByIdParameters.verified.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Contracts.Users; + +/// +/// Parameters for operation request. +/// Description: Get user by id. +/// Operation: GetUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetUserByIdParameters +{ + /// + /// Id of the user. + /// + [Required] + public Guid Id { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Contracts/Users/RequestParameters/PostUserParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Contracts/Users/RequestParameters/PostUserParameters.verified.cs new file mode 100644 index 00000000..36011ed4 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Contracts/Users/RequestParameters/PostUserParameters.verified.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Contracts.Users; + +/// +/// Parameters for operation request. +/// Description: Create a new user. +/// Operation: PostUser. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class PostUserParameters +{ + /// + /// Request to create a user. + /// + [Required] + public CreateUserRequest Request { get; set; } + + /// + public override string ToString() + => $"{nameof(Request)}: ({Request})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Contracts/Users/RequestParameters/UpdateUserByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Contracts/Users/RequestParameters/UpdateUserByIdParameters.verified.cs new file mode 100644 index 00000000..9f52a0ac --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Contracts/Users/RequestParameters/UpdateUserByIdParameters.verified.cs @@ -0,0 +1,32 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Contracts.Users; + +/// +/// Parameters for operation request. +/// Description: Update user by id. +/// Operation: UpdateUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateUserByIdParameters +{ + /// + /// Id of the user. + /// + [Required] + public Guid Id { get; set; } + + /// + /// Request to update a user. + /// + [Required] + public UpdateUserRequest Request { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(Request)}: ({Request})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Contracts/Users/UpdateUserRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Contracts/Users/UpdateUserRequest.verified.cs new file mode 100644 index 00000000..ad9c07ef --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Contracts/Users/UpdateUserRequest.verified.cs @@ -0,0 +1,36 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Contracts.Users; + +/// +/// Request to update a user. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateUserRequest +{ + public string FirstName { get; set; } + + public string LastName { get; set; } + + /// + /// Undefined description. + /// + /// + /// Email validation being enforced. + /// + [EmailAddress] + public string Email { get; set; } + + /// + /// GenderType. + /// + public GenderType Gender { get; set; } + + /// + public override string ToString() + => $"{nameof(FirstName)}: {FirstName}, {nameof(LastName)}: {LastName}, {nameof(Email)}: {Email}, {nameof(Gender)}: {Gender}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Contracts/Users/User.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Contracts/Users/User.verified.cs new file mode 100644 index 00000000..35aca578 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Contracts/Users/User.verified.cs @@ -0,0 +1,57 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Contracts.Users; + +/// +/// A single user. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class User +{ + public Guid Id { get; set; } + + /// + /// GenderType. + /// + public GenderType Gender { get; set; } + + public string FirstName { get; set; } + + public string LastName { get; set; } + + /// + /// Undefined description. + /// + /// + /// Email validation being enforced. + /// + [EmailAddress] + public string Email { get; set; } + + /// + /// Undefined description. + /// + /// + /// Url validation being enforced. + /// + [Uri] + public Uri Homepage { get; set; } + + /// + /// Address. + /// + public Address HomeAddress { get; set; } + + /// + /// Address. + /// + public Address CompanyAddress { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(Gender)}: {Gender}, {nameof(FirstName)}: {FirstName}, {nameof(LastName)}: {LastName}, {nameof(Email)}: {Email}, {nameof(Homepage)}: ({Homepage}), {nameof(HomeAddress)}: ({HomeAddress}), {nameof(CompanyAddress)}: ({CompanyAddress})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Contracts/Users/Users.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Contracts/Users/Users.verified.cs new file mode 100644 index 00000000..f9baafbd --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Contracts/Users/Users.verified.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Contracts.Users; + +/// +/// A list of users. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Users +{ + /// + /// A list of User. + /// + public List UserList { get; set; } = new List(); + + /// + public override string ToString() + => $"{nameof(UserList)}.Count: {UserList?.Count ?? 0}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Contracts/_EnumerationTypes/GenderType.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Contracts/_EnumerationTypes/GenderType.verified.cs new file mode 100644 index 00000000..7aed2fb6 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Contracts/_EnumerationTypes/GenderType.verified.cs @@ -0,0 +1,19 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Contracts; + +/// +/// Enumeration: GenderType. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public enum GenderType +{ + None, + NonBinary, + Male, + Female, +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/DeleteUserByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/DeleteUserByIdEndpoint.verified.cs new file mode 100644 index 00000000..cb6dd14f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/DeleteUserByIdEndpoint.verified.cs @@ -0,0 +1,49 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Endpoints.Users; + +/// +/// Client Endpoint. +/// Description: Delete user by id. +/// Operation: DeleteUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class DeleteUserByIdEndpoint : IDeleteUserByIdEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public DeleteUserByIdEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + DeleteUserByIdParameters parameters, + string httpClientName = "ExUsers-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/users/{id}"); + requestBuilder.WithPathParameter("id", parameters.Id); + + using var requestMessage = requestBuilder.Build(HttpMethod.Delete); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + responseBuilder.AddErrorResponse(HttpStatusCode.NotFound); + responseBuilder.AddErrorResponse(HttpStatusCode.Conflict); + return await responseBuilder.BuildResponseAsync(x => new DeleteUserByIdEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/DeleteUserByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/DeleteUserByIdEndpointResult.verified.cs new file mode 100644 index 00000000..e1cb2b93 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/DeleteUserByIdEndpointResult.verified.cs @@ -0,0 +1,61 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Endpoints.Users; + +/// +/// Client Endpoint result. +/// Description: Delete user by id. +/// Operation: DeleteUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class DeleteUserByIdEndpointResult : EndpointResponse, IDeleteUserByIdEndpointResult +{ + public DeleteUserByIdEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public bool IsNotFound + => StatusCode == HttpStatusCode.NotFound; + + public bool IsConflict + => StatusCode == HttpStatusCode.Conflict; + + public string? OkContent + => IsOk && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public ValidationProblemDetails BadRequestContent + => IsBadRequest && ContentObject is ValidationProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public ProblemDetails UnauthorizedContent + => IsUnauthorized && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); + + public ProblemDetails NotFoundContent + => IsNotFound && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsNotFound property first."); + + public ProblemDetails ConflictContent + => IsConflict && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsConflict property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/GetUserByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/GetUserByIdEndpoint.verified.cs new file mode 100644 index 00000000..5df7cfc1 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/GetUserByIdEndpoint.verified.cs @@ -0,0 +1,49 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Endpoints.Users; + +/// +/// Client Endpoint. +/// Description: Get user by id. +/// Operation: GetUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetUserByIdEndpoint : IGetUserByIdEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public GetUserByIdEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + GetUserByIdParameters parameters, + string httpClientName = "ExUsers-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/users/{id}"); + requestBuilder.WithPathParameter("id", parameters.Id); + + using var requestMessage = requestBuilder.Build(HttpMethod.Get); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + responseBuilder.AddErrorResponse(HttpStatusCode.NotFound); + responseBuilder.AddErrorResponse(HttpStatusCode.Conflict); + return await responseBuilder.BuildResponseAsync(x => new GetUserByIdEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/GetUserByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/GetUserByIdEndpointResult.verified.cs new file mode 100644 index 00000000..23671452 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/GetUserByIdEndpointResult.verified.cs @@ -0,0 +1,61 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Endpoints.Users; + +/// +/// Client Endpoint result. +/// Description: Get user by id. +/// Operation: GetUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetUserByIdEndpointResult : EndpointResponse, IGetUserByIdEndpointResult +{ + public GetUserByIdEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public bool IsNotFound + => StatusCode == HttpStatusCode.NotFound; + + public bool IsConflict + => StatusCode == HttpStatusCode.Conflict; + + public User OkContent + => IsOk && ContentObject is User result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public ValidationProblemDetails BadRequestContent + => IsBadRequest && ContentObject is ValidationProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public ProblemDetails UnauthorizedContent + => IsUnauthorized && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); + + public ProblemDetails NotFoundContent + => IsNotFound && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsNotFound property first."); + + public ProblemDetails ConflictContent + => IsConflict && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsConflict property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/GetUsersEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/GetUsersEndpoint.verified.cs new file mode 100644 index 00000000..b0dcdd84 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/GetUsersEndpoint.verified.cs @@ -0,0 +1,45 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Endpoints.Users; + +/// +/// Client Endpoint. +/// Description: Get all users. +/// Operation: GetUsers. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetUsersEndpoint : IGetUsersEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public GetUsersEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + string httpClientName = "ExUsers-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/users"); + + using var requestMessage = requestBuilder.Build(HttpMethod.Get); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse>(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + responseBuilder.AddErrorResponse(HttpStatusCode.Conflict); + return await responseBuilder.BuildResponseAsync(x => new GetUsersEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/GetUsersEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/GetUsersEndpointResult.verified.cs new file mode 100644 index 00000000..1cdb13b9 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/GetUsersEndpointResult.verified.cs @@ -0,0 +1,45 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Endpoints.Users; + +/// +/// Client Endpoint result. +/// Description: Get all users. +/// Operation: GetUsers. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetUsersEndpointResult : EndpointResponse, IGetUsersEndpointResult +{ + public GetUsersEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public bool IsConflict + => StatusCode == HttpStatusCode.Conflict; + + public IEnumerable OkContent + => IsOk && ContentObject is IEnumerable result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public ProblemDetails UnauthorizedContent + => IsUnauthorized && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); + + public ProblemDetails ConflictContent + => IsConflict && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsConflict property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IDeleteUserByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IDeleteUserByIdEndpoint.verified.cs new file mode 100644 index 00000000..e3d4af6a --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IDeleteUserByIdEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Endpoints.Users.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Delete user by id. +/// Operation: DeleteUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IDeleteUserByIdEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + DeleteUserByIdParameters parameters, + string httpClientName = "ExUsers-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IDeleteUserByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IDeleteUserByIdEndpointResult.verified.cs new file mode 100644 index 00000000..12e2fd5b --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IDeleteUserByIdEndpointResult.verified.cs @@ -0,0 +1,37 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Endpoints.Users.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Delete user by id. +/// Operation: DeleteUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IDeleteUserByIdEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + bool IsNotFound { get; } + + bool IsConflict { get; } + + string? OkContent { get; } + + ValidationProblemDetails BadRequestContent { get; } + + ProblemDetails UnauthorizedContent { get; } + + ProblemDetails NotFoundContent { get; } + + ProblemDetails ConflictContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUserByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUserByIdEndpoint.verified.cs new file mode 100644 index 00000000..e66b23fd --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUserByIdEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Endpoints.Users.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Get user by id. +/// Operation: GetUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetUserByIdEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + GetUserByIdParameters parameters, + string httpClientName = "ExUsers-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUserByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUserByIdEndpointResult.verified.cs new file mode 100644 index 00000000..7c76b543 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUserByIdEndpointResult.verified.cs @@ -0,0 +1,37 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Endpoints.Users.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Get user by id. +/// Operation: GetUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetUserByIdEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + bool IsNotFound { get; } + + bool IsConflict { get; } + + User OkContent { get; } + + ValidationProblemDetails BadRequestContent { get; } + + ProblemDetails UnauthorizedContent { get; } + + ProblemDetails NotFoundContent { get; } + + ProblemDetails ConflictContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUsersEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUsersEndpoint.verified.cs new file mode 100644 index 00000000..3a398c2a --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUsersEndpoint.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Endpoints.Users.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Get all users. +/// Operation: GetUsers. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetUsersEndpoint +{ + /// + /// Execute method. + /// + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + string httpClientName = "ExUsers-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUsersEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUsersEndpointResult.verified.cs new file mode 100644 index 00000000..cecdb0c4 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IGetUsersEndpointResult.verified.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Endpoints.Users.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Get all users. +/// Operation: GetUsers. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetUsersEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsUnauthorized { get; } + + bool IsConflict { get; } + + IEnumerable OkContent { get; } + + ProblemDetails UnauthorizedContent { get; } + + ProblemDetails ConflictContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IPostUserEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IPostUserEndpoint.verified.cs new file mode 100644 index 00000000..d74f600a --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IPostUserEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Endpoints.Users.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Create a new user. +/// Operation: PostUser. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IPostUserEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + PostUserParameters parameters, + string httpClientName = "ExUsers-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IPostUserEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IPostUserEndpointResult.verified.cs new file mode 100644 index 00000000..7d485ddd --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IPostUserEndpointResult.verified.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Endpoints.Users.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Create a new user. +/// Operation: PostUser. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IPostUserEndpointResult : IEndpointResponse +{ + + bool IsCreated { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + bool IsConflict { get; } + + ProblemDetails CreatedContent { get; } + + ValidationProblemDetails BadRequestContent { get; } + + ProblemDetails UnauthorizedContent { get; } + + ProblemDetails ConflictContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IUpdateUserByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IUpdateUserByIdEndpoint.verified.cs new file mode 100644 index 00000000..297afecb --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IUpdateUserByIdEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Endpoints.Users.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Update user by id. +/// Operation: UpdateUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IUpdateUserByIdEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + UpdateUserByIdParameters parameters, + string httpClientName = "ExUsers-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IUpdateUserByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IUpdateUserByIdEndpointResult.verified.cs new file mode 100644 index 00000000..218d0729 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/Interfaces/IUpdateUserByIdEndpointResult.verified.cs @@ -0,0 +1,37 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Endpoints.Users.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Update user by id. +/// Operation: UpdateUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IUpdateUserByIdEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + bool IsNotFound { get; } + + bool IsConflict { get; } + + string? OkContent { get; } + + ValidationProblemDetails BadRequestContent { get; } + + ProblemDetails UnauthorizedContent { get; } + + ProblemDetails NotFoundContent { get; } + + ProblemDetails ConflictContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/PostUserEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/PostUserEndpoint.verified.cs new file mode 100644 index 00000000..1b6b4e2c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/PostUserEndpoint.verified.cs @@ -0,0 +1,48 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Endpoints.Users; + +/// +/// Client Endpoint. +/// Description: Create a new user. +/// Operation: PostUser. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class PostUserEndpoint : IPostUserEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public PostUserEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + PostUserParameters parameters, + string httpClientName = "ExUsers-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/users"); + requestBuilder.WithBody(parameters.Request); + + using var requestMessage = requestBuilder.Build(HttpMethod.Post); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddErrorResponse(HttpStatusCode.Created); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + responseBuilder.AddErrorResponse(HttpStatusCode.Conflict); + return await responseBuilder.BuildResponseAsync(x => new PostUserEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/PostUserEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/PostUserEndpointResult.verified.cs new file mode 100644 index 00000000..3136b5fc --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/PostUserEndpointResult.verified.cs @@ -0,0 +1,53 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Endpoints.Users; + +/// +/// Client Endpoint result. +/// Description: Create a new user. +/// Operation: PostUser. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class PostUserEndpointResult : EndpointResponse, IPostUserEndpointResult +{ + public PostUserEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsCreated + => StatusCode == HttpStatusCode.Created; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public bool IsConflict + => StatusCode == HttpStatusCode.Conflict; + + public ProblemDetails CreatedContent + => IsCreated && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsCreated property first."); + + public ValidationProblemDetails BadRequestContent + => IsBadRequest && ContentObject is ValidationProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public ProblemDetails UnauthorizedContent + => IsUnauthorized && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); + + public ProblemDetails ConflictContent + => IsConflict && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsConflict property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/UpdateUserByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/UpdateUserByIdEndpoint.verified.cs new file mode 100644 index 00000000..d7523eb9 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/UpdateUserByIdEndpoint.verified.cs @@ -0,0 +1,50 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Endpoints.Users; + +/// +/// Client Endpoint. +/// Description: Update user by id. +/// Operation: UpdateUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateUserByIdEndpoint : IUpdateUserByIdEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public UpdateUserByIdEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + UpdateUserByIdParameters parameters, + string httpClientName = "ExUsers-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/users/{id}"); + requestBuilder.WithPathParameter("id", parameters.Id); + requestBuilder.WithBody(parameters.Request); + + using var requestMessage = requestBuilder.Build(HttpMethod.Put); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + responseBuilder.AddErrorResponse(HttpStatusCode.NotFound); + responseBuilder.AddErrorResponse(HttpStatusCode.Conflict); + return await responseBuilder.BuildResponseAsync(x => new UpdateUserByIdEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/UpdateUserByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/UpdateUserByIdEndpointResult.verified.cs new file mode 100644 index 00000000..3c46c7df --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/Endpoints/Users/UpdateUserByIdEndpointResult.verified.cs @@ -0,0 +1,61 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.ApiClient.Generated.Endpoints.Users; + +/// +/// Client Endpoint result. +/// Description: Update user by id. +/// Operation: UpdateUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateUserByIdEndpointResult : EndpointResponse, IUpdateUserByIdEndpointResult +{ + public UpdateUserByIdEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public bool IsNotFound + => StatusCode == HttpStatusCode.NotFound; + + public bool IsConflict + => StatusCode == HttpStatusCode.Conflict; + + public string? OkContent + => IsOk && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public ValidationProblemDetails BadRequestContent + => IsBadRequest && ContentObject is ValidationProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public ProblemDetails UnauthorizedContent + => IsUnauthorized && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); + + public ProblemDetails NotFoundContent + => IsNotFound && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsNotFound property first."); + + public ProblemDetails ConflictContent + => IsConflict && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsConflict property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/GlobalUsings.verified.cs new file mode 100644 index 00000000..3637c8d3 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyClient/WPD/src/ExUsers.ApiClient.Generated/GlobalUsings.verified.cs @@ -0,0 +1,17 @@ +global using System; +global using System.CodeDom.Compiler; +global using System.Collections.Generic; +global using System.ComponentModel.DataAnnotations; +global using System.Net; +global using System.Net.Http; +global using System.Threading; +global using System.Threading.Tasks; + +global using Atc.Rest.Client; +global using Atc.Rest.Client.Builder; + +global using ExUsers.ApiClient.Generated.Contracts; +global using ExUsers.ApiClient.Generated.Contracts.Users; +global using ExUsers.ApiClient.Generated.Endpoints.Users.Interfaces; + +global using Microsoft.AspNetCore.Mvc; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/ApiRegistration.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/ApiRegistration.verified.cs new file mode 100644 index 00000000..4baeacd5 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/ApiRegistration.verified.cs @@ -0,0 +1,12 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Generated; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ApiRegistration +{ +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Interfaces/IDeleteUserByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Interfaces/IDeleteUserByIdHandler.verified.cs new file mode 100644 index 00000000..622d5268 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Interfaces/IDeleteUserByIdHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Generated.Contracts.Users; + +/// +/// Domain Interface for RequestHandler. +/// Description: Delete user by id. +/// Operation: DeleteUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IDeleteUserByIdHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + DeleteUserByIdParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Interfaces/IGetUserByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Interfaces/IGetUserByIdHandler.verified.cs new file mode 100644 index 00000000..4002fb4e --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Interfaces/IGetUserByIdHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Generated.Contracts.Users; + +/// +/// Domain Interface for RequestHandler. +/// Description: Get user by id. +/// Operation: GetUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetUserByIdHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + GetUserByIdParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Interfaces/IGetUsersHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Interfaces/IGetUsersHandler.verified.cs new file mode 100644 index 00000000..8db29fc5 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Interfaces/IGetUsersHandler.verified.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Generated.Contracts.Users; + +/// +/// Domain Interface for RequestHandler. +/// Description: Get all users. +/// Operation: GetUsers. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetUsersHandler +{ + /// + /// Execute method. + /// + /// The cancellation token. + Task ExecuteAsync( + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Interfaces/IPostUserHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Interfaces/IPostUserHandler.verified.cs new file mode 100644 index 00000000..9ce7369c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Interfaces/IPostUserHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Generated.Contracts.Users; + +/// +/// Domain Interface for RequestHandler. +/// Description: Create a new user. +/// Operation: PostUser. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IPostUserHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + PostUserParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Interfaces/IUpdateUserByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Interfaces/IUpdateUserByIdHandler.verified.cs new file mode 100644 index 00000000..fb9f0040 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Interfaces/IUpdateUserByIdHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Generated.Contracts.Users; + +/// +/// Domain Interface for RequestHandler. +/// Description: Update user by id. +/// Operation: UpdateUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IUpdateUserByIdHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + UpdateUserByIdParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Models/Address.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Models/Address.verified.cs new file mode 100644 index 00000000..1a1a942f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Models/Address.verified.cs @@ -0,0 +1,32 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Generated.Contracts.Users; + +/// +/// Address. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Address +{ + [StringLength(255)] + public string StreetName { get; set; } + + public string StreetNumber { get; set; } + + public string PostalCode { get; set; } + + public string CityName { get; set; } + + /// + /// Country. + /// + public Country MyCountry { get; set; } + + /// + public override string ToString() + => $"{nameof(StreetName)}: {StreetName}, {nameof(StreetNumber)}: {StreetNumber}, {nameof(PostalCode)}: {PostalCode}, {nameof(CityName)}: {CityName}, {nameof(MyCountry)}: ({MyCountry})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Models/Country.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Models/Country.verified.cs new file mode 100644 index 00000000..77092361 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Models/Country.verified.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Generated.Contracts.Users; + +/// +/// Country. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Country +{ + [Required] + public string Name { get; set; } + + [Required] + [MinLength(2)] + [MaxLength(2)] + [RegularExpression("^[A-Za-z]{2}$")] + public string Alpha2Code { get; set; } + + [Required] + [MinLength(3)] + [MaxLength(3)] + [RegularExpression("^[A-Za-z]{3}$")] + public string Alpha3Code { get; set; } + + /// + public override string ToString() + => $"{nameof(Name)}: {Name}, {nameof(Alpha2Code)}: {Alpha2Code}, {nameof(Alpha3Code)}: {Alpha3Code}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Models/CreateUserRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Models/CreateUserRequest.verified.cs new file mode 100644 index 00000000..d1292c97 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Models/CreateUserRequest.verified.cs @@ -0,0 +1,56 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Generated.Contracts.Users; + +/// +/// Request to create a user. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class CreateUserRequest +{ + [Required] + public string FirstName { get; set; } + + [Required] + public string LastName { get; set; } + + public DateTimeOffset? MyNullableDateTime { get; set; } + + [Required] + public DateTimeOffset MyDateTime { get; set; } + + /// + /// Undefined description. + /// + /// + /// Email validation being enforced. + /// + [Required] + [EmailAddress] + public string Email { get; set; } + + /// + /// Undefined description. + /// + /// + /// Url validation being enforced. + /// + [Uri] + public Uri Homepage { get; set; } + + /// + /// GenderType. + /// + [Required] + public GenderType Gender { get; set; } + + public Address? MyNullableAddress { get; set; } + + /// + public override string ToString() + => $"{nameof(FirstName)}: {FirstName}, {nameof(LastName)}: {LastName}, {nameof(MyNullableDateTime)}: ({MyNullableDateTime}), {nameof(MyDateTime)}: ({MyDateTime}), {nameof(Email)}: {Email}, {nameof(Homepage)}: ({Homepage}), {nameof(Gender)}: {Gender}, {nameof(MyNullableAddress)}: ({MyNullableAddress})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Models/UpdateUserRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Models/UpdateUserRequest.verified.cs new file mode 100644 index 00000000..dca64c4d --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Models/UpdateUserRequest.verified.cs @@ -0,0 +1,36 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Generated.Contracts.Users; + +/// +/// Request to update a user. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateUserRequest +{ + public string FirstName { get; set; } + + public string LastName { get; set; } + + /// + /// Undefined description. + /// + /// + /// Email validation being enforced. + /// + [EmailAddress] + public string Email { get; set; } + + /// + /// GenderType. + /// + public GenderType Gender { get; set; } + + /// + public override string ToString() + => $"{nameof(FirstName)}: {FirstName}, {nameof(LastName)}: {LastName}, {nameof(Email)}: {Email}, {nameof(Gender)}: {Gender}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Models/User.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Models/User.verified.cs new file mode 100644 index 00000000..2c2423b7 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Models/User.verified.cs @@ -0,0 +1,57 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Generated.Contracts.Users; + +/// +/// A single user. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class User +{ + public Guid Id { get; set; } + + /// + /// GenderType. + /// + public GenderType Gender { get; set; } + + public string FirstName { get; set; } + + public string LastName { get; set; } + + /// + /// Undefined description. + /// + /// + /// Email validation being enforced. + /// + [EmailAddress] + public string Email { get; set; } + + /// + /// Undefined description. + /// + /// + /// Url validation being enforced. + /// + [Uri] + public Uri Homepage { get; set; } + + /// + /// Address. + /// + public Address HomeAddress { get; set; } + + /// + /// Address. + /// + public Address CompanyAddress { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(Gender)}: {Gender}, {nameof(FirstName)}: {FirstName}, {nameof(LastName)}: {LastName}, {nameof(Email)}: {Email}, {nameof(Homepage)}: ({Homepage}), {nameof(HomeAddress)}: ({HomeAddress}), {nameof(CompanyAddress)}: ({CompanyAddress})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Models/Users.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Models/Users.verified.cs new file mode 100644 index 00000000..1381b695 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Models/Users.verified.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Generated.Contracts.Users; + +/// +/// A list of users. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Users +{ + /// + /// A list of User. + /// + public List UserList { get; set; } = new List(); + + /// + public override string ToString() + => $"{nameof(UserList)}.Count: {UserList?.Count ?? 0}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Parameters/DeleteUserByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Parameters/DeleteUserByIdParameters.verified.cs new file mode 100644 index 00000000..3bb7845f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Parameters/DeleteUserByIdParameters.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Generated.Contracts.Users; + +/// +/// Parameters for operation request. +/// Description: Delete user by id. +/// Operation: DeleteUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class DeleteUserByIdParameters +{ + /// + /// Id of the user. + /// + [FromRoute(Name = "id")] + [Required] + public Guid Id { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Parameters/GetUserByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Parameters/GetUserByIdParameters.verified.cs new file mode 100644 index 00000000..71fdd1cf --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Parameters/GetUserByIdParameters.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Generated.Contracts.Users; + +/// +/// Parameters for operation request. +/// Description: Get user by id. +/// Operation: GetUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetUserByIdParameters +{ + /// + /// Id of the user. + /// + [FromRoute(Name = "id")] + [Required] + public Guid Id { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Parameters/PostUserParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Parameters/PostUserParameters.verified.cs new file mode 100644 index 00000000..0e2edee0 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Parameters/PostUserParameters.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Generated.Contracts.Users; + +/// +/// Parameters for operation request. +/// Description: Create a new user. +/// Operation: PostUser. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class PostUserParameters +{ + /// + /// Request to create a user. + /// + [FromBody] + [Required] + public CreateUserRequest Request { get; set; } + + /// + public override string ToString() + => $"{nameof(Request)}: ({Request})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Parameters/UpdateUserByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Parameters/UpdateUserByIdParameters.verified.cs new file mode 100644 index 00000000..52c6e1d8 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Parameters/UpdateUserByIdParameters.verified.cs @@ -0,0 +1,34 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Generated.Contracts.Users; + +/// +/// Parameters for operation request. +/// Description: Update user by id. +/// Operation: UpdateUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateUserByIdParameters +{ + /// + /// Id of the user. + /// + [FromRoute(Name = "id")] + [Required] + public Guid Id { get; set; } + + /// + /// Request to update a user. + /// + [FromBody] + [Required] + public UpdateUserRequest Request { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(Request)}: ({Request})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Results/DeleteUserByIdResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Results/DeleteUserByIdResult.verified.cs new file mode 100644 index 00000000..0f5702df --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Results/DeleteUserByIdResult.verified.cs @@ -0,0 +1,42 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Generated.Contracts.Users; + +/// +/// Results for operation request. +/// Description: Delete user by id. +/// Operation: DeleteUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class DeleteUserByIdResult : ResultBase +{ + private DeleteUserByIdResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static DeleteUserByIdResult Ok(string? message = null) + => new DeleteUserByIdResult(new OkObjectResult(message)); + + /// + /// 404 - NotFound response. + /// + public static DeleteUserByIdResult NotFound(string? message = null) + => new DeleteUserByIdResult(new NotFoundObjectResult(message)); + + /// + /// 409 - Conflict response. + /// + public static DeleteUserByIdResult Conflict(string? message = null) + => new DeleteUserByIdResult(new ConflictObjectResult(message)); + + /// + /// Performs an implicit conversion from DeleteUserByIdResult to ActionResult. + /// + public static implicit operator DeleteUserByIdResult(string response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Results/GetUserByIdResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Results/GetUserByIdResult.verified.cs new file mode 100644 index 00000000..1a56625b --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Results/GetUserByIdResult.verified.cs @@ -0,0 +1,42 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Generated.Contracts.Users; + +/// +/// Results for operation request. +/// Description: Get user by id. +/// Operation: GetUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetUserByIdResult : ResultBase +{ + private GetUserByIdResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static GetUserByIdResult Ok(User response) + => new GetUserByIdResult(new OkObjectResult(response)); + + /// + /// 404 - NotFound response. + /// + public static GetUserByIdResult NotFound(string? message = null) + => new GetUserByIdResult(new NotFoundObjectResult(message)); + + /// + /// 409 - Conflict response. + /// + public static GetUserByIdResult Conflict(string? message = null) + => new GetUserByIdResult(new ConflictObjectResult(message)); + + /// + /// Performs an implicit conversion from GetUserByIdResult to ActionResult. + /// + public static implicit operator GetUserByIdResult(User response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Results/GetUsersResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Results/GetUsersResult.verified.cs new file mode 100644 index 00000000..9321bc1b --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Results/GetUsersResult.verified.cs @@ -0,0 +1,36 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Generated.Contracts.Users; + +/// +/// Results for operation request. +/// Description: Get all users. +/// Operation: GetUsers. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetUsersResult : ResultBase +{ + private GetUsersResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static GetUsersResult Ok(IEnumerable response) + => new GetUsersResult(new OkObjectResult(response ?? Enumerable.Empty())); + + /// + /// 409 - Conflict response. + /// + public static GetUsersResult Conflict(string? message = null) + => new GetUsersResult(new ConflictObjectResult(message)); + + /// + /// Performs an implicit conversion from GetUsersResult to ActionResult. + /// + public static implicit operator GetUsersResult(List response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Results/PostUserResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Results/PostUserResult.verified.cs new file mode 100644 index 00000000..ac65c834 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Results/PostUserResult.verified.cs @@ -0,0 +1,36 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Generated.Contracts.Users; + +/// +/// Results for operation request. +/// Description: Create a new user. +/// Operation: PostUser. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class PostUserResult : ResultBase +{ + private PostUserResult(ActionResult result) : base(result) { } + + /// + /// 201 - Created response. + /// + public static PostUserResult Created(string? uri = null) + => new PostUserResult(ResultFactory.CreateContentResult(HttpStatusCode.Created, uri)); + + /// + /// 400 - BadRequest response. + /// + public static PostUserResult BadRequest(string? message = null) + => new PostUserResult(new BadRequestObjectResult(message)); + + /// + /// 409 - Conflict response. + /// + public static PostUserResult Conflict(string? message = null) + => new PostUserResult(new ConflictObjectResult(message)); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Results/UpdateUserByIdResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Results/UpdateUserByIdResult.verified.cs new file mode 100644 index 00000000..5df09e4f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/Users/Results/UpdateUserByIdResult.verified.cs @@ -0,0 +1,48 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Generated.Contracts.Users; + +/// +/// Results for operation request. +/// Description: Update user by id. +/// Operation: UpdateUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateUserByIdResult : ResultBase +{ + private UpdateUserByIdResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static UpdateUserByIdResult Ok(string? message = null) + => new UpdateUserByIdResult(new OkObjectResult(message)); + + /// + /// 400 - BadRequest response. + /// + public static UpdateUserByIdResult BadRequest(string? message = null) + => new UpdateUserByIdResult(new BadRequestObjectResult(message)); + + /// + /// 404 - NotFound response. + /// + public static UpdateUserByIdResult NotFound(string? message = null) + => new UpdateUserByIdResult(new NotFoundObjectResult(message)); + + /// + /// 409 - Conflict response. + /// + public static UpdateUserByIdResult Conflict(string? message = null) + => new UpdateUserByIdResult(new ConflictObjectResult(message)); + + /// + /// Performs an implicit conversion from UpdateUserByIdResult to ActionResult. + /// + public static implicit operator UpdateUserByIdResult(string response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/_EnumerationTypes/GenderType.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/_EnumerationTypes/GenderType.verified.cs new file mode 100644 index 00000000..c7fe94b2 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Contracts/_EnumerationTypes/GenderType.verified.cs @@ -0,0 +1,19 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Generated.Contracts; + +/// +/// Enumeration: GenderType. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public enum GenderType +{ + None, + NonBinary, + Male, + Female, +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Endpoints/UsersController.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Endpoints/UsersController.verified.cs new file mode 100644 index 00000000..7814e4f0 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/Endpoints/UsersController.verified.cs @@ -0,0 +1,93 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Generated.Endpoints; + +/// +/// Endpoint definitions. +/// +[Authorize] +[ApiController] +[Route("/api/v1/users")] +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public sealed class UsersController : ControllerBase +{ + /// + /// Description: Get all users. + /// Operation: GetUsers. + /// + [HttpGet] + [ProducesResponseType(typeof(IEnumerable), StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(typeof(string), StatusCodes.Status409Conflict)] + public async Task GetUsers( + [FromServices] IGetUsersHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(cancellationToken); + + /// + /// Description: Create a new user. + /// Operation: PostUser. + /// + [HttpPost] + [ProducesResponseType(typeof(string), StatusCodes.Status201Created)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(typeof(string), StatusCodes.Status409Conflict)] + public async Task PostUser( + PostUserParameters parameters, + [FromServices] IPostUserHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); + + /// + /// Description: Get user by id. + /// Operation: GetUserById. + /// + [HttpGet("{id}")] + [ProducesResponseType(typeof(User), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(typeof(string), StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(string), StatusCodes.Status409Conflict)] + public async Task GetUserById( + GetUserByIdParameters parameters, + [FromServices] IGetUserByIdHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); + + /// + /// Description: Update user by id. + /// Operation: UpdateUserById. + /// + [HttpPut("{id}")] + [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(typeof(string), StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(string), StatusCodes.Status409Conflict)] + public async Task UpdateUserById( + UpdateUserByIdParameters parameters, + [FromServices] IUpdateUserByIdHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); + + /// + /// Description: Delete user by id. + /// Operation: DeleteUserById. + /// + [HttpDelete("{id}")] + [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(typeof(string), StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(string), StatusCodes.Status409Conflict)] + public async Task DeleteUserById( + DeleteUserByIdParameters parameters, + [FromServices] IDeleteUserByIdHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/GlobalUsings.verified.cs new file mode 100644 index 00000000..3d2cda0e --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api.Generated/GlobalUsings.verified.cs @@ -0,0 +1,11 @@ +global using System.CodeDom.Compiler; +global using System.ComponentModel.DataAnnotations; +global using System.Net; + +global using Atc.Rest.Results; + +global using ExUsers.Api.Generated.Contracts.Users; + +global using Microsoft.AspNetCore.Authorization; +global using Microsoft.AspNetCore.Http; +global using Microsoft.AspNetCore.Mvc; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api/GlobalUsings.verified.cs new file mode 100644 index 00000000..bfa54760 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api/GlobalUsings.verified.cs @@ -0,0 +1,15 @@ +global using System.CodeDom.Compiler; +global using System.Reflection; + +global using Asp.Versioning.ApiExplorer; + +global using Atc.Rest.Extended.Options; + +global using ExUsers.Api.Generated; +global using ExUsers.Api.Options; +global using ExUsers.Domain; + +global using Microsoft.Extensions.Options; +global using Microsoft.OpenApi.Models; + +global using Swashbuckle.AspNetCore.SwaggerGen; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api/Options/ConfigureSwaggerDocOptions.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api/Options/ConfigureSwaggerDocOptions.verified.cs new file mode 100644 index 00000000..bc5147e7 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api/Options/ConfigureSwaggerDocOptions.verified.cs @@ -0,0 +1,39 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Options; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ConfigureSwaggerDocOptions : IConfigureOptions +{ + private readonly IApiVersionDescriptionProvider provider; + + public ConfigureSwaggerDocOptions( + IApiVersionDescriptionProvider provider) + => this.provider = provider; + + public void Configure( + SwaggerGenOptions options) + { + foreach (var version in provider.ApiVersionDescriptions) + { + options.SwaggerDoc( + version.GroupName, + new OpenApiInfo + { + Version = "1.0", + Title = "Demo Users Api", + Description = "Demo Users Api - SingleFileVersion", + Contact = new OpenApiContact + { + Name = "atc-net A/S", + }, + }); + } + + options.IncludeXmlComments(Path.ChangeExtension(GetType().Assembly.Location, "xml")); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api/Program.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api/Program.verified.cs new file mode 100644 index 00000000..1f7dfbf9 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api/Program.verified.cs @@ -0,0 +1,23 @@ +namespace ExUsers.Api; + +public static class Program +{ + public static void Main(string[] args) + { + CreateHostBuilder(args) + .Build() + .Run(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) + { + var builder = Host + .CreateDefaultBuilder(args) + .ConfigureWebHostDefaults(webBuilder => + { + webBuilder.UseStartup(); + }); + + return builder; + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api/Startup.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api/Startup.verified.cs new file mode 100644 index 00000000..0904c9d3 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Api/Startup.verified.cs @@ -0,0 +1,38 @@ +namespace ExUsers.Api; + +public class Startup +{ + private readonly RestApiExtendedOptions restApiOptions; + + public Startup( + IConfiguration configuration) + { + Configuration = configuration; + restApiOptions = new RestApiExtendedOptions + { + // TODO: Remove/out-comment/set to false this for production scenarios! + AllowAnonymousAccessForDevelopment = true, + }; + + restApiOptions.AddAssemblyPairs( + Assembly.GetAssembly(typeof(ApiRegistration)), + Assembly.GetAssembly(typeof(DomainRegistration))); + } + + public IConfiguration Configuration { get; } + + public void ConfigureServices( + IServiceCollection services) + { + services.ConfigureOptions(); + + services.AddRestApi(restApiOptions, Configuration); + } + + public void Configure( + IApplicationBuilder app, + IWebHostEnvironment env) + { + app.ConfigureRestApi(env, restApiOptions); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Domain/DomainRegistration.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Domain/DomainRegistration.verified.cs new file mode 100644 index 00000000..7628fe22 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Domain/DomainRegistration.verified.cs @@ -0,0 +1,12 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Domain; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class DomainRegistration +{ +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Domain/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Domain/GlobalUsings.verified.cs new file mode 100644 index 00000000..0c3db6f8 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Domain/GlobalUsings.verified.cs @@ -0,0 +1,3 @@ +global using System.CodeDom.Compiler; + +global using ExUsers.Api.Generated.Contracts.Users; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Domain/Handlers/Users/DeleteUserByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Domain/Handlers/Users/DeleteUserByIdHandler.verified.cs new file mode 100644 index 00000000..690df3b2 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Domain/Handlers/Users/DeleteUserByIdHandler.verified.cs @@ -0,0 +1,18 @@ +namespace ExUsers.Domain.Handlers.Users; + +/// +/// Handler for operation request. +/// Description: Delete user by id. +/// Operation: DeleteUserById. +/// +public class DeleteUserByIdHandler : IDeleteUserByIdHandler +{ + public Task ExecuteAsync( + DeleteUserByIdParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for DeleteUserByIdHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Domain/Handlers/Users/GetUserByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Domain/Handlers/Users/GetUserByIdHandler.verified.cs new file mode 100644 index 00000000..99b9377a --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Domain/Handlers/Users/GetUserByIdHandler.verified.cs @@ -0,0 +1,18 @@ +namespace ExUsers.Domain.Handlers.Users; + +/// +/// Handler for operation request. +/// Description: Get user by id. +/// Operation: GetUserById. +/// +public class GetUserByIdHandler : IGetUserByIdHandler +{ + public Task ExecuteAsync( + GetUserByIdParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for GetUserByIdHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Domain/Handlers/Users/GetUsersHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Domain/Handlers/Users/GetUsersHandler.verified.cs new file mode 100644 index 00000000..f88ae3dc --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Domain/Handlers/Users/GetUsersHandler.verified.cs @@ -0,0 +1,15 @@ +namespace ExUsers.Domain.Handlers.Users; + +/// +/// Handler for operation request. +/// Description: Get all users. +/// Operation: GetUsers. +/// +public class GetUsersHandler : IGetUsersHandler +{ + public Task ExecuteAsync( + CancellationToken cancellationToken = default) + { + throw new NotImplementedException("Add logic here for GetUsersHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Domain/Handlers/Users/PostUserHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Domain/Handlers/Users/PostUserHandler.verified.cs new file mode 100644 index 00000000..c4db3890 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Domain/Handlers/Users/PostUserHandler.verified.cs @@ -0,0 +1,18 @@ +namespace ExUsers.Domain.Handlers.Users; + +/// +/// Handler for operation request. +/// Description: Create a new user. +/// Operation: PostUser. +/// +public class PostUserHandler : IPostUserHandler +{ + public Task ExecuteAsync( + PostUserParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for PostUserHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Domain/Handlers/Users/UpdateUserByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Domain/Handlers/Users/UpdateUserByIdHandler.verified.cs new file mode 100644 index 00000000..2c6c3538 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/src/ExUsers.Domain/Handlers/Users/UpdateUserByIdHandler.verified.cs @@ -0,0 +1,18 @@ +namespace ExUsers.Domain.Handlers.Users; + +/// +/// Handler for operation request. +/// Description: Update user by id. +/// Operation: UpdateUserById. +/// +public class UpdateUserByIdHandler : IUpdateUserByIdHandler +{ + public Task ExecuteAsync( + UpdateUserByIdParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for UpdateUserByIdHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Api.Tests/Endpoints/Users/DeleteUserByIdHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Api.Tests/Endpoints/Users/DeleteUserByIdHandlerStub.verified.cs new file mode 100644 index 00000000..c6fb2cc7 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Api.Tests/Endpoints/Users/DeleteUserByIdHandlerStub.verified.cs @@ -0,0 +1,18 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Tests.Endpoints.Users; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class DeleteUserByIdHandlerStub : IDeleteUserByIdHandler +{ + public Task ExecuteAsync( + DeleteUserByIdParameters parameters, + CancellationToken cancellationToken = default) + { + return Task.FromResult(DeleteUserByIdResult.Ok("Hallo world")); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Api.Tests/Endpoints/Users/DeleteUserByIdTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Api.Tests/Endpoints/Users/DeleteUserByIdTests.verified.cs new file mode 100644 index 00000000..826d4567 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Api.Tests/Endpoints/Users/DeleteUserByIdTests.verified.cs @@ -0,0 +1,21 @@ +namespace ExUsers.Api.Tests.Endpoints.Users; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class DeleteUserByIdTests : WebApiControllerBaseTest +{ + public DeleteUserByIdTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Api.Tests/Endpoints/Users/GetUserByIdHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Api.Tests/Endpoints/Users/GetUserByIdHandlerStub.verified.cs new file mode 100644 index 00000000..8a125b11 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Api.Tests/Endpoints/Users/GetUserByIdHandlerStub.verified.cs @@ -0,0 +1,20 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Tests.Endpoints.Users; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetUserByIdHandlerStub : IGetUserByIdHandler +{ + public Task ExecuteAsync( + GetUserByIdParameters parameters, + CancellationToken cancellationToken = default) + { + var data = new Fixture().Create(); + + return Task.FromResult(GetUserByIdResult.Ok(data)); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Api.Tests/Endpoints/Users/GetUserByIdTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Api.Tests/Endpoints/Users/GetUserByIdTests.verified.cs new file mode 100644 index 00000000..50e928bf --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Api.Tests/Endpoints/Users/GetUserByIdTests.verified.cs @@ -0,0 +1,21 @@ +namespace ExUsers.Api.Tests.Endpoints.Users; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class GetUserByIdTests : WebApiControllerBaseTest +{ + public GetUserByIdTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Api.Tests/Endpoints/Users/GetUsersHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Api.Tests/Endpoints/Users/GetUsersHandlerStub.verified.cs new file mode 100644 index 00000000..d9eead27 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Api.Tests/Endpoints/Users/GetUsersHandlerStub.verified.cs @@ -0,0 +1,19 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Tests.Endpoints.Users; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetUsersHandlerStub : IGetUsersHandler +{ + public Task ExecuteAsync( + CancellationToken cancellationToken = default) + { + var data = new Fixture().Create>(); + + return Task.FromResult(GetUsersResult.Ok(data)); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Api.Tests/Endpoints/Users/GetUsersTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Api.Tests/Endpoints/Users/GetUsersTests.verified.cs new file mode 100644 index 00000000..52e87d2c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Api.Tests/Endpoints/Users/GetUsersTests.verified.cs @@ -0,0 +1,21 @@ +namespace ExUsers.Api.Tests.Endpoints.Users; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class GetUsersTests : WebApiControllerBaseTest +{ + public GetUsersTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Api.Tests/Endpoints/Users/PostUserHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Api.Tests/Endpoints/Users/PostUserHandlerStub.verified.cs new file mode 100644 index 00000000..9b84fd70 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Api.Tests/Endpoints/Users/PostUserHandlerStub.verified.cs @@ -0,0 +1,18 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Tests.Endpoints.Users; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class PostUserHandlerStub : IPostUserHandler +{ + public Task ExecuteAsync( + PostUserParameters parameters, + CancellationToken cancellationToken = default) + { + return Task.FromResult(PostUserResult.Created()); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Api.Tests/Endpoints/Users/PostUserTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Api.Tests/Endpoints/Users/PostUserTests.verified.cs new file mode 100644 index 00000000..d6260bfd --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Api.Tests/Endpoints/Users/PostUserTests.verified.cs @@ -0,0 +1,21 @@ +namespace ExUsers.Api.Tests.Endpoints.Users; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class PostUserTests : WebApiControllerBaseTest +{ + public PostUserTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Api.Tests/Endpoints/Users/UpdateUserByIdHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Api.Tests/Endpoints/Users/UpdateUserByIdHandlerStub.verified.cs new file mode 100644 index 00000000..8755fe63 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Api.Tests/Endpoints/Users/UpdateUserByIdHandlerStub.verified.cs @@ -0,0 +1,18 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Tests.Endpoints.Users; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateUserByIdHandlerStub : IUpdateUserByIdHandler +{ + public Task ExecuteAsync( + UpdateUserByIdParameters parameters, + CancellationToken cancellationToken = default) + { + return Task.FromResult(UpdateUserByIdResult.Ok("Hallo world")); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Api.Tests/Endpoints/Users/UpdateUserByIdTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Api.Tests/Endpoints/Users/UpdateUserByIdTests.verified.cs new file mode 100644 index 00000000..9388e352 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Api.Tests/Endpoints/Users/UpdateUserByIdTests.verified.cs @@ -0,0 +1,21 @@ +namespace ExUsers.Api.Tests.Endpoints.Users; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class UpdateUserByIdTests : WebApiControllerBaseTest +{ + public UpdateUserByIdTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Api.Tests/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Api.Tests/GlobalUsings.verified.cs new file mode 100644 index 00000000..e2a9a0c5 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Api.Tests/GlobalUsings.verified.cs @@ -0,0 +1,22 @@ +global using System.CodeDom.Compiler; +global using System.Reflection; +global using System.Text; +global using System.Text.Json; +global using System.Text.Json.Serialization; + +global using Atc.Rest.Options; +global using Atc.XUnit; + +global using AutoFixture; + +global using ExUsers.Api.Generated; +global using ExUsers.Api.Generated.Contracts.Users; + +global using Microsoft.AspNetCore.Hosting; +global using Microsoft.AspNetCore.Http; +global using Microsoft.AspNetCore.Mvc.Testing; +global using Microsoft.AspNetCore.TestHost; +global using Microsoft.Extensions.Configuration; +global using Microsoft.Extensions.DependencyInjection; + +global using Xunit; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Api.Tests/WebApiControllerBaseTest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Api.Tests/WebApiControllerBaseTest.verified.cs new file mode 100644 index 00000000..a797ea58 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Api.Tests/WebApiControllerBaseTest.verified.cs @@ -0,0 +1,56 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Tests; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public abstract class WebApiControllerBaseTest : IClassFixture +{ + protected readonly WebApiStartupFactory Factory; + + protected readonly HttpClient HttpClient; + + protected readonly IConfiguration Configuration; + + protected static JsonSerializerOptions? JsonSerializerOptions; + + protected WebApiControllerBaseTest(WebApiStartupFactory fixture) + { + this.Factory = fixture; + this.HttpClient = this.Factory.CreateClient(); + this.Configuration = new ConfigurationBuilder().Build(); + JsonSerializerOptions = new JsonSerializerOptions + { + PropertyNameCaseInsensitive = true, + Converters = + { + new JsonStringEnumConverter() + }, + }; + } + + protected static StringContent ToJson(object data) + => new(JsonSerializer.Serialize(data, JsonSerializerOptions), Encoding.UTF8, "application/json"); + + protected static StringContent Json(string data) + => new(data, Encoding.UTF8, "application/json"); + + protected static IFormFile GetTestFile() + { + var bytes = Encoding.UTF8.GetBytes("Hello World"); + var stream = new MemoryStream(bytes); + var formFile = new FormFile(stream, 0, stream.Length, "dummy", "dummy.txt") + { + Headers = new HeaderDictionary(), + ContentType = "application/octet-stream", + }; + + return formFile; + } + + protected static List GetTestFiles() + => new() { GetTestFile(), GetTestFile() }; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Api.Tests/WebApiStartupFactory.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Api.Tests/WebApiStartupFactory.verified.cs new file mode 100644 index 00000000..e6d92d34 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Api.Tests/WebApiStartupFactory.verified.cs @@ -0,0 +1,40 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Tests; + +/// +/// Factory for bootstrapping in memory tests. +/// Includes options to override configuration and service collection using a partial class. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public partial class WebApiStartupFactory : WebApplicationFactory +{ + protected override void ConfigureWebHost(IWebHostBuilder builder) + { + builder.ConfigureAppConfiguration(config => + { + ModifyConfiguration(config); + var integrationConfig = new ConfigurationBuilder() + .AddJsonFile("appsettings.integrationtest.json") + .Build(); + config.AddConfiguration(integrationConfig); + }); + + builder.ConfigureTestServices(services => + { + ModifyServices(services); + services.AddSingleton(); + services.AutoRegistrateServices( + Assembly.GetAssembly(typeof(ApiRegistration))!, + Assembly.GetAssembly(typeof(WebApiStartupFactory))!); + }); + } + + partial void ModifyConfiguration(IConfigurationBuilder config); + + partial void ModifyServices(IServiceCollection services); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Domain.Tests/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Domain.Tests/GlobalUsings.verified.cs new file mode 100644 index 00000000..8c927eb7 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Domain.Tests/GlobalUsings.verified.cs @@ -0,0 +1 @@ +global using Xunit; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Domain.Tests/Handlers/Users/DeleteUserByIdHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Domain.Tests/Handlers/Users/DeleteUserByIdHandlerTests.verified.cs new file mode 100644 index 00000000..c0b909bf --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Domain.Tests/Handlers/Users/DeleteUserByIdHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace ExUsers.Domain.Tests.Handlers.Users; + +public class DeleteUserByIdHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Domain.Tests/Handlers/Users/GetUserByIdHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Domain.Tests/Handlers/Users/GetUserByIdHandlerTests.verified.cs new file mode 100644 index 00000000..4b7c5919 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Domain.Tests/Handlers/Users/GetUserByIdHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace ExUsers.Domain.Tests.Handlers.Users; + +public class GetUserByIdHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Domain.Tests/Handlers/Users/GetUsersHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Domain.Tests/Handlers/Users/GetUsersHandlerTests.verified.cs new file mode 100644 index 00000000..9f2760ed --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Domain.Tests/Handlers/Users/GetUsersHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace ExUsers.Domain.Tests.Handlers.Users; + +public class GetUsersHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Domain.Tests/Handlers/Users/PostUserHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Domain.Tests/Handlers/Users/PostUserHandlerTests.verified.cs new file mode 100644 index 00000000..5d7c6619 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Domain.Tests/Handlers/Users/PostUserHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace ExUsers.Domain.Tests.Handlers.Users; + +public class PostUserHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Domain.Tests/Handlers/Users/UpdateUserByIdHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Domain.Tests/Handlers/Users/UpdateUserByIdHandlerTests.verified.cs new file mode 100644 index 00000000..e6a30620 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WOPD/test/ExUsers.Domain.Tests/Handlers/Users/UpdateUserByIdHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace ExUsers.Domain.Tests.Handlers.Users; + +public class UpdateUserByIdHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/ApiRegistration.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/ApiRegistration.verified.cs new file mode 100644 index 00000000..4baeacd5 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/ApiRegistration.verified.cs @@ -0,0 +1,12 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Generated; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ApiRegistration +{ +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Interfaces/IDeleteUserByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Interfaces/IDeleteUserByIdHandler.verified.cs new file mode 100644 index 00000000..622d5268 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Interfaces/IDeleteUserByIdHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Generated.Contracts.Users; + +/// +/// Domain Interface for RequestHandler. +/// Description: Delete user by id. +/// Operation: DeleteUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IDeleteUserByIdHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + DeleteUserByIdParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Interfaces/IGetUserByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Interfaces/IGetUserByIdHandler.verified.cs new file mode 100644 index 00000000..4002fb4e --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Interfaces/IGetUserByIdHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Generated.Contracts.Users; + +/// +/// Domain Interface for RequestHandler. +/// Description: Get user by id. +/// Operation: GetUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetUserByIdHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + GetUserByIdParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Interfaces/IGetUsersHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Interfaces/IGetUsersHandler.verified.cs new file mode 100644 index 00000000..8db29fc5 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Interfaces/IGetUsersHandler.verified.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Generated.Contracts.Users; + +/// +/// Domain Interface for RequestHandler. +/// Description: Get all users. +/// Operation: GetUsers. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IGetUsersHandler +{ + /// + /// Execute method. + /// + /// The cancellation token. + Task ExecuteAsync( + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Interfaces/IPostUserHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Interfaces/IPostUserHandler.verified.cs new file mode 100644 index 00000000..9ce7369c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Interfaces/IPostUserHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Generated.Contracts.Users; + +/// +/// Domain Interface for RequestHandler. +/// Description: Create a new user. +/// Operation: PostUser. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IPostUserHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + PostUserParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Interfaces/IUpdateUserByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Interfaces/IUpdateUserByIdHandler.verified.cs new file mode 100644 index 00000000..fb9f0040 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Interfaces/IUpdateUserByIdHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Generated.Contracts.Users; + +/// +/// Domain Interface for RequestHandler. +/// Description: Update user by id. +/// Operation: UpdateUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IUpdateUserByIdHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + UpdateUserByIdParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Models/Address.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Models/Address.verified.cs new file mode 100644 index 00000000..1a1a942f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Models/Address.verified.cs @@ -0,0 +1,32 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Generated.Contracts.Users; + +/// +/// Address. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Address +{ + [StringLength(255)] + public string StreetName { get; set; } + + public string StreetNumber { get; set; } + + public string PostalCode { get; set; } + + public string CityName { get; set; } + + /// + /// Country. + /// + public Country MyCountry { get; set; } + + /// + public override string ToString() + => $"{nameof(StreetName)}: {StreetName}, {nameof(StreetNumber)}: {StreetNumber}, {nameof(PostalCode)}: {PostalCode}, {nameof(CityName)}: {CityName}, {nameof(MyCountry)}: ({MyCountry})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Models/Country.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Models/Country.verified.cs new file mode 100644 index 00000000..77092361 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Models/Country.verified.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Generated.Contracts.Users; + +/// +/// Country. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Country +{ + [Required] + public string Name { get; set; } + + [Required] + [MinLength(2)] + [MaxLength(2)] + [RegularExpression("^[A-Za-z]{2}$")] + public string Alpha2Code { get; set; } + + [Required] + [MinLength(3)] + [MaxLength(3)] + [RegularExpression("^[A-Za-z]{3}$")] + public string Alpha3Code { get; set; } + + /// + public override string ToString() + => $"{nameof(Name)}: {Name}, {nameof(Alpha2Code)}: {Alpha2Code}, {nameof(Alpha3Code)}: {Alpha3Code}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Models/CreateUserRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Models/CreateUserRequest.verified.cs new file mode 100644 index 00000000..d1292c97 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Models/CreateUserRequest.verified.cs @@ -0,0 +1,56 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Generated.Contracts.Users; + +/// +/// Request to create a user. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class CreateUserRequest +{ + [Required] + public string FirstName { get; set; } + + [Required] + public string LastName { get; set; } + + public DateTimeOffset? MyNullableDateTime { get; set; } + + [Required] + public DateTimeOffset MyDateTime { get; set; } + + /// + /// Undefined description. + /// + /// + /// Email validation being enforced. + /// + [Required] + [EmailAddress] + public string Email { get; set; } + + /// + /// Undefined description. + /// + /// + /// Url validation being enforced. + /// + [Uri] + public Uri Homepage { get; set; } + + /// + /// GenderType. + /// + [Required] + public GenderType Gender { get; set; } + + public Address? MyNullableAddress { get; set; } + + /// + public override string ToString() + => $"{nameof(FirstName)}: {FirstName}, {nameof(LastName)}: {LastName}, {nameof(MyNullableDateTime)}: ({MyNullableDateTime}), {nameof(MyDateTime)}: ({MyDateTime}), {nameof(Email)}: {Email}, {nameof(Homepage)}: ({Homepage}), {nameof(Gender)}: {Gender}, {nameof(MyNullableAddress)}: ({MyNullableAddress})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Models/UpdateUserRequest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Models/UpdateUserRequest.verified.cs new file mode 100644 index 00000000..dca64c4d --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Models/UpdateUserRequest.verified.cs @@ -0,0 +1,36 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Generated.Contracts.Users; + +/// +/// Request to update a user. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateUserRequest +{ + public string FirstName { get; set; } + + public string LastName { get; set; } + + /// + /// Undefined description. + /// + /// + /// Email validation being enforced. + /// + [EmailAddress] + public string Email { get; set; } + + /// + /// GenderType. + /// + public GenderType Gender { get; set; } + + /// + public override string ToString() + => $"{nameof(FirstName)}: {FirstName}, {nameof(LastName)}: {LastName}, {nameof(Email)}: {Email}, {nameof(Gender)}: {Gender}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Models/User.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Models/User.verified.cs new file mode 100644 index 00000000..2c2423b7 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Models/User.verified.cs @@ -0,0 +1,57 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Generated.Contracts.Users; + +/// +/// A single user. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class User +{ + public Guid Id { get; set; } + + /// + /// GenderType. + /// + public GenderType Gender { get; set; } + + public string FirstName { get; set; } + + public string LastName { get; set; } + + /// + /// Undefined description. + /// + /// + /// Email validation being enforced. + /// + [EmailAddress] + public string Email { get; set; } + + /// + /// Undefined description. + /// + /// + /// Url validation being enforced. + /// + [Uri] + public Uri Homepage { get; set; } + + /// + /// Address. + /// + public Address HomeAddress { get; set; } + + /// + /// Address. + /// + public Address CompanyAddress { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(Gender)}: {Gender}, {nameof(FirstName)}: {FirstName}, {nameof(LastName)}: {LastName}, {nameof(Email)}: {Email}, {nameof(Homepage)}: ({Homepage}), {nameof(HomeAddress)}: ({HomeAddress}), {nameof(CompanyAddress)}: ({CompanyAddress})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Models/Users.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Models/Users.verified.cs new file mode 100644 index 00000000..1381b695 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Models/Users.verified.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Generated.Contracts.Users; + +/// +/// A list of users. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Users +{ + /// + /// A list of User. + /// + public List UserList { get; set; } = new List(); + + /// + public override string ToString() + => $"{nameof(UserList)}.Count: {UserList?.Count ?? 0}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Parameters/DeleteUserByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Parameters/DeleteUserByIdParameters.verified.cs new file mode 100644 index 00000000..3bb7845f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Parameters/DeleteUserByIdParameters.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Generated.Contracts.Users; + +/// +/// Parameters for operation request. +/// Description: Delete user by id. +/// Operation: DeleteUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class DeleteUserByIdParameters +{ + /// + /// Id of the user. + /// + [FromRoute(Name = "id")] + [Required] + public Guid Id { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Parameters/GetUserByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Parameters/GetUserByIdParameters.verified.cs new file mode 100644 index 00000000..71fdd1cf --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Parameters/GetUserByIdParameters.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Generated.Contracts.Users; + +/// +/// Parameters for operation request. +/// Description: Get user by id. +/// Operation: GetUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetUserByIdParameters +{ + /// + /// Id of the user. + /// + [FromRoute(Name = "id")] + [Required] + public Guid Id { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Parameters/PostUserParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Parameters/PostUserParameters.verified.cs new file mode 100644 index 00000000..0e2edee0 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Parameters/PostUserParameters.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Generated.Contracts.Users; + +/// +/// Parameters for operation request. +/// Description: Create a new user. +/// Operation: PostUser. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class PostUserParameters +{ + /// + /// Request to create a user. + /// + [FromBody] + [Required] + public CreateUserRequest Request { get; set; } + + /// + public override string ToString() + => $"{nameof(Request)}: ({Request})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Parameters/UpdateUserByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Parameters/UpdateUserByIdParameters.verified.cs new file mode 100644 index 00000000..52c6e1d8 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Parameters/UpdateUserByIdParameters.verified.cs @@ -0,0 +1,34 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Generated.Contracts.Users; + +/// +/// Parameters for operation request. +/// Description: Update user by id. +/// Operation: UpdateUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateUserByIdParameters +{ + /// + /// Id of the user. + /// + [FromRoute(Name = "id")] + [Required] + public Guid Id { get; set; } + + /// + /// Request to update a user. + /// + [FromBody] + [Required] + public UpdateUserRequest Request { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(Request)}: ({Request})"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Results/DeleteUserByIdResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Results/DeleteUserByIdResult.verified.cs new file mode 100644 index 00000000..fb7e0283 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Results/DeleteUserByIdResult.verified.cs @@ -0,0 +1,42 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Generated.Contracts.Users; + +/// +/// Results for operation request. +/// Description: Delete user by id. +/// Operation: DeleteUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class DeleteUserByIdResult : ResultBase +{ + private DeleteUserByIdResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static DeleteUserByIdResult Ok(string? message = null) + => new DeleteUserByIdResult(new OkObjectResult(message)); + + /// + /// 404 - NotFound response. + /// + public static DeleteUserByIdResult NotFound(string? message = null) + => new DeleteUserByIdResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.NotFound, message)); + + /// + /// 409 - Conflict response. + /// + public static DeleteUserByIdResult Conflict(string? message = null) + => new DeleteUserByIdResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.Conflict, message)); + + /// + /// Performs an implicit conversion from DeleteUserByIdResult to ActionResult. + /// + public static implicit operator DeleteUserByIdResult(string response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Results/GetUserByIdResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Results/GetUserByIdResult.verified.cs new file mode 100644 index 00000000..e2bebc9c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Results/GetUserByIdResult.verified.cs @@ -0,0 +1,42 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Generated.Contracts.Users; + +/// +/// Results for operation request. +/// Description: Get user by id. +/// Operation: GetUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetUserByIdResult : ResultBase +{ + private GetUserByIdResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static GetUserByIdResult Ok(User response) + => new GetUserByIdResult(new OkObjectResult(response)); + + /// + /// 404 - NotFound response. + /// + public static GetUserByIdResult NotFound(string? message = null) + => new GetUserByIdResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.NotFound, message)); + + /// + /// 409 - Conflict response. + /// + public static GetUserByIdResult Conflict(string? message = null) + => new GetUserByIdResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.Conflict, message)); + + /// + /// Performs an implicit conversion from GetUserByIdResult to ActionResult. + /// + public static implicit operator GetUserByIdResult(User response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Results/GetUsersResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Results/GetUsersResult.verified.cs new file mode 100644 index 00000000..4f3ee7c4 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Results/GetUsersResult.verified.cs @@ -0,0 +1,36 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Generated.Contracts.Users; + +/// +/// Results for operation request. +/// Description: Get all users. +/// Operation: GetUsers. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetUsersResult : ResultBase +{ + private GetUsersResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static GetUsersResult Ok(IEnumerable response) + => new GetUsersResult(new OkObjectResult(response ?? Enumerable.Empty())); + + /// + /// 409 - Conflict response. + /// + public static GetUsersResult Conflict(string? message = null) + => new GetUsersResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.Conflict, message)); + + /// + /// Performs an implicit conversion from GetUsersResult to ActionResult. + /// + public static implicit operator GetUsersResult(List response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Results/PostUserResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Results/PostUserResult.verified.cs new file mode 100644 index 00000000..6d515f46 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Results/PostUserResult.verified.cs @@ -0,0 +1,36 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Generated.Contracts.Users; + +/// +/// Results for operation request. +/// Description: Create a new user. +/// Operation: PostUser. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class PostUserResult : ResultBase +{ + private PostUserResult(ActionResult result) : base(result) { } + + /// + /// 201 - Created response. + /// + public static PostUserResult Created(string? uri = null) + => new PostUserResult(ResultFactory.CreateContentResult(HttpStatusCode.Created, uri)); + + /// + /// 400 - BadRequest response. + /// + public static PostUserResult BadRequest(string? message = null) + => new PostUserResult(ResultFactory.CreateContentResultWithValidationProblemDetails(HttpStatusCode.BadRequest, message)); + + /// + /// 409 - Conflict response. + /// + public static PostUserResult Conflict(string? message = null) + => new PostUserResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.Conflict, message)); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Results/UpdateUserByIdResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Results/UpdateUserByIdResult.verified.cs new file mode 100644 index 00000000..ac8d5bdf --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/Users/Results/UpdateUserByIdResult.verified.cs @@ -0,0 +1,48 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Generated.Contracts.Users; + +/// +/// Results for operation request. +/// Description: Update user by id. +/// Operation: UpdateUserById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateUserByIdResult : ResultBase +{ + private UpdateUserByIdResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static UpdateUserByIdResult Ok(string? message = null) + => new UpdateUserByIdResult(new OkObjectResult(message)); + + /// + /// 400 - BadRequest response. + /// + public static UpdateUserByIdResult BadRequest(string? message = null) + => new UpdateUserByIdResult(ResultFactory.CreateContentResultWithValidationProblemDetails(HttpStatusCode.BadRequest, message)); + + /// + /// 404 - NotFound response. + /// + public static UpdateUserByIdResult NotFound(string? message = null) + => new UpdateUserByIdResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.NotFound, message)); + + /// + /// 409 - Conflict response. + /// + public static UpdateUserByIdResult Conflict(string? message = null) + => new UpdateUserByIdResult(ResultFactory.CreateContentResultWithProblemDetails(HttpStatusCode.Conflict, message)); + + /// + /// Performs an implicit conversion from UpdateUserByIdResult to ActionResult. + /// + public static implicit operator UpdateUserByIdResult(string response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/_EnumerationTypes/GenderType.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/_EnumerationTypes/GenderType.verified.cs new file mode 100644 index 00000000..c7fe94b2 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Contracts/_EnumerationTypes/GenderType.verified.cs @@ -0,0 +1,19 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Generated.Contracts; + +/// +/// Enumeration: GenderType. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public enum GenderType +{ + None, + NonBinary, + Male, + Female, +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Endpoints/UsersController.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Endpoints/UsersController.verified.cs new file mode 100644 index 00000000..42d4d30d --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/Endpoints/UsersController.verified.cs @@ -0,0 +1,93 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Generated.Endpoints; + +/// +/// Endpoint definitions. +/// +[Authorize] +[ApiController] +[Route("/api/v1/users")] +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public sealed class UsersController : ControllerBase +{ + /// + /// Description: Get all users. + /// Operation: GetUsers. + /// + [HttpGet] + [ProducesResponseType(typeof(IEnumerable), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status409Conflict)] + public async Task GetUsers( + [FromServices] IGetUsersHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(cancellationToken); + + /// + /// Description: Create a new user. + /// Operation: PostUser. + /// + [HttpPost] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status201Created)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status409Conflict)] + public async Task PostUser( + PostUserParameters parameters, + [FromServices] IPostUserHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); + + /// + /// Description: Get user by id. + /// Operation: GetUserById. + /// + [HttpGet("{id}")] + [ProducesResponseType(typeof(User), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status409Conflict)] + public async Task GetUserById( + GetUserByIdParameters parameters, + [FromServices] IGetUserByIdHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); + + /// + /// Description: Update user by id. + /// Operation: UpdateUserById. + /// + [HttpPut("{id}")] + [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status409Conflict)] + public async Task UpdateUserById( + UpdateUserByIdParameters parameters, + [FromServices] IUpdateUserByIdHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); + + /// + /// Description: Delete user by id. + /// Operation: DeleteUserById. + /// + [HttpDelete("{id}")] + [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status409Conflict)] + public async Task DeleteUserById( + DeleteUserByIdParameters parameters, + [FromServices] IDeleteUserByIdHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/GlobalUsings.verified.cs new file mode 100644 index 00000000..3d2cda0e --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api.Generated/GlobalUsings.verified.cs @@ -0,0 +1,11 @@ +global using System.CodeDom.Compiler; +global using System.ComponentModel.DataAnnotations; +global using System.Net; + +global using Atc.Rest.Results; + +global using ExUsers.Api.Generated.Contracts.Users; + +global using Microsoft.AspNetCore.Authorization; +global using Microsoft.AspNetCore.Http; +global using Microsoft.AspNetCore.Mvc; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api/GlobalUsings.verified.cs new file mode 100644 index 00000000..bfa54760 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api/GlobalUsings.verified.cs @@ -0,0 +1,15 @@ +global using System.CodeDom.Compiler; +global using System.Reflection; + +global using Asp.Versioning.ApiExplorer; + +global using Atc.Rest.Extended.Options; + +global using ExUsers.Api.Generated; +global using ExUsers.Api.Options; +global using ExUsers.Domain; + +global using Microsoft.Extensions.Options; +global using Microsoft.OpenApi.Models; + +global using Swashbuckle.AspNetCore.SwaggerGen; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api/Options/ConfigureSwaggerDocOptions.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api/Options/ConfigureSwaggerDocOptions.verified.cs new file mode 100644 index 00000000..bc5147e7 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api/Options/ConfigureSwaggerDocOptions.verified.cs @@ -0,0 +1,39 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Options; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ConfigureSwaggerDocOptions : IConfigureOptions +{ + private readonly IApiVersionDescriptionProvider provider; + + public ConfigureSwaggerDocOptions( + IApiVersionDescriptionProvider provider) + => this.provider = provider; + + public void Configure( + SwaggerGenOptions options) + { + foreach (var version in provider.ApiVersionDescriptions) + { + options.SwaggerDoc( + version.GroupName, + new OpenApiInfo + { + Version = "1.0", + Title = "Demo Users Api", + Description = "Demo Users Api - SingleFileVersion", + Contact = new OpenApiContact + { + Name = "atc-net A/S", + }, + }); + } + + options.IncludeXmlComments(Path.ChangeExtension(GetType().Assembly.Location, "xml")); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api/Program.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api/Program.verified.cs new file mode 100644 index 00000000..1f7dfbf9 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api/Program.verified.cs @@ -0,0 +1,23 @@ +namespace ExUsers.Api; + +public static class Program +{ + public static void Main(string[] args) + { + CreateHostBuilder(args) + .Build() + .Run(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) + { + var builder = Host + .CreateDefaultBuilder(args) + .ConfigureWebHostDefaults(webBuilder => + { + webBuilder.UseStartup(); + }); + + return builder; + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api/Startup.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api/Startup.verified.cs new file mode 100644 index 00000000..0904c9d3 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Api/Startup.verified.cs @@ -0,0 +1,38 @@ +namespace ExUsers.Api; + +public class Startup +{ + private readonly RestApiExtendedOptions restApiOptions; + + public Startup( + IConfiguration configuration) + { + Configuration = configuration; + restApiOptions = new RestApiExtendedOptions + { + // TODO: Remove/out-comment/set to false this for production scenarios! + AllowAnonymousAccessForDevelopment = true, + }; + + restApiOptions.AddAssemblyPairs( + Assembly.GetAssembly(typeof(ApiRegistration)), + Assembly.GetAssembly(typeof(DomainRegistration))); + } + + public IConfiguration Configuration { get; } + + public void ConfigureServices( + IServiceCollection services) + { + services.ConfigureOptions(); + + services.AddRestApi(restApiOptions, Configuration); + } + + public void Configure( + IApplicationBuilder app, + IWebHostEnvironment env) + { + app.ConfigureRestApi(env, restApiOptions); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Domain/DomainRegistration.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Domain/DomainRegistration.verified.cs new file mode 100644 index 00000000..7628fe22 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Domain/DomainRegistration.verified.cs @@ -0,0 +1,12 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Domain; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class DomainRegistration +{ +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Domain/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Domain/GlobalUsings.verified.cs new file mode 100644 index 00000000..0c3db6f8 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Domain/GlobalUsings.verified.cs @@ -0,0 +1,3 @@ +global using System.CodeDom.Compiler; + +global using ExUsers.Api.Generated.Contracts.Users; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Domain/Handlers/Users/DeleteUserByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Domain/Handlers/Users/DeleteUserByIdHandler.verified.cs new file mode 100644 index 00000000..690df3b2 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Domain/Handlers/Users/DeleteUserByIdHandler.verified.cs @@ -0,0 +1,18 @@ +namespace ExUsers.Domain.Handlers.Users; + +/// +/// Handler for operation request. +/// Description: Delete user by id. +/// Operation: DeleteUserById. +/// +public class DeleteUserByIdHandler : IDeleteUserByIdHandler +{ + public Task ExecuteAsync( + DeleteUserByIdParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for DeleteUserByIdHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Domain/Handlers/Users/GetUserByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Domain/Handlers/Users/GetUserByIdHandler.verified.cs new file mode 100644 index 00000000..99b9377a --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Domain/Handlers/Users/GetUserByIdHandler.verified.cs @@ -0,0 +1,18 @@ +namespace ExUsers.Domain.Handlers.Users; + +/// +/// Handler for operation request. +/// Description: Get user by id. +/// Operation: GetUserById. +/// +public class GetUserByIdHandler : IGetUserByIdHandler +{ + public Task ExecuteAsync( + GetUserByIdParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for GetUserByIdHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Domain/Handlers/Users/GetUsersHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Domain/Handlers/Users/GetUsersHandler.verified.cs new file mode 100644 index 00000000..f88ae3dc --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Domain/Handlers/Users/GetUsersHandler.verified.cs @@ -0,0 +1,15 @@ +namespace ExUsers.Domain.Handlers.Users; + +/// +/// Handler for operation request. +/// Description: Get all users. +/// Operation: GetUsers. +/// +public class GetUsersHandler : IGetUsersHandler +{ + public Task ExecuteAsync( + CancellationToken cancellationToken = default) + { + throw new NotImplementedException("Add logic here for GetUsersHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Domain/Handlers/Users/PostUserHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Domain/Handlers/Users/PostUserHandler.verified.cs new file mode 100644 index 00000000..c4db3890 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Domain/Handlers/Users/PostUserHandler.verified.cs @@ -0,0 +1,18 @@ +namespace ExUsers.Domain.Handlers.Users; + +/// +/// Handler for operation request. +/// Description: Create a new user. +/// Operation: PostUser. +/// +public class PostUserHandler : IPostUserHandler +{ + public Task ExecuteAsync( + PostUserParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for PostUserHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Domain/Handlers/Users/UpdateUserByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Domain/Handlers/Users/UpdateUserByIdHandler.verified.cs new file mode 100644 index 00000000..2c6c3538 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/src/ExUsers.Domain/Handlers/Users/UpdateUserByIdHandler.verified.cs @@ -0,0 +1,18 @@ +namespace ExUsers.Domain.Handlers.Users; + +/// +/// Handler for operation request. +/// Description: Update user by id. +/// Operation: UpdateUserById. +/// +public class UpdateUserByIdHandler : IUpdateUserByIdHandler +{ + public Task ExecuteAsync( + UpdateUserByIdParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for UpdateUserByIdHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Api.Tests/Endpoints/Users/DeleteUserByIdHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Api.Tests/Endpoints/Users/DeleteUserByIdHandlerStub.verified.cs new file mode 100644 index 00000000..c6fb2cc7 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Api.Tests/Endpoints/Users/DeleteUserByIdHandlerStub.verified.cs @@ -0,0 +1,18 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Tests.Endpoints.Users; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class DeleteUserByIdHandlerStub : IDeleteUserByIdHandler +{ + public Task ExecuteAsync( + DeleteUserByIdParameters parameters, + CancellationToken cancellationToken = default) + { + return Task.FromResult(DeleteUserByIdResult.Ok("Hallo world")); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Api.Tests/Endpoints/Users/DeleteUserByIdTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Api.Tests/Endpoints/Users/DeleteUserByIdTests.verified.cs new file mode 100644 index 00000000..826d4567 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Api.Tests/Endpoints/Users/DeleteUserByIdTests.verified.cs @@ -0,0 +1,21 @@ +namespace ExUsers.Api.Tests.Endpoints.Users; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class DeleteUserByIdTests : WebApiControllerBaseTest +{ + public DeleteUserByIdTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Api.Tests/Endpoints/Users/GetUserByIdHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Api.Tests/Endpoints/Users/GetUserByIdHandlerStub.verified.cs new file mode 100644 index 00000000..8a125b11 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Api.Tests/Endpoints/Users/GetUserByIdHandlerStub.verified.cs @@ -0,0 +1,20 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Tests.Endpoints.Users; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetUserByIdHandlerStub : IGetUserByIdHandler +{ + public Task ExecuteAsync( + GetUserByIdParameters parameters, + CancellationToken cancellationToken = default) + { + var data = new Fixture().Create(); + + return Task.FromResult(GetUserByIdResult.Ok(data)); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Api.Tests/Endpoints/Users/GetUserByIdTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Api.Tests/Endpoints/Users/GetUserByIdTests.verified.cs new file mode 100644 index 00000000..50e928bf --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Api.Tests/Endpoints/Users/GetUserByIdTests.verified.cs @@ -0,0 +1,21 @@ +namespace ExUsers.Api.Tests.Endpoints.Users; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class GetUserByIdTests : WebApiControllerBaseTest +{ + public GetUserByIdTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Api.Tests/Endpoints/Users/GetUsersHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Api.Tests/Endpoints/Users/GetUsersHandlerStub.verified.cs new file mode 100644 index 00000000..d9eead27 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Api.Tests/Endpoints/Users/GetUsersHandlerStub.verified.cs @@ -0,0 +1,19 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Tests.Endpoints.Users; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class GetUsersHandlerStub : IGetUsersHandler +{ + public Task ExecuteAsync( + CancellationToken cancellationToken = default) + { + var data = new Fixture().Create>(); + + return Task.FromResult(GetUsersResult.Ok(data)); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Api.Tests/Endpoints/Users/GetUsersTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Api.Tests/Endpoints/Users/GetUsersTests.verified.cs new file mode 100644 index 00000000..52e87d2c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Api.Tests/Endpoints/Users/GetUsersTests.verified.cs @@ -0,0 +1,21 @@ +namespace ExUsers.Api.Tests.Endpoints.Users; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class GetUsersTests : WebApiControllerBaseTest +{ + public GetUsersTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Api.Tests/Endpoints/Users/PostUserHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Api.Tests/Endpoints/Users/PostUserHandlerStub.verified.cs new file mode 100644 index 00000000..9b84fd70 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Api.Tests/Endpoints/Users/PostUserHandlerStub.verified.cs @@ -0,0 +1,18 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Tests.Endpoints.Users; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class PostUserHandlerStub : IPostUserHandler +{ + public Task ExecuteAsync( + PostUserParameters parameters, + CancellationToken cancellationToken = default) + { + return Task.FromResult(PostUserResult.Created()); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Api.Tests/Endpoints/Users/PostUserTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Api.Tests/Endpoints/Users/PostUserTests.verified.cs new file mode 100644 index 00000000..d6260bfd --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Api.Tests/Endpoints/Users/PostUserTests.verified.cs @@ -0,0 +1,21 @@ +namespace ExUsers.Api.Tests.Endpoints.Users; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class PostUserTests : WebApiControllerBaseTest +{ + public PostUserTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Api.Tests/Endpoints/Users/UpdateUserByIdHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Api.Tests/Endpoints/Users/UpdateUserByIdHandlerStub.verified.cs new file mode 100644 index 00000000..8755fe63 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Api.Tests/Endpoints/Users/UpdateUserByIdHandlerStub.verified.cs @@ -0,0 +1,18 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Tests.Endpoints.Users; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class UpdateUserByIdHandlerStub : IUpdateUserByIdHandler +{ + public Task ExecuteAsync( + UpdateUserByIdParameters parameters, + CancellationToken cancellationToken = default) + { + return Task.FromResult(UpdateUserByIdResult.Ok("Hallo world")); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Api.Tests/Endpoints/Users/UpdateUserByIdTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Api.Tests/Endpoints/Users/UpdateUserByIdTests.verified.cs new file mode 100644 index 00000000..9388e352 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Api.Tests/Endpoints/Users/UpdateUserByIdTests.verified.cs @@ -0,0 +1,21 @@ +namespace ExUsers.Api.Tests.Endpoints.Users; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class UpdateUserByIdTests : WebApiControllerBaseTest +{ + public UpdateUserByIdTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Api.Tests/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Api.Tests/GlobalUsings.verified.cs new file mode 100644 index 00000000..e2a9a0c5 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Api.Tests/GlobalUsings.verified.cs @@ -0,0 +1,22 @@ +global using System.CodeDom.Compiler; +global using System.Reflection; +global using System.Text; +global using System.Text.Json; +global using System.Text.Json.Serialization; + +global using Atc.Rest.Options; +global using Atc.XUnit; + +global using AutoFixture; + +global using ExUsers.Api.Generated; +global using ExUsers.Api.Generated.Contracts.Users; + +global using Microsoft.AspNetCore.Hosting; +global using Microsoft.AspNetCore.Http; +global using Microsoft.AspNetCore.Mvc.Testing; +global using Microsoft.AspNetCore.TestHost; +global using Microsoft.Extensions.Configuration; +global using Microsoft.Extensions.DependencyInjection; + +global using Xunit; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Api.Tests/WebApiControllerBaseTest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Api.Tests/WebApiControllerBaseTest.verified.cs new file mode 100644 index 00000000..a797ea58 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Api.Tests/WebApiControllerBaseTest.verified.cs @@ -0,0 +1,56 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Tests; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public abstract class WebApiControllerBaseTest : IClassFixture +{ + protected readonly WebApiStartupFactory Factory; + + protected readonly HttpClient HttpClient; + + protected readonly IConfiguration Configuration; + + protected static JsonSerializerOptions? JsonSerializerOptions; + + protected WebApiControllerBaseTest(WebApiStartupFactory fixture) + { + this.Factory = fixture; + this.HttpClient = this.Factory.CreateClient(); + this.Configuration = new ConfigurationBuilder().Build(); + JsonSerializerOptions = new JsonSerializerOptions + { + PropertyNameCaseInsensitive = true, + Converters = + { + new JsonStringEnumConverter() + }, + }; + } + + protected static StringContent ToJson(object data) + => new(JsonSerializer.Serialize(data, JsonSerializerOptions), Encoding.UTF8, "application/json"); + + protected static StringContent Json(string data) + => new(data, Encoding.UTF8, "application/json"); + + protected static IFormFile GetTestFile() + { + var bytes = Encoding.UTF8.GetBytes("Hello World"); + var stream = new MemoryStream(bytes); + var formFile = new FormFile(stream, 0, stream.Length, "dummy", "dummy.txt") + { + Headers = new HeaderDictionary(), + ContentType = "application/octet-stream", + }; + + return formFile; + } + + protected static List GetTestFiles() + => new() { GetTestFile(), GetTestFile() }; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Api.Tests/WebApiStartupFactory.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Api.Tests/WebApiStartupFactory.verified.cs new file mode 100644 index 00000000..e6d92d34 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Api.Tests/WebApiStartupFactory.verified.cs @@ -0,0 +1,40 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace ExUsers.Api.Tests; + +/// +/// Factory for bootstrapping in memory tests. +/// Includes options to override configuration and service collection using a partial class. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public partial class WebApiStartupFactory : WebApplicationFactory +{ + protected override void ConfigureWebHost(IWebHostBuilder builder) + { + builder.ConfigureAppConfiguration(config => + { + ModifyConfiguration(config); + var integrationConfig = new ConfigurationBuilder() + .AddJsonFile("appsettings.integrationtest.json") + .Build(); + config.AddConfiguration(integrationConfig); + }); + + builder.ConfigureTestServices(services => + { + ModifyServices(services); + services.AddSingleton(); + services.AutoRegistrateServices( + Assembly.GetAssembly(typeof(ApiRegistration))!, + Assembly.GetAssembly(typeof(WebApiStartupFactory))!); + }); + } + + partial void ModifyConfiguration(IConfigurationBuilder config); + + partial void ModifyServices(IServiceCollection services); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Domain.Tests/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Domain.Tests/GlobalUsings.verified.cs new file mode 100644 index 00000000..8c927eb7 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Domain.Tests/GlobalUsings.verified.cs @@ -0,0 +1 @@ +global using Xunit; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Domain.Tests/Handlers/Users/DeleteUserByIdHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Domain.Tests/Handlers/Users/DeleteUserByIdHandlerTests.verified.cs new file mode 100644 index 00000000..c0b909bf --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Domain.Tests/Handlers/Users/DeleteUserByIdHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace ExUsers.Domain.Tests.Handlers.Users; + +public class DeleteUserByIdHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Domain.Tests/Handlers/Users/GetUserByIdHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Domain.Tests/Handlers/Users/GetUserByIdHandlerTests.verified.cs new file mode 100644 index 00000000..4b7c5919 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Domain.Tests/Handlers/Users/GetUserByIdHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace ExUsers.Domain.Tests.Handlers.Users; + +public class GetUserByIdHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Domain.Tests/Handlers/Users/GetUsersHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Domain.Tests/Handlers/Users/GetUsersHandlerTests.verified.cs new file mode 100644 index 00000000..9f2760ed --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Domain.Tests/Handlers/Users/GetUsersHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace ExUsers.Domain.Tests.Handlers.Users; + +public class GetUsersHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Domain.Tests/Handlers/Users/PostUserHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Domain.Tests/Handlers/Users/PostUserHandlerTests.verified.cs new file mode 100644 index 00000000..5d7c6619 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Domain.Tests/Handlers/Users/PostUserHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace ExUsers.Domain.Tests.Handlers.Users; + +public class PostUserHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Domain.Tests/Handlers/Users/UpdateUserByIdHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Domain.Tests/Handlers/Users/UpdateUserByIdHandlerTests.verified.cs new file mode 100644 index 00000000..e6a30620 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/ExUsers/VerifyServerAll/Mvc_WPD/test/ExUsers.Domain.Tests/Handlers/Users/UpdateUserByIdHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace ExUsers.Domain.Tests.Handlers.Users; + +public class UpdateUserByIdHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/PetStoreApi.yaml b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/PetStore.yaml similarity index 100% rename from test/Atc.Rest.ApiGenerator.CLI.Tests/PetStoreApi/PetStoreApi.yaml rename to test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/PetStore.yaml diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WOPD/src/PetStore.ApiClient.Generated/Contracts/Pets/Error.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WOPD/src/PetStore.ApiClient.Generated/Contracts/Pets/Error.verified.cs new file mode 100644 index 00000000..d959eb73 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WOPD/src/PetStore.ApiClient.Generated/Contracts/Pets/Error.verified.cs @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.ApiClient.Generated.Contracts.Pets; + +/// +/// Error. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Error +{ + [Required] + public int Code { get; set; } + + [Required] + public string Message { get; set; } + + /// + public override string ToString() + => $"{nameof(Code)}: {Code}, {nameof(Message)}: {Message}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WOPD/src/PetStore.ApiClient.Generated/Contracts/Pets/Pet.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WOPD/src/PetStore.ApiClient.Generated/Contracts/Pets/Pet.verified.cs new file mode 100644 index 00000000..f3ea5030 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WOPD/src/PetStore.ApiClient.Generated/Contracts/Pets/Pet.verified.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.ApiClient.Generated.Contracts.Pets; + +/// +/// Pet. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Pet +{ + [Required] + public long Id { get; set; } + + [Required] + public string Name { get; set; } + + public string Tag { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(Name)}: {Name}, {nameof(Tag)}: {Tag}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WOPD/src/PetStore.ApiClient.Generated/Contracts/Pets/Pets.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WOPD/src/PetStore.ApiClient.Generated/Contracts/Pets/Pets.verified.cs new file mode 100644 index 00000000..1cb5e0c7 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WOPD/src/PetStore.ApiClient.Generated/Contracts/Pets/Pets.verified.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.ApiClient.Generated.Contracts.Pets; + +/// +/// Pets. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Pets +{ + /// + /// A list of Pet. + /// + public List PetList { get; set; } = new List(); + + /// + public override string ToString() + => $"{nameof(PetList)}.Count: {PetList?.Count ?? 0}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WOPD/src/PetStore.ApiClient.Generated/Contracts/Pets/RequestParameters/ListPetsParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WOPD/src/PetStore.ApiClient.Generated/Contracts/Pets/RequestParameters/ListPetsParameters.verified.cs new file mode 100644 index 00000000..a4a03f33 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WOPD/src/PetStore.ApiClient.Generated/Contracts/Pets/RequestParameters/ListPetsParameters.verified.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.ApiClient.Generated.Contracts.Pets; + +/// +/// Parameters for operation request. +/// Description: List all pets. +/// Operation: ListPets. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ListPetsParameters +{ + /// + /// How many items to return at one time (max 100). + /// + [Range(-2147483648, 100)] + public int Limit { get; set; } + + /// + public override string ToString() + => $"{nameof(Limit)}: {Limit}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WOPD/src/PetStore.ApiClient.Generated/Contracts/Pets/RequestParameters/ShowPetByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WOPD/src/PetStore.ApiClient.Generated/Contracts/Pets/RequestParameters/ShowPetByIdParameters.verified.cs new file mode 100644 index 00000000..e6c8d542 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WOPD/src/PetStore.ApiClient.Generated/Contracts/Pets/RequestParameters/ShowPetByIdParameters.verified.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.ApiClient.Generated.Contracts.Pets; + +/// +/// Parameters for operation request. +/// Description: Info for a specific pet. +/// Operation: ShowPetById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ShowPetByIdParameters +{ + /// + /// The id of the pet to retrieve. + /// + [Required] + public string PetId { get; set; } + + /// + public override string ToString() + => $"{nameof(PetId)}: {PetId}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WOPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/CreatePetsEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WOPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/CreatePetsEndpoint.verified.cs new file mode 100644 index 00000000..fa7898bd --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WOPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/CreatePetsEndpoint.verified.cs @@ -0,0 +1,44 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.ApiClient.Generated.Endpoints.Pets; + +/// +/// Client Endpoint. +/// Description: Create a pet. +/// Operation: CreatePets. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class CreatePetsEndpoint : ICreatePetsEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public CreatePetsEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + string httpClientName = "PetStore-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/v1/pets"); + + using var requestMessage = requestBuilder.Build(HttpMethod.Post); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddErrorResponse(HttpStatusCode.Created); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + return await responseBuilder.BuildResponseAsync(x => new CreatePetsEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WOPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/CreatePetsEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WOPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/CreatePetsEndpointResult.verified.cs new file mode 100644 index 00000000..e62db02e --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WOPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/CreatePetsEndpointResult.verified.cs @@ -0,0 +1,37 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.ApiClient.Generated.Endpoints.Pets; + +/// +/// Client Endpoint result. +/// Description: Create a pet. +/// Operation: CreatePets. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class CreatePetsEndpointResult : EndpointResponse, ICreatePetsEndpointResult +{ + public CreatePetsEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsCreated + => StatusCode == HttpStatusCode.Created; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public string? CreatedContent + => IsCreated && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsCreated property first."); + + public string? UnauthorizedContent + => IsUnauthorized && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WOPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/Interfaces/ICreatePetsEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WOPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/Interfaces/ICreatePetsEndpoint.verified.cs new file mode 100644 index 00000000..b68ab352 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WOPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/Interfaces/ICreatePetsEndpoint.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.ApiClient.Generated.Endpoints.Pets.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Create a pet. +/// Operation: CreatePets. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface ICreatePetsEndpoint +{ + /// + /// Execute method. + /// + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + string httpClientName = "PetStore-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WOPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/Interfaces/ICreatePetsEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WOPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/Interfaces/ICreatePetsEndpointResult.verified.cs new file mode 100644 index 00000000..1c03f32e --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WOPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/Interfaces/ICreatePetsEndpointResult.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.ApiClient.Generated.Endpoints.Pets.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Create a pet. +/// Operation: CreatePets. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface ICreatePetsEndpointResult : IEndpointResponse +{ + + bool IsCreated { get; } + + bool IsUnauthorized { get; } + + string? CreatedContent { get; } + + string? UnauthorizedContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WOPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/Interfaces/IListPetsEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WOPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/Interfaces/IListPetsEndpoint.verified.cs new file mode 100644 index 00000000..c55ff45f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WOPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/Interfaces/IListPetsEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.ApiClient.Generated.Endpoints.Pets.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: List all pets. +/// Operation: ListPets. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IListPetsEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + ListPetsParameters parameters, + string httpClientName = "PetStore-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WOPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/Interfaces/IListPetsEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WOPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/Interfaces/IListPetsEndpointResult.verified.cs new file mode 100644 index 00000000..7ae5facd --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WOPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/Interfaces/IListPetsEndpointResult.verified.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.ApiClient.Generated.Endpoints.Pets.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: List all pets. +/// Operation: ListPets. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IListPetsEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + IEnumerable OkContent { get; } + + string? BadRequestContent { get; } + + string? UnauthorizedContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WOPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/Interfaces/IShowPetByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WOPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/Interfaces/IShowPetByIdEndpoint.verified.cs new file mode 100644 index 00000000..bfb5f78d --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WOPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/Interfaces/IShowPetByIdEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.ApiClient.Generated.Endpoints.Pets.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Info for a specific pet. +/// Operation: ShowPetById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IShowPetByIdEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + ShowPetByIdParameters parameters, + string httpClientName = "PetStore-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WOPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/Interfaces/IShowPetByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WOPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/Interfaces/IShowPetByIdEndpointResult.verified.cs new file mode 100644 index 00000000..d421cb2f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WOPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/Interfaces/IShowPetByIdEndpointResult.verified.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.ApiClient.Generated.Endpoints.Pets.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Info for a specific pet. +/// Operation: ShowPetById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IShowPetByIdEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + Pet OkContent { get; } + + string? BadRequestContent { get; } + + string? UnauthorizedContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WOPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/ListPetsEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WOPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/ListPetsEndpoint.verified.cs new file mode 100644 index 00000000..84e9c591 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WOPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/ListPetsEndpoint.verified.cs @@ -0,0 +1,47 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.ApiClient.Generated.Endpoints.Pets; + +/// +/// Client Endpoint. +/// Description: List all pets. +/// Operation: ListPets. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ListPetsEndpoint : IListPetsEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public ListPetsEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + ListPetsParameters parameters, + string httpClientName = "PetStore-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/v1/pets"); + requestBuilder.WithQueryParameter("limit", parameters.Limit); + + using var requestMessage = requestBuilder.Build(HttpMethod.Get); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse>(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + return await responseBuilder.BuildResponseAsync(x => new ListPetsEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WOPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/ListPetsEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WOPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/ListPetsEndpointResult.verified.cs new file mode 100644 index 00000000..f5cd5ce5 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WOPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/ListPetsEndpointResult.verified.cs @@ -0,0 +1,45 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.ApiClient.Generated.Endpoints.Pets; + +/// +/// Client Endpoint result. +/// Description: List all pets. +/// Operation: ListPets. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ListPetsEndpointResult : EndpointResponse, IListPetsEndpointResult +{ + public ListPetsEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public IEnumerable OkContent + => IsOk && ContentObject is IEnumerable result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public string? BadRequestContent + => IsBadRequest && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public string? UnauthorizedContent + => IsUnauthorized && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WOPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/ShowPetByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WOPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/ShowPetByIdEndpoint.verified.cs new file mode 100644 index 00000000..a09f1ad2 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WOPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/ShowPetByIdEndpoint.verified.cs @@ -0,0 +1,47 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.ApiClient.Generated.Endpoints.Pets; + +/// +/// Client Endpoint. +/// Description: Info for a specific pet. +/// Operation: ShowPetById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ShowPetByIdEndpoint : IShowPetByIdEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public ShowPetByIdEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + ShowPetByIdParameters parameters, + string httpClientName = "PetStore-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/v1/pets/{petId}"); + requestBuilder.WithPathParameter("petId", parameters.PetId); + + using var requestMessage = requestBuilder.Build(HttpMethod.Get); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + return await responseBuilder.BuildResponseAsync(x => new ShowPetByIdEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WOPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/ShowPetByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WOPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/ShowPetByIdEndpointResult.verified.cs new file mode 100644 index 00000000..4be5064d --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WOPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/ShowPetByIdEndpointResult.verified.cs @@ -0,0 +1,45 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.ApiClient.Generated.Endpoints.Pets; + +/// +/// Client Endpoint result. +/// Description: Info for a specific pet. +/// Operation: ShowPetById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ShowPetByIdEndpointResult : EndpointResponse, IShowPetByIdEndpointResult +{ + public ShowPetByIdEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public Pet OkContent + => IsOk && ContentObject is Pet result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public string? BadRequestContent + => IsBadRequest && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public string? UnauthorizedContent + => IsUnauthorized && ContentObject is string result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WOPD/src/PetStore.ApiClient.Generated/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WOPD/src/PetStore.ApiClient.Generated/GlobalUsings.verified.cs new file mode 100644 index 00000000..b79baddd --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WOPD/src/PetStore.ApiClient.Generated/GlobalUsings.verified.cs @@ -0,0 +1,16 @@ +global using System; +global using System.CodeDom.Compiler; +global using System.Collections.Generic; +global using System.ComponentModel.DataAnnotations; +global using System.Net; +global using System.Net.Http; +global using System.Threading; +global using System.Threading.Tasks; + +global using Atc.Rest.Client; +global using Atc.Rest.Client.Builder; + +global using Microsoft.AspNetCore.Mvc; + +global using PetStore.ApiClient.Generated.Contracts.Pets; +global using PetStore.ApiClient.Generated.Endpoints.Pets.Interfaces; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WPD/src/PetStore.ApiClient.Generated/Contracts/Pets/Error.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WPD/src/PetStore.ApiClient.Generated/Contracts/Pets/Error.verified.cs new file mode 100644 index 00000000..d959eb73 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WPD/src/PetStore.ApiClient.Generated/Contracts/Pets/Error.verified.cs @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.ApiClient.Generated.Contracts.Pets; + +/// +/// Error. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Error +{ + [Required] + public int Code { get; set; } + + [Required] + public string Message { get; set; } + + /// + public override string ToString() + => $"{nameof(Code)}: {Code}, {nameof(Message)}: {Message}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WPD/src/PetStore.ApiClient.Generated/Contracts/Pets/Pet.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WPD/src/PetStore.ApiClient.Generated/Contracts/Pets/Pet.verified.cs new file mode 100644 index 00000000..f3ea5030 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WPD/src/PetStore.ApiClient.Generated/Contracts/Pets/Pet.verified.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.ApiClient.Generated.Contracts.Pets; + +/// +/// Pet. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Pet +{ + [Required] + public long Id { get; set; } + + [Required] + public string Name { get; set; } + + public string Tag { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(Name)}: {Name}, {nameof(Tag)}: {Tag}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WPD/src/PetStore.ApiClient.Generated/Contracts/Pets/Pets.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WPD/src/PetStore.ApiClient.Generated/Contracts/Pets/Pets.verified.cs new file mode 100644 index 00000000..1cb5e0c7 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WPD/src/PetStore.ApiClient.Generated/Contracts/Pets/Pets.verified.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.ApiClient.Generated.Contracts.Pets; + +/// +/// Pets. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Pets +{ + /// + /// A list of Pet. + /// + public List PetList { get; set; } = new List(); + + /// + public override string ToString() + => $"{nameof(PetList)}.Count: {PetList?.Count ?? 0}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WPD/src/PetStore.ApiClient.Generated/Contracts/Pets/RequestParameters/ListPetsParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WPD/src/PetStore.ApiClient.Generated/Contracts/Pets/RequestParameters/ListPetsParameters.verified.cs new file mode 100644 index 00000000..a4a03f33 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WPD/src/PetStore.ApiClient.Generated/Contracts/Pets/RequestParameters/ListPetsParameters.verified.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.ApiClient.Generated.Contracts.Pets; + +/// +/// Parameters for operation request. +/// Description: List all pets. +/// Operation: ListPets. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ListPetsParameters +{ + /// + /// How many items to return at one time (max 100). + /// + [Range(-2147483648, 100)] + public int Limit { get; set; } + + /// + public override string ToString() + => $"{nameof(Limit)}: {Limit}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WPD/src/PetStore.ApiClient.Generated/Contracts/Pets/RequestParameters/ShowPetByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WPD/src/PetStore.ApiClient.Generated/Contracts/Pets/RequestParameters/ShowPetByIdParameters.verified.cs new file mode 100644 index 00000000..e6c8d542 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WPD/src/PetStore.ApiClient.Generated/Contracts/Pets/RequestParameters/ShowPetByIdParameters.verified.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.ApiClient.Generated.Contracts.Pets; + +/// +/// Parameters for operation request. +/// Description: Info for a specific pet. +/// Operation: ShowPetById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ShowPetByIdParameters +{ + /// + /// The id of the pet to retrieve. + /// + [Required] + public string PetId { get; set; } + + /// + public override string ToString() + => $"{nameof(PetId)}: {PetId}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/CreatePetsEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/CreatePetsEndpoint.verified.cs new file mode 100644 index 00000000..5318569f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/CreatePetsEndpoint.verified.cs @@ -0,0 +1,44 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.ApiClient.Generated.Endpoints.Pets; + +/// +/// Client Endpoint. +/// Description: Create a pet. +/// Operation: CreatePets. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class CreatePetsEndpoint : ICreatePetsEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public CreatePetsEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + string httpClientName = "PetStore-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/v1/pets"); + + using var requestMessage = requestBuilder.Build(HttpMethod.Post); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddErrorResponse(HttpStatusCode.Created); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + return await responseBuilder.BuildResponseAsync(x => new CreatePetsEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/CreatePetsEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/CreatePetsEndpointResult.verified.cs new file mode 100644 index 00000000..054ebe7a --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/CreatePetsEndpointResult.verified.cs @@ -0,0 +1,37 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.ApiClient.Generated.Endpoints.Pets; + +/// +/// Client Endpoint result. +/// Description: Create a pet. +/// Operation: CreatePets. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class CreatePetsEndpointResult : EndpointResponse, ICreatePetsEndpointResult +{ + public CreatePetsEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsCreated + => StatusCode == HttpStatusCode.Created; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public ProblemDetails CreatedContent + => IsCreated && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsCreated property first."); + + public ProblemDetails UnauthorizedContent + => IsUnauthorized && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/Interfaces/ICreatePetsEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/Interfaces/ICreatePetsEndpoint.verified.cs new file mode 100644 index 00000000..b68ab352 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/Interfaces/ICreatePetsEndpoint.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.ApiClient.Generated.Endpoints.Pets.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Create a pet. +/// Operation: CreatePets. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface ICreatePetsEndpoint +{ + /// + /// Execute method. + /// + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + string httpClientName = "PetStore-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/Interfaces/ICreatePetsEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/Interfaces/ICreatePetsEndpointResult.verified.cs new file mode 100644 index 00000000..d9795176 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/Interfaces/ICreatePetsEndpointResult.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.ApiClient.Generated.Endpoints.Pets.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Create a pet. +/// Operation: CreatePets. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface ICreatePetsEndpointResult : IEndpointResponse +{ + + bool IsCreated { get; } + + bool IsUnauthorized { get; } + + ProblemDetails CreatedContent { get; } + + ProblemDetails UnauthorizedContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/Interfaces/IListPetsEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/Interfaces/IListPetsEndpoint.verified.cs new file mode 100644 index 00000000..c55ff45f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/Interfaces/IListPetsEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.ApiClient.Generated.Endpoints.Pets.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: List all pets. +/// Operation: ListPets. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IListPetsEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + ListPetsParameters parameters, + string httpClientName = "PetStore-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/Interfaces/IListPetsEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/Interfaces/IListPetsEndpointResult.verified.cs new file mode 100644 index 00000000..596fc590 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/Interfaces/IListPetsEndpointResult.verified.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.ApiClient.Generated.Endpoints.Pets.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: List all pets. +/// Operation: ListPets. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IListPetsEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + IEnumerable OkContent { get; } + + ValidationProblemDetails BadRequestContent { get; } + + ProblemDetails UnauthorizedContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/Interfaces/IShowPetByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/Interfaces/IShowPetByIdEndpoint.verified.cs new file mode 100644 index 00000000..bfb5f78d --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/Interfaces/IShowPetByIdEndpoint.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.ApiClient.Generated.Endpoints.Pets.Interfaces; + +/// +/// Interface for Client Endpoint. +/// Description: Info for a specific pet. +/// Operation: ShowPetById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IShowPetByIdEndpoint +{ + /// + /// Execute method. + /// + /// The parameters. + /// The http client name. + /// The cancellation token. + Task ExecuteAsync( + ShowPetByIdParameters parameters, + string httpClientName = "PetStore-ApiClient", + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/Interfaces/IShowPetByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/Interfaces/IShowPetByIdEndpointResult.verified.cs new file mode 100644 index 00000000..2f448c62 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/Interfaces/IShowPetByIdEndpointResult.verified.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.ApiClient.Generated.Endpoints.Pets.Interfaces; + +/// +/// Interface for Client Endpoint Result. +/// Description: Info for a specific pet. +/// Operation: ShowPetById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IShowPetByIdEndpointResult : IEndpointResponse +{ + + bool IsOk { get; } + + bool IsBadRequest { get; } + + bool IsUnauthorized { get; } + + Pet OkContent { get; } + + ValidationProblemDetails BadRequestContent { get; } + + ProblemDetails UnauthorizedContent { get; } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/ListPetsEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/ListPetsEndpoint.verified.cs new file mode 100644 index 00000000..e3ca9ca8 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/ListPetsEndpoint.verified.cs @@ -0,0 +1,47 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.ApiClient.Generated.Endpoints.Pets; + +/// +/// Client Endpoint. +/// Description: List all pets. +/// Operation: ListPets. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ListPetsEndpoint : IListPetsEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public ListPetsEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + ListPetsParameters parameters, + string httpClientName = "PetStore-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/v1/pets"); + requestBuilder.WithQueryParameter("limit", parameters.Limit); + + using var requestMessage = requestBuilder.Build(HttpMethod.Get); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse>(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + return await responseBuilder.BuildResponseAsync(x => new ListPetsEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/ListPetsEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/ListPetsEndpointResult.verified.cs new file mode 100644 index 00000000..2e938c3f --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/ListPetsEndpointResult.verified.cs @@ -0,0 +1,45 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.ApiClient.Generated.Endpoints.Pets; + +/// +/// Client Endpoint result. +/// Description: List all pets. +/// Operation: ListPets. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ListPetsEndpointResult : EndpointResponse, IListPetsEndpointResult +{ + public ListPetsEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public IEnumerable OkContent + => IsOk && ContentObject is IEnumerable result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public ValidationProblemDetails BadRequestContent + => IsBadRequest && ContentObject is ValidationProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public ProblemDetails UnauthorizedContent + => IsUnauthorized && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/ShowPetByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/ShowPetByIdEndpoint.verified.cs new file mode 100644 index 00000000..1361c714 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/ShowPetByIdEndpoint.verified.cs @@ -0,0 +1,47 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.ApiClient.Generated.Endpoints.Pets; + +/// +/// Client Endpoint. +/// Description: Info for a specific pet. +/// Operation: ShowPetById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ShowPetByIdEndpoint : IShowPetByIdEndpoint +{ + private readonly IHttpClientFactory factory; + private readonly IHttpMessageFactory httpMessageFactory; + + public ShowPetByIdEndpoint( + IHttpClientFactory factory, + IHttpMessageFactory httpMessageFactory) + { + this.factory = factory; + this.httpMessageFactory = httpMessageFactory; + } + + public async Task ExecuteAsync( + ShowPetByIdParameters parameters, + string httpClientName = "PetStore-ApiClient", + CancellationToken cancellationToken = default) + { + var client = factory.CreateClient(httpClientName); + + var requestBuilder = httpMessageFactory.FromTemplate("/v1/pets/{petId}"); + requestBuilder.WithPathParameter("petId", parameters.PetId); + + using var requestMessage = requestBuilder.Build(HttpMethod.Get); + using var response = await client.SendAsync(requestMessage, cancellationToken); + + var responseBuilder = httpMessageFactory.FromResponse(response); + responseBuilder.AddSuccessResponse(HttpStatusCode.OK); + responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); + responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); + return await responseBuilder.BuildResponseAsync(x => new ShowPetByIdEndpointResult(x), cancellationToken); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/ShowPetByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/ShowPetByIdEndpointResult.verified.cs new file mode 100644 index 00000000..6bbe6493 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WPD/src/PetStore.ApiClient.Generated/Endpoints/Pets/ShowPetByIdEndpointResult.verified.cs @@ -0,0 +1,45 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.ApiClient.Generated.Endpoints.Pets; + +/// +/// Client Endpoint result. +/// Description: Info for a specific pet. +/// Operation: ShowPetById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ShowPetByIdEndpointResult : EndpointResponse, IShowPetByIdEndpointResult +{ + public ShowPetByIdEndpointResult(EndpointResponse response) + : base(response) + { + } + + public bool IsOk + => StatusCode == HttpStatusCode.OK; + + public bool IsBadRequest + => StatusCode == HttpStatusCode.BadRequest; + + public bool IsUnauthorized + => StatusCode == HttpStatusCode.Unauthorized; + + public Pet OkContent + => IsOk && ContentObject is Pet result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); + + public ValidationProblemDetails BadRequestContent + => IsBadRequest && ContentObject is ValidationProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); + + public ProblemDetails UnauthorizedContent + => IsUnauthorized && ContentObject is ProblemDetails result + ? result + : throw new InvalidOperationException("Content is not the expected type - please use the IsUnauthorized property first."); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WPD/src/PetStore.ApiClient.Generated/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WPD/src/PetStore.ApiClient.Generated/GlobalUsings.verified.cs new file mode 100644 index 00000000..b79baddd --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyClient/WPD/src/PetStore.ApiClient.Generated/GlobalUsings.verified.cs @@ -0,0 +1,16 @@ +global using System; +global using System.CodeDom.Compiler; +global using System.Collections.Generic; +global using System.ComponentModel.DataAnnotations; +global using System.Net; +global using System.Net.Http; +global using System.Threading; +global using System.Threading.Tasks; + +global using Atc.Rest.Client; +global using Atc.Rest.Client.Builder; + +global using Microsoft.AspNetCore.Mvc; + +global using PetStore.ApiClient.Generated.Contracts.Pets; +global using PetStore.ApiClient.Generated.Endpoints.Pets.Interfaces; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Api.Generated/ApiRegistration.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Api.Generated/ApiRegistration.verified.cs new file mode 100644 index 00000000..297eb74b --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Api.Generated/ApiRegistration.verified.cs @@ -0,0 +1,12 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.Api.Generated; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ApiRegistration +{ +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Api.Generated/Contracts/Pets/Interfaces/ICreatePetsHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Api.Generated/Contracts/Pets/Interfaces/ICreatePetsHandler.verified.cs new file mode 100644 index 00000000..55e7940b --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Api.Generated/Contracts/Pets/Interfaces/ICreatePetsHandler.verified.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.Api.Generated.Contracts.Pets; + +/// +/// Domain Interface for RequestHandler. +/// Description: Create a pet. +/// Operation: CreatePets. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface ICreatePetsHandler +{ + /// + /// Execute method. + /// + /// The cancellation token. + Task ExecuteAsync( + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Api.Generated/Contracts/Pets/Interfaces/IListPetsHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Api.Generated/Contracts/Pets/Interfaces/IListPetsHandler.verified.cs new file mode 100644 index 00000000..6e733409 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Api.Generated/Contracts/Pets/Interfaces/IListPetsHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.Api.Generated.Contracts.Pets; + +/// +/// Domain Interface for RequestHandler. +/// Description: List all pets. +/// Operation: ListPets. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IListPetsHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + ListPetsParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Api.Generated/Contracts/Pets/Interfaces/IShowPetByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Api.Generated/Contracts/Pets/Interfaces/IShowPetByIdHandler.verified.cs new file mode 100644 index 00000000..b1f835c8 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Api.Generated/Contracts/Pets/Interfaces/IShowPetByIdHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.Api.Generated.Contracts.Pets; + +/// +/// Domain Interface for RequestHandler. +/// Description: Info for a specific pet. +/// Operation: ShowPetById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IShowPetByIdHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + ShowPetByIdParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Api.Generated/Contracts/Pets/Models/Error.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Api.Generated/Contracts/Pets/Models/Error.verified.cs new file mode 100644 index 00000000..47c38f47 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Api.Generated/Contracts/Pets/Models/Error.verified.cs @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.Api.Generated.Contracts.Pets; + +/// +/// Error. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Error +{ + [Required] + public int Code { get; set; } + + [Required] + public string Message { get; set; } + + /// + public override string ToString() + => $"{nameof(Code)}: {Code}, {nameof(Message)}: {Message}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Api.Generated/Contracts/Pets/Models/Pet.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Api.Generated/Contracts/Pets/Models/Pet.verified.cs new file mode 100644 index 00000000..dc0bc1d4 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Api.Generated/Contracts/Pets/Models/Pet.verified.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.Api.Generated.Contracts.Pets; + +/// +/// Pet. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Pet +{ + [Required] + public long Id { get; set; } + + [Required] + public string Name { get; set; } + + public string Tag { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(Name)}: {Name}, {nameof(Tag)}: {Tag}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Api.Generated/Contracts/Pets/Models/Pets.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Api.Generated/Contracts/Pets/Models/Pets.verified.cs new file mode 100644 index 00000000..3dff33f4 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Api.Generated/Contracts/Pets/Models/Pets.verified.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.Api.Generated.Contracts.Pets; + +/// +/// Pets. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Pets +{ + /// + /// A list of Pet. + /// + public List PetList { get; set; } = new List(); + + /// + public override string ToString() + => $"{nameof(PetList)}.Count: {PetList?.Count ?? 0}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Api.Generated/Contracts/Pets/Parameters/ListPetsParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Api.Generated/Contracts/Pets/Parameters/ListPetsParameters.verified.cs new file mode 100644 index 00000000..460e6aa0 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Api.Generated/Contracts/Pets/Parameters/ListPetsParameters.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.Api.Generated.Contracts.Pets; + +/// +/// Parameters for operation request. +/// Description: List all pets. +/// Operation: ListPets. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ListPetsParameters +{ + /// + /// How many items to return at one time (max 100). + /// + [FromQuery(Name = "limit")] + [Range(-2147483648, 100)] + public int? Limit { get; set; } + + /// + public override string ToString() + => $"{nameof(Limit)}: {Limit}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Api.Generated/Contracts/Pets/Parameters/ShowPetByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Api.Generated/Contracts/Pets/Parameters/ShowPetByIdParameters.verified.cs new file mode 100644 index 00000000..8fac6673 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Api.Generated/Contracts/Pets/Parameters/ShowPetByIdParameters.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.Api.Generated.Contracts.Pets; + +/// +/// Parameters for operation request. +/// Description: Info for a specific pet. +/// Operation: ShowPetById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ShowPetByIdParameters +{ + /// + /// The id of the pet to retrieve. + /// + [FromRoute(Name = "petId")] + [Required] + public string PetId { get; set; } + + /// + public override string ToString() + => $"{nameof(PetId)}: {PetId}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Api.Generated/Contracts/Pets/Results/CreatePetsResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Api.Generated/Contracts/Pets/Results/CreatePetsResult.verified.cs new file mode 100644 index 00000000..a24b9b58 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Api.Generated/Contracts/Pets/Results/CreatePetsResult.verified.cs @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.Api.Generated.Contracts.Pets; + +/// +/// Results for operation request. +/// Description: Create a pet. +/// Operation: CreatePets. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class CreatePetsResult : ResultBase +{ + private CreatePetsResult(ActionResult result) : base(result) { } + + /// + /// 201 - Created response. + /// + public static CreatePetsResult Created(string? uri = null) + => new CreatePetsResult(ResultFactory.CreateContentResult(HttpStatusCode.Created, uri)); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Api.Generated/Contracts/Pets/Results/ListPetsResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Api.Generated/Contracts/Pets/Results/ListPetsResult.verified.cs new file mode 100644 index 00000000..80380a48 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Api.Generated/Contracts/Pets/Results/ListPetsResult.verified.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.Api.Generated.Contracts.Pets; + +/// +/// Results for operation request. +/// Description: List all pets. +/// Operation: ListPets. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ListPetsResult : ResultBase +{ + private ListPetsResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static ListPetsResult Ok(IEnumerable response) + => new ListPetsResult(new OkObjectResult(response ?? Enumerable.Empty())); + + /// + /// Performs an implicit conversion from ListPetsResult to ActionResult. + /// + public static implicit operator ListPetsResult(List response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Api.Generated/Contracts/Pets/Results/ShowPetByIdResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Api.Generated/Contracts/Pets/Results/ShowPetByIdResult.verified.cs new file mode 100644 index 00000000..2ac68497 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Api.Generated/Contracts/Pets/Results/ShowPetByIdResult.verified.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.Api.Generated.Contracts.Pets; + +/// +/// Results for operation request. +/// Description: Info for a specific pet. +/// Operation: ShowPetById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ShowPetByIdResult : ResultBase +{ + private ShowPetByIdResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static ShowPetByIdResult Ok(Pet response) + => new ShowPetByIdResult(new OkObjectResult(response)); + + /// + /// Performs an implicit conversion from ShowPetByIdResult to ActionResult. + /// + public static implicit operator ShowPetByIdResult(Pet response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Api.Generated/Endpoints/PetsController.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Api.Generated/Endpoints/PetsController.verified.cs new file mode 100644 index 00000000..e83fd001 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Api.Generated/Endpoints/PetsController.verified.cs @@ -0,0 +1,57 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.Api.Generated.Endpoints; + +/// +/// Endpoint definitions. +/// +[Authorize] +[ApiController] +[Route("/v1/pets")] +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public sealed class PetsController : ControllerBase +{ + /// + /// Description: List all pets. + /// Operation: ListPets. + /// + [HttpGet] + [ProducesResponseType(typeof(IEnumerable), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + public async Task ListPets( + ListPetsParameters parameters, + [FromServices] IListPetsHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); + + /// + /// Description: Create a pet. + /// Operation: CreatePets. + /// + [HttpPost] + [ProducesResponseType(typeof(string), StatusCodes.Status201Created)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + public async Task CreatePets( + [FromServices] ICreatePetsHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(cancellationToken); + + /// + /// Description: Info for a specific pet. + /// Operation: ShowPetById. + /// + [HttpGet("{petId}")] + [ProducesResponseType(typeof(Pet), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + public async Task ShowPetById( + ShowPetByIdParameters parameters, + [FromServices] IShowPetByIdHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Api.Generated/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Api.Generated/GlobalUsings.verified.cs new file mode 100644 index 00000000..5449814a --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Api.Generated/GlobalUsings.verified.cs @@ -0,0 +1,11 @@ +global using System.CodeDom.Compiler; +global using System.ComponentModel.DataAnnotations; +global using System.Net; + +global using Atc.Rest.Results; + +global using Microsoft.AspNetCore.Authorization; +global using Microsoft.AspNetCore.Http; +global using Microsoft.AspNetCore.Mvc; + +global using PetStore.Api.Generated.Contracts.Pets; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Api/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Api/GlobalUsings.verified.cs new file mode 100644 index 00000000..4adaf1e6 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Api/GlobalUsings.verified.cs @@ -0,0 +1,15 @@ +global using System.CodeDom.Compiler; +global using System.Reflection; + +global using Asp.Versioning.ApiExplorer; + +global using Atc.Rest.Extended.Options; + +global using Microsoft.Extensions.Options; +global using Microsoft.OpenApi.Models; + +global using PetStore.Api.Generated; +global using PetStore.Api.Options; +global using PetStore.Domain; + +global using Swashbuckle.AspNetCore.SwaggerGen; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Api/Options/ConfigureSwaggerDocOptions.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Api/Options/ConfigureSwaggerDocOptions.verified.cs new file mode 100644 index 00000000..47f2c147 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Api/Options/ConfigureSwaggerDocOptions.verified.cs @@ -0,0 +1,38 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.Api.Options; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ConfigureSwaggerDocOptions : IConfigureOptions +{ + private readonly IApiVersionDescriptionProvider provider; + + public ConfigureSwaggerDocOptions( + IApiVersionDescriptionProvider provider) + => this.provider = provider; + + public void Configure( + SwaggerGenOptions options) + { + foreach (var version in provider.ApiVersionDescriptions) + { + options.SwaggerDoc( + version.GroupName, + new OpenApiInfo + { + Version = "1.0.0", + Title = "Swagger Petstore", + License = new OpenApiLicense + { + Name = "MIT", + }, + }); + } + + options.IncludeXmlComments(Path.ChangeExtension(GetType().Assembly.Location, "xml")); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Api/Program.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Api/Program.verified.cs new file mode 100644 index 00000000..86172a6a --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Api/Program.verified.cs @@ -0,0 +1,23 @@ +namespace PetStore.Api; + +public static class Program +{ + public static void Main(string[] args) + { + CreateHostBuilder(args) + .Build() + .Run(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) + { + var builder = Host + .CreateDefaultBuilder(args) + .ConfigureWebHostDefaults(webBuilder => + { + webBuilder.UseStartup(); + }); + + return builder; + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Api/Startup.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Api/Startup.verified.cs new file mode 100644 index 00000000..e709224d --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Api/Startup.verified.cs @@ -0,0 +1,38 @@ +namespace PetStore.Api; + +public class Startup +{ + private readonly RestApiExtendedOptions restApiOptions; + + public Startup( + IConfiguration configuration) + { + Configuration = configuration; + restApiOptions = new RestApiExtendedOptions + { + // TODO: Remove/out-comment/set to false this for production scenarios! + AllowAnonymousAccessForDevelopment = true, + }; + + restApiOptions.AddAssemblyPairs( + Assembly.GetAssembly(typeof(ApiRegistration)), + Assembly.GetAssembly(typeof(DomainRegistration))); + } + + public IConfiguration Configuration { get; } + + public void ConfigureServices( + IServiceCollection services) + { + services.ConfigureOptions(); + + services.AddRestApi(restApiOptions, Configuration); + } + + public void Configure( + IApplicationBuilder app, + IWebHostEnvironment env) + { + app.ConfigureRestApi(env, restApiOptions); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Domain/DomainRegistration.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Domain/DomainRegistration.verified.cs new file mode 100644 index 00000000..1869eb07 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Domain/DomainRegistration.verified.cs @@ -0,0 +1,12 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.Domain; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class DomainRegistration +{ +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Domain/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Domain/GlobalUsings.verified.cs new file mode 100644 index 00000000..a7b3e966 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Domain/GlobalUsings.verified.cs @@ -0,0 +1,3 @@ +global using System.CodeDom.Compiler; + +global using PetStore.Api.Generated.Contracts.Pets; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Domain/Handlers/Pets/CreatePetsHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Domain/Handlers/Pets/CreatePetsHandler.verified.cs new file mode 100644 index 00000000..0de06e54 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Domain/Handlers/Pets/CreatePetsHandler.verified.cs @@ -0,0 +1,15 @@ +namespace PetStore.Domain.Handlers.Pets; + +/// +/// Handler for operation request. +/// Description: Create a pet. +/// Operation: CreatePets. +/// +public class CreatePetsHandler : ICreatePetsHandler +{ + public Task ExecuteAsync( + CancellationToken cancellationToken = default) + { + throw new NotImplementedException("Add logic here for CreatePetsHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Domain/Handlers/Pets/ListPetsHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Domain/Handlers/Pets/ListPetsHandler.verified.cs new file mode 100644 index 00000000..38a9dfb7 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Domain/Handlers/Pets/ListPetsHandler.verified.cs @@ -0,0 +1,18 @@ +namespace PetStore.Domain.Handlers.Pets; + +/// +/// Handler for operation request. +/// Description: List all pets. +/// Operation: ListPets. +/// +public class ListPetsHandler : IListPetsHandler +{ + public Task ExecuteAsync( + ListPetsParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for ListPetsHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Domain/Handlers/Pets/ShowPetByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Domain/Handlers/Pets/ShowPetByIdHandler.verified.cs new file mode 100644 index 00000000..578ba108 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/src/PetStore.Domain/Handlers/Pets/ShowPetByIdHandler.verified.cs @@ -0,0 +1,18 @@ +namespace PetStore.Domain.Handlers.Pets; + +/// +/// Handler for operation request. +/// Description: Info for a specific pet. +/// Operation: ShowPetById. +/// +public class ShowPetByIdHandler : IShowPetByIdHandler +{ + public Task ExecuteAsync( + ShowPetByIdParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for ShowPetByIdHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/test/PetStore.Api.Tests/Endpoints/Pets/CreatePetsHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/test/PetStore.Api.Tests/Endpoints/Pets/CreatePetsHandlerStub.verified.cs new file mode 100644 index 00000000..5e0f0461 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/test/PetStore.Api.Tests/Endpoints/Pets/CreatePetsHandlerStub.verified.cs @@ -0,0 +1,17 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.Api.Tests.Endpoints.Pets; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class CreatePetsHandlerStub : ICreatePetsHandler +{ + public Task ExecuteAsync( + CancellationToken cancellationToken = default) + { + return Task.FromResult(CreatePetsResult.Created()); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/test/PetStore.Api.Tests/Endpoints/Pets/CreatePetsTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/test/PetStore.Api.Tests/Endpoints/Pets/CreatePetsTests.verified.cs new file mode 100644 index 00000000..419b4470 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/test/PetStore.Api.Tests/Endpoints/Pets/CreatePetsTests.verified.cs @@ -0,0 +1,21 @@ +namespace PetStore.Api.Tests.Endpoints.Pets; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class CreatePetsTests : WebApiControllerBaseTest +{ + public CreatePetsTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/test/PetStore.Api.Tests/Endpoints/Pets/ListPetsHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/test/PetStore.Api.Tests/Endpoints/Pets/ListPetsHandlerStub.verified.cs new file mode 100644 index 00000000..e9a56c5d --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/test/PetStore.Api.Tests/Endpoints/Pets/ListPetsHandlerStub.verified.cs @@ -0,0 +1,20 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.Api.Tests.Endpoints.Pets; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ListPetsHandlerStub : IListPetsHandler +{ + public Task ExecuteAsync( + ListPetsParameters parameters, + CancellationToken cancellationToken = default) + { + var data = new Fixture().Create>(); + + return Task.FromResult(ListPetsResult.Ok(data)); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/test/PetStore.Api.Tests/Endpoints/Pets/ListPetsTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/test/PetStore.Api.Tests/Endpoints/Pets/ListPetsTests.verified.cs new file mode 100644 index 00000000..e85ad27c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/test/PetStore.Api.Tests/Endpoints/Pets/ListPetsTests.verified.cs @@ -0,0 +1,21 @@ +namespace PetStore.Api.Tests.Endpoints.Pets; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class ListPetsTests : WebApiControllerBaseTest +{ + public ListPetsTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/test/PetStore.Api.Tests/Endpoints/Pets/ShowPetByIdHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/test/PetStore.Api.Tests/Endpoints/Pets/ShowPetByIdHandlerStub.verified.cs new file mode 100644 index 00000000..625b7a73 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/test/PetStore.Api.Tests/Endpoints/Pets/ShowPetByIdHandlerStub.verified.cs @@ -0,0 +1,20 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.Api.Tests.Endpoints.Pets; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ShowPetByIdHandlerStub : IShowPetByIdHandler +{ + public Task ExecuteAsync( + ShowPetByIdParameters parameters, + CancellationToken cancellationToken = default) + { + var data = new Fixture().Create(); + + return Task.FromResult(ShowPetByIdResult.Ok(data)); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/test/PetStore.Api.Tests/Endpoints/Pets/ShowPetByIdTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/test/PetStore.Api.Tests/Endpoints/Pets/ShowPetByIdTests.verified.cs new file mode 100644 index 00000000..e075ea6d --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/test/PetStore.Api.Tests/Endpoints/Pets/ShowPetByIdTests.verified.cs @@ -0,0 +1,21 @@ +namespace PetStore.Api.Tests.Endpoints.Pets; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class ShowPetByIdTests : WebApiControllerBaseTest +{ + public ShowPetByIdTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/test/PetStore.Api.Tests/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/test/PetStore.Api.Tests/GlobalUsings.verified.cs new file mode 100644 index 00000000..d96aaa6b --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/test/PetStore.Api.Tests/GlobalUsings.verified.cs @@ -0,0 +1,22 @@ +global using System.CodeDom.Compiler; +global using System.Reflection; +global using System.Text; +global using System.Text.Json; +global using System.Text.Json.Serialization; + +global using Atc.Rest.Options; +global using Atc.XUnit; + +global using AutoFixture; + +global using Microsoft.AspNetCore.Hosting; +global using Microsoft.AspNetCore.Http; +global using Microsoft.AspNetCore.Mvc.Testing; +global using Microsoft.AspNetCore.TestHost; +global using Microsoft.Extensions.Configuration; +global using Microsoft.Extensions.DependencyInjection; + +global using PetStore.Api.Generated; +global using PetStore.Api.Generated.Contracts.Pets; + +global using Xunit; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/test/PetStore.Api.Tests/WebApiControllerBaseTest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/test/PetStore.Api.Tests/WebApiControllerBaseTest.verified.cs new file mode 100644 index 00000000..81789efa --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/test/PetStore.Api.Tests/WebApiControllerBaseTest.verified.cs @@ -0,0 +1,56 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.Api.Tests; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public abstract class WebApiControllerBaseTest : IClassFixture +{ + protected readonly WebApiStartupFactory Factory; + + protected readonly HttpClient HttpClient; + + protected readonly IConfiguration Configuration; + + protected static JsonSerializerOptions? JsonSerializerOptions; + + protected WebApiControllerBaseTest(WebApiStartupFactory fixture) + { + this.Factory = fixture; + this.HttpClient = this.Factory.CreateClient(); + this.Configuration = new ConfigurationBuilder().Build(); + JsonSerializerOptions = new JsonSerializerOptions + { + PropertyNameCaseInsensitive = true, + Converters = + { + new JsonStringEnumConverter() + }, + }; + } + + protected static StringContent ToJson(object data) + => new(JsonSerializer.Serialize(data, JsonSerializerOptions), Encoding.UTF8, "application/json"); + + protected static StringContent Json(string data) + => new(data, Encoding.UTF8, "application/json"); + + protected static IFormFile GetTestFile() + { + var bytes = Encoding.UTF8.GetBytes("Hello World"); + var stream = new MemoryStream(bytes); + var formFile = new FormFile(stream, 0, stream.Length, "dummy", "dummy.txt") + { + Headers = new HeaderDictionary(), + ContentType = "application/octet-stream", + }; + + return formFile; + } + + protected static List GetTestFiles() + => new() { GetTestFile(), GetTestFile() }; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/test/PetStore.Api.Tests/WebApiStartupFactory.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/test/PetStore.Api.Tests/WebApiStartupFactory.verified.cs new file mode 100644 index 00000000..e7acb12e --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/test/PetStore.Api.Tests/WebApiStartupFactory.verified.cs @@ -0,0 +1,40 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.Api.Tests; + +/// +/// Factory for bootstrapping in memory tests. +/// Includes options to override configuration and service collection using a partial class. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public partial class WebApiStartupFactory : WebApplicationFactory +{ + protected override void ConfigureWebHost(IWebHostBuilder builder) + { + builder.ConfigureAppConfiguration(config => + { + ModifyConfiguration(config); + var integrationConfig = new ConfigurationBuilder() + .AddJsonFile("appsettings.integrationtest.json") + .Build(); + config.AddConfiguration(integrationConfig); + }); + + builder.ConfigureTestServices(services => + { + ModifyServices(services); + services.AddSingleton(); + services.AutoRegistrateServices( + Assembly.GetAssembly(typeof(ApiRegistration))!, + Assembly.GetAssembly(typeof(WebApiStartupFactory))!); + }); + } + + partial void ModifyConfiguration(IConfigurationBuilder config); + + partial void ModifyServices(IServiceCollection services); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/test/PetStore.Domain.Tests/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/test/PetStore.Domain.Tests/GlobalUsings.verified.cs new file mode 100644 index 00000000..8c927eb7 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/test/PetStore.Domain.Tests/GlobalUsings.verified.cs @@ -0,0 +1 @@ +global using Xunit; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/test/PetStore.Domain.Tests/Handlers/Pets/CreatePetsHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/test/PetStore.Domain.Tests/Handlers/Pets/CreatePetsHandlerTests.verified.cs new file mode 100644 index 00000000..8f37e936 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/test/PetStore.Domain.Tests/Handlers/Pets/CreatePetsHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace PetStore.Domain.Tests.Handlers.Pets; + +public class CreatePetsHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/test/PetStore.Domain.Tests/Handlers/Pets/ListPetsHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/test/PetStore.Domain.Tests/Handlers/Pets/ListPetsHandlerTests.verified.cs new file mode 100644 index 00000000..033d6249 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/test/PetStore.Domain.Tests/Handlers/Pets/ListPetsHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace PetStore.Domain.Tests.Handlers.Pets; + +public class ListPetsHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/test/PetStore.Domain.Tests/Handlers/Pets/ShowPetByIdHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/test/PetStore.Domain.Tests/Handlers/Pets/ShowPetByIdHandlerTests.verified.cs new file mode 100644 index 00000000..ba0cd0b1 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WOPD/test/PetStore.Domain.Tests/Handlers/Pets/ShowPetByIdHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace PetStore.Domain.Tests.Handlers.Pets; + +public class ShowPetByIdHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Api.Generated/ApiRegistration.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Api.Generated/ApiRegistration.verified.cs new file mode 100644 index 00000000..297eb74b --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Api.Generated/ApiRegistration.verified.cs @@ -0,0 +1,12 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.Api.Generated; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ApiRegistration +{ +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Api.Generated/Contracts/Pets/Interfaces/ICreatePetsHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Api.Generated/Contracts/Pets/Interfaces/ICreatePetsHandler.verified.cs new file mode 100644 index 00000000..55e7940b --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Api.Generated/Contracts/Pets/Interfaces/ICreatePetsHandler.verified.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.Api.Generated.Contracts.Pets; + +/// +/// Domain Interface for RequestHandler. +/// Description: Create a pet. +/// Operation: CreatePets. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface ICreatePetsHandler +{ + /// + /// Execute method. + /// + /// The cancellation token. + Task ExecuteAsync( + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Api.Generated/Contracts/Pets/Interfaces/IListPetsHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Api.Generated/Contracts/Pets/Interfaces/IListPetsHandler.verified.cs new file mode 100644 index 00000000..6e733409 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Api.Generated/Contracts/Pets/Interfaces/IListPetsHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.Api.Generated.Contracts.Pets; + +/// +/// Domain Interface for RequestHandler. +/// Description: List all pets. +/// Operation: ListPets. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IListPetsHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + ListPetsParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Api.Generated/Contracts/Pets/Interfaces/IShowPetByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Api.Generated/Contracts/Pets/Interfaces/IShowPetByIdHandler.verified.cs new file mode 100644 index 00000000..b1f835c8 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Api.Generated/Contracts/Pets/Interfaces/IShowPetByIdHandler.verified.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.Api.Generated.Contracts.Pets; + +/// +/// Domain Interface for RequestHandler. +/// Description: Info for a specific pet. +/// Operation: ShowPetById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public interface IShowPetByIdHandler +{ + /// + /// Execute method. + /// + /// The parameters. + /// The cancellation token. + Task ExecuteAsync( + ShowPetByIdParameters parameters, + CancellationToken cancellationToken = default); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Api.Generated/Contracts/Pets/Models/Error.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Api.Generated/Contracts/Pets/Models/Error.verified.cs new file mode 100644 index 00000000..47c38f47 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Api.Generated/Contracts/Pets/Models/Error.verified.cs @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.Api.Generated.Contracts.Pets; + +/// +/// Error. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Error +{ + [Required] + public int Code { get; set; } + + [Required] + public string Message { get; set; } + + /// + public override string ToString() + => $"{nameof(Code)}: {Code}, {nameof(Message)}: {Message}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Api.Generated/Contracts/Pets/Models/Pet.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Api.Generated/Contracts/Pets/Models/Pet.verified.cs new file mode 100644 index 00000000..dc0bc1d4 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Api.Generated/Contracts/Pets/Models/Pet.verified.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.Api.Generated.Contracts.Pets; + +/// +/// Pet. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Pet +{ + [Required] + public long Id { get; set; } + + [Required] + public string Name { get; set; } + + public string Tag { get; set; } + + /// + public override string ToString() + => $"{nameof(Id)}: {Id}, {nameof(Name)}: {Name}, {nameof(Tag)}: {Tag}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Api.Generated/Contracts/Pets/Models/Pets.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Api.Generated/Contracts/Pets/Models/Pets.verified.cs new file mode 100644 index 00000000..3dff33f4 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Api.Generated/Contracts/Pets/Models/Pets.verified.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.Api.Generated.Contracts.Pets; + +/// +/// Pets. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class Pets +{ + /// + /// A list of Pet. + /// + public List PetList { get; set; } = new List(); + + /// + public override string ToString() + => $"{nameof(PetList)}.Count: {PetList?.Count ?? 0}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Api.Generated/Contracts/Pets/Parameters/ListPetsParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Api.Generated/Contracts/Pets/Parameters/ListPetsParameters.verified.cs new file mode 100644 index 00000000..460e6aa0 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Api.Generated/Contracts/Pets/Parameters/ListPetsParameters.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.Api.Generated.Contracts.Pets; + +/// +/// Parameters for operation request. +/// Description: List all pets. +/// Operation: ListPets. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ListPetsParameters +{ + /// + /// How many items to return at one time (max 100). + /// + [FromQuery(Name = "limit")] + [Range(-2147483648, 100)] + public int? Limit { get; set; } + + /// + public override string ToString() + => $"{nameof(Limit)}: {Limit}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Api.Generated/Contracts/Pets/Parameters/ShowPetByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Api.Generated/Contracts/Pets/Parameters/ShowPetByIdParameters.verified.cs new file mode 100644 index 00000000..8fac6673 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Api.Generated/Contracts/Pets/Parameters/ShowPetByIdParameters.verified.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.Api.Generated.Contracts.Pets; + +/// +/// Parameters for operation request. +/// Description: Info for a specific pet. +/// Operation: ShowPetById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ShowPetByIdParameters +{ + /// + /// The id of the pet to retrieve. + /// + [FromRoute(Name = "petId")] + [Required] + public string PetId { get; set; } + + /// + public override string ToString() + => $"{nameof(PetId)}: {PetId}"; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Api.Generated/Contracts/Pets/Results/CreatePetsResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Api.Generated/Contracts/Pets/Results/CreatePetsResult.verified.cs new file mode 100644 index 00000000..a24b9b58 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Api.Generated/Contracts/Pets/Results/CreatePetsResult.verified.cs @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.Api.Generated.Contracts.Pets; + +/// +/// Results for operation request. +/// Description: Create a pet. +/// Operation: CreatePets. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class CreatePetsResult : ResultBase +{ + private CreatePetsResult(ActionResult result) : base(result) { } + + /// + /// 201 - Created response. + /// + public static CreatePetsResult Created(string? uri = null) + => new CreatePetsResult(ResultFactory.CreateContentResult(HttpStatusCode.Created, uri)); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Api.Generated/Contracts/Pets/Results/ListPetsResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Api.Generated/Contracts/Pets/Results/ListPetsResult.verified.cs new file mode 100644 index 00000000..80380a48 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Api.Generated/Contracts/Pets/Results/ListPetsResult.verified.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.Api.Generated.Contracts.Pets; + +/// +/// Results for operation request. +/// Description: List all pets. +/// Operation: ListPets. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ListPetsResult : ResultBase +{ + private ListPetsResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static ListPetsResult Ok(IEnumerable response) + => new ListPetsResult(new OkObjectResult(response ?? Enumerable.Empty())); + + /// + /// Performs an implicit conversion from ListPetsResult to ActionResult. + /// + public static implicit operator ListPetsResult(List response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Api.Generated/Contracts/Pets/Results/ShowPetByIdResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Api.Generated/Contracts/Pets/Results/ShowPetByIdResult.verified.cs new file mode 100644 index 00000000..2ac68497 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Api.Generated/Contracts/Pets/Results/ShowPetByIdResult.verified.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.Api.Generated.Contracts.Pets; + +/// +/// Results for operation request. +/// Description: Info for a specific pet. +/// Operation: ShowPetById. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ShowPetByIdResult : ResultBase +{ + private ShowPetByIdResult(ActionResult result) : base(result) { } + + /// + /// 200 - Ok response. + /// + public static ShowPetByIdResult Ok(Pet response) + => new ShowPetByIdResult(new OkObjectResult(response)); + + /// + /// Performs an implicit conversion from ShowPetByIdResult to ActionResult. + /// + public static implicit operator ShowPetByIdResult(Pet response) + => Ok(response); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Api.Generated/Endpoints/PetsController.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Api.Generated/Endpoints/PetsController.verified.cs new file mode 100644 index 00000000..b8bc33c7 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Api.Generated/Endpoints/PetsController.verified.cs @@ -0,0 +1,57 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.Api.Generated.Endpoints; + +/// +/// Endpoint definitions. +/// +[Authorize] +[ApiController] +[Route("/v1/pets")] +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public sealed class PetsController : ControllerBase +{ + /// + /// Description: List all pets. + /// Operation: ListPets. + /// + [HttpGet] + [ProducesResponseType(typeof(IEnumerable), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] + public async Task ListPets( + ListPetsParameters parameters, + [FromServices] IListPetsHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); + + /// + /// Description: Create a pet. + /// Operation: CreatePets. + /// + [HttpPost] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status201Created)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] + public async Task CreatePets( + [FromServices] ICreatePetsHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(cancellationToken); + + /// + /// Description: Info for a specific pet. + /// Operation: ShowPetById. + /// + [HttpGet("{petId}")] + [ProducesResponseType(typeof(Pet), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)] + public async Task ShowPetById( + ShowPetByIdParameters parameters, + [FromServices] IShowPetByIdHandler handler, + CancellationToken cancellationToken) + => await handler.ExecuteAsync(parameters, cancellationToken); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Api.Generated/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Api.Generated/GlobalUsings.verified.cs new file mode 100644 index 00000000..5449814a --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Api.Generated/GlobalUsings.verified.cs @@ -0,0 +1,11 @@ +global using System.CodeDom.Compiler; +global using System.ComponentModel.DataAnnotations; +global using System.Net; + +global using Atc.Rest.Results; + +global using Microsoft.AspNetCore.Authorization; +global using Microsoft.AspNetCore.Http; +global using Microsoft.AspNetCore.Mvc; + +global using PetStore.Api.Generated.Contracts.Pets; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Api/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Api/GlobalUsings.verified.cs new file mode 100644 index 00000000..4adaf1e6 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Api/GlobalUsings.verified.cs @@ -0,0 +1,15 @@ +global using System.CodeDom.Compiler; +global using System.Reflection; + +global using Asp.Versioning.ApiExplorer; + +global using Atc.Rest.Extended.Options; + +global using Microsoft.Extensions.Options; +global using Microsoft.OpenApi.Models; + +global using PetStore.Api.Generated; +global using PetStore.Api.Options; +global using PetStore.Domain; + +global using Swashbuckle.AspNetCore.SwaggerGen; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Api/Options/ConfigureSwaggerDocOptions.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Api/Options/ConfigureSwaggerDocOptions.verified.cs new file mode 100644 index 00000000..47f2c147 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Api/Options/ConfigureSwaggerDocOptions.verified.cs @@ -0,0 +1,38 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.Api.Options; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ConfigureSwaggerDocOptions : IConfigureOptions +{ + private readonly IApiVersionDescriptionProvider provider; + + public ConfigureSwaggerDocOptions( + IApiVersionDescriptionProvider provider) + => this.provider = provider; + + public void Configure( + SwaggerGenOptions options) + { + foreach (var version in provider.ApiVersionDescriptions) + { + options.SwaggerDoc( + version.GroupName, + new OpenApiInfo + { + Version = "1.0.0", + Title = "Swagger Petstore", + License = new OpenApiLicense + { + Name = "MIT", + }, + }); + } + + options.IncludeXmlComments(Path.ChangeExtension(GetType().Assembly.Location, "xml")); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Api/Program.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Api/Program.verified.cs new file mode 100644 index 00000000..86172a6a --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Api/Program.verified.cs @@ -0,0 +1,23 @@ +namespace PetStore.Api; + +public static class Program +{ + public static void Main(string[] args) + { + CreateHostBuilder(args) + .Build() + .Run(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) + { + var builder = Host + .CreateDefaultBuilder(args) + .ConfigureWebHostDefaults(webBuilder => + { + webBuilder.UseStartup(); + }); + + return builder; + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Api/Startup.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Api/Startup.verified.cs new file mode 100644 index 00000000..e709224d --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Api/Startup.verified.cs @@ -0,0 +1,38 @@ +namespace PetStore.Api; + +public class Startup +{ + private readonly RestApiExtendedOptions restApiOptions; + + public Startup( + IConfiguration configuration) + { + Configuration = configuration; + restApiOptions = new RestApiExtendedOptions + { + // TODO: Remove/out-comment/set to false this for production scenarios! + AllowAnonymousAccessForDevelopment = true, + }; + + restApiOptions.AddAssemblyPairs( + Assembly.GetAssembly(typeof(ApiRegistration)), + Assembly.GetAssembly(typeof(DomainRegistration))); + } + + public IConfiguration Configuration { get; } + + public void ConfigureServices( + IServiceCollection services) + { + services.ConfigureOptions(); + + services.AddRestApi(restApiOptions, Configuration); + } + + public void Configure( + IApplicationBuilder app, + IWebHostEnvironment env) + { + app.ConfigureRestApi(env, restApiOptions); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Domain/DomainRegistration.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Domain/DomainRegistration.verified.cs new file mode 100644 index 00000000..1869eb07 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Domain/DomainRegistration.verified.cs @@ -0,0 +1,12 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.Domain; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class DomainRegistration +{ +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Domain/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Domain/GlobalUsings.verified.cs new file mode 100644 index 00000000..a7b3e966 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Domain/GlobalUsings.verified.cs @@ -0,0 +1,3 @@ +global using System.CodeDom.Compiler; + +global using PetStore.Api.Generated.Contracts.Pets; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Domain/Handlers/Pets/CreatePetsHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Domain/Handlers/Pets/CreatePetsHandler.verified.cs new file mode 100644 index 00000000..0de06e54 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Domain/Handlers/Pets/CreatePetsHandler.verified.cs @@ -0,0 +1,15 @@ +namespace PetStore.Domain.Handlers.Pets; + +/// +/// Handler for operation request. +/// Description: Create a pet. +/// Operation: CreatePets. +/// +public class CreatePetsHandler : ICreatePetsHandler +{ + public Task ExecuteAsync( + CancellationToken cancellationToken = default) + { + throw new NotImplementedException("Add logic here for CreatePetsHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Domain/Handlers/Pets/ListPetsHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Domain/Handlers/Pets/ListPetsHandler.verified.cs new file mode 100644 index 00000000..38a9dfb7 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Domain/Handlers/Pets/ListPetsHandler.verified.cs @@ -0,0 +1,18 @@ +namespace PetStore.Domain.Handlers.Pets; + +/// +/// Handler for operation request. +/// Description: List all pets. +/// Operation: ListPets. +/// +public class ListPetsHandler : IListPetsHandler +{ + public Task ExecuteAsync( + ListPetsParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for ListPetsHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Domain/Handlers/Pets/ShowPetByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Domain/Handlers/Pets/ShowPetByIdHandler.verified.cs new file mode 100644 index 00000000..578ba108 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/src/PetStore.Domain/Handlers/Pets/ShowPetByIdHandler.verified.cs @@ -0,0 +1,18 @@ +namespace PetStore.Domain.Handlers.Pets; + +/// +/// Handler for operation request. +/// Description: Info for a specific pet. +/// Operation: ShowPetById. +/// +public class ShowPetByIdHandler : IShowPetByIdHandler +{ + public Task ExecuteAsync( + ShowPetByIdParameters parameters, + CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(parameters); + + throw new NotImplementedException("Add logic here for ShowPetByIdHandler"); + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/test/PetStore.Api.Tests/Endpoints/Pets/CreatePetsHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/test/PetStore.Api.Tests/Endpoints/Pets/CreatePetsHandlerStub.verified.cs new file mode 100644 index 00000000..5e0f0461 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/test/PetStore.Api.Tests/Endpoints/Pets/CreatePetsHandlerStub.verified.cs @@ -0,0 +1,17 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.Api.Tests.Endpoints.Pets; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class CreatePetsHandlerStub : ICreatePetsHandler +{ + public Task ExecuteAsync( + CancellationToken cancellationToken = default) + { + return Task.FromResult(CreatePetsResult.Created()); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/test/PetStore.Api.Tests/Endpoints/Pets/CreatePetsTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/test/PetStore.Api.Tests/Endpoints/Pets/CreatePetsTests.verified.cs new file mode 100644 index 00000000..419b4470 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/test/PetStore.Api.Tests/Endpoints/Pets/CreatePetsTests.verified.cs @@ -0,0 +1,21 @@ +namespace PetStore.Api.Tests.Endpoints.Pets; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class CreatePetsTests : WebApiControllerBaseTest +{ + public CreatePetsTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/test/PetStore.Api.Tests/Endpoints/Pets/ListPetsHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/test/PetStore.Api.Tests/Endpoints/Pets/ListPetsHandlerStub.verified.cs new file mode 100644 index 00000000..e9a56c5d --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/test/PetStore.Api.Tests/Endpoints/Pets/ListPetsHandlerStub.verified.cs @@ -0,0 +1,20 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.Api.Tests.Endpoints.Pets; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ListPetsHandlerStub : IListPetsHandler +{ + public Task ExecuteAsync( + ListPetsParameters parameters, + CancellationToken cancellationToken = default) + { + var data = new Fixture().Create>(); + + return Task.FromResult(ListPetsResult.Ok(data)); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/test/PetStore.Api.Tests/Endpoints/Pets/ListPetsTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/test/PetStore.Api.Tests/Endpoints/Pets/ListPetsTests.verified.cs new file mode 100644 index 00000000..e85ad27c --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/test/PetStore.Api.Tests/Endpoints/Pets/ListPetsTests.verified.cs @@ -0,0 +1,21 @@ +namespace PetStore.Api.Tests.Endpoints.Pets; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class ListPetsTests : WebApiControllerBaseTest +{ + public ListPetsTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/test/PetStore.Api.Tests/Endpoints/Pets/ShowPetByIdHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/test/PetStore.Api.Tests/Endpoints/Pets/ShowPetByIdHandlerStub.verified.cs new file mode 100644 index 00000000..625b7a73 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/test/PetStore.Api.Tests/Endpoints/Pets/ShowPetByIdHandlerStub.verified.cs @@ -0,0 +1,20 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.Api.Tests.Endpoints.Pets; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public class ShowPetByIdHandlerStub : IShowPetByIdHandler +{ + public Task ExecuteAsync( + ShowPetByIdParameters parameters, + CancellationToken cancellationToken = default) + { + var data = new Fixture().Create(); + + return Task.FromResult(ShowPetByIdResult.Ok(data)); + } +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/test/PetStore.Api.Tests/Endpoints/Pets/ShowPetByIdTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/test/PetStore.Api.Tests/Endpoints/Pets/ShowPetByIdTests.verified.cs new file mode 100644 index 00000000..e075ea6d --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/test/PetStore.Api.Tests/Endpoints/Pets/ShowPetByIdTests.verified.cs @@ -0,0 +1,21 @@ +namespace PetStore.Api.Tests.Endpoints.Pets; + +[Collection("Sequential-Endpoints")] +[Trait(Traits.Category, Traits.Categories.Integration)] +public class ShowPetByIdTests : WebApiControllerBaseTest +{ + public ShowPetByIdTests(WebApiStartupFactory fixture) + : base(fixture) + { + } + + [Fact(Skip = "Change this to a real integration-test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/test/PetStore.Api.Tests/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/test/PetStore.Api.Tests/GlobalUsings.verified.cs new file mode 100644 index 00000000..d96aaa6b --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/test/PetStore.Api.Tests/GlobalUsings.verified.cs @@ -0,0 +1,22 @@ +global using System.CodeDom.Compiler; +global using System.Reflection; +global using System.Text; +global using System.Text.Json; +global using System.Text.Json.Serialization; + +global using Atc.Rest.Options; +global using Atc.XUnit; + +global using AutoFixture; + +global using Microsoft.AspNetCore.Hosting; +global using Microsoft.AspNetCore.Http; +global using Microsoft.AspNetCore.Mvc.Testing; +global using Microsoft.AspNetCore.TestHost; +global using Microsoft.Extensions.Configuration; +global using Microsoft.Extensions.DependencyInjection; + +global using PetStore.Api.Generated; +global using PetStore.Api.Generated.Contracts.Pets; + +global using Xunit; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/test/PetStore.Api.Tests/WebApiControllerBaseTest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/test/PetStore.Api.Tests/WebApiControllerBaseTest.verified.cs new file mode 100644 index 00000000..81789efa --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/test/PetStore.Api.Tests/WebApiControllerBaseTest.verified.cs @@ -0,0 +1,56 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.Api.Tests; + +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public abstract class WebApiControllerBaseTest : IClassFixture +{ + protected readonly WebApiStartupFactory Factory; + + protected readonly HttpClient HttpClient; + + protected readonly IConfiguration Configuration; + + protected static JsonSerializerOptions? JsonSerializerOptions; + + protected WebApiControllerBaseTest(WebApiStartupFactory fixture) + { + this.Factory = fixture; + this.HttpClient = this.Factory.CreateClient(); + this.Configuration = new ConfigurationBuilder().Build(); + JsonSerializerOptions = new JsonSerializerOptions + { + PropertyNameCaseInsensitive = true, + Converters = + { + new JsonStringEnumConverter() + }, + }; + } + + protected static StringContent ToJson(object data) + => new(JsonSerializer.Serialize(data, JsonSerializerOptions), Encoding.UTF8, "application/json"); + + protected static StringContent Json(string data) + => new(data, Encoding.UTF8, "application/json"); + + protected static IFormFile GetTestFile() + { + var bytes = Encoding.UTF8.GetBytes("Hello World"); + var stream = new MemoryStream(bytes); + var formFile = new FormFile(stream, 0, stream.Length, "dummy", "dummy.txt") + { + Headers = new HeaderDictionary(), + ContentType = "application/octet-stream", + }; + + return formFile; + } + + protected static List GetTestFiles() + => new() { GetTestFile(), GetTestFile() }; +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/test/PetStore.Api.Tests/WebApiStartupFactory.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/test/PetStore.Api.Tests/WebApiStartupFactory.verified.cs new file mode 100644 index 00000000..e7acb12e --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/test/PetStore.Api.Tests/WebApiStartupFactory.verified.cs @@ -0,0 +1,40 @@ +//------------------------------------------------------------------------------ +// This code was auto-generated by ApiGenerator x.x.x.x. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ +namespace PetStore.Api.Tests; + +/// +/// Factory for bootstrapping in memory tests. +/// Includes options to override configuration and service collection using a partial class. +/// +[GeneratedCode("ApiGenerator", "x.x.x.x")] +public partial class WebApiStartupFactory : WebApplicationFactory +{ + protected override void ConfigureWebHost(IWebHostBuilder builder) + { + builder.ConfigureAppConfiguration(config => + { + ModifyConfiguration(config); + var integrationConfig = new ConfigurationBuilder() + .AddJsonFile("appsettings.integrationtest.json") + .Build(); + config.AddConfiguration(integrationConfig); + }); + + builder.ConfigureTestServices(services => + { + ModifyServices(services); + services.AddSingleton(); + services.AutoRegistrateServices( + Assembly.GetAssembly(typeof(ApiRegistration))!, + Assembly.GetAssembly(typeof(WebApiStartupFactory))!); + }); + } + + partial void ModifyConfiguration(IConfigurationBuilder config); + + partial void ModifyServices(IServiceCollection services); +} diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/test/PetStore.Domain.Tests/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/test/PetStore.Domain.Tests/GlobalUsings.verified.cs new file mode 100644 index 00000000..8c927eb7 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/test/PetStore.Domain.Tests/GlobalUsings.verified.cs @@ -0,0 +1 @@ +global using Xunit; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/test/PetStore.Domain.Tests/Handlers/Pets/CreatePetsHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/test/PetStore.Domain.Tests/Handlers/Pets/CreatePetsHandlerTests.verified.cs new file mode 100644 index 00000000..8f37e936 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/test/PetStore.Domain.Tests/Handlers/Pets/CreatePetsHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace PetStore.Domain.Tests.Handlers.Pets; + +public class CreatePetsHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/test/PetStore.Domain.Tests/Handlers/Pets/ListPetsHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/test/PetStore.Domain.Tests/Handlers/Pets/ListPetsHandlerTests.verified.cs new file mode 100644 index 00000000..033d6249 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/test/PetStore.Domain.Tests/Handlers/Pets/ListPetsHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace PetStore.Domain.Tests.Handlers.Pets; + +public class ListPetsHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/test/PetStore.Domain.Tests/Handlers/Pets/ShowPetByIdHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/test/PetStore.Domain.Tests/Handlers/Pets/ShowPetByIdHandlerTests.verified.cs new file mode 100644 index 00000000..ba0cd0b1 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/Scenarios/PetStore/VerifyServerAll/Mvc_WPD/test/PetStore.Domain.Tests/Handlers/Pets/ShowPetByIdHandlerTests.verified.cs @@ -0,0 +1,14 @@ +namespace PetStore.Domain.Tests.Handlers.Pets; + +public class ShowPetByIdHandlerTests +{ + [Fact(Skip = "Change this to a real test")] + public void Sample() + { + // Arrange + + // Act + + // Assert + } +} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/ScenariosTests.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/ScenariosTests.cs index c7481d82..d9624248 100644 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/ScenariosTests.cs +++ b/test/Atc.Rest.ApiGenerator.CLI.Tests/ScenariosTests.cs @@ -1,23 +1,26 @@ // ReSharper disable SuggestBaseTypeForParameter +// ReSharper disable HeuristicUnreachableCode namespace Atc.Rest.ApiGenerator.CLI.Tests; [UsesVerify] [Collection("Sequential-Scenarios")] +[Trait(Traits.Category, Traits.Categories.Integration)] public class ScenariosTests : ScenarioIntegrationTestBase, IAsyncLifetime { private static readonly DirectoryInfo WorkingPath = new( Path.Combine( - Path.GetTempPath(), - "atc-rest-api-generator-cli-test")); + @"c:\temp", + "atc-rest-cli-tests")); private static FileInfo? cliExeFile; [Theory] - [InlineData("DemoSampleApi")] - [InlineData("DemoUsersApi")] - [InlineData("GenericPaginationApi")] - [InlineData("PetStoreApi")] - [InlineData("TestUnit.Task.NsApi")] + [InlineData("DemoSample")] + [InlineData("ExAllResponseTypes")] + [InlineData("ExGenericPagination")] + [InlineData("ExNsWithTask")] + [InlineData("ExUsers")] + [InlineData("PetStore")] public async Task ValidateYamlSpecificationByScenario( string scenarioName) { @@ -48,119 +51,216 @@ public async Task ValidateYamlSpecificationByScenario( } [Theory] - [InlineData("DemoSampleApi")] - [InlineData("DemoUsersApi")] - [InlineData("GenericPaginationApi")] - [InlineData("PetStoreApi")] - [InlineData("TestUnit.Task.NsApi")] + [InlineData("DemoSample", AspNetOutputType.Mvc, false)] + [InlineData("DemoSample", AspNetOutputType.Mvc, true)] + [InlineData("ExAllResponseTypes", AspNetOutputType.Mvc, false)] + [InlineData("ExAllResponseTypes", AspNetOutputType.Mvc, true)] + [InlineData("ExGenericPagination", AspNetOutputType.Mvc, false)] + [InlineData("ExGenericPagination", AspNetOutputType.Mvc, true)] + [InlineData("ExNsWithTask", AspNetOutputType.Mvc, false)] + [InlineData("ExNsWithTask", AspNetOutputType.Mvc, true)] + [InlineData("ExUsers", AspNetOutputType.Mvc, false)] + [InlineData("ExUsers", AspNetOutputType.Mvc, true)] + [InlineData("PetStore", AspNetOutputType.Mvc, false)] + [InlineData("PetStore", AspNetOutputType.Mvc, true)] public async Task GenerateVerifyAndBuildForServerAllByScenario( - string scenarioName) + string scenarioName, + AspNetOutputType aspNetOutputType, + bool useProblemDetailsAsDefaultResponseBody) { // Arrange var scenarioPath = CollectScenarioPaths().First(x => x.Name == scenarioName); var specificationFile = GetYamlSpecificationPath(scenarioPath.FullName); + var outputPath = GetOutputPath(WorkingPath, scenarioPath, aspNetOutputType, useProblemDetailsAsDefaultResponseBody); + if (Directory.Exists(outputPath.FullName)) + { + Directory.Delete(outputPath.FullName, recursive: true); + } + // Act & Assert - await AssertGenerateForServerAll(WorkingPath, scenarioPath, specificationFile); - await AssertVerifyCsFilesForServerAll(WorkingPath, scenarioPath); - await AssertBuildForServerAll(WorkingPath, scenarioPath); + await AssertGenerateForServerAll(outputPath, scenarioPath, specificationFile, aspNetOutputType, useProblemDetailsAsDefaultResponseBody); + await AssertVerifyCsFilesForServerAll(outputPath, scenarioPath, aspNetOutputType, useProblemDetailsAsDefaultResponseBody); + await AssertBuildForServerAll(outputPath, scenarioPath); } - [Theory(Skip = "Remove 'skip' to test a single scenario by name without cleanup after code generations")] - [InlineData("Dummy for Skip-Theory")] - ////[Theory] - ////[InlineData("DemoSampleApi")] - ////[InlineData("DemoUsersApi")] - ////[InlineData("GenericPaginationApi")] - ////[InlineData("PetStoreApi")] - ////[InlineData("TestUnit.Task.NsApi")] - public async Task GenerateVerifyAndBuildForServerAllByScenarioWithoutCleanup( - string scenarioName) + [Theory] + [InlineData("DemoSample", false)] + [InlineData("DemoSample", true)] + [InlineData("ExAllResponseTypes", false)] + [InlineData("ExAllResponseTypes", true)] + [InlineData("ExGenericPagination", false)] + [InlineData("ExGenericPagination", true)] + [InlineData("ExNsWithTask", false)] + [InlineData("ExNsWithTask", true)] + [InlineData("ExUsers", false)] + [InlineData("ExUsers", true)] + [InlineData("PetStore", false)] + [InlineData("PetStore", true)] + public async Task GenerateVerifyAndBuildForClientCSharpByScenario( + string scenarioName, + bool useProblemDetailsAsDefaultResponseBody) { // Arrange var scenarioPath = CollectScenarioPaths().First(x => x.Name == scenarioName); var specificationFile = GetYamlSpecificationPath(scenarioPath.FullName); - var workingPath = new DirectoryInfo(@"c:\temp\ApiGenTemp"); - var workingPathForScenario = new DirectoryInfo(Path.Combine(workingPath.FullName, scenarioName)); - - if (workingPathForScenario.Exists) + var outputPath = GetOutputPath(WorkingPath, scenarioPath, aspNetOutputType: null, useProblemDetailsAsDefaultResponseBody); + if (Directory.Exists(outputPath.FullName)) { - Directory.Delete(workingPathForScenario.FullName, recursive: true); + Directory.Delete(outputPath.FullName, recursive: true); } // Act & Assert - await AssertGenerateForServerAll(workingPath, scenarioPath, specificationFile); - await AssertVerifyCsFilesForServerAll(workingPath, scenarioPath); - await AssertBuildForServerAll(workingPath, scenarioPath); + await AssertGenerateForClientCSharp(outputPath, scenarioPath, specificationFile, useProblemDetailsAsDefaultResponseBody); + await AssertVerifyCsFilesForClientCSharp(outputPath, scenarioPath, useProblemDetailsAsDefaultResponseBody); } - [Theory] - [InlineData("DemoSampleApi")] - [InlineData("DemoUsersApi")] - [InlineData("GenericPaginationApi")] - [InlineData("PetStoreApi")] - [InlineData("TestUnit.Task.NsApi")] - public async Task GenerateVerifyAndBuildForClientCSharpByScenario( - string scenarioName) + ////[Fact] + [Fact(Skip = "Only use it for prepare verify files")] + [SuppressMessage("Major Bug", "S2583:Conditionally executed code should be reachable", Justification = "OK.")] + public void PrepareVerifyServerAllCsFilesFromGeneratedOutput() { - // Arrange + const string scenarioName = "DemoSample"; + const AspNetOutputType aspNetOutputType = AspNetOutputType.Mvc; + const bool useProblemDetailsAsDefaultResponseBody = false; + var scenarioPath = CollectScenarioPaths().First(x => x.Name == scenarioName); - var specificationFile = GetYamlSpecificationPath(scenarioPath.FullName); + var outputPath = GetOutputPath(WorkingPath, scenarioPath, aspNetOutputType, useProblemDetailsAsDefaultResponseBody); + if (!outputPath.Exists) + { + return; + } - // Act & Assert - await AssertGenerateForClientCSharp(WorkingPath, scenarioPath, specificationFile); - await AssertVerifyCsFilesForClientCSharp(WorkingPath, scenarioPath); + var suffix = useProblemDetailsAsDefaultResponseBody + ? "WPD" + : "WOPD"; + + var verifyPath = new DirectoryInfo(Path.Combine(scenarioPath.FullName, "VerifyServerAll", $"{aspNetOutputType}_{suffix}")); + + CopyAndRenameCsFilesToVerified(outputPath, verifyPath); } - [Theory(Skip = "Remove 'skip' to test a single scenario by name without cleanup after code generations")] - [InlineData("Dummy for Skip-Theory")] - ////[Theory] - ////[InlineData("DemoSampleApi")] - ////[InlineData("DemoUsersApi")] - ////[InlineData("GenericPaginationApi")] - ////[InlineData("PetStoreApi")] - ////[InlineData("TestUnit.Task.NsApi")] - public async Task GenerateVerifyAndBuildForClientCSharpByScenarioWithoutCleanup( - string scenarioName) + ////[Fact] + [Fact(Skip = "Only use it for prepare verify files")] + [SuppressMessage("Major Bug", "S2583:Conditionally executed code should be reachable", Justification = "OK.")] + public void PrepareVerifySClientCsFilesFromGeneratedOutput() { - // Arrange + const string scenarioName = "PetStore"; + const bool useProblemDetailsAsDefaultResponseBody = true; + var scenarioPath = CollectScenarioPaths().First(x => x.Name == scenarioName); - var specificationFile = GetYamlSpecificationPath(scenarioPath.FullName); + var outputPath = GetOutputPath(WorkingPath, scenarioPath, aspNetOutputType: null, useProblemDetailsAsDefaultResponseBody); + if (!outputPath.Exists) + { + return; + } - var workingPath = new DirectoryInfo(@"c:\temp\ApiGenTemp"); - var workingPathForScenario = new DirectoryInfo(Path.Combine(workingPath.FullName, scenarioName)); + var suffix = useProblemDetailsAsDefaultResponseBody + ? "WPD" + : "WOPD"; - if (workingPathForScenario.Exists) + var verifyPath = new DirectoryInfo(Path.Combine(scenarioPath.FullName, "VerifyClient", suffix)); + + CopyAndRenameCsFilesToVerified(outputPath, verifyPath); + } + + private static void CopyAndRenameCsFilesToVerified( + DirectoryInfo source, + DirectoryInfo target) + { + foreach (var directory in source.GetDirectories()) { - Directory.Delete(workingPathForScenario.FullName, recursive: true); + var targetDirectory = target.CreateSubdirectory(directory.Name); + CopyAndRenameCsFilesToVerified(directory, targetDirectory); } - // Act & Assert - await AssertGenerateForClientCSharp(workingPath, scenarioPath, specificationFile); - await AssertVerifyCsFilesForClientCSharp(workingPath, scenarioPath); + foreach (var file in source.GetFiles("*.cs")) + { + var targetFilePath = Path.Combine(target.FullName, file.Name); + file.CopyTo(targetFilePath, overwrite: true); + + var renamedFilePath = Path.Combine(target.FullName, Path.GetFileNameWithoutExtension(file.Name) + ".verified.cs"); + File.Move(targetFilePath, renamedFilePath, true); + + ModifyFileToReplaceVersionIfNeeded(new FileInfo(renamedFilePath)); + } + } + + [SuppressMessage("Major Bug", "S4143:Collection elements should not be replaced unconditionally", Justification = "OK.")] + private static void ModifyFileToReplaceVersionIfNeeded( + FileInfo file) + { + var updateCount = 0; + var lines = FileHelper.ReadAllTextToLines(file); + for (var i = 0; i < lines.Length; i++) + { + if (!lines[i].Contains("ApiGenerator", StringComparison.Ordinal)) + { + continue; + } + + lines[i] = Regex.Replace( + lines[i], + pattern: @"ApiGenerator\s\d+\.\d+\.\d+\.\d+", + replacement: "ApiGenerator x.x.x.x", + RegexOptions.None, + TimeSpan.FromSeconds(1)); + + lines[i] = Regex.Replace( + lines[i], + pattern: @"\[GeneratedCode\(""ApiGenerator"",\s*""\d+\.\d+\.\d+\.\d+""\)\]", + replacement: @"[GeneratedCode(""ApiGenerator"", ""x.x.x.x"")]", + RegexOptions.None, + TimeSpan.FromSeconds(1)); + + updateCount++; + + if (updateCount >= 2) + { + break; + } + } + + if (updateCount > 0) + { + File.WriteAllLines(file.FullName, lines); + } } private static async Task AssertGenerateForServerAll( - DirectoryInfo workingPath, + DirectoryInfo outputPath, DirectoryInfo scenarioPath, - FileInfo specificationFile) + FileInfo specificationFile, + AspNetOutputType aspNetOutputType, + bool useProblemDetailsAsDefaultResponseBody) { - var outputPath = GetOutputPath(workingPath, scenarioPath); + var sbCommands = new StringBuilder(); + sbCommands.Append("generate server all"); + sbCommands.Append(" --specificationPath "); + sbCommands.Append(specificationFile.FullName); + sbCommands.Append(" --projectPrefixName "); + sbCommands.Append(scenarioPath.Name); + sbCommands.Append(" --outputSlnPath "); + sbCommands.Append(outputPath.FullName); + sbCommands.Append(" --outputSrcPath "); + sbCommands.Append(Path.Combine(outputPath.FullName, "src")); + sbCommands.Append(" --outputTestPath "); + sbCommands.Append(Path.Combine(outputPath.FullName, "test")); + sbCommands.Append(" --aspnet-output-type "); + sbCommands.Append(aspNetOutputType.ToString()); + if (useProblemDetailsAsDefaultResponseBody) + { + sbCommands.Append(" --useProblemDetailsAsDefaultResponseBody"); + } - var (isSuccessful, output) = await ProcessHelper.Execute( - cliExeFile!, - "generate server all " + - $"--specificationPath {specificationFile.FullName} " + - $"--projectPrefixName {scenarioPath.Name} " + - $"--outputSlnPath {outputPath.FullName} " + - $"--outputSrcPath {Path.Combine(outputPath.FullName, "src")} " + - $"--outputTestPath {Path.Combine(outputPath.FullName, "test")} " + - "-v"); + sbCommands.Append(" --verbose"); + + var (isSuccessful, output) = await ProcessHelper.Execute(cliExeFile!, sbCommands.ToString()); Assert.True( isSuccessful, @@ -178,15 +278,22 @@ private static async Task AssertGenerateForServerAll( } private static async Task AssertVerifyCsFilesForServerAll( - DirectoryInfo workingPath, - DirectoryInfo scenarioPath) + DirectoryInfo outputPath, + DirectoryInfo scenarioPath, + AspNetOutputType aspNetOutputType, + bool useProblemDetailsAsDefaultResponseBody) { - var verifyCsFiles = GetVerifyServerAllCsFilesForScenario(scenarioPath); - var outputPath = GetOutputPath(workingPath, scenarioPath); + var suffix = useProblemDetailsAsDefaultResponseBody + ? "WPD" + : "WOPD"; + + var verifyPath = new DirectoryInfo(Path.Combine(scenarioPath.FullName, "VerifyServerAll", $"{aspNetOutputType}_{suffix}")); + + var verifyCsFiles = GetVerifyCsFilesForScenario(verifyPath); foreach (var verifyFile in verifyCsFiles) { - var generatedFile = GetServerAllGeneratedFileForScenario(scenarioPath, verifyFile, outputPath); + var generatedFile = GetGeneratedFileForScenario(verifyPath, verifyFile, outputPath); Assert.True( generatedFile.Exists, @@ -198,19 +305,39 @@ private static async Task AssertVerifyCsFilesForServerAll( await Verify(generatedFileContent, settings); } - var outputCsFiles = Directory.GetFiles(outputPath.FullName, "*.cs", SearchOption.AllDirectories); + var outputCsFilesWithRelativePath = Directory.GetFiles(outputPath.FullName, "*.cs", SearchOption.AllDirectories) + .Select(x => Path.GetRelativePath(outputPath.FullName, x)) + .ToArray(); + + var verifyCsFilesWithRelativePath = verifyCsFiles.Select(x => x.FullName) + .Select(x => Path.GetRelativePath(scenarioPath.CombineFileInfo("VerifyServerAll", $"{aspNetOutputType}_{suffix}").FullName, x)) + .ToArray(); + + var onlyInOutput = outputCsFilesWithRelativePath + .Except(verifyCsFilesWithRelativePath, StringComparer.Ordinal) + .OrderBy(x => x, StringComparer.Ordinal) + .ToArray(); + + var onlyInVerify = verifyCsFilesWithRelativePath + .Except(outputCsFilesWithRelativePath, StringComparer.Ordinal) + .OrderBy(x => x, StringComparer.Ordinal) + .ToArray(); Assert.True( - outputCsFiles.Length == verifyCsFiles.Length, - $"Different count on *.cs files, input.count={verifyCsFiles.Length} and output.count={outputCsFiles.Length} for scenario '{scenarioPath.Name}'"); + outputCsFilesWithRelativePath.Length == verifyCsFilesWithRelativePath.Length, + $"Different count on *.cs files, " + + $"verify.count={verifyCsFilesWithRelativePath.Length} and " + + $"generated.count={outputCsFilesWithRelativePath.Length} for scenario '{scenarioPath.Name}'. " + + $"\n\nFiles only in output:" + + $"\n\t{string.Join("\n\t", onlyInOutput)}" + + $"\n\nFiles only in verify:" + + $"\n\t{string.Join("\n\t", onlyInVerify)}\n"); } private static async Task AssertBuildForServerAll( - DirectoryInfo workingPath, + DirectoryInfo outputPath, DirectoryInfo scenarioPath) { - var outputPath = GetOutputPath(workingPath, scenarioPath); - var buildErrors = await DotnetBuildHelper.BuildAndCollectErrors( NullLogger.Instance, outputPath, @@ -222,19 +349,27 @@ private static async Task AssertBuildForServerAll( } private static async Task AssertGenerateForClientCSharp( - DirectoryInfo workingPath, + DirectoryInfo outputPath, DirectoryInfo scenarioPath, - FileInfo specificationFile) + FileInfo specificationFile, + bool useProblemDetailsAsDefaultResponseBody) { - var outputPath = GetOutputPath(workingPath, scenarioPath); + var sbCommands = new StringBuilder(); + sbCommands.Append("generate client csharp"); + sbCommands.Append(" --specificationPath "); + sbCommands.Append(specificationFile.FullName); + sbCommands.Append(" --projectPrefixName "); + sbCommands.Append(scenarioPath.Name); + sbCommands.Append(" --outputPath "); + sbCommands.Append(Path.Combine(outputPath.FullName, "src")); + if (useProblemDetailsAsDefaultResponseBody) + { + sbCommands.Append(" --useProblemDetailsAsDefaultResponseBody"); + } - var (isSuccessful, output) = await ProcessHelper.Execute( - cliExeFile!, - "generate client csharp " + - $"--specificationPath {specificationFile.FullName} " + - $"--projectPrefixName {scenarioPath.Name} " + - $"--outputPath {Path.Combine(outputPath.FullName, "src")} " + - "-v"); + sbCommands.Append(" --verbose"); + + var (isSuccessful, output) = await ProcessHelper.Execute(cliExeFile!, sbCommands.ToString()); Assert.True( isSuccessful, @@ -252,15 +387,21 @@ private static async Task AssertGenerateForClientCSharp( } private static async Task AssertVerifyCsFilesForClientCSharp( - DirectoryInfo workingPath, - DirectoryInfo scenarioPath) + DirectoryInfo outputPath, + DirectoryInfo scenarioPath, + bool useProblemDetailsAsDefaultResponseBody) { - var verifyCsFiles = GetVerifyClientCSharpCsFilesForScenario(scenarioPath); - var outputPath = GetOutputPath(workingPath, scenarioPath); + var suffix = useProblemDetailsAsDefaultResponseBody + ? "WPD" + : "WOPD"; + + var verifyPath = new DirectoryInfo(Path.Combine(scenarioPath.FullName, "VerifyClient", suffix)); + + var verifyCsFiles = GetVerifyCsFilesForScenario(verifyPath); foreach (var verifyFile in verifyCsFiles) { - var generatedFile = GetClientCSharpGeneratedFileForScenario(scenarioPath, verifyFile, outputPath); + var generatedFile = GetGeneratedFileForScenario(verifyPath, verifyFile, outputPath); Assert.True( generatedFile.Exists, @@ -272,11 +413,26 @@ private static async Task AssertVerifyCsFilesForClientCSharp( await Verify(generatedFileContent, settings); } - var outputCsFiles = Directory.GetFiles(outputPath.FullName, "*.cs", SearchOption.AllDirectories); + var outputCsFilesWithRelativePath = Directory.GetFiles(outputPath.FullName, "*.cs", SearchOption.AllDirectories) + .Select(x => Path.GetRelativePath(outputPath.FullName, x)) + .ToArray(); + + var verifyCsFilesWithRelativePath = verifyCsFiles.Select(x => x.FullName) + .Select(x => Path.GetRelativePath(scenarioPath.CombineFileInfo("VerifyServerAll", suffix).FullName, x)) + .ToArray(); + + var onlyInOutput = outputCsFilesWithRelativePath.Except(verifyCsFilesWithRelativePath, StringComparer.Ordinal).ToArray(); + var onlyInVerify = verifyCsFilesWithRelativePath.Except(outputCsFilesWithRelativePath, StringComparer.Ordinal).ToArray(); Assert.True( - outputCsFiles.Length == verifyCsFiles.Length, - $"Different count on *.cs files, input.count={verifyCsFiles.Length} and output.count={outputCsFiles.Length} for scenario '{scenarioPath.Name}'"); + outputCsFilesWithRelativePath.Length == verifyCsFilesWithRelativePath.Length, + $"Different count on *.cs files, " + + $"verify.count={verifyCsFilesWithRelativePath.Length} and " + + $"generated.count={outputCsFilesWithRelativePath.Length} for scenario '{scenarioPath.Name}'. " + + $"\n\nFiles only in output:" + + $"\n\t{string.Join("\n\t", onlyInOutput)}" + + $"\n\nFiles only in verify:" + + $"\n\t{string.Join("\n\t", onlyInVerify)}\n"); } public Task InitializeAsync() @@ -288,11 +444,6 @@ public Task InitializeAsync() public Task DisposeAsync() { - if (Directory.Exists(WorkingPath.FullName)) - { - Directory.Delete(WorkingPath.FullName, recursive: true); - } - return Task.CompletedTask; } } \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Contracts/EventArgs/Models/EventArgs.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Contracts/EventArgs/Models/EventArgs.verified.cs deleted file mode 100644 index 6adf64f0..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Contracts/EventArgs/Models/EventArgs.verified.cs +++ /dev/null @@ -1,22 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.ApiClient.Generated.Contracts; - -/// -/// EventArgs. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class EventArgs -{ - public Guid Id { get; set; } - - public string EventName { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}, {nameof(EventName)}: {EventName}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Contracts/EventArgs/RequestParameters/GetEventArgByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Contracts/EventArgs/RequestParameters/GetEventArgByIdParameters.verified.cs deleted file mode 100644 index 9faaee77..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Contracts/EventArgs/RequestParameters/GetEventArgByIdParameters.verified.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.ApiClient.Generated.Contracts; - -/// -/// Parameters for operation request. -/// Description: Get EventArgs By Id. -/// Operation: GetEventArgById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetEventArgByIdParameters -{ - /// - /// The id of the eventArgs. - /// - [Required] - public string Id { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Contracts/Orders/Models/Order.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Contracts/Orders/Models/Order.verified.cs deleted file mode 100644 index f0211676..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Contracts/Orders/Models/Order.verified.cs +++ /dev/null @@ -1,23 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.ApiClient.Generated.Contracts; - -/// -/// A single order. -/// Hallo description with multiline and no ending dot. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class Order -{ - public Guid Id { get; set; } - - public string Description { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}, {nameof(Description)}: {Description}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Contracts/Orders/RequestParameters/GetOrderByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Contracts/Orders/RequestParameters/GetOrderByIdParameters.verified.cs deleted file mode 100644 index 79a567b1..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Contracts/Orders/RequestParameters/GetOrderByIdParameters.verified.cs +++ /dev/null @@ -1,35 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.ApiClient.Generated.Contracts; - -/// -/// Parameters for operation request. -/// Description: Get order by id. -/// Operation: GetOrderById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetOrderByIdParameters -{ - /// - /// The id of the order. - /// - [Required] - public Guid Id { get; set; } - - /// - /// The email for filter orders to retrieve. - /// - /// - /// Email validation being enforced. - /// - [EmailAddress] - public string? MyEmail { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}, {nameof(MyEmail)}: {MyEmail}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Contracts/Orders/RequestParameters/GetOrdersParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Contracts/Orders/RequestParameters/GetOrdersParameters.verified.cs deleted file mode 100644 index 0ba044cd..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Contracts/Orders/RequestParameters/GetOrdersParameters.verified.cs +++ /dev/null @@ -1,38 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.ApiClient.Generated.Contracts; - -/// -/// Parameters for operation request. -/// Description: Get orders. -/// Operation: GetOrders. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetOrdersParameters -{ - /// - /// The numbers of items to return. - /// - [Required] - [Range(1, 100)] - public int PageSize { get; set; } = 10; - - /// - /// The number of items to skip before starting to collect the result set. - /// - [Range(0, 2147483647)] - public int PageIndex { get; set; } = 0; - - /// - /// The continuation token. - /// - public string? ContinuationToken { get; set; } - - /// - public override string ToString() - => $"{nameof(PageSize)}: {PageSize}, {nameof(PageIndex)}: {PageIndex}, {nameof(ContinuationToken)}: {ContinuationToken}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Contracts/Tasks/Models/Task.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Contracts/Tasks/Models/Task.verified.cs deleted file mode 100644 index bf06139b..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Contracts/Tasks/Models/Task.verified.cs +++ /dev/null @@ -1,22 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.ApiClient.Generated.Contracts; - -/// -/// Describes a single task. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class Task -{ - public Guid Id { get; set; } - - public string Name { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}, {nameof(Name)}: {Name}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Contracts/Tasks/Models/Tasks.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Contracts/Tasks/Models/Tasks.verified.cs deleted file mode 100644 index 2271c5e0..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Contracts/Tasks/Models/Tasks.verified.cs +++ /dev/null @@ -1,23 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.ApiClient.Generated.Contracts; - -/// -/// Contains a list of Tasks. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class Tasks -{ - /// - /// A list of Task. - /// - public List TaskList { get; set; } = new List(); - - /// - public override string ToString() - => $"{nameof(TaskList)}.Count: {TaskList?.Count ?? 0}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Contracts/TestUnits/Models/TestUnit.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Contracts/TestUnits/Models/TestUnit.verified.cs deleted file mode 100644 index 754f4dc1..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Contracts/TestUnits/Models/TestUnit.verified.cs +++ /dev/null @@ -1,20 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.ApiClient.Generated.Contracts; - -/// -/// TestUnit. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class TestUnit -{ - public Guid Id { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Contracts/TestUnits/RequestParameters/ListTestUnitsParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Contracts/TestUnits/RequestParameters/ListTestUnitsParameters.verified.cs deleted file mode 100644 index b5e89359..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Contracts/TestUnits/RequestParameters/ListTestUnitsParameters.verified.cs +++ /dev/null @@ -1,38 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.ApiClient.Generated.Contracts; - -/// -/// Parameters for operation request. -/// Description: List test units. -/// Operation: ListTestUnits. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class ListTestUnitsParameters -{ - /// - /// The numbers of items to return. - /// - [Required] - [Range(1, 100)] - public int PageSize { get; set; } = 10; - - /// - /// The number of items to skip before starting to collect the result set. - /// - [Range(0, 2147483647)] - public int PageIndex { get; set; } = 0; - - /// - /// The continuation token. - /// - public string? ContinuationToken { get; set; } - - /// - public override string ToString() - => $"{nameof(PageSize)}: {PageSize}, {nameof(PageIndex)}: {PageIndex}, {nameof(ContinuationToken)}: {ContinuationToken}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Contracts/_Shared/PaginationResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Contracts/_Shared/PaginationResult.verified.cs deleted file mode 100644 index 66f407f0..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Contracts/_Shared/PaginationResult.verified.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.ApiClient.Generated.Contracts; - -/// -/// An item result subset of a data query. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class PaginationResult -{ - public int PageSize { get; set; } - - /// - /// Token to indicate next result set. - /// - public string? ContinuationToken { get; set; } - - public List Results { get; set; } = new List(); - - /// - public override string ToString() - => $"{nameof(PageSize)}: {PageSize}, {nameof(ContinuationToken)}: {ContinuationToken}, {nameof(Results)}.Count: {Results?.Count ?? 0}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/EventArgs/GetEventArgByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/EventArgs/GetEventArgByIdEndpoint.verified.cs deleted file mode 100644 index 1072be94..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/EventArgs/GetEventArgByIdEndpoint.verified.cs +++ /dev/null @@ -1,51 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint. -/// Description: Get EventArgs By Id. -/// Operation: GetEventArgById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetEventArgByIdEndpoint : IGetEventArgByIdEndpoint -{ - private readonly IHttpClientFactory factory; - private readonly IHttpMessageFactory httpMessageFactory; - - public GetEventArgByIdEndpoint( - IHttpClientFactory factory, - IHttpMessageFactory httpMessageFactory) - { - this.factory = factory; - this.httpMessageFactory = httpMessageFactory; - } - - public async Task ExecuteAsync( - GetEventArgByIdParameters parameters, - string httpClientName = "TestUnit.Task.NsApi-ApiClient", - CancellationToken cancellationToken = default) - { - var client = factory.CreateClient(httpClientName); - - var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/eventArgs/{id}"); - requestBuilder.WithPathParameter("id", parameters.Id); - - using var requestMessage = requestBuilder.Build(HttpMethod.Get); - using var response = await client.SendAsync(requestMessage, cancellationToken); - - var responseBuilder = httpMessageFactory.FromResponse(response); - responseBuilder.AddSuccessResponse(HttpStatusCode.OK); - responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); - responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); - responseBuilder.AddErrorResponse(HttpStatusCode.Forbidden); - responseBuilder.AddErrorResponse(HttpStatusCode.NotFound); - responseBuilder.AddErrorResponse(HttpStatusCode.InternalServerError); - - return await responseBuilder.BuildResponseAsync(x => new GetEventArgByIdEndpointResult(x), cancellationToken); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/EventArgs/GetEventArgByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/EventArgs/GetEventArgByIdEndpointResult.verified.cs deleted file mode 100644 index 2da87087..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/EventArgs/GetEventArgByIdEndpointResult.verified.cs +++ /dev/null @@ -1,59 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint result. -/// Description: Get EventArgs By Id. -/// Operation: GetEventArgById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetEventArgByIdEndpointResult : EndpointResponse, IGetEventArgByIdEndpointResult -{ - public GetEventArgByIdEndpointResult(EndpointResponse response) - : base(response) - { - } - - public bool IsOk - => StatusCode == HttpStatusCode.OK; - - public bool IsBadRequest - => StatusCode == HttpStatusCode.BadRequest; - - public bool IsUnauthorized - => StatusCode == HttpStatusCode.Unauthorized; - - public bool IsForbidden - => StatusCode == HttpStatusCode.Forbidden; - - public bool IsNotFound - => StatusCode == HttpStatusCode.NotFound; - - public bool IsInternalServerError - => StatusCode == HttpStatusCode.InternalServerError; - - public Contracts.EventArgs OkContent - => IsOk && ContentObject is Contracts.EventArgs result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); - - public ValidationProblemDetails BadRequestContent - => IsBadRequest && ContentObject is ValidationProblemDetails result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); - - public string NotFoundContent - => IsNotFound && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsNotFound property first."); - - public string InternalServerErrorContent - => IsInternalServerError && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsInternalServerError property first."); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/EventArgs/GetEventArgsEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/EventArgs/GetEventArgsEndpoint.verified.cs deleted file mode 100644 index 1bd0a6a6..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/EventArgs/GetEventArgsEndpoint.verified.cs +++ /dev/null @@ -1,47 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint. -/// Description: Get EventArgs List. -/// Operation: GetEventArgs. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetEventArgsEndpoint : IGetEventArgsEndpoint -{ - private readonly IHttpClientFactory factory; - private readonly IHttpMessageFactory httpMessageFactory; - - public GetEventArgsEndpoint( - IHttpClientFactory factory, - IHttpMessageFactory httpMessageFactory) - { - this.factory = factory; - this.httpMessageFactory = httpMessageFactory; - } - - public async Task ExecuteAsync( - string httpClientName = "TestUnit.Task.NsApi-ApiClient", - CancellationToken cancellationToken = default) - { - var client = factory.CreateClient(httpClientName); - - var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/eventArgs"); - - using var requestMessage = requestBuilder.Build(HttpMethod.Get); - using var response = await client.SendAsync(requestMessage, cancellationToken); - - var responseBuilder = httpMessageFactory.FromResponse(response); - responseBuilder.AddSuccessResponse>(HttpStatusCode.OK); - responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); - responseBuilder.AddErrorResponse(HttpStatusCode.Forbidden); - responseBuilder.AddErrorResponse(HttpStatusCode.InternalServerError); - - return await responseBuilder.BuildResponseAsync(x => new GetEventArgsEndpointResult(x), cancellationToken); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/EventArgs/GetEventArgsEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/EventArgs/GetEventArgsEndpointResult.verified.cs deleted file mode 100644 index f21f3dd8..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/EventArgs/GetEventArgsEndpointResult.verified.cs +++ /dev/null @@ -1,43 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint result. -/// Description: Get EventArgs List. -/// Operation: GetEventArgs. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetEventArgsEndpointResult : EndpointResponse, IGetEventArgsEndpointResult -{ - public GetEventArgsEndpointResult(EndpointResponse response) - : base(response) - { - } - - public bool IsOk - => StatusCode == HttpStatusCode.OK; - - public bool IsUnauthorized - => StatusCode == HttpStatusCode.Unauthorized; - - public bool IsForbidden - => StatusCode == HttpStatusCode.Forbidden; - - public bool IsInternalServerError - => StatusCode == HttpStatusCode.InternalServerError; - - public List OkContent - => IsOk && ContentObject is List result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); - - public string InternalServerErrorContent - => IsInternalServerError && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsInternalServerError property first."); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgByIdEndpoint.verified.cs deleted file mode 100644 index 26c08fbf..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgByIdEndpoint.verified.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint. -/// Description: Get EventArgs By Id. -/// Operation: GetEventArgById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetEventArgByIdEndpoint -{ - /// - /// Execute method. - /// - /// The parameters. - /// The http client name. - /// The cancellation token. - Task ExecuteAsync( - GetEventArgByIdParameters parameters, - string httpClientName = "TestUnit.Task.NsApi-ApiClient", - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgByIdEndpointResult.verified.cs deleted file mode 100644 index ba4c5982..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgByIdEndpointResult.verified.cs +++ /dev/null @@ -1,36 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint Result. -/// Description: Get EventArgs By Id. -/// Operation: GetEventArgById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetEventArgByIdEndpointResult : IEndpointResponse -{ - bool IsOk { get; } - - bool IsBadRequest { get; } - - bool IsUnauthorized { get; } - - bool IsForbidden { get; } - - bool IsNotFound { get; } - - bool IsInternalServerError { get; } - - Contracts.EventArgs OkContent { get; } - - ValidationProblemDetails BadRequestContent { get; } - - string NotFoundContent { get; } - - string InternalServerErrorContent { get; } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgsEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgsEndpoint.verified.cs deleted file mode 100644 index b2512a17..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgsEndpoint.verified.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint. -/// Description: Get EventArgs List. -/// Operation: GetEventArgs. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetEventArgsEndpoint -{ - /// - /// Execute method. - /// - /// The http client name. - /// The cancellation token. - Task ExecuteAsync( - string httpClientName = "TestUnit.Task.NsApi-ApiClient", - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgsEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgsEndpointResult.verified.cs deleted file mode 100644 index e31ae374..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/EventArgs/Interfaces/IGetEventArgsEndpointResult.verified.cs +++ /dev/null @@ -1,28 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint Result. -/// Description: Get EventArgs List. -/// Operation: GetEventArgs. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetEventArgsEndpointResult : IEndpointResponse -{ - bool IsOk { get; } - - bool IsUnauthorized { get; } - - bool IsForbidden { get; } - - bool IsInternalServerError { get; } - - List OkContent { get; } - - string InternalServerErrorContent { get; } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/Orders/GetOrderByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/Orders/GetOrderByIdEndpoint.verified.cs deleted file mode 100644 index bda89d99..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/Orders/GetOrderByIdEndpoint.verified.cs +++ /dev/null @@ -1,52 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint. -/// Description: Get order by id. -/// Operation: GetOrderById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetOrderByIdEndpoint : IGetOrderByIdEndpoint -{ - private readonly IHttpClientFactory factory; - private readonly IHttpMessageFactory httpMessageFactory; - - public GetOrderByIdEndpoint( - IHttpClientFactory factory, - IHttpMessageFactory httpMessageFactory) - { - this.factory = factory; - this.httpMessageFactory = httpMessageFactory; - } - - public async Task ExecuteAsync( - GetOrderByIdParameters parameters, - string httpClientName = "TestUnit.Task.NsApi-ApiClient", - CancellationToken cancellationToken = default) - { - var client = factory.CreateClient(httpClientName); - - var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/orders/{id}"); - requestBuilder.WithPathParameter("id", parameters.Id); - requestBuilder.WithQueryParameter("myEmail", parameters.MyEmail); - - using var requestMessage = requestBuilder.Build(HttpMethod.Get); - using var response = await client.SendAsync(requestMessage, cancellationToken); - - var responseBuilder = httpMessageFactory.FromResponse(response); - responseBuilder.AddSuccessResponse(HttpStatusCode.OK); - responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); - responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); - responseBuilder.AddErrorResponse(HttpStatusCode.Forbidden); - responseBuilder.AddErrorResponse(HttpStatusCode.NotFound); - responseBuilder.AddErrorResponse(HttpStatusCode.InternalServerError); - - return await responseBuilder.BuildResponseAsync(x => new GetOrderByIdEndpointResult(x), cancellationToken); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/Orders/GetOrderByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/Orders/GetOrderByIdEndpointResult.verified.cs deleted file mode 100644 index f574fb7c..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/Orders/GetOrderByIdEndpointResult.verified.cs +++ /dev/null @@ -1,59 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint result. -/// Description: Get order by id. -/// Operation: GetOrderById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetOrderByIdEndpointResult : EndpointResponse, IGetOrderByIdEndpointResult -{ - public GetOrderByIdEndpointResult(EndpointResponse response) - : base(response) - { - } - - public bool IsOk - => StatusCode == HttpStatusCode.OK; - - public bool IsBadRequest - => StatusCode == HttpStatusCode.BadRequest; - - public bool IsUnauthorized - => StatusCode == HttpStatusCode.Unauthorized; - - public bool IsForbidden - => StatusCode == HttpStatusCode.Forbidden; - - public bool IsNotFound - => StatusCode == HttpStatusCode.NotFound; - - public bool IsInternalServerError - => StatusCode == HttpStatusCode.InternalServerError; - - public Order OkContent - => IsOk && ContentObject is Order result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); - - public ValidationProblemDetails BadRequestContent - => IsBadRequest && ContentObject is ValidationProblemDetails result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); - - public string NotFoundContent - => IsNotFound && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsNotFound property first."); - - public string InternalServerErrorContent - => IsInternalServerError && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsInternalServerError property first."); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/Orders/GetOrdersEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/Orders/GetOrdersEndpoint.verified.cs deleted file mode 100644 index 8d1fd116..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/Orders/GetOrdersEndpoint.verified.cs +++ /dev/null @@ -1,53 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint. -/// Description: Get orders. -/// Operation: GetOrders. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetOrdersEndpoint : IGetOrdersEndpoint -{ - private readonly IHttpClientFactory factory; - private readonly IHttpMessageFactory httpMessageFactory; - - public GetOrdersEndpoint( - IHttpClientFactory factory, - IHttpMessageFactory httpMessageFactory) - { - this.factory = factory; - this.httpMessageFactory = httpMessageFactory; - } - - public async Task ExecuteAsync( - GetOrdersParameters parameters, - string httpClientName = "TestUnit.Task.NsApi-ApiClient", - CancellationToken cancellationToken = default) - { - var client = factory.CreateClient(httpClientName); - - var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/orders"); - requestBuilder.WithQueryParameter("pageSize", parameters.PageSize); - requestBuilder.WithQueryParameter("pageIndex", parameters.PageIndex); - requestBuilder.WithQueryParameter("continuationToken", parameters.ContinuationToken); - - using var requestMessage = requestBuilder.Build(HttpMethod.Get); - using var response = await client.SendAsync(requestMessage, cancellationToken); - - var responseBuilder = httpMessageFactory.FromResponse(response); - responseBuilder.AddSuccessResponse>(HttpStatusCode.OK); - responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); - responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); - responseBuilder.AddErrorResponse(HttpStatusCode.Forbidden); - responseBuilder.AddErrorResponse(HttpStatusCode.NotFound); - responseBuilder.AddErrorResponse(HttpStatusCode.InternalServerError); - - return await responseBuilder.BuildResponseAsync(x => new GetOrdersEndpointResult(x), cancellationToken); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/Orders/GetOrdersEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/Orders/GetOrdersEndpointResult.verified.cs deleted file mode 100644 index 23168511..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/Orders/GetOrdersEndpointResult.verified.cs +++ /dev/null @@ -1,59 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint result. -/// Description: Get orders. -/// Operation: GetOrders. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetOrdersEndpointResult : EndpointResponse, IGetOrdersEndpointResult -{ - public GetOrdersEndpointResult(EndpointResponse response) - : base(response) - { - } - - public bool IsOk - => StatusCode == HttpStatusCode.OK; - - public bool IsBadRequest - => StatusCode == HttpStatusCode.BadRequest; - - public bool IsUnauthorized - => StatusCode == HttpStatusCode.Unauthorized; - - public bool IsForbidden - => StatusCode == HttpStatusCode.Forbidden; - - public bool IsNotFound - => StatusCode == HttpStatusCode.NotFound; - - public bool IsInternalServerError - => StatusCode == HttpStatusCode.InternalServerError; - - public PaginationResult OkContent - => IsOk && ContentObject is PaginationResult result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); - - public ValidationProblemDetails BadRequestContent - => IsBadRequest && ContentObject is ValidationProblemDetails result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); - - public string NotFoundContent - => IsNotFound && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsNotFound property first."); - - public string InternalServerErrorContent - => IsInternalServerError && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsInternalServerError property first."); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrderByIdEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrderByIdEndpoint.verified.cs deleted file mode 100644 index 227baf05..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrderByIdEndpoint.verified.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint. -/// Description: Get order by id. -/// Operation: GetOrderById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetOrderByIdEndpoint -{ - /// - /// Execute method. - /// - /// The parameters. - /// The http client name. - /// The cancellation token. - Task ExecuteAsync( - GetOrderByIdParameters parameters, - string httpClientName = "TestUnit.Task.NsApi-ApiClient", - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrderByIdEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrderByIdEndpointResult.verified.cs deleted file mode 100644 index 87ce8668..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrderByIdEndpointResult.verified.cs +++ /dev/null @@ -1,36 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint Result. -/// Description: Get order by id. -/// Operation: GetOrderById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetOrderByIdEndpointResult : IEndpointResponse -{ - bool IsOk { get; } - - bool IsBadRequest { get; } - - bool IsUnauthorized { get; } - - bool IsForbidden { get; } - - bool IsNotFound { get; } - - bool IsInternalServerError { get; } - - Order OkContent { get; } - - ValidationProblemDetails BadRequestContent { get; } - - string NotFoundContent { get; } - - string InternalServerErrorContent { get; } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrdersEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrdersEndpoint.verified.cs deleted file mode 100644 index 114acab7..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrdersEndpoint.verified.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint. -/// Description: Get orders. -/// Operation: GetOrders. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetOrdersEndpoint -{ - /// - /// Execute method. - /// - /// The parameters. - /// The http client name. - /// The cancellation token. - Task ExecuteAsync( - GetOrdersParameters parameters, - string httpClientName = "TestUnit.Task.NsApi-ApiClient", - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrdersEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrdersEndpointResult.verified.cs deleted file mode 100644 index 609a0449..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/Orders/Interfaces/IGetOrdersEndpointResult.verified.cs +++ /dev/null @@ -1,36 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint Result. -/// Description: Get orders. -/// Operation: GetOrders. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetOrdersEndpointResult : IEndpointResponse -{ - bool IsOk { get; } - - bool IsBadRequest { get; } - - bool IsUnauthorized { get; } - - bool IsForbidden { get; } - - bool IsNotFound { get; } - - bool IsInternalServerError { get; } - - PaginationResult OkContent { get; } - - ValidationProblemDetails BadRequestContent { get; } - - string NotFoundContent { get; } - - string InternalServerErrorContent { get; } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/Tasks/GetTasksEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/Tasks/GetTasksEndpoint.verified.cs deleted file mode 100644 index fcb6739c..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/Tasks/GetTasksEndpoint.verified.cs +++ /dev/null @@ -1,47 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint. -/// Description: Returns tasks. -/// Operation: GetTasks. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetTasksEndpoint : IGetTasksEndpoint -{ - private readonly IHttpClientFactory factory; - private readonly IHttpMessageFactory httpMessageFactory; - - public GetTasksEndpoint( - IHttpClientFactory factory, - IHttpMessageFactory httpMessageFactory) - { - this.factory = factory; - this.httpMessageFactory = httpMessageFactory; - } - - public async Task ExecuteAsync( - string httpClientName = "TestUnit.Task.NsApi-ApiClient", - CancellationToken cancellationToken = default) - { - var client = factory.CreateClient(httpClientName); - - var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/tasks"); - - using var requestMessage = requestBuilder.Build(HttpMethod.Get); - using var response = await client.SendAsync(requestMessage, cancellationToken); - - var responseBuilder = httpMessageFactory.FromResponse(response); - responseBuilder.AddSuccessResponse>(HttpStatusCode.OK); - responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); - responseBuilder.AddErrorResponse(HttpStatusCode.Forbidden); - responseBuilder.AddErrorResponse(HttpStatusCode.InternalServerError); - - return await responseBuilder.BuildResponseAsync(x => new GetTasksEndpointResult(x), cancellationToken); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/Tasks/GetTasksEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/Tasks/GetTasksEndpointResult.verified.cs deleted file mode 100644 index 986e1726..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/Tasks/GetTasksEndpointResult.verified.cs +++ /dev/null @@ -1,43 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint result. -/// Description: Returns tasks. -/// Operation: GetTasks. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetTasksEndpointResult : EndpointResponse, IGetTasksEndpointResult -{ - public GetTasksEndpointResult(EndpointResponse response) - : base(response) - { - } - - public bool IsOk - => StatusCode == HttpStatusCode.OK; - - public bool IsUnauthorized - => StatusCode == HttpStatusCode.Unauthorized; - - public bool IsForbidden - => StatusCode == HttpStatusCode.Forbidden; - - public bool IsInternalServerError - => StatusCode == HttpStatusCode.InternalServerError; - - public List OkContent - => IsOk && ContentObject is List result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); - - public string InternalServerErrorContent - => IsInternalServerError && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsInternalServerError property first."); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/Tasks/Interfaces/IGetTasksEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/Tasks/Interfaces/IGetTasksEndpoint.verified.cs deleted file mode 100644 index 895a1986..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/Tasks/Interfaces/IGetTasksEndpoint.verified.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint. -/// Description: Returns tasks. -/// Operation: GetTasks. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetTasksEndpoint -{ - /// - /// Execute method. - /// - /// The http client name. - /// The cancellation token. - Task ExecuteAsync( - string httpClientName = "TestUnit.Task.NsApi-ApiClient", - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/Tasks/Interfaces/IGetTasksEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/Tasks/Interfaces/IGetTasksEndpointResult.verified.cs deleted file mode 100644 index ccf01bdf..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/Tasks/Interfaces/IGetTasksEndpointResult.verified.cs +++ /dev/null @@ -1,28 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint Result. -/// Description: Returns tasks. -/// Operation: GetTasks. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetTasksEndpointResult : IEndpointResponse -{ - bool IsOk { get; } - - bool IsUnauthorized { get; } - - bool IsForbidden { get; } - - bool IsInternalServerError { get; } - - List OkContent { get; } - - string InternalServerErrorContent { get; } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/TestUnits/Interfaces/IListTestUnitsEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/TestUnits/Interfaces/IListTestUnitsEndpoint.verified.cs deleted file mode 100644 index e4f6751e..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/TestUnits/Interfaces/IListTestUnitsEndpoint.verified.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint. -/// Description: List test units. -/// Operation: ListTestUnits. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IListTestUnitsEndpoint -{ - /// - /// Execute method. - /// - /// The parameters. - /// The http client name. - /// The cancellation token. - Task ExecuteAsync( - ListTestUnitsParameters parameters, - string httpClientName = "TestUnit.Task.NsApi-ApiClient", - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/TestUnits/Interfaces/IListTestUnitsEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/TestUnits/Interfaces/IListTestUnitsEndpointResult.verified.cs deleted file mode 100644 index 977bfa67..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/TestUnits/Interfaces/IListTestUnitsEndpointResult.verified.cs +++ /dev/null @@ -1,32 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.ApiClient.Generated.Endpoints; - -/// -/// Interface for Client Endpoint Result. -/// Description: List test units. -/// Operation: ListTestUnits. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IListTestUnitsEndpointResult : IEndpointResponse -{ - bool IsOk { get; } - - bool IsBadRequest { get; } - - bool IsUnauthorized { get; } - - bool IsForbidden { get; } - - bool IsInternalServerError { get; } - - PaginationResult OkContent { get; } - - ValidationProblemDetails BadRequestContent { get; } - - string InternalServerErrorContent { get; } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/TestUnits/ListTestUnitsEndpoint.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/TestUnits/ListTestUnitsEndpoint.verified.cs deleted file mode 100644 index b8981c6d..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/TestUnits/ListTestUnitsEndpoint.verified.cs +++ /dev/null @@ -1,52 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint. -/// Description: List test units. -/// Operation: ListTestUnits. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class ListTestUnitsEndpoint : IListTestUnitsEndpoint -{ - private readonly IHttpClientFactory factory; - private readonly IHttpMessageFactory httpMessageFactory; - - public ListTestUnitsEndpoint( - IHttpClientFactory factory, - IHttpMessageFactory httpMessageFactory) - { - this.factory = factory; - this.httpMessageFactory = httpMessageFactory; - } - - public async Task ExecuteAsync( - ListTestUnitsParameters parameters, - string httpClientName = "TestUnit.Task.NsApi-ApiClient", - CancellationToken cancellationToken = default) - { - var client = factory.CreateClient(httpClientName); - - var requestBuilder = httpMessageFactory.FromTemplate("/api/v1/test-units"); - requestBuilder.WithQueryParameter("pageSize", parameters.PageSize); - requestBuilder.WithQueryParameter("pageIndex", parameters.PageIndex); - requestBuilder.WithQueryParameter("continuationToken", parameters.ContinuationToken); - - using var requestMessage = requestBuilder.Build(HttpMethod.Get); - using var response = await client.SendAsync(requestMessage, cancellationToken); - - var responseBuilder = httpMessageFactory.FromResponse(response); - responseBuilder.AddSuccessResponse>(HttpStatusCode.OK); - responseBuilder.AddErrorResponse(HttpStatusCode.BadRequest); - responseBuilder.AddErrorResponse(HttpStatusCode.Unauthorized); - responseBuilder.AddErrorResponse(HttpStatusCode.Forbidden); - responseBuilder.AddErrorResponse(HttpStatusCode.InternalServerError); - - return await responseBuilder.BuildResponseAsync(x => new ListTestUnitsEndpointResult(x), cancellationToken); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/TestUnits/ListTestUnitsEndpointResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/TestUnits/ListTestUnitsEndpointResult.verified.cs deleted file mode 100644 index b336c144..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/Endpoints/TestUnits/ListTestUnitsEndpointResult.verified.cs +++ /dev/null @@ -1,51 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.ApiClient.Generated.Endpoints; - -/// -/// Client Endpoint result. -/// Description: List test units. -/// Operation: ListTestUnits. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class ListTestUnitsEndpointResult : EndpointResponse, IListTestUnitsEndpointResult -{ - public ListTestUnitsEndpointResult(EndpointResponse response) - : base(response) - { - } - - public bool IsOk - => StatusCode == HttpStatusCode.OK; - - public bool IsBadRequest - => StatusCode == HttpStatusCode.BadRequest; - - public bool IsUnauthorized - => StatusCode == HttpStatusCode.Unauthorized; - - public bool IsForbidden - => StatusCode == HttpStatusCode.Forbidden; - - public bool IsInternalServerError - => StatusCode == HttpStatusCode.InternalServerError; - - public PaginationResult OkContent - => IsOk && ContentObject is PaginationResult result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsOk property first."); - - public ValidationProblemDetails BadRequestContent - => IsBadRequest && ContentObject is ValidationProblemDetails result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsBadRequest property first."); - - public string InternalServerErrorContent - => IsInternalServerError && ContentObject is string result - ? result - : throw new InvalidOperationException("Content is not the expected type - please use the IsInternalServerError property first."); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/GlobalUsings.verified.cs deleted file mode 100644 index f264c4d3..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyClientCSharp/src/TestUnit.Task.NsApi.ApiClient.Generated/GlobalUsings.verified.cs +++ /dev/null @@ -1,10 +0,0 @@ -global using System.CodeDom.Compiler; -global using System.ComponentModel.DataAnnotations; -global using System.Net; - -global using Atc.Rest.Client; -global using Atc.Rest.Client.Builder; - -global using Microsoft.AspNetCore.Mvc; - -global using TestUnit.Task.NsApi.ApiClient.Generated.Contracts; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/ApiRegistration.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/ApiRegistration.verified.cs deleted file mode 100644 index 2202c39f..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/ApiRegistration.verified.cs +++ /dev/null @@ -1,12 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.Api.Generated; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class ApiRegistration -{ -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/EventArgs/Interfaces/IGetEventArgByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/EventArgs/Interfaces/IGetEventArgByIdHandler.verified.cs deleted file mode 100644 index 414a236b..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/EventArgs/Interfaces/IGetEventArgByIdHandler.verified.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.Api.Generated.Contracts.EventArgs; - -/// -/// Domain Interface for RequestHandler. -/// Description: Get EventArgs By Id. -/// Operation: GetEventArgById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetEventArgByIdHandler -{ - /// - /// Execute method. - /// - /// The parameters. - /// The cancellation token. - Task ExecuteAsync( - GetEventArgByIdParameters parameters, - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/EventArgs/Interfaces/IGetEventArgsHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/EventArgs/Interfaces/IGetEventArgsHandler.verified.cs deleted file mode 100644 index db560353..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/EventArgs/Interfaces/IGetEventArgsHandler.verified.cs +++ /dev/null @@ -1,23 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.Api.Generated.Contracts.EventArgs; - -/// -/// Domain Interface for RequestHandler. -/// Description: Get EventArgs List. -/// Operation: GetEventArgs. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetEventArgsHandler -{ - /// - /// Execute method. - /// - /// The cancellation token. - Task ExecuteAsync( - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/EventArgs/Models/EventArgs.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/EventArgs/Models/EventArgs.verified.cs deleted file mode 100644 index c462c465..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/EventArgs/Models/EventArgs.verified.cs +++ /dev/null @@ -1,22 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.Api.Generated.Contracts.EventArgs; - -/// -/// EventArgs. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class EventArgs -{ - public Guid Id { get; set; } - - public string EventName { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}, {nameof(EventName)}: {EventName}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/EventArgs/Parameters/GetEventArgByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/EventArgs/Parameters/GetEventArgByIdParameters.verified.cs deleted file mode 100644 index 0ad00256..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/EventArgs/Parameters/GetEventArgByIdParameters.verified.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.Api.Generated.Contracts.EventArgs; - -/// -/// Parameters for operation request. -/// Description: Get EventArgs By Id. -/// Operation: GetEventArgById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetEventArgByIdParameters -{ - /// - /// The id of the eventArgs. - /// - [FromRoute(Name = "id")] - [Required] - public string Id { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/EventArgs/Results/GetEventArgByIdResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/EventArgs/Results/GetEventArgByIdResult.verified.cs deleted file mode 100644 index bc0ac69a..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/EventArgs/Results/GetEventArgByIdResult.verified.cs +++ /dev/null @@ -1,36 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.Api.Generated.Contracts.EventArgs; - -/// -/// Results for operation request. -/// Description: Get EventArgs By Id. -/// Operation: GetEventArgById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetEventArgByIdResult : ResultBase -{ - private GetEventArgByIdResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static GetEventArgByIdResult Ok(EventArgs response) - => new GetEventArgByIdResult(new OkObjectResult(response)); - - /// - /// 404 - NotFound response. - /// - public static GetEventArgByIdResult NotFound(string? message = null) - => new GetEventArgByIdResult(new NotFoundObjectResult(message)); - - /// - /// Performs an implicit conversion from GetEventArgByIdResult to ActionResult. - /// - public static implicit operator GetEventArgByIdResult(EventArgs response) - => Ok(response); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/EventArgs/Results/GetEventArgsResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/EventArgs/Results/GetEventArgsResult.verified.cs deleted file mode 100644 index f21ae7f4..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/EventArgs/Results/GetEventArgsResult.verified.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.Api.Generated.Contracts.EventArgs; - -/// -/// Results for operation request. -/// Description: Get EventArgs List. -/// Operation: GetEventArgs. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetEventArgsResult : ResultBase -{ - private GetEventArgsResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static GetEventArgsResult Ok(IEnumerable response) - => new GetEventArgsResult(new OkObjectResult(response ?? Enumerable.Empty())); - - /// - /// Performs an implicit conversion from GetEventArgsResult to ActionResult. - /// - public static implicit operator GetEventArgsResult(List response) - => Ok(response); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/Orders/Interfaces/IGetOrderByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/Orders/Interfaces/IGetOrderByIdHandler.verified.cs deleted file mode 100644 index 07dd9df4..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/Orders/Interfaces/IGetOrderByIdHandler.verified.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.Api.Generated.Contracts.Orders; - -/// -/// Domain Interface for RequestHandler. -/// Description: Get order by id. -/// Operation: GetOrderById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetOrderByIdHandler -{ - /// - /// Execute method. - /// - /// The parameters. - /// The cancellation token. - Task ExecuteAsync( - GetOrderByIdParameters parameters, - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/Orders/Interfaces/IGetOrdersHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/Orders/Interfaces/IGetOrdersHandler.verified.cs deleted file mode 100644 index b2192c49..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/Orders/Interfaces/IGetOrdersHandler.verified.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.Api.Generated.Contracts.Orders; - -/// -/// Domain Interface for RequestHandler. -/// Description: Get orders. -/// Operation: GetOrders. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetOrdersHandler -{ - /// - /// Execute method. - /// - /// The parameters. - /// The cancellation token. - Task ExecuteAsync( - GetOrdersParameters parameters, - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/Orders/Models/Order.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/Orders/Models/Order.verified.cs deleted file mode 100644 index b0e66ba5..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/Orders/Models/Order.verified.cs +++ /dev/null @@ -1,23 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.Api.Generated.Contracts.Orders; - -/// -/// A single order. -/// Hallo description with multiline and no ending dot. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class Order -{ - public Guid Id { get; set; } - - public string Description { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}, {nameof(Description)}: {Description}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/Orders/Parameters/GetOrderByIdParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/Orders/Parameters/GetOrderByIdParameters.verified.cs deleted file mode 100644 index 86d3ba13..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/Orders/Parameters/GetOrderByIdParameters.verified.cs +++ /dev/null @@ -1,37 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.Api.Generated.Contracts.Orders; - -/// -/// Parameters for operation request. -/// Description: Get order by id. -/// Operation: GetOrderById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetOrderByIdParameters -{ - /// - /// The id of the order. - /// - [FromRoute(Name = "id")] - [Required] - public Guid Id { get; set; } - - /// - /// The email for filter orders to retrieve. - /// - /// - /// Email validation being enforced. - /// - [FromQuery(Name = "myEmail")] - [EmailAddress] - public string? MyEmail { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}, {nameof(MyEmail)}: {MyEmail}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/Orders/Parameters/GetOrdersParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/Orders/Parameters/GetOrdersParameters.verified.cs deleted file mode 100644 index e3520dd5..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/Orders/Parameters/GetOrdersParameters.verified.cs +++ /dev/null @@ -1,41 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.Api.Generated.Contracts.Orders; - -/// -/// Parameters for operation request. -/// Description: Get orders. -/// Operation: GetOrders. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetOrdersParameters -{ - /// - /// The numbers of items to return. - /// - [FromQuery(Name = "pageSize")] - [Required] - [Range(1, 100)] - public int PageSize { get; set; } = 10; - - /// - /// The number of items to skip before starting to collect the result set. - /// - [FromQuery(Name = "pageIndex")] - [Range(0, 2147483647)] - public int PageIndex { get; set; } = 0; - - /// - /// The continuation token. - /// - [FromQuery(Name = "continuationToken")] - public string? ContinuationToken { get; set; } - - /// - public override string ToString() - => $"{nameof(PageSize)}: {PageSize}, {nameof(PageIndex)}: {PageIndex}, {nameof(ContinuationToken)}: {ContinuationToken}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/Orders/Results/GetOrderByIdResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/Orders/Results/GetOrderByIdResult.verified.cs deleted file mode 100644 index bd4f9084..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/Orders/Results/GetOrderByIdResult.verified.cs +++ /dev/null @@ -1,36 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.Api.Generated.Contracts.Orders; - -/// -/// Results for operation request. -/// Description: Get order by id. -/// Operation: GetOrderById. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetOrderByIdResult : ResultBase -{ - private GetOrderByIdResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static GetOrderByIdResult Ok(Order response) - => new GetOrderByIdResult(new OkObjectResult(response)); - - /// - /// 404 - NotFound response. - /// - public static GetOrderByIdResult NotFound(string? message = null) - => new GetOrderByIdResult(new NotFoundObjectResult(message)); - - /// - /// Performs an implicit conversion from GetOrderByIdResult to ActionResult. - /// - public static implicit operator GetOrderByIdResult(Order response) - => Ok(response); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/Orders/Results/GetOrdersResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/Orders/Results/GetOrdersResult.verified.cs deleted file mode 100644 index e4e12a2d..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/Orders/Results/GetOrdersResult.verified.cs +++ /dev/null @@ -1,36 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.Api.Generated.Contracts.Orders; - -/// -/// Results for operation request. -/// Description: Get orders. -/// Operation: GetOrders. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetOrdersResult : ResultBase -{ - private GetOrdersResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static GetOrdersResult Ok(PaginationResult response) - => new GetOrdersResult(new OkObjectResult(response)); - - /// - /// 404 - NotFound response. - /// - public static GetOrdersResult NotFound(string? message = null) - => new GetOrdersResult(new NotFoundObjectResult(message)); - - /// - /// Performs an implicit conversion from GetOrdersResult to ActionResult. - /// - public static implicit operator GetOrdersResult(PaginationResult response) - => Ok(response); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/Tasks/Interfaces/IGetTasksHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/Tasks/Interfaces/IGetTasksHandler.verified.cs deleted file mode 100644 index 0f3c8ee3..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/Tasks/Interfaces/IGetTasksHandler.verified.cs +++ /dev/null @@ -1,23 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.Api.Generated.Contracts.Tasks; - -/// -/// Domain Interface for RequestHandler. -/// Description: Returns tasks. -/// Operation: GetTasks. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IGetTasksHandler -{ - /// - /// Execute method. - /// - /// The cancellation token. - Task ExecuteAsync( - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/Tasks/Models/Task.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/Tasks/Models/Task.verified.cs deleted file mode 100644 index b3d4b443..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/Tasks/Models/Task.verified.cs +++ /dev/null @@ -1,22 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.Api.Generated.Contracts.Tasks; - -/// -/// Describes a single task. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class Task -{ - public Guid Id { get; set; } - - public string Name { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}, {nameof(Name)}: {Name}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/Tasks/Models/Tasks.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/Tasks/Models/Tasks.verified.cs deleted file mode 100644 index e2e99e42..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/Tasks/Models/Tasks.verified.cs +++ /dev/null @@ -1,23 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.Api.Generated.Contracts.Tasks; - -/// -/// Contains a list of Tasks. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class Tasks -{ - /// - /// A list of Task. - /// - public List TaskList { get; set; } = new List(); - - /// - public override string ToString() - => $"{nameof(TaskList)}.Count: {TaskList?.Count ?? 0}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/Tasks/Results/GetTasksResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/Tasks/Results/GetTasksResult.verified.cs deleted file mode 100644 index 4e9d704c..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/Tasks/Results/GetTasksResult.verified.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.Api.Generated.Contracts.Tasks; - -/// -/// Results for operation request. -/// Description: Returns tasks. -/// Operation: GetTasks. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetTasksResult : ResultBase -{ - private GetTasksResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static GetTasksResult Ok(IEnumerable response) - => new GetTasksResult(new OkObjectResult(response ?? Enumerable.Empty())); - - /// - /// Performs an implicit conversion from GetTasksResult to ActionResult. - /// - public static implicit operator GetTasksResult(List response) - => Ok(response); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/TestUnits/Interfaces/IListTestUnitsHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/TestUnits/Interfaces/IListTestUnitsHandler.verified.cs deleted file mode 100644 index 44cc430b..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/TestUnits/Interfaces/IListTestUnitsHandler.verified.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.Api.Generated.Contracts.TestUnits; - -/// -/// Domain Interface for RequestHandler. -/// Description: List test units. -/// Operation: ListTestUnits. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public interface IListTestUnitsHandler -{ - /// - /// Execute method. - /// - /// The parameters. - /// The cancellation token. - Task ExecuteAsync( - ListTestUnitsParameters parameters, - CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/TestUnits/Models/TestUnit.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/TestUnits/Models/TestUnit.verified.cs deleted file mode 100644 index 0bb10dfa..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/TestUnits/Models/TestUnit.verified.cs +++ /dev/null @@ -1,20 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.Api.Generated.Contracts.TestUnits; - -/// -/// TestUnit. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class TestUnit -{ - public Guid Id { get; set; } - - /// - public override string ToString() - => $"{nameof(Id)}: {Id}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/TestUnits/Parameters/ListTestUnitsParameters.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/TestUnits/Parameters/ListTestUnitsParameters.verified.cs deleted file mode 100644 index 9ce56ce4..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/TestUnits/Parameters/ListTestUnitsParameters.verified.cs +++ /dev/null @@ -1,41 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.Api.Generated.Contracts.TestUnits; - -/// -/// Parameters for operation request. -/// Description: List test units. -/// Operation: ListTestUnits. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class ListTestUnitsParameters -{ - /// - /// The numbers of items to return. - /// - [FromQuery(Name = "pageSize")] - [Required] - [Range(1, 100)] - public int PageSize { get; set; } = 10; - - /// - /// The number of items to skip before starting to collect the result set. - /// - [FromQuery(Name = "pageIndex")] - [Range(0, 2147483647)] - public int PageIndex { get; set; } = 0; - - /// - /// The continuation token. - /// - [FromQuery(Name = "continuationToken")] - public string? ContinuationToken { get; set; } - - /// - public override string ToString() - => $"{nameof(PageSize)}: {PageSize}, {nameof(PageIndex)}: {PageIndex}, {nameof(ContinuationToken)}: {ContinuationToken}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/TestUnits/Results/ListTestUnitsResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/TestUnits/Results/ListTestUnitsResult.verified.cs deleted file mode 100644 index e98ae758..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/TestUnits/Results/ListTestUnitsResult.verified.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.Api.Generated.Contracts.TestUnits; - -/// -/// Results for operation request. -/// Description: List test units. -/// Operation: ListTestUnits. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class ListTestUnitsResult : ResultBase -{ - private ListTestUnitsResult(ActionResult result) : base(result) { } - - /// - /// 200 - Ok response. - /// - public static ListTestUnitsResult Ok(PaginationResult response) - => new ListTestUnitsResult(new OkObjectResult(response)); - - /// - /// Performs an implicit conversion from ListTestUnitsResult to ActionResult. - /// - public static implicit operator ListTestUnitsResult(PaginationResult response) - => Ok(response); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/_Shared/PaginationResult.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/_Shared/PaginationResult.verified.cs deleted file mode 100644 index c9fb78f2..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Contracts/_Shared/PaginationResult.verified.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.Api.Generated.Contracts; - -/// -/// An item result subset of a data query. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class PaginationResult -{ - public int PageSize { get; set; } - - /// - /// Token to indicate next result set. - /// - public string? ContinuationToken { get; set; } - - public List Results { get; set; } = new List(); - - /// - public override string ToString() - => $"{nameof(PageSize)}: {PageSize}, {nameof(ContinuationToken)}: {ContinuationToken}, {nameof(Results)}.Count: {Results?.Count ?? 0}"; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Endpoints/EventArgsController.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Endpoints/EventArgsController.verified.cs deleted file mode 100644 index d68ac4cd..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Endpoints/EventArgsController.verified.cs +++ /dev/null @@ -1,45 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.Api.Generated.Endpoints; - -/// -/// Endpoint definitions. -/// -[Authorize] -[ApiController] -[Route("/api/v1/eventArgs")] -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class EventArgsController : ControllerBase -{ - /// - /// Description: Get EventArgs List. - /// Operation: GetEventArgs. - /// - [HttpGet] - [ProducesResponseType(typeof(List), StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status401Unauthorized)] - [ProducesResponseType(StatusCodes.Status403Forbidden)] - public async Task GetEventArgs( - [FromServices] IGetEventArgsHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(cancellationToken); - - /// - /// Description: Get EventArgs By Id. - /// Operation: GetEventArgById. - /// - [HttpGet("{id}")] - [ProducesResponseType(typeof(TestUnit.Task.NsApi.Api.Generated.Contracts.EventArgs.EventArgs), StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status401Unauthorized)] - [ProducesResponseType(StatusCodes.Status403Forbidden)] - [ProducesResponseType(typeof(string), StatusCodes.Status404NotFound)] - public async Task GetEventArgById( - GetEventArgByIdParameters parameters, - [FromServices] IGetEventArgByIdHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(parameters, cancellationToken); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Endpoints/OrdersController.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Endpoints/OrdersController.verified.cs deleted file mode 100644 index 73683f02..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Endpoints/OrdersController.verified.cs +++ /dev/null @@ -1,49 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.Api.Generated.Endpoints; - -/// -/// Endpoint definitions. -/// -[Authorize] -[ApiController] -[Route("/api/v1/orders")] -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class OrdersController : ControllerBase -{ - /// - /// Description: Get orders. - /// Operation: GetOrders. - /// - [HttpGet] - [ProducesResponseType(typeof(PaginationResult), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(StatusCodes.Status401Unauthorized)] - [ProducesResponseType(StatusCodes.Status403Forbidden)] - [ProducesResponseType(typeof(string), StatusCodes.Status404NotFound)] - public async Task GetOrders( - GetOrdersParameters parameters, - [FromServices] IGetOrdersHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(parameters, cancellationToken); - - /// - /// Description: Get order by id. - /// Operation: GetOrderById. - /// - [HttpGet("{id}")] - [ProducesResponseType(typeof(Order), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(StatusCodes.Status401Unauthorized)] - [ProducesResponseType(StatusCodes.Status403Forbidden)] - [ProducesResponseType(typeof(string), StatusCodes.Status404NotFound)] - public async Task GetOrderById( - GetOrderByIdParameters parameters, - [FromServices] IGetOrderByIdHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(parameters, cancellationToken); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Endpoints/TasksController.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Endpoints/TasksController.verified.cs deleted file mode 100644 index e3439e0e..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Endpoints/TasksController.verified.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.Api.Generated.Endpoints; - -/// -/// Endpoint definitions. -/// -[Authorize] -[ApiController] -[Route("/api/v1/tasks")] -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class TasksController : ControllerBase -{ - /// - /// Description: Returns tasks. - /// Operation: GetTasks. - /// - [HttpGet] - [ProducesResponseType(typeof(List), StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status401Unauthorized)] - [ProducesResponseType(StatusCodes.Status403Forbidden)] - public async Task GetTasks( - [FromServices] IGetTasksHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(cancellationToken); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Endpoints/TestUnitsController.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Endpoints/TestUnitsController.verified.cs deleted file mode 100644 index f2709731..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/Endpoints/TestUnitsController.verified.cs +++ /dev/null @@ -1,32 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.Api.Generated.Endpoints; - -/// -/// Endpoint definitions. -/// -[Authorize] -[ApiController] -[Route("/api/v1/test-units")] -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class TestUnitsController : ControllerBase -{ - /// - /// Description: List test units. - /// Operation: ListTestUnits. - /// - [HttpGet] - [ProducesResponseType(typeof(PaginationResult), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(StatusCodes.Status401Unauthorized)] - [ProducesResponseType(StatusCodes.Status403Forbidden)] - public async Task ListTestUnits( - ListTestUnitsParameters parameters, - [FromServices] IListTestUnitsHandler handler, - CancellationToken cancellationToken) - => await handler.ExecuteAsync(parameters, cancellationToken); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/GlobalUsings.verified.cs deleted file mode 100644 index db86fb3b..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api.Generated/GlobalUsings.verified.cs +++ /dev/null @@ -1,15 +0,0 @@ -global using System.CodeDom.Compiler; -global using System.ComponentModel.DataAnnotations; -global using System.Net; - -global using Atc.Rest.Results; - -global using Microsoft.AspNetCore.Authorization; -global using Microsoft.AspNetCore.Http; -global using Microsoft.AspNetCore.Mvc; - -global using TestUnit.Task.NsApi.Api.Generated.Contracts; -global using TestUnit.Task.NsApi.Api.Generated.Contracts.EventArgs; -global using TestUnit.Task.NsApi.Api.Generated.Contracts.Orders; -global using TestUnit.Task.NsApi.Api.Generated.Contracts.Tasks; -global using TestUnit.Task.NsApi.Api.Generated.Contracts.TestUnits; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api/ConfigureSwaggerDocOptions.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api/ConfigureSwaggerDocOptions.verified.cs deleted file mode 100644 index 40244f94..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api/ConfigureSwaggerDocOptions.verified.cs +++ /dev/null @@ -1,39 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.Api; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class ConfigureSwaggerDocOptions : IConfigureOptions -{ - private readonly IApiVersionDescriptionProvider provider; - - public ConfigureSwaggerDocOptions( - IApiVersionDescriptionProvider provider) - => this.provider = provider; - - public void Configure( - SwaggerGenOptions options) - { - foreach (var version in provider.ApiVersionDescriptions) - { - options.SwaggerDoc( - version.GroupName, - new OpenApiInfo - { - Version = "1.0", - Title = "TestUnit Task Ns Api", - Description = @"TestUnit Task Ns Api - SingleFileVersion", - Contact = new OpenApiContact - { - Name = "atc-net A/S", - }, - }); - } - - options.IncludeXmlComments(Path.ChangeExtension(GetType().Assembly.Location, "xml")); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api/GlobalUsings.verified.cs deleted file mode 100644 index efa12e7e..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api/GlobalUsings.verified.cs +++ /dev/null @@ -1,13 +0,0 @@ -global using System.CodeDom.Compiler; -global using System.Reflection; - -global using Atc.Rest.Extended.Options; - -global using Microsoft.AspNetCore.Mvc.ApiExplorer; -global using Microsoft.Extensions.Options; -global using Microsoft.OpenApi.Models; - -global using Swashbuckle.AspNetCore.SwaggerGen; - -global using TestUnit.Task.NsApi.Api.Generated; -global using TestUnit.Task.NsApi.Domain; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api/Program.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api/Program.verified.cs deleted file mode 100644 index 225e7159..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api/Program.verified.cs +++ /dev/null @@ -1,23 +0,0 @@ -namespace TestUnit.Task.NsApi.Api; - -public static class Program -{ - public static void Main(string[] args) - { - CreateHostBuilder(args) - .Build() - .Run(); - } - - public static IHostBuilder CreateHostBuilder(string[] args) - { - var builder = Host - .CreateDefaultBuilder(args) - .ConfigureWebHostDefaults(webBuilder => - { - webBuilder.UseStartup(); - }); - - return builder; - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api/Startup.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api/Startup.verified.cs deleted file mode 100644 index 09716052..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Api/Startup.verified.cs +++ /dev/null @@ -1,38 +0,0 @@ -namespace TestUnit.Task.NsApi.Api; - -public class Startup -{ - private readonly RestApiExtendedOptions restApiOptions; - - public Startup( - IConfiguration configuration) - { - Configuration = configuration; - restApiOptions = new RestApiExtendedOptions - { - // TODO: Remove/out-comment/set to false this for production scenarios! - AllowAnonymousAccessForDevelopment = true, - }; - - restApiOptions.AddAssemblyPairs( - Assembly.GetAssembly(typeof(ApiRegistration)), - Assembly.GetAssembly(typeof(DomainRegistration))); - } - - public IConfiguration Configuration { get; } - - public void ConfigureServices( - IServiceCollection services) - { - services.ConfigureOptions(); - - services.AddRestApi(restApiOptions, Configuration); - } - - public void Configure( - IApplicationBuilder app, - IWebHostEnvironment env) - { - app.ConfigureRestApi(env, restApiOptions); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Domain/DomainRegistration.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Domain/DomainRegistration.verified.cs deleted file mode 100644 index 89d01af0..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Domain/DomainRegistration.verified.cs +++ /dev/null @@ -1,12 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.Domain; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class DomainRegistration -{ -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Domain/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Domain/GlobalUsings.verified.cs deleted file mode 100644 index a61a059f..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Domain/GlobalUsings.verified.cs +++ /dev/null @@ -1,6 +0,0 @@ -global using System.CodeDom.Compiler; - -global using TestUnit.Task.NsApi.Api.Generated.Contracts.EventArgs; -global using TestUnit.Task.NsApi.Api.Generated.Contracts.Orders; -global using TestUnit.Task.NsApi.Api.Generated.Contracts.Tasks; -global using TestUnit.Task.NsApi.Api.Generated.Contracts.TestUnits; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Domain/Handlers/EventArgs/GetEventArgByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Domain/Handlers/EventArgs/GetEventArgByIdHandler.verified.cs deleted file mode 100644 index a6faac81..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Domain/Handlers/EventArgs/GetEventArgByIdHandler.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace TestUnit.Task.NsApi.Domain.Handlers.EventArgs; - -/// -/// Handler for operation request. -/// Description: Get EventArgs By Id. -/// Operation: GetEventArgById. -/// -public class GetEventArgByIdHandler : IGetEventArgByIdHandler -{ - public Task ExecuteAsync( - GetEventArgByIdParameters parameters, - CancellationToken cancellationToken = default) - { - ArgumentNullException.ThrowIfNull(parameters); - - throw new NotImplementedException("Add logic here for GetEventArgByIdHandler"); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Domain/Handlers/EventArgs/GetEventArgsHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Domain/Handlers/EventArgs/GetEventArgsHandler.verified.cs deleted file mode 100644 index 18feb114..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Domain/Handlers/EventArgs/GetEventArgsHandler.verified.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace TestUnit.Task.NsApi.Domain.Handlers.EventArgs; - -/// -/// Handler for operation request. -/// Description: Get EventArgs List. -/// Operation: GetEventArgs. -/// -public class GetEventArgsHandler : IGetEventArgsHandler -{ - public Task ExecuteAsync( - CancellationToken cancellationToken = default) - { - throw new NotImplementedException("Add logic here for GetEventArgsHandler"); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Domain/Handlers/Orders/GetOrderByIdHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Domain/Handlers/Orders/GetOrderByIdHandler.verified.cs deleted file mode 100644 index 3870567e..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Domain/Handlers/Orders/GetOrderByIdHandler.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace TestUnit.Task.NsApi.Domain.Handlers.Orders; - -/// -/// Handler for operation request. -/// Description: Get order by id. -/// Operation: GetOrderById. -/// -public class GetOrderByIdHandler : IGetOrderByIdHandler -{ - public Task ExecuteAsync( - GetOrderByIdParameters parameters, - CancellationToken cancellationToken = default) - { - ArgumentNullException.ThrowIfNull(parameters); - - throw new NotImplementedException("Add logic here for GetOrderByIdHandler"); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Domain/Handlers/Orders/GetOrdersHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Domain/Handlers/Orders/GetOrdersHandler.verified.cs deleted file mode 100644 index 6e1f31ed..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Domain/Handlers/Orders/GetOrdersHandler.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace TestUnit.Task.NsApi.Domain.Handlers.Orders; - -/// -/// Handler for operation request. -/// Description: Get orders. -/// Operation: GetOrders. -/// -public class GetOrdersHandler : IGetOrdersHandler -{ - public Task ExecuteAsync( - GetOrdersParameters parameters, - CancellationToken cancellationToken = default) - { - ArgumentNullException.ThrowIfNull(parameters); - - throw new NotImplementedException("Add logic here for GetOrdersHandler"); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Domain/Handlers/Tasks/GetTasksHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Domain/Handlers/Tasks/GetTasksHandler.verified.cs deleted file mode 100644 index 54cc3279..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Domain/Handlers/Tasks/GetTasksHandler.verified.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace TestUnit.Task.NsApi.Domain.Handlers.Tasks; - -/// -/// Handler for operation request. -/// Description: Returns tasks. -/// Operation: GetTasks. -/// -public class GetTasksHandler : IGetTasksHandler -{ - public Task ExecuteAsync( - CancellationToken cancellationToken = default) - { - throw new NotImplementedException("Add logic here for GetTasksHandler"); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Domain/Handlers/TestUnits/ListTestUnitsHandler.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Domain/Handlers/TestUnits/ListTestUnitsHandler.verified.cs deleted file mode 100644 index e2e564f8..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/src/TestUnit.Task.NsApi.Domain/Handlers/TestUnits/ListTestUnitsHandler.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace TestUnit.Task.NsApi.Domain.Handlers.TestUnits; - -/// -/// Handler for operation request. -/// Description: List test units. -/// Operation: ListTestUnits. -/// -public class ListTestUnitsHandler : IListTestUnitsHandler -{ - public Task ExecuteAsync( - ListTestUnitsParameters parameters, - CancellationToken cancellationToken = default) - { - ArgumentNullException.ThrowIfNull(parameters); - - throw new NotImplementedException("Add logic here for ListTestUnitsHandler"); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Api.Tests/Endpoints/EventArgs/GetEventArgByIdHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Api.Tests/Endpoints/EventArgs/GetEventArgByIdHandlerStub.verified.cs deleted file mode 100644 index f4a17a10..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Api.Tests/Endpoints/EventArgs/GetEventArgByIdHandlerStub.verified.cs +++ /dev/null @@ -1,20 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.Api.Tests.Endpoints.EventArgs; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetEventArgByIdHandlerStub : IGetEventArgByIdHandler -{ - public Task ExecuteAsync( - GetEventArgByIdParameters parameters, - CancellationToken cancellationToken = default) - { - var data = new Fixture().Create(); - - return System.Threading.Tasks.Task.FromResult(GetEventArgByIdResult.Ok(data)); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Api.Tests/Endpoints/EventArgs/GetEventArgByIdTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Api.Tests/Endpoints/EventArgs/GetEventArgByIdTests.verified.cs deleted file mode 100644 index 72028011..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Api.Tests/Endpoints/EventArgs/GetEventArgByIdTests.verified.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace TestUnit.Task.NsApi.Api.Tests.Endpoints.EventArgs; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class GetEventArgByIdTests : WebApiControllerBaseTest -{ - public GetEventArgByIdTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Api.Tests/Endpoints/EventArgs/GetEventArgsHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Api.Tests/Endpoints/EventArgs/GetEventArgsHandlerStub.verified.cs deleted file mode 100644 index 9e082e1a..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Api.Tests/Endpoints/EventArgs/GetEventArgsHandlerStub.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.Api.Tests.Endpoints.EventArgs; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetEventArgsHandlerStub : IGetEventArgsHandler -{ - public Task ExecuteAsync( - CancellationToken cancellationToken = default) - { - var data = new Fixture().Create>(); - - return System.Threading.Tasks.Task.FromResult(GetEventArgsResult.Ok(data)); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Api.Tests/Endpoints/EventArgs/GetEventArgsTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Api.Tests/Endpoints/EventArgs/GetEventArgsTests.verified.cs deleted file mode 100644 index 1272dd00..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Api.Tests/Endpoints/EventArgs/GetEventArgsTests.verified.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace TestUnit.Task.NsApi.Api.Tests.Endpoints.EventArgs; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class GetEventArgsTests : WebApiControllerBaseTest -{ - public GetEventArgsTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Api.Tests/Endpoints/Orders/GetOrderByIdHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Api.Tests/Endpoints/Orders/GetOrderByIdHandlerStub.verified.cs deleted file mode 100644 index cecf11d1..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Api.Tests/Endpoints/Orders/GetOrderByIdHandlerStub.verified.cs +++ /dev/null @@ -1,20 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.Api.Tests.Endpoints.Orders; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetOrderByIdHandlerStub : IGetOrderByIdHandler -{ - public Task ExecuteAsync( - GetOrderByIdParameters parameters, - CancellationToken cancellationToken = default) - { - var data = new Fixture().Create(); - - return System.Threading.Tasks.Task.FromResult(GetOrderByIdResult.Ok(data)); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Api.Tests/Endpoints/Orders/GetOrderByIdTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Api.Tests/Endpoints/Orders/GetOrderByIdTests.verified.cs deleted file mode 100644 index c60ceb2a..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Api.Tests/Endpoints/Orders/GetOrderByIdTests.verified.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace TestUnit.Task.NsApi.Api.Tests.Endpoints.Orders; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class GetOrderByIdTests : WebApiControllerBaseTest -{ - public GetOrderByIdTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Api.Tests/Endpoints/Orders/GetOrdersHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Api.Tests/Endpoints/Orders/GetOrdersHandlerStub.verified.cs deleted file mode 100644 index 452c401c..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Api.Tests/Endpoints/Orders/GetOrdersHandlerStub.verified.cs +++ /dev/null @@ -1,22 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.Api.Tests.Endpoints.Orders; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetOrdersHandlerStub : IGetOrdersHandler -{ - public Task ExecuteAsync( - GetOrdersParameters parameters, - CancellationToken cancellationToken = default) - { - var data = new Fixture().Create>(); - - var paginationData = new PaginationResult(); - - return System.Threading.Tasks.Task.FromResult(GetOrdersResult.Ok(paginationData)); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Api.Tests/Endpoints/Orders/GetOrdersTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Api.Tests/Endpoints/Orders/GetOrdersTests.verified.cs deleted file mode 100644 index 09a0a6ef..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Api.Tests/Endpoints/Orders/GetOrdersTests.verified.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace TestUnit.Task.NsApi.Api.Tests.Endpoints.Orders; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class GetOrdersTests : WebApiControllerBaseTest -{ - public GetOrdersTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Api.Tests/Endpoints/Tasks/GetTasksHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Api.Tests/Endpoints/Tasks/GetTasksHandlerStub.verified.cs deleted file mode 100644 index 74c4b221..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Api.Tests/Endpoints/Tasks/GetTasksHandlerStub.verified.cs +++ /dev/null @@ -1,19 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.Api.Tests.Endpoints.Tasks; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class GetTasksHandlerStub : TestUnit.Task.NsApi.Api.Generated.Contracts.Tasks.IGetTasksHandler -{ - public Task ExecuteAsync( - CancellationToken cancellationToken = default) - { - var data = new Fixture().Create>(); - - return System.Threading.Tasks.Task.FromResult(TestUnit.Task.NsApi.Api.Generated.Contracts.Tasks.GetTasksResult.Ok(data)); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Api.Tests/Endpoints/Tasks/GetTasksTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Api.Tests/Endpoints/Tasks/GetTasksTests.verified.cs deleted file mode 100644 index 90f7a067..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Api.Tests/Endpoints/Tasks/GetTasksTests.verified.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace TestUnit.Task.NsApi.Api.Tests.Endpoints.Tasks; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class GetTasksTests : WebApiControllerBaseTest -{ - public GetTasksTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Api.Tests/Endpoints/TestUnits/ListTestUnitsHandlerStub.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Api.Tests/Endpoints/TestUnits/ListTestUnitsHandlerStub.verified.cs deleted file mode 100644 index b5783c2b..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Api.Tests/Endpoints/TestUnits/ListTestUnitsHandlerStub.verified.cs +++ /dev/null @@ -1,22 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.Api.Tests.Endpoints.TestUnits; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public class ListTestUnitsHandlerStub : IListTestUnitsHandler -{ - public Task ExecuteAsync( - ListTestUnitsParameters parameters, - CancellationToken cancellationToken = default) - { - var data = new Fixture().Create>(); - - var paginationData = new PaginationResult(); - - return System.Threading.Tasks.Task.FromResult(ListTestUnitsResult.Ok(paginationData)); - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Api.Tests/Endpoints/TestUnits/ListTestUnitsTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Api.Tests/Endpoints/TestUnits/ListTestUnitsTests.verified.cs deleted file mode 100644 index db45175a..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Api.Tests/Endpoints/TestUnits/ListTestUnitsTests.verified.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace TestUnit.Task.NsApi.Api.Tests.Endpoints.TestUnits; - -[Collection("Sequential-Endpoints")] -[Trait(Traits.Category, Traits.Categories.Integration)] -public class ListTestUnitsTests : WebApiControllerBaseTest -{ - public ListTestUnitsTests(WebApiStartupFactory fixture) - : base(fixture) - { - } - - [Fact(Skip = "Change this to a real integration-test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Api.Tests/GlobalUsings.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Api.Tests/GlobalUsings.verified.cs deleted file mode 100644 index ce39ba2e..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Api.Tests/GlobalUsings.verified.cs +++ /dev/null @@ -1,22 +0,0 @@ -global using System.CodeDom.Compiler; -global using System.Reflection; -global using System.Text; -global using System.Text.Json; -global using System.Text.Json.Serialization; - -global using Atc.Rest.Options; -global using Atc.Rest.Results; -global using Atc.XUnit; - -global using Microsoft.AspNetCore.Hosting; -global using Microsoft.AspNetCore.Http; -global using Microsoft.AspNetCore.Mvc.Testing; -global using Microsoft.AspNetCore.TestHost; -global using Microsoft.Extensions.Configuration; -global using Microsoft.Extensions.DependencyInjection; - -global using TestUnit.Task.NsApi.Api.Generated; -global using TestUnit.Task.NsApi.Api.Generated.Contracts; -global using TestUnit.Task.NsApi.Api.Generated.Contracts.EventArgs; -global using TestUnit.Task.NsApi.Api.Generated.Contracts.Orders; -global using TestUnit.Task.NsApi.Api.Generated.Contracts.TestUnits; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Api.Tests/WebApiControllerBaseTest.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Api.Tests/WebApiControllerBaseTest.verified.cs deleted file mode 100644 index b510148a..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Api.Tests/WebApiControllerBaseTest.verified.cs +++ /dev/null @@ -1,56 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.Api.Tests; - -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public abstract class WebApiControllerBaseTest : IClassFixture -{ - protected readonly WebApiStartupFactory Factory; - - protected readonly HttpClient HttpClient; - - protected readonly IConfiguration Configuration; - - protected static JsonSerializerOptions? JsonSerializerOptions; - - protected WebApiControllerBaseTest(WebApiStartupFactory fixture) - { - this.Factory = fixture; - this.HttpClient = this.Factory.CreateClient(); - this.Configuration = new ConfigurationBuilder().Build(); - JsonSerializerOptions = new JsonSerializerOptions - { - PropertyNameCaseInsensitive = true, - Converters = - { - new JsonStringEnumConverter() - }, - }; - } - - protected static StringContent ToJson(object data) - => new(JsonSerializer.Serialize(data, JsonSerializerOptions), Encoding.UTF8, "application/json"); - - protected static StringContent Json(string data) - => new(data, Encoding.UTF8, "application/json"); - - protected static IFormFile GetTestFile() - { - var bytes = Encoding.UTF8.GetBytes("Hello World"); - var stream = new MemoryStream(bytes); - var formFile = new FormFile(stream, 0, stream.Length, "dummy", "dummy.txt") - { - Headers = new HeaderDictionary(), - ContentType = "application/octet-stream", - }; - - return formFile; - } - - protected static List GetTestFiles() - => new() { GetTestFile(), GetTestFile() }; -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Api.Tests/WebApiStartupFactory.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Api.Tests/WebApiStartupFactory.verified.cs deleted file mode 100644 index 294d4abb..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Api.Tests/WebApiStartupFactory.verified.cs +++ /dev/null @@ -1,40 +0,0 @@ -//------------------------------------------------------------------------------ -// This code was auto-generated by ApiGenerator x.x.x.x. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ -namespace TestUnit.Task.NsApi.Api.Tests; - -/// -/// Factory for bootstrapping in memory tests. -/// Includes options to override configuration and service collection using a partial class. -/// -[GeneratedCode("ApiGenerator", "x.x.x.x")] -public partial class WebApiStartupFactory : WebApplicationFactory -{ - protected override void ConfigureWebHost(IWebHostBuilder builder) - { - builder.ConfigureAppConfiguration(config => - { - ModifyConfiguration(config); - var integrationConfig = new ConfigurationBuilder() - .AddJsonFile("appsettings.integrationtest.json") - .Build(); - config.AddConfiguration(integrationConfig); - }); - - builder.ConfigureTestServices(services => - { - ModifyServices(services); - services.AddSingleton(); - services.AutoRegistrateServices( - Assembly.GetAssembly(typeof(ApiRegistration))!, - Assembly.GetAssembly(typeof(WebApiStartupFactory))!); - }); - } - - partial void ModifyConfiguration(IConfigurationBuilder config); - - partial void ModifyServices(IServiceCollection services); -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Domain.Tests/Handlers/EventArgs/GetEventArgByIdHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Domain.Tests/Handlers/EventArgs/GetEventArgByIdHandlerTests.verified.cs deleted file mode 100644 index cf329a6e..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Domain.Tests/Handlers/EventArgs/GetEventArgByIdHandlerTests.verified.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace TestUnit.Task.NsApi.Domain.Tests.Handlers.EventArgs; - -public class GetEventArgByIdHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Domain.Tests/Handlers/EventArgs/GetEventArgsHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Domain.Tests/Handlers/EventArgs/GetEventArgsHandlerTests.verified.cs deleted file mode 100644 index 6ac92d97..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Domain.Tests/Handlers/EventArgs/GetEventArgsHandlerTests.verified.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace TestUnit.Task.NsApi.Domain.Tests.Handlers.EventArgs; - -public class GetEventArgsHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Domain.Tests/Handlers/Orders/GetOrderByIdHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Domain.Tests/Handlers/Orders/GetOrderByIdHandlerTests.verified.cs deleted file mode 100644 index cde55e7e..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Domain.Tests/Handlers/Orders/GetOrderByIdHandlerTests.verified.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace TestUnit.Task.NsApi.Domain.Tests.Handlers.Orders; - -public class GetOrderByIdHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Domain.Tests/Handlers/Orders/GetOrdersHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Domain.Tests/Handlers/Orders/GetOrdersHandlerTests.verified.cs deleted file mode 100644 index 669aa163..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Domain.Tests/Handlers/Orders/GetOrdersHandlerTests.verified.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace TestUnit.Task.NsApi.Domain.Tests.Handlers.Orders; - -public class GetOrdersHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Domain.Tests/Handlers/Tasks/GetTasksHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Domain.Tests/Handlers/Tasks/GetTasksHandlerTests.verified.cs deleted file mode 100644 index 57b945a5..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Domain.Tests/Handlers/Tasks/GetTasksHandlerTests.verified.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace TestUnit.Task.NsApi.Domain.Tests.Handlers.Tasks; - -public class GetTasksHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Domain.Tests/Handlers/TestUnits/ListTestUnitsHandlerTests.verified.cs b/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Domain.Tests/Handlers/TestUnits/ListTestUnitsHandlerTests.verified.cs deleted file mode 100644 index 400b7325..00000000 --- a/test/Atc.Rest.ApiGenerator.CLI.Tests/TestUnit.Task.NsApi/VerifyServerAll/test/TestUnit.Task.NsApi.Domain.Tests/Handlers/TestUnits/ListTestUnitsHandlerTests.verified.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace TestUnit.Task.NsApi.Domain.Tests.Handlers.TestUnits; - -public class ListTestUnitsHandlerTests -{ - [Fact(Skip = "Change this to a real test")] - public void Sample() - { - // Arrange - - // Act - - // Assert - } -} \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.Contracts.Tests/Atc.Rest.ApiGenerator.Contracts.Tests.csproj b/test/Atc.Rest.ApiGenerator.Contracts.Tests/Atc.Rest.ApiGenerator.Contracts.Tests.csproj new file mode 100644 index 00000000..b77365f8 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.Contracts.Tests/Atc.Rest.ApiGenerator.Contracts.Tests.csproj @@ -0,0 +1,25 @@ + + + + net8.0 + false + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + + diff --git a/test/Atc.Rest.ApiGenerator.Contracts.Tests/GlobalUsings.cs b/test/Atc.Rest.ApiGenerator.Contracts.Tests/GlobalUsings.cs new file mode 100644 index 00000000..84064399 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.Contracts.Tests/GlobalUsings.cs @@ -0,0 +1 @@ +global using Atc.Rest.ApiGenerator.Contracts.Resolver; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.Framework.Contracts.Tests/Resolver/OpenApiDocumentSchemaModelNameResolverTests.cs b/test/Atc.Rest.ApiGenerator.Contracts.Tests/Resolver/OpenApiDocumentSchemaModelNameResolverTests.cs similarity index 89% rename from test/Atc.Rest.ApiGenerator.Framework.Contracts.Tests/Resolver/OpenApiDocumentSchemaModelNameResolverTests.cs rename to test/Atc.Rest.ApiGenerator.Contracts.Tests/Resolver/OpenApiDocumentSchemaModelNameResolverTests.cs index 065b46a1..e81933ac 100644 --- a/test/Atc.Rest.ApiGenerator.Framework.Contracts.Tests/Resolver/OpenApiDocumentSchemaModelNameResolverTests.cs +++ b/test/Atc.Rest.ApiGenerator.Contracts.Tests/Resolver/OpenApiDocumentSchemaModelNameResolverTests.cs @@ -1,4 +1,4 @@ -namespace Atc.Rest.ApiGenerator.Framework.Contracts.Tests.Resolver; +namespace Atc.Rest.ApiGenerator.Contracts.Tests.Resolver; public class OpenApiDocumentSchemaModelNameResolverTests { diff --git a/test/Atc.Rest.ApiGenerator.Framework.Contracts.Tests/Atc.Rest.ApiGenerator.Framework.Contracts.Tests.csproj b/test/Atc.Rest.ApiGenerator.Framework.Contracts.Tests/Atc.Rest.ApiGenerator.Framework.Contracts.Tests.csproj deleted file mode 100644 index 187541dc..00000000 --- a/test/Atc.Rest.ApiGenerator.Framework.Contracts.Tests/Atc.Rest.ApiGenerator.Framework.Contracts.Tests.csproj +++ /dev/null @@ -1,25 +0,0 @@ - - - - net6.0 - false - - - - - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - - - - - - diff --git a/test/Atc.Rest.ApiGenerator.Framework.Contracts.Tests/GlobalUsings.cs b/test/Atc.Rest.ApiGenerator.Framework.Contracts.Tests/GlobalUsings.cs deleted file mode 100644 index 516110f8..00000000 --- a/test/Atc.Rest.ApiGenerator.Framework.Contracts.Tests/GlobalUsings.cs +++ /dev/null @@ -1 +0,0 @@ -global using Atc.Rest.ApiGenerator.Framework.Contracts.Resolver; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.Framework.Mvc.Tests/Atc.Rest.ApiGenerator.Framework.Mvc.Tests.csproj b/test/Atc.Rest.ApiGenerator.Framework.Mvc.Tests/Atc.Rest.ApiGenerator.Framework.Mvc.Tests.csproj index f42da584..30dbc9c6 100644 --- a/test/Atc.Rest.ApiGenerator.Framework.Mvc.Tests/Atc.Rest.ApiGenerator.Framework.Mvc.Tests.csproj +++ b/test/Atc.Rest.ApiGenerator.Framework.Mvc.Tests/Atc.Rest.ApiGenerator.Framework.Mvc.Tests.csproj @@ -1,19 +1,19 @@ - net6.0 + net8.0 false CA1014 - - - + + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/test/Atc.Rest.ApiGenerator.Framework.Tests/Atc.Rest.ApiGenerator.Framework.Tests.csproj b/test/Atc.Rest.ApiGenerator.Framework.Tests/Atc.Rest.ApiGenerator.Framework.Tests.csproj index be2b12c2..c0d41a8a 100644 --- a/test/Atc.Rest.ApiGenerator.Framework.Tests/Atc.Rest.ApiGenerator.Framework.Tests.csproj +++ b/test/Atc.Rest.ApiGenerator.Framework.Tests/Atc.Rest.ApiGenerator.Framework.Tests.csproj @@ -1,18 +1,18 @@ - net6.0 + net8.0 false - - - + + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/test/Atc.Rest.ApiGenerator.Framework.Tests/ContentGenerators/GeneratedCodeAttributeGeneratorTests.cs b/test/Atc.Rest.ApiGenerator.Framework.Tests/ContentGenerators/GeneratedCodeAttributeGeneratorTests.cs index 2972f0ef..36dc981e 100644 --- a/test/Atc.Rest.ApiGenerator.Framework.Tests/ContentGenerators/GeneratedCodeAttributeGeneratorTests.cs +++ b/test/Atc.Rest.ApiGenerator.Framework.Tests/ContentGenerators/GeneratedCodeAttributeGeneratorTests.cs @@ -1,5 +1,6 @@ namespace Atc.Rest.ApiGenerator.Framework.Tests.ContentGenerators; +[SuppressMessage("X", "S2094: Remove this empty record, write its code or make it an interface", Justification = "OK - WIP")] public class GeneratedCodeAttributeGeneratorTests { // TODO: Test GeneratedCodeAttributeGenerator diff --git a/test/Atc.Rest.ApiGenerator.Framework.Tests/ContentGenerators/GeneratedCodeHeaderGeneratorTests.cs b/test/Atc.Rest.ApiGenerator.Framework.Tests/ContentGenerators/GeneratedCodeHeaderGeneratorTests.cs index 7e414511..7963e555 100644 --- a/test/Atc.Rest.ApiGenerator.Framework.Tests/ContentGenerators/GeneratedCodeHeaderGeneratorTests.cs +++ b/test/Atc.Rest.ApiGenerator.Framework.Tests/ContentGenerators/GeneratedCodeHeaderGeneratorTests.cs @@ -1,5 +1,6 @@ namespace Atc.Rest.ApiGenerator.Framework.Tests.ContentGenerators; +[SuppressMessage("X", "S2094: Remove this empty record, write its code or make it an interface", Justification = "OK - WIP")] public class GeneratedCodeHeaderGeneratorTests { // TODO: Test GeneratedCodeHeaderGenerator diff --git a/test/Atc.Rest.ApiGenerator.Framework.Tests/GlobalUsings.cs b/test/Atc.Rest.ApiGenerator.Framework.Tests/GlobalUsings.cs new file mode 100644 index 00000000..ed971978 --- /dev/null +++ b/test/Atc.Rest.ApiGenerator.Framework.Tests/GlobalUsings.cs @@ -0,0 +1 @@ +global using System.Diagnostics.CodeAnalysis; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.Nuget.Tests/Atc.Rest.ApiGenerator.Nuget.Tests.csproj b/test/Atc.Rest.ApiGenerator.Nuget.Tests/Atc.Rest.ApiGenerator.Nuget.Tests.csproj index 62a0410e..cfdca245 100644 --- a/test/Atc.Rest.ApiGenerator.Nuget.Tests/Atc.Rest.ApiGenerator.Nuget.Tests.csproj +++ b/test/Atc.Rest.ApiGenerator.Nuget.Tests/Atc.Rest.ApiGenerator.Nuget.Tests.csproj @@ -1,19 +1,19 @@ - net6.0 + net8.0 false - - - - + + + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/test/Atc.Rest.ApiGenerator.Nuget.Tests/Clients/AtcApiNugetClientIntegrationTests.cs b/test/Atc.Rest.ApiGenerator.Nuget.Tests/Clients/AtcApiNugetClientIntegrationTests.cs index 954f00e1..5ae2578e 100644 --- a/test/Atc.Rest.ApiGenerator.Nuget.Tests/Clients/AtcApiNugetClientIntegrationTests.cs +++ b/test/Atc.Rest.ApiGenerator.Nuget.Tests/Clients/AtcApiNugetClientIntegrationTests.cs @@ -1,5 +1,3 @@ -using System; - namespace Atc.Rest.ApiGenerator.Nuget.Tests.Clients; [Collection("Sequential-Endpoints")] @@ -7,7 +5,7 @@ namespace Atc.Rest.ApiGenerator.Nuget.Tests.Clients; public class AtcApiNugetClientIntegrationTests { [Theory] - [InlineData("2.0.280", "Atc")] + [InlineData("2.0.472", "Atc")] [InlineData(null, "xAtcDummy")] public async Task RetrieveLatestVersionForPackageId( string? expectedMinPackageVersion, diff --git a/test/Atc.Rest.ApiGenerator.Nuget.Tests/GlobalUsings.cs b/test/Atc.Rest.ApiGenerator.Nuget.Tests/GlobalUsings.cs index 3461b9b2..811dee43 100644 --- a/test/Atc.Rest.ApiGenerator.Nuget.Tests/GlobalUsings.cs +++ b/test/Atc.Rest.ApiGenerator.Nuget.Tests/GlobalUsings.cs @@ -1,4 +1,5 @@ global using Atc.Rest.ApiGenerator.Nuget.Clients; + global using Atc.XUnit; global using Microsoft.Extensions.Logging.Abstractions; \ No newline at end of file diff --git a/test/Atc.Rest.ApiGenerator.OpenApi.Tests/Atc.Rest.ApiGenerator.OpenApi.Tests.csproj b/test/Atc.Rest.ApiGenerator.OpenApi.Tests/Atc.Rest.ApiGenerator.OpenApi.Tests.csproj index 7f13ccc8..1525fd15 100644 --- a/test/Atc.Rest.ApiGenerator.OpenApi.Tests/Atc.Rest.ApiGenerator.OpenApi.Tests.csproj +++ b/test/Atc.Rest.ApiGenerator.OpenApi.Tests/Atc.Rest.ApiGenerator.OpenApi.Tests.csproj @@ -1,18 +1,18 @@ - net6.0 + net8.0 false - - - + + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/test/Atc.Rest.ApiGenerator.OpenApi.Tests/Extensions/OpenApiDocumentExtensionsTests.cs b/test/Atc.Rest.ApiGenerator.OpenApi.Tests/Extensions/OpenApiDocumentExtensionsTests.cs index 0948c725..8f7377d9 100644 --- a/test/Atc.Rest.ApiGenerator.OpenApi.Tests/Extensions/OpenApiDocumentExtensionsTests.cs +++ b/test/Atc.Rest.ApiGenerator.OpenApi.Tests/Extensions/OpenApiDocumentExtensionsTests.cs @@ -1,5 +1,6 @@ namespace Atc.Rest.ApiGenerator.OpenApi.Tests.Extensions; +[SuppressMessage("X", "S2094: Remove this empty record, write its code or make it an interface", Justification = "OK - WIP")] public class OpenApiDocumentExtensionsTests { // TODO: ToSwaggerDocOptionsParameters diff --git a/test/Atc.Rest.ApiGenerator.OpenApi.Tests/GlobalUsings.cs b/test/Atc.Rest.ApiGenerator.OpenApi.Tests/GlobalUsings.cs index 5af69981..9705c293 100644 --- a/test/Atc.Rest.ApiGenerator.OpenApi.Tests/GlobalUsings.cs +++ b/test/Atc.Rest.ApiGenerator.OpenApi.Tests/GlobalUsings.cs @@ -1,3 +1,5 @@ +global using System.Diagnostics.CodeAnalysis; + global using Atc.Rest.ApiGenerator.OpenApi.Extensions; global using Atc.Rest.ApiGenerator.OpenApi.Factories; diff --git a/test/Directory.Build.props b/test/Directory.Build.props index e5dadd9d..020fd5c2 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -11,8 +11,8 @@ - - + + diff --git a/test/generator-test-script/generate-build-verify.ps1 b/test/generator-test-script/generate-build-verify.ps1 index 7c4803f6..f8b03998 100644 --- a/test/generator-test-script/generate-build-verify.ps1 +++ b/test/generator-test-script/generate-build-verify.ps1 @@ -49,7 +49,7 @@ function HandleProject --outputSlnPath "$($projectRootFolder)\$($projectName)" ` --outputSrcPath "$($projectRootFolder)\$($projectName)\src" ` --outputTestPath "$($projectRootFolder)\$($projectName)\test" ` - -v + --verbose } else { @@ -60,7 +60,7 @@ function HandleProject --outputSlnPath "$($projectRootFolder)\$($projectName)" ` --outputSrcPath "$($projectRootFolder)\$($projectName)\src" ` --outputTestPath "$($projectRootFolder)\$($projectName)\test" ` - -v + --verbose } Write-Host " Building '$($projectName)' project" -ForegroundColor Yellow @@ -91,7 +91,7 @@ function HandleProject } $projects = @( - @{ Name = 'ATCDemo'; ValidateStrictMode = $true; FileLocation = "$($generatorBasePath)\sample\Demo.ApiDesign\SingleFileVersion\Api.v1.yaml";}, + @{ Name = 'ATCDemo'; ValidateStrictMode = $true; FileLocation = "$($generatorBasePath)\sample-mvc\Demo.ApiDesign\SingleFileVersion\Api.v1.yaml";}, @{ Name = 'PetStore'; ValidateStrictMode = $false; FileLocation = 'https://petstore3.swagger.io/api/v3/openapi.yaml'; } )